{"version":3,"sources":["webpack:///./src/views/admin/users/AdminUserUpdate.vue?182b","webpack:///./src/views/admin/users/AdminUserUpdate.vue","webpack:///./src/views/admin/users/AdminUserUpdate.vue?0dc1","webpack:///./src/helpers/validation.ts","webpack:///./src/views/admin/users/AdminUserUpdate.vue?8bf1","webpack:///./src/helpers/regex.ts","webpack:///./src/helpers/cleavePlugin.ts","webpack:///./src/constants/index.ts"],"names":["_withScopeId","n","_pushScopeId","_popScopeId","_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_createElementVNode","_hoisted_7","key","_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","render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","_createElementBlock","_Fragment","_toDisplayString","form","firstName","lastName","_withDirectives","_normalizeClass","error","v$","$error","$event","type","placeholder","_vModelText","$errors","$message","_createCommentVNode","middleName","emailField","emailError","onInput","_createVNode","phone","modelValue","options","phoneNumberOption","onClick","router","go","updateUser","_defineComponent","__name","setup","__props","expose","__expose","userId","currentRoute","value","params","reactive","ref","user","rules","computed","required","$autoDirty","validPhoneNumber","email","useVuelidate","route","useRoute","onMounted","store","dispatch","then","res","data","async","_user$value","$touch","isFormCorrect","$validate","toLowerCase","status","id","catch","response","message","push","name","__returned__","Cleave","UserInterface","Object","defineProperty","enumerable","__exports__","cov_2csbspw5gy","actualCoverage","s","hasLowerAndUpperCase","f","b","hasLowerCaseRegex","test","hasUpperCaseRegex","hasPasswordLength","length","hasSpecialChars","hasSpecialCharsRegex","hasDigits","hasDigitsRegex","hasNumberAndSymbol","validatePassword","validateDocumentMimeType","mimeType","allowedDocumentMimeTypes","includes","validOptionalPhoneNumber","getRegex","string","cov_1f6uyvd7xm","RegExp","latinCharactersRegex","cov_290zsd572f","blocks","startsWith","delimiter","phonePlaceholder","getCurr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AtB,EAAA,KAAGoB,EAAS,gBAC7BV,GAAoBY,IAAAtB,EAAA,KAAGoB,EAClC,yDAEWR,GAAcU,IAAAtB,EAAA,KAAGoB,EAAS,iBAC1BI,GAAoBF,IAAAtB,EAAA,KAAGoB,EAAS,8B,mmHCRvC,SAAU3E,EAAkBH,GAChC,OAD6CmF,IAAAvB,EAAA,KAAAuB,IAAAzB,EAAA,KACtC,CACL0B,QAAQD,IAAAtB,EAAA,SAAC7D,IAAKmF,IAAAtB,EAAA,QAAS,OAAL7D,QAAK,IAALA,KAAOqF,WAAW,OAAIF,IAAAtB,EAAA,QAAG,CAAC,EAAG,EAAG,EAAG,KAAEsB,IAAAtB,EAAA,QAAG,CAAC,EAAG,EAAG,KACjEyB,UAAW,K,iKAIR,MAAMC,GAAgBJ,IAAAzB,EAAA,KAAG,gBAAeyB,IAAAzB,EAAA,KAExC,MAAM8B,EAAqBA,EAChCC,WAAON,IAAAtB,EAAA,SAAG,GACV6B,8BAA0BP,IAAAtB,EAAA,QAAG,YAC7B8B,uBAAmBR,IAAAtB,EAAA,SAAG,OAKAsB,IAAAvB,EAAA,KAAAuB,IAAAzB,EAAA,MACtB+B,UACAC,6BACAC,sBACAC,mBAAmB,K,w9CCrBd,MAAMjB,GAAwBkB,IAAAnC,EAAA,KAAG,CACtC,aACA,YACA,aACA,aACA,QACA,oBAEWoC,GAAWD,IAAAnC,EAAA,KAAG,W","file":"js/admin34.3d2e585e.js","sourcesContent":["import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, vModelText as _vModelText, normalizeClass as _normalizeClass, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7106f1f9\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"dashboard-header\" }\nconst _hoisted_2 = { class: \"title-main\" }\nconst _hoisted_3 = { class: \"default-form\" }\nconst _hoisted_4 = { class: \"input-row\" }\nconst _hoisted_5 = { class: \"input-wr\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"First Name\", -1))\nconst _hoisted_7 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_8 = { class: \"input-wr\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Middle Name\", -1))\nconst _hoisted_10 = { class: \"input-wr\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Last Name\", -1))\nconst _hoisted_12 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_13 = { class: \"input-row\" }\nconst _hoisted_14 = { class: \"input-wr\" }\nconst _hoisted_15 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Email\", -1))\nconst _hoisted_16 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_17 = {\n key: 1,\n class: \"error-hint\"\n}\nconst _hoisted_18 = { class: \"input-wr\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Phone\", -1))\nconst _hoisted_20 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_21 = { 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 _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"h2\", _hoisted_2, _toDisplayString(`${$setup.form.firstName} ${$setup.form.lastName}`), 1)\n ]),\n _createElementVNode(\"form\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.form.firstName.$error }]),\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => (($setup.form.firstName) = $event)),\n type: \"text\",\n placeholder: \"First Name\"\n }, null, 2), [\n [_vModelText, $setup.form.firstName]\n ]),\n ($setup.v$.form.firstName.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_7, _toDisplayString($setup.v$.form.firstName.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _withDirectives(_createElementVNode(\"input\", {\n class: \"input\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (($setup.form.middleName) = $event)),\n type: \"text\",\n placeholder: \"Middle Name\"\n }, null, 512), [\n [_vModelText, $setup.form.middleName]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.form.lastName.$error }]),\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (($setup.form.lastName) = $event)),\n type: \"text\",\n placeholder: \"Last Name\"\n }, null, 2), [\n [_vModelText, $setup.form.lastName]\n ]),\n ($setup.v$.form.lastName.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, _toDisplayString($setup.v$.form.lastName.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", _hoisted_14, [\n _hoisted_15,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.emailField.$error || $setup.emailError }]),\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => (($setup.emailField) = $event)),\n onInput: _cache[4] || (_cache[4] = ($event: any) => ($setup.emailError = '')),\n type: \"email\",\n placeholder: \"Email\"\n }, null, 34), [\n [_vModelText, $setup.emailField]\n ]),\n ($setup.v$.emailField.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, _toDisplayString($setup.v$.emailField.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true),\n ($setup.emailError)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_17, _toDisplayString($setup.emailError), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode($setup[\"Cleave\"], {\n class: _normalizeClass([\"input\", { error: $setup.v$.form.phone.$error }]),\n modelValue: $setup.form.phone,\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = ($event: any) => (($setup.form.phone) = $event)),\n options: $setup.phoneNumberOption($setup.form.phone),\n placeholder: \"0412 345 678\"\n }, null, 8, [\"modelValue\", \"options\", \"class\"]),\n ($setup.v$.form.phone.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_20, \"Invalid phone\"))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_21, [\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.updateUser,\n type: \"button\"\n }, \"Update\")\n ])\n ])\n ], 64))\n}","import { defineComponent as _defineComponent } from 'vue'\nimport Cleave from \"vue-cleave-component\";\nimport { reactive, computed, onMounted, ref } from \"vue\";\nimport useVuelidate from \"@vuelidate/core\";\nimport { required, email } from \"@vuelidate/validators\";\nimport { validPhoneNumber } from \"@/helpers/validation\";\nimport store from \"@/store\";\nimport router from \"@/router\";\nimport { UserInterface } from \"@/types/UserInterface\";\nimport { phoneNumberOption } from \"@/helpers/cleavePlugin\";\nimport { useRoute } from \"vue-router\";\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AdminUserUpdate',\n setup(__props, { expose: __expose }) {\n __expose();\n\nconst userId = router.currentRoute.value.params.userId;\nconst form = reactive>({\n firstName: \"\",\n middleName: \"\",\n lastName: \"\",\n phone: \"\",\n});\nconst emailField = ref(\"\");\nconst user = ref(null);\nconst rules = computed(() => {\n return {\n form: {\n firstName: { required, $autoDirty: true },\n lastName: { required, $autoDirty: true },\n phone: { validPhoneNumber, $autoDirty: true },\n },\n emailField: { required, email, $autoDirty: true },\n };\n});\nconst v$ = useVuelidate(rules, { form, emailField });\nconst emailError = ref(\"\");\nconst route = useRoute();\n\nonMounted(() => {\n store.dispatch(\"user/getUser\", userId).then((res) => {\n form.firstName = res.data.firstName;\n form.middleName = res.data.middleName;\n form.lastName = res.data.lastName;\n form.phone = res.data.phone;\n emailField.value = res.data.email;\n user.value = res.data;\n });\n});\n\n const updateUser = async () => {\n v$.value.$touch();\n const isFormCorrect = await v$.value.$validate();\n if (!isFormCorrect) return;\n if (user.value?.email !== emailField.value.toLowerCase()) {\n const { status } = await store\n .dispatch(\"user/updateUserEmail\", {\n id: userId,\n data: { email: emailField.value.toLowerCase() },\n })\n .catch((error) => {\n if (error.response.data.message) {\n emailError.value = error.response.data.message;\n }\n });\n if (status !== 200) {\n return;\n }\n }\n const data = {\n id: userId,\n data: form,\n };\n store.dispatch(\"user/updateUser\", data).then(() => {\n router.push({\n name: router.currentRoute.value.name === \"AdminUserUpdate\" ? \"AdminUser\" : \"AdminLawyer\",\n params: { userId },\n });\n });\n};\n\nconst __returned__ = { userId, form, emailField, user, rules, v$, emailError, route, updateUser, get Cleave() { return Cleave }, reactive, computed, onMounted, ref, get useVuelidate() { return useVuelidate }, get required() { return required }, get email() { return email }, get validPhoneNumber() { return validPhoneNumber }, get store() { return store }, get router() { return router }, get UserInterface() { return UserInterface }, get phoneNumberOption() { return phoneNumberOption }, get useRoute() { return useRoute } }\nObject.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })\nreturn __returned__\n}\n\n})","import { render } from \"./AdminUserUpdate.vue?vue&type=template&id=7106f1f9&scoped=true&ts=true&lang=pug\"\nimport script from \"./AdminUserUpdate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AdminUserUpdate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AdminUserUpdate.vue?vue&type=style&index=0&id=7106f1f9&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-7106f1f9\"]])\n\nexport default __exports__","import {\n hasLowerCaseRegex,\n hasUpperCaseRegex,\n hasSpecialCharsRegex,\n hasDigitsRegex,\n} from \"@/helpers/regex\";\nimport { allowedDocumentMimeTypes } from \"@/constants\";\n\nexport const hasLowerAndUpperCase = (value: string) =>\n hasLowerCaseRegex.test(value) && hasUpperCaseRegex.test(value);\nexport const hasPasswordLength = (value: string) =>\n value.length >= 4 && value.length <= 16;\nexport const hasSpecialChars = (value: string) =>\n hasSpecialCharsRegex.test(value);\nexport const hasDigits = (value: string) => hasDigitsRegex.test(value);\nexport const hasNumberAndSymbol = (value: string) =>\n hasDigits(value) && hasSpecialChars(value);\nexport const validatePassword = (value: string) =>\n hasLowerAndUpperCase(value) &&\n hasPasswordLength(value) &&\n hasNumberAndSymbol(value);\nexport const validateDocumentMimeType = (mimeType: string): boolean =>\n allowedDocumentMimeTypes.includes(mimeType);\nexport const validPhoneNumber = (value: string) =>\n /^(\\+61|0)4\\d{8}$/.test(value);\nexport const validOptionalPhoneNumber = (value: string) => {\n if (value) {\n return validPhoneNumber(value);\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!./AdminUserUpdate.vue?vue&type=style&index=0&id=7106f1f9&lang=scss&scoped=true\"","const getRegex = (string: string | RegExp) => new RegExp(string, \"u\");\n\nexport const hasLowerCaseRegex = getRegex(\"^.*[a-z].*$\");\nexport const hasUpperCaseRegex = getRegex(\"^.*[A-Z].*$\");\nexport const hasSpecialCharsRegex = getRegex(\n \"^.*[`!@#$%^&*()_+\\\\-=\\\\[\\\\]{};':\\\"\\\\\\\\|,.<>\\\\/?~].*$\"\n);\nexport const hasDigitsRegex = getRegex(\"^.*[+0-9].*$\");\nexport const latinCharactersRegex = getRegex(/^[A-Za-z0-9(),.`\\-&\\s]*$/);\n","export function phoneNumberOption(phone: string) {\n return {\n blocks: !phone || phone?.startsWith(\"+\") ? [3, 3, 3, 3] : [4, 3, 3],\n delimiter: \" \",\n };\n}\n\nexport const phonePlaceholder = \"0412 345 678\";\n\nexport const getCurrencyOptions = ({\n numeral = true,\n numeralThousandsGroupStyle = \"thousand\",\n numeralPositiveOnly = true,\n}: {\n numeral?: boolean;\n numeralThousandsGroupStyle?: NumeralThousandsGroupStyle;\n numeralPositiveOnly?: boolean;\n}): CurrencyOptions => ({\n numeral,\n numeralThousandsGroupStyle,\n numeralPositiveOnly,\n noImmediatePrefix: true,\n});\ntype NumeralThousandsGroupStyle = \"thousand\" | \"lakh\" | \"wan\";\n\ntype CurrencyOptions = {\n numeral: boolean;\n numeralThousandsGroupStyle: NumeralThousandsGroupStyle;\n numeralPositiveOnly: boolean;\n noImmediatePrefix: boolean;\n};\n","export const allowedDocumentMimeTypes = [\n \"image/jpeg\",\n \"image/png\",\n \"image/heic\",\n \"image/heif\",\n \".heic\",\n \"application/pdf\",\n];\nexport const MaxFileSize = 26214400;\n"],"sourceRoot":""}