{"version":3,"sources":["webpack:///./src/helpers/fileUpload.ts","webpack:///./src/views/admin/stages/AdminStageMapUpdate.vue?429c","webpack:///./src/views/admin/stages/AdminStageMapUpdate.vue?4d5d","webpack:///./src/views/admin/stages/AdminStageMapUpdate.vue","webpack:///./src/views/admin/stages/AdminStageMapUpdate.vue?2d38"],"names":["cov_tf4ol8p5k","actualCoverage","MaxFileSize","s","toast","useToast","validDocumentsTypes","validImagesTypes","isValidDocumentType","file","showErrorToast","b","f","includes","type","name","toLowerCase","endsWith","error","isValidImageType","isPngType","isXlsxType","isValidFileSize","size","Math","floor","_withScopeId","n","_pushScopeId","_popScopeId","_hoisted_1","_createElementVNode","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","key","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","_createElementBlock","_Fragment","_withDirectives","_normalizeClass","v$","width","$error","$event","form","placeholder","_vModelText","_toDisplayString","$errors","$message","_createCommentVNode","height","x","y","path","map","src","mapImage","url","_createTextVNode","onChange","selectFile","accept","onClick","router","go","updateMap","_defineComponent","__name","setup","__props","expose","__expose","userId","currentRoute","value","params","estateId","stageId","ref","reactive","rules","computed","required","numeric","$autoDirty","useVuelidate","e","target","files","length","selectedFile","uploadFile","data","FormData","append","payload","landownerId","store","dispatch","async","_map$value","$touch","isFormCorrect","$validate","binding","id","_id","then","push","onMounted","res","__returned__","StageMapInterface","CreateStageMapInterface","Object","defineProperty","enumerable","__exports__"],"mappings":"s7UAgBE,OAAAA,EAAA,kBAAAC,KAAAD,IAdK,MAAME,GAAWF,IAAAG,EAAA,KAAG,UACrBC,GAAKJ,IA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AAU,wBAA0B,OAAOiD,wBAAqB,8BAAgC,OAAOC,8BAA2B,gBAAkB,OAAOhI,gBAAa,sBAAwB,OAAOE,uBAE5f,OADA+H,OAAOC,eAAeJ,EAAc,kBAAmB,CAAEK,YAAY,EAAO1C,OAAO,IAC5EqC,K,iCC9FP,MAAMM,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAS1F,GAAQ,CAAC,YAAY,qBAE1E","file":"js/admin29.35c9ee48.js","sourcesContent":["import { useToast } from \"vue-toastification\";\n\nexport const MaxFileSize = 26214400;\nconst toast = useToast();\nexport const validDocumentsTypes = [\n \"image/png\",\n \"image/jpeg\",\n \"image/heic\",\n \"image/heif\",\n \".heic\",\n \"application/pdf\",\n];\nexport const validImagesTypes = [\n \"image/png\",\n \"image/jpeg\",\n \"image/heic\",\n \"image/heif\",\n \".heic\",\n];\n\nexport function isValidDocumentType(file: File, showErrorToast = true) {\n if (\n !validDocumentsTypes.includes(file.type) &&\n !file.name.toLowerCase().endsWith(\".heic\")\n ) {\n if (showErrorToast) {\n toast.error(\"Only png, jpg, jpeg, heic, pdf files allowed\");\n }\n return false;\n }\n return true;\n}\nexport function isValidImageType(file: File, showErrorToast = true) {\n if (\n !validImagesTypes.includes(file.type) &&\n !file.name.toLowerCase().endsWith(\".heic\")\n ) {\n if (showErrorToast) {\n toast.error(\"Only png, jpg, jpeg, heic files allowed\");\n }\n return false;\n }\n return true;\n}\nexport function isPngType(file: File, showErrorToast = true) {\n if (file.type !== \"image/png\") {\n if (showErrorToast) {\n toast.error(\"Only png files allowed\");\n }\n return false;\n }\n return true;\n}\nexport function isXlsxType(file: File, showErrorToast = true) {\n if (\n file.type !==\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ) {\n if (showErrorToast) {\n toast.error(\"Only xlsx files allowed\");\n }\n return false;\n }\n return true;\n}\nexport function isValidFileSize(file: File, showErrorToast = true) {\n if (file.size > MaxFileSize) {\n if (showErrorToast) {\n toast.error(\n `File size should not exceed ${Math.floor(\n MaxFileSize / 1024 / 1024\n )} MB`\n );\n }\n return false;\n }\n return true;\n}\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./AdminStageMapUpdate.vue?vue&type=style&index=0&id=4e8ed161&lang=scss&scoped=true\"","import { createElementVNode as _createElementVNode, vModelText as _vModelText, normalizeClass as _normalizeClass, withDirectives as _withDirectives, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4e8ed161\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"dashboard-header\" }, [\n /*#__PURE__*/_createElementVNode(\"h2\", { class: \"title-main\" }, \"Update Stage Map\")\n], -1))\nconst _hoisted_2 = { class: \"default-form\" }\nconst _hoisted_3 = { class: \"input-row\" }\nconst _hoisted_4 = { class: \"input-wr\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Width\", -1))\nconst _hoisted_6 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_7 = { class: \"input-wr\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Height\", -1))\nconst _hoisted_9 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_10 = { class: \"input-row\" }\nconst _hoisted_11 = { class: \"input-wr\" }\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Coordinate X\", -1))\nconst _hoisted_13 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_14 = { class: \"input-wr\" }\nconst _hoisted_15 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Coordinate Y\", -1))\nconst _hoisted_16 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_17 = { class: \"input-row\" }\nconst _hoisted_18 = { class: \"input-wr\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Figure Path\", -1))\nconst _hoisted_20 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_21 = { class: \"input-row\" }\nconst _hoisted_22 = { class: \"input-wr\" }\nconst _hoisted_23 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Current Map\", -1))\nconst _hoisted_24 = [\"src\"]\nconst _hoisted_25 = { class: \"input-row\" }\nconst _hoisted_26 = { class: \"input-wr\" }\nconst _hoisted_27 = { class: \"file-label\" }\nconst _hoisted_28 = { key: 0 }\nconst _hoisted_29 = { class: \"input-row\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _hoisted_1,\n _createElementVNode(\"form\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.width.$error }]),\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => (($setup.form.width) = $event)),\n type: \"number\",\n placeholder: \"Width\"\n }, null, 2), [\n [_vModelText, $setup.form.width]\n ]),\n ($setup.v$.width.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, _toDisplayString($setup.v$.width.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.height.$error }]),\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (($setup.form.height) = $event)),\n type: \"number\",\n placeholder: \"Height\"\n }, null, 2), [\n [_vModelText, $setup.form.height]\n ]),\n ($setup.v$.height.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_9, _toDisplayString($setup.v$.height.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _createElementVNode(\"div\", _hoisted_11, [\n _hoisted_12,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.x.$error }]),\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (($setup.form.x) = $event)),\n type: \"number\",\n placeholder: \"X\"\n }, null, 2), [\n [_vModelText, $setup.form.x]\n ]),\n ($setup.v$.x.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_13, _toDisplayString($setup.v$.x.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_14, [\n _hoisted_15,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.y.$error }]),\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => (($setup.form.y) = $event)),\n type: \"number\",\n placeholder: \"Y\"\n }, null, 2), [\n [_vModelText, $setup.form.y]\n ]),\n ($setup.v$.y.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, _toDisplayString($setup.v$.y.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_17, [\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.path.$error }]),\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event: any) => (($setup.form.path) = $event)),\n type: \"text\",\n placeholder: \"Figure Path\"\n }, null, 2), [\n [_vModelText, $setup.form.path]\n ]),\n ($setup.v$.path.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_20, _toDisplayString($setup.v$.path.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_21, [\n _createElementVNode(\"div\", _hoisted_22, [\n _hoisted_23,\n ($setup.map)\n ? (_openBlock(), _createElementBlock(\"img\", {\n key: 0,\n src: $setup.map.mapImage.url\n }, null, 8, _hoisted_24))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_25, [\n _createElementVNode(\"div\", _hoisted_26, [\n _createElementVNode(\"label\", _hoisted_27, [\n _createTextVNode(\"Choose New File\"),\n _createElementVNode(\"input\", {\n onChange: _cache[5] || (_cache[5] = ($event: any) => ($setup.selectFile($event))),\n type: \"file\",\n accept: \"image/png\"\n }, null, 32),\n ($setup.form.file)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_28, _toDisplayString($setup.form.file.name), 1))\n : _createCommentVNode(\"\", true)\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_29, [\n _createElementVNode(\"button\", {\n class: \"button default outlined cancel-btn\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => ($setup.router.go(-1))),\n type: \"button\"\n }, \"Cancel\"),\n _createElementVNode(\"button\", {\n class: \"button default primary create-btn\",\n onClick: $setup.updateMap,\n type: \"button\"\n }, \"Update\")\n ])\n ])\n ], 64))\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { reactive, computed, onMounted, ref } from \"vue\";\nimport useVuelidate from \"@vuelidate/core\";\nimport { numeric, required } from \"@vuelidate/validators\";\nimport store from \"@/store\";\nimport router from \"@/router\";\nimport { StageMapInterface } from \"@/types/StageMapInterface\";\nimport { CreateStageMapInterface } from \"@/types/CreateStageMapInterface\";\nimport { isPngType, isValidFileSize } from \"@/helpers/fileUpload\";\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AdminStageMapUpdate',\n setup(__props, { expose: __expose }) {\n __expose();\n\nconst userId = router.currentRoute.value.params.userId as string;\nconst estateId = router.currentRoute.value.params.estateId as string;\nconst stageId = router.currentRoute.value.params.stageId as string;\nconst map = ref(null);\nconst form = reactive({\n width: 0,\n height: 0,\n x: 0,\n y: 0,\n path: \"\",\n file: null,\n});\nconst rules = computed(() => {\n return {\n width: { required, numeric, $autoDirty: true },\n height: { required, numeric, $autoDirty: true },\n x: { required, numeric, $autoDirty: true },\n y: { required, numeric, $autoDirty: true },\n path: { required, $autoDirty: true },\n };\n});\nconst v$ = useVuelidate(rules, form);\n\nonMounted(() => {\n store.dispatch(\"stage/getStageMap\", stageId).then((res) => {\n map.value = res.data;\n form.width = map.value.size.width;\n form.height = map.value.size.height;\n form.x = map.value.binding.x;\n form.y = map.value.binding.y;\n form.path = map.value.path;\n });\n});\n\nfunction selectFile(e: any) {\n if (!e.target.files.length) {\n return;\n }\n const selectedFile = e.target.files[0];\n if (!isPngType(selectedFile) || !isValidFileSize(selectedFile)) {\n return;\n }\n form.file = selectedFile;\n}\nfunction uploadFile() {\n const data = new FormData();\n data.append(\"file\", form.file as File);\n const payload = {\n landownerId: userId,\n estateId,\n stageId,\n data,\n };\n return store.dispatch(\"stage/uploadStageMapImg\", payload);\n}\nasync function updateMap() {\n v$.value.$touch();\n const isFormCorrect = await v$.value.$validate();\n if (!isFormCorrect) return;\n const data: Partial = {\n size: {\n width: form.width,\n height: form.height,\n },\n path: form.path,\n binding: {\n x: form.x,\n y: form.y,\n },\n };\n if (form.file) {\n data.mapImage = (await uploadFile()).data;\n }\n store\n .dispatch(\"stage/updateStageMap\", { id: map.value?._id, data })\n .then(() => {\n router.push({\n name: \"AdminStageMap\",\n params: { userId, estateId, stageId },\n });\n });\n}\n\nconst __returned__ = { userId, estateId, stageId, map, form, rules, v$, selectFile, uploadFile, updateMap, reactive, computed, onMounted, ref, get useVuelidate() { return useVuelidate }, get numeric() { return numeric }, get required() { return required }, get store() { return store }, get router() { return router }, get StageMapInterface() { return StageMapInterface }, get CreateStageMapInterface() { return CreateStageMapInterface }, get isPngType() { return isPngType }, get isValidFileSize() { return isValidFileSize } }\nObject.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })\nreturn __returned__\n}\n\n})","import { render } from \"./AdminStageMapUpdate.vue?vue&type=template&id=4e8ed161&scoped=true&ts=true&lang=pug\"\nimport script from \"./AdminStageMapUpdate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AdminStageMapUpdate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AdminStageMapUpdate.vue?vue&type=style&index=0&id=4e8ed161&lang=scss&scoped=true\"\n\nimport exportComponent from \"/codebuild/output/src264950160/src/lottrackr-front/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-4e8ed161\"]])\n\nexport default __exports__"],"sourceRoot":""}