{"version":3,"sources":["webpack:///./plugins/ModalOTP/ModalOTP.vue?45c4","webpack:///plugins/ModalOTP/ModalOTP.vue","webpack:///./plugins/ModalOTP/ModalOTP.vue?d614","webpack:///./plugins/ModalOTP/ModalOTP.vue"],"names":["inject","data","tForm","formName","show","submit","confirmation","name","callback","computed","description","$t","concat","created","events","$on","open","methods","_ref","_this","_ref$name","_ref$callback","focusTimer","setInterval","rconfirm","$refs","undefined","focus","clearInterval","onSubmit","_this2","_asyncToGenerator","regeneratorRuntime","mark","_callee","wrap","_context","prev","next","abrupt","errors","clear","$validator","validateAll","sent","t0","console","error","catchDispatchErrorMsg","toLowerCase","includes","catchDispatch","finish","stop","component","_vm","this","_c","_self","attrs","model","value","$$v","expression","slot","_v","_s","domProps","staticClass","on","$event","preventDefault","apply","arguments","class","has","directives","rawName","ref","target","composing","first","_e"],"mappings":"6KAAka,ECoDnZ,CACfA,OAAA,eACAC,KAAA,WACA,OACAC,MAAA,aACAC,SAAA,aACAC,MAAA,EACAC,QAAA,EACAC,aAAA,GACAC,KAAA,GACAC,SAAA,qBAEA,EACAC,SAAA,CACAC,YAAA,WACA,IAAAH,EAAA,KAAAI,GAAA,KAAAJ,MACA,YAAAI,GAAA,GAAAC,OAAA,KAAAV,MAAA,iBAAAK,QACA,GAEAM,QAAA,WACAC,IAAAC,IAAA,YAAAC,KACA,EACAC,QAAA,CACAD,KAAA,SAAAE,GAAA,IAAAC,EAAA,KAAAC,EAAAF,EAAAX,YAAA,IAAAa,EAAA,GAAAA,EAAAC,EAAAH,EAAAV,gBAAA,IAAAa,EAAA,qBAAAA,EACA,KAAAhB,QAAA,EACA,KAAAC,aAAA,GACA,KAAAC,OACA,KAAAC,WACA,KAAAJ,MAAA,EACA,IAAAkB,EAAAC,aAAA,WACA,IAAAC,EAAAL,EAAAM,MAAAD,cACAE,IAAAF,IACAA,EAAAG,QACAC,cAAAN,GACA,GACA,EACAO,SAAA,eAAAC,EAAA,YAAAC,YAAAC,mBAAAC,MAAA,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OAAOyC,MAAM,GAADrE,OAAI2C,EAAIpD,SAAQ,sBAAqBoD,EAAI2B,SAAS3B,EAAIU,GAAG,KAAKR,EAAG,MAAM,CAACW,YAAY,mBAAmBT,MAAM,CAAC,KAAO,gBAAgBK,KAAK,gBAAgB,CAACP,EAAG,SAAS,CAACW,YAAY,uDAAuDM,MAAM,CAAC,SAAYnB,EAAIlD,QAAQsD,MAAM,CAAC,KAAO,UAAUU,GAAG,CAAC,MAAQd,EAAI1B,WAAW,CAAC4B,EAAG,IAAI,CAACA,EAAG,IAAI,CAACW,YAAY,sBAAsBb,EAAIU,GAAG,WAAWV,EAAIW,GAAGX,EAAI5C,GAAG,GAADC,OAAI2C,EAAIrD,MAAK,iBAAgB,eAAe,EACp6D,GACsB,IDSpB,EACA,KACA,KACA,MAIa,UAAAoD,U","file":"78f5c0b.js","sourcesContent":["import mod from \"-!../../../../node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.24.9_webpack@4.46.0/node_modules/babel-loader/lib/index.js??ref--3-0!../../../../node_modules/.pnpm/vue-loader@15.10.1_@vue+compiler-sfc@3.4.32_babel-core@7.0.0-bridge.0_@babel+core@7.24._816e0b0c944497fa0a7bff6d26d8b1fc/node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalOTP.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.24.9_webpack@4.46.0/node_modules/babel-loader/lib/index.js??ref--3-0!../../../../node_modules/.pnpm/vue-loader@15.10.1_@vue+compiler-sfc@3.4.32_babel-core@7.0.0-bridge.0_@babel+core@7.24._816e0b0c944497fa0a7bff6d26d8b1fc/node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalOTP.vue?vue&type=script&lang=js&\"","<template>\n <b-modal\n :no-close-on-backdrop=\"true\"\n :no-close-on-esc=\"true\"\n v-model=\"show\">\n <template slot=\"modal-title\">\n {{ $t(`${tForm}.title`) }}\n </template>\n <p v-html=\"description\"/>\n <form\n :data-vv-scope=\"formName\"\n class=\"form-horizontal\"\n @submit.prevent=\"onSubmit\">\n <div\n :class=\"{'has-warning': errors.has(`${formName}.confirmation`)}\"\n class=\"form-group\">\n <label class=\"control-label\">{{ $t(`${tForm}.confirmation`) }}</label>\n <input\n v-validate=\"'required'\"\n ref=\"rconfirm\"\n :data-vv-as=\"$t(`${tForm}.confirmation`).toLowerCase()\"\n :data-vv-scope=\"formName\"\n :placeholder=\"$t(`${tForm}.confirmation_placeholder`)\"\n v-model=\"confirmation\"\n class=\"form-control\"\n type=\"text\"\n name=\"confirmation\">\n <span\n v-if=\"errors.has(`${formName}.confirmation`)\"\n class=\"help-block\"\n v-html=\"errors.first(`${formName}.confirmation`)\"/>\n </div>\n </form>\n <div\n slot=\"modal-footer\"\n class=\"w-100 text-right\">\n <button\n :class=\"{'disabled': submit}\"\n type=\"button\"\n class=\"btn ml-auto btn-primary btn-labeled btn-labeled-left\"\n @click=\"onSubmit\">\n <b><i class=\"icon-checkmark4\"/></b>\n {{ $t(`${tForm}.btn_submit`) }}\n </button>\n </div>\n </b-modal>\n</template>\n\n<script>\nimport {catchDispatch, catchDispatchErrorMsg} from '~/utils/form';\nimport {events} from './';\n\nexport default {\n inject: ['$validator'],\n data() {\n return {\n tForm: 'widget.otp',\n formName: 'widget.otp',\n show: false,\n submit: false,\n confirmation: '',\n name: '',\n callback: () => ({}),\n };\n },\n computed: {\n description() {\n const name = this.$t(this.name);\n return this.$t(`${this.tForm}.description`, {name});\n },\n },\n created() {\n events.$on('open', this.open);\n },\n methods: {\n open({name = '', callback = () => ({})}) {\n this.submit = false;\n this.confirmation = '';\n this.name = name;\n this.callback = callback;\n this.show = true;\n const focusTimer = setInterval(() => {\n const {rconfirm} = this.$refs;\n if (rconfirm === undefined) return;\n rconfirm.focus();\n clearInterval(focusTimer);\n });\n },\n async onSubmit() {\n if (this.submit) return false;\n this.submit = true;\n\n this.errors.clear(this.formName);\n\n const r = await this.$validator.validateAll(this.formName);\n if (!r) {\n this.submit = false;\n return;\n }\n\n try {\n const {confirmation} = this;\n await this.callback({confirmation});\n this.show = false;\n } catch (e) {\n console.error('ModalOTP.onSubmit');\n\n const eMsg = catchDispatchErrorMsg(this, e).toLowerCase();\n if (eMsg.includes('messaggio_otp')) {\n this.confirmation = '';\n }\n\n catchDispatch(this, e);\n } finally {\n this.submit = false;\n }\n },\n },\n};\n</script>\n","import { render, staticRenderFns } from \"./ModalOTP.vue?vue&type=template&id=1e9cf75c&\"\nimport script from \"./ModalOTP.vue?vue&type=script&lang=js&\"\nexport * from \"./ModalOTP.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/.pnpm/vue-loader@15.10.1_@vue+compiler-sfc@3.4.32_babel-core@7.0.0-bridge.0_@babel+core@7.24._816e0b0c944497fa0a7bff6d26d8b1fc/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('b-modal',{attrs:{\"no-close-on-backdrop\":true,\"no-close-on-esc\":true},model:{value:(_vm.show),callback:function ($$v) {_vm.show=$$v},expression:\"show\"}},[_c('template',{slot:\"modal-title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t(`${_vm.tForm}.title`))+\"\\n \")]),_vm._v(\" \"),_c('p',{domProps:{\"innerHTML\":_vm._s(_vm.description)}}),_vm._v(\" \"),_c('form',{staticClass:\"form-horizontal\",attrs:{\"data-vv-scope\":_vm.formName},on:{\"submit\":function($event){$event.preventDefault();return _vm.onSubmit.apply(null, arguments)}}},[_c('div',{staticClass:\"form-group\",class:{'has-warning': _vm.errors.has(`${_vm.formName}.confirmation`)}},[_c('label',{staticClass:\"control-label\"},[_vm._v(_vm._s(_vm.$t(`${_vm.tForm}.confirmation`)))]),_vm._v(\" \"),_c('input',{directives:[{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"},{name:\"model\",rawName:\"v-model\",value:(_vm.confirmation),expression:\"confirmation\"}],ref:\"rconfirm\",staticClass:\"form-control\",attrs:{\"data-vv-as\":_vm.$t(`${_vm.tForm}.confirmation`).toLowerCase(),\"data-vv-scope\":_vm.formName,\"placeholder\":_vm.$t(`${_vm.tForm}.confirmation_placeholder`),\"type\":\"text\",\"name\":\"confirmation\"},domProps:{\"value\":(_vm.confirmation)},on:{\"input\":function($event){if($event.target.composing)return;_vm.confirmation=$event.target.value}}}),_vm._v(\" \"),(_vm.errors.has(`${_vm.formName}.confirmation`))?_c('span',{staticClass:\"help-block\",domProps:{\"innerHTML\":_vm._s(_vm.errors.first(`${_vm.formName}.confirmation`))}}):_vm._e()])]),_vm._v(\" \"),_c('div',{staticClass:\"w-100 text-right\",attrs:{\"slot\":\"modal-footer\"},slot:\"modal-footer\"},[_c('button',{staticClass:\"btn ml-auto btn-primary btn-labeled btn-labeled-left\",class:{'disabled': _vm.submit},attrs:{\"type\":\"button\"},on:{\"click\":_vm.onSubmit}},[_c('b',[_c('i',{staticClass:\"icon-checkmark4\"})]),_vm._v(\"\\n \"+_vm._s(_vm.$t(`${_vm.tForm}.btn_submit`))+\"\\n \")])])],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"sourceRoot":""}