{"version":3,"sources":["webpack:///./src/views/auth/pages/ConfirmDevice.vue?173b","webpack:///../../../src/components/VOtpInput/VOtpInput.ts","webpack:///./src/views/auth/pages/ConfirmDevice.vue?561c","webpack:///./src/views/auth/pages/ConfirmDevice.vue","webpack:///./src/views/auth/pages/ConfirmDevice.vue?64e6","webpack:///./src/views/auth/pages/ConfirmDevice.vue?061e"],"names":["baseMixins","mixins","VInput","extend","name","directives","ripple","inheritAttrs","props","length","type","Number","String","default","plain","Boolean","data","initialValue","isBooted","otp","computed","outlined","this","classes","options","call","VTextField","watch","isFocused","value","val","lazyValue","split","created","$attrs","hasOwnProperty","breaking","internalValue","_a","mounted","requestAnimationFrame","methods","focus","e","otpIdx","onFocus","genInputSlot","$createElement","setBackgroundColor","backgroundColor","staticClass","style","height","convertToUnit","on","click","onClick","mousedown","onMouseDown","mouseup","onMouseUp","genDefaultSlot","genControl","genFieldset","genTextFieldSlot","genContent","Array","from","_","i","setTextColor","validationState","class","attrs","genLegend","span","domProps","innerHTML","width","genInput","listeners","Object","assign","listeners$","change","min","attrs$","autocomplete","disabled","isDisabled","readonly","isReadonly","id","computedId","blur","onBlur","input","onInput","keydown","onKeyDown","keyup","onKeyUp","ref","refInFor","$nextTick","$emit","$refs","undefined","preventDefault","stopPropagation","elements","document","activeElement","select","index","maxCursor","target","inputDataArray","newOtp","appIdx","toString","splice","join","onCompleted","clearFocus","changeFocus","keyCode","keyCodes","enter","hasMouseDown","updateValue","hasColor","event","eventKey","key","includes","rsp","render","h","themeClasses","_vm","_h","_c","_self","step","done","_e","staticStyle","VIcon","_v","_s","$t","userCodeErrors","model","callback","$$v","userCodeInput","expression","VBtn","validateCode","userCodeFormatted","$event","submit","$router","push","VProgressCircular","staticRenderFns","ConfirmDevice","loading","userCode","substring","errors","$v","$dirty","required","minLength","maxLength","max","console","log","$touch","$invalid","$route","query","deviceCode","success","end","api","post","res","displaySnackbar","skipOnSuccessReturn","Vue","__decorate","Action","Component","validationMixin","validations","component"],"mappings":"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CC,eAAO,6BAA2B,uCAHhB3B,EAAa,gBAVjC4B,eAAU,CACTlM,OAAQ,CAACmM,sBACTC,YAAa,CACXzC,cAAe,CACbkB,uBACAC,UAAWA,uBAAU,GACrBC,UAAWA,uBAAU,QAINT,WCpHuZ,I,wBCQxa+B,EAAY,eACd,EACA7D,EACA6B,GACA,EACA,KACA,KACA,MAIa,aAAAgC,E","file":"assets/js/chunk-34cfe5fb.2d42681e.js","sourcesContent":["export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ConfirmDevice.vue?vue&type=style&index=0&id=10731fca&prod&lang=css&\"","// Styles\nimport '../VTextField/VTextField.sass'\nimport './VOtpInput.sass'\n\n// Extensions\nimport VInput from '../VInput'\nimport VTextField from '../VTextField/VTextField'\n// Directives\nimport ripple from '../../directives/ripple'\n\n// Utilities\nimport { convertToUnit, keyCodes } from '../../util/helpers'\nimport { breaking } from '../../util/console'\n\n// Types\nimport mixins from '../../util/mixins'\nimport { VNode } from 'vue'\n\nconst baseMixins = mixins(\n VInput,\n)\n\ninterface options extends InstanceType {\n $refs: {\n input: HTMLInputElement[]\n }\n}\n\n/* @vue/component */\nexport default baseMixins.extend().extend({\n name: 'v-otp-input',\n\n directives: {\n ripple,\n },\n\n inheritAttrs: false,\n\n props: {\n length: {\n type: [Number, String],\n default: 6,\n },\n type: {\n type: String,\n default: 'text',\n },\n plain: Boolean,\n },\n\n data: () => ({\n initialValue: null,\n isBooted: false,\n otp: [] as string[],\n }),\n\n computed: {\n outlined (): Boolean {\n return !this.plain\n },\n classes (): object {\n return {\n ...VInput.options.computed.classes.call(this),\n ...VTextField.options.computed.classes.call(this),\n 'v-otp-input--plain': this.plain,\n }\n },\n },\n\n watch: {\n isFocused: 'updateValue',\n value (val) {\n this.lazyValue = val\n this.otp = val?.split('') || []\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('browser-autocomplete')) {\n breaking('browser-autocomplete', 'autocomplete', this)\n }\n\n this.otp = this.internalValue?.split('') || []\n },\n\n mounted () {\n requestAnimationFrame(() => (this.isBooted = true))\n },\n\n methods: {\n /** @public */\n focus (e: Event, otpIdx: number) {\n this.onFocus(e, otpIdx || 0)\n },\n genInputSlot (otpIdx: number) {\n return this.$createElement('div', this.setBackgroundColor(this.backgroundColor, {\n staticClass: 'v-input__slot',\n style: { height: convertToUnit(this.height) },\n on: {\n click: () => this.onClick(otpIdx),\n mousedown: (e: Event) => this.onMouseDown(e, otpIdx),\n mouseup: (e: Event) => this.onMouseUp(e, otpIdx),\n },\n }), [this.genDefaultSlot(otpIdx)])\n },\n genControl (otpIdx: number) {\n return this.$createElement('div', {\n staticClass: 'v-input__control',\n }, [\n this.genInputSlot(otpIdx),\n ])\n },\n genDefaultSlot (otpIdx: number) {\n return [\n this.genFieldset(),\n this.genTextFieldSlot(otpIdx),\n ]\n },\n genContent () {\n return Array.from({ length: +this.length }, (_, i) => {\n return this.$createElement('div', this.setTextColor(this.validationState, {\n staticClass: 'v-input',\n class: this.classes,\n }), [this.genControl(i)])\n })\n },\n genFieldset () {\n return this.$createElement('fieldset', {\n attrs: {\n 'aria-hidden': true,\n },\n }, [this.genLegend()])\n },\n genLegend () {\n const span = this.$createElement('span', {\n domProps: { innerHTML: '​' },\n })\n\n return this.$createElement('legend', {\n style: {\n width: '0px',\n },\n }, [span])\n },\n genInput (otpIdx: number) {\n const listeners = Object.assign({}, this.listeners$)\n delete listeners.change // Change should not be bound externally\n\n return this.$createElement('input', {\n style: {},\n domProps: {\n value: this.otp[otpIdx],\n min: this.type === 'number' ? 0 : null,\n },\n attrs: {\n ...this.attrs$,\n autocomplete: 'one-time-code',\n disabled: this.isDisabled,\n readonly: this.isReadonly,\n type: this.type,\n id: `${this.computedId}--${otpIdx}`,\n class: `otp-field-box--${otpIdx}`,\n },\n on: Object.assign(listeners, {\n blur: this.onBlur,\n input: (e: Event) => this.onInput(e, otpIdx),\n focus: (e: Event) => this.onFocus(e, otpIdx),\n keydown: this.onKeyDown,\n keyup: (e: KeyboardEvent) => this.onKeyUp(e, otpIdx),\n }),\n ref: 'input',\n refInFor: true,\n })\n },\n genTextFieldSlot (otpIdx: number): VNode {\n return this.$createElement('div', {\n staticClass: 'v-text-field__slot',\n }, [\n this.genInput(otpIdx),\n ])\n },\n onBlur (e?: Event) {\n this.isFocused = false\n e && this.$nextTick(() => this.$emit('blur', e))\n },\n onClick (otpIdx: number) {\n if (this.isFocused || this.isDisabled || !this.$refs.input[otpIdx]) return\n\n this.onFocus(undefined, otpIdx)\n },\n onFocus (e?: Event, otpIdx?: number) {\n e?.preventDefault()\n e?.stopPropagation()\n const elements = this.$refs.input as HTMLInputElement[]\n const ref = this.$refs.input && elements[otpIdx || 0]\n if (!ref) return\n\n if (document.activeElement !== ref) {\n ref.focus()\n return ref.select()\n }\n\n if (!this.isFocused) {\n this.isFocused = true\n ref.select()\n e && this.$emit('focus', e)\n }\n },\n onInput (e: Event, index: number) {\n const maxCursor = +this.length - 1\n\n const target = e.target as HTMLInputElement\n const value = target.value\n const inputDataArray = value?.split('') || []\n\n const newOtp: string[] = [...this.otp]\n for (let i = 0; i < inputDataArray.length; i++) {\n const appIdx = index + i\n if (appIdx > maxCursor) break\n newOtp[appIdx] = inputDataArray[i].toString()\n }\n if (!inputDataArray.length) {\n newOtp.splice(index, 1)\n }\n\n this.otp = newOtp\n this.internalValue = this.otp.join('')\n\n if (index + inputDataArray.length >= +this.length) {\n this.onCompleted()\n this.clearFocus(index)\n } else if (inputDataArray.length) {\n this.changeFocus(index + inputDataArray.length)\n }\n },\n clearFocus (index: number) {\n const input = this.$refs.input[index] as HTMLInputElement\n input.blur()\n },\n onKeyDown (e: KeyboardEvent) {\n if (e.keyCode === keyCodes.enter) {\n this.$emit('change', this.internalValue)\n }\n\n this.$emit('keydown', e)\n },\n onMouseDown (e: Event, otpIdx: number) {\n // Prevent input from being blurred\n if (e.target !== this.$refs.input[otpIdx]) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n VInput.options.methods.onMouseDown.call(this, e)\n },\n onMouseUp (e: Event, otpIdx: number) {\n if (this.hasMouseDown) this.focus(e, otpIdx)\n\n VInput.options.methods.onMouseUp.call(this, e)\n },\n changeFocus (index: number) {\n this.onFocus(undefined, index || 0)\n },\n updateValue (val: boolean) {\n // Sets validationState from validatable\n this.hasColor = val\n\n if (val) {\n this.initialValue = this.lazyValue\n } else if (this.initialValue !== this.lazyValue) {\n this.$emit('change', this.lazyValue)\n }\n },\n onKeyUp (event: KeyboardEvent, index: number) {\n event.preventDefault()\n const eventKey = event.key\n if (['Tab', 'Shift', 'Meta', 'Control', 'Alt'].includes(eventKey)) {\n return\n }\n if (['Delete'].includes(eventKey)) {\n return\n }\n if (eventKey === 'ArrowLeft' || (eventKey === 'Backspace' && !this.otp[index])) {\n return index > 0 && this.changeFocus(index - 1)\n }\n if (eventKey === 'ArrowRight') {\n return index + 1 < +this.length && this.changeFocus(index + 1)\n }\n },\n onCompleted () {\n const rsp = this.otp.join('')\n if (rsp.length === +this.length) {\n this.$emit('finish', rsp)\n }\n },\n },\n render (h): VNode {\n return h('div', {\n staticClass: 'v-otp-input',\n class: this.themeClasses,\n }, this.genContent())\n },\n})\n","import { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VOtpInput } from 'vuetify/lib/components/VOtpInput';\nimport { VProgressCircular } from 'vuetify/lib/components/VProgressCircular';\n\nvar render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"form-wrapper\"},[(_vm.step === 1 && !_vm.done)?_c('div',{staticClass:\"px-12 d-flex flex-column justify-center\",staticStyle:{\"align-items\":\"center\"}},[_c(VIcon,{staticClass:\"primary--text loading-spinner display-4\"},[_vm._v(\"mdi-key\")]),_c('h1',{staticClass:\"text-center\",staticStyle:{\"width\":\"100%\"}},[_c('span',[_vm._v(_vm._s(_vm.$t(\"confirmDeviceSection.deviceActivation\")))])]),_c('div',{staticClass:\"caption-1 mb-4\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.enterCode\"))+\" \")]),_c(VOtpInput,{staticClass:\"device-otp\",attrs:{\"outlined\":\"\",\"type\":\"number\",\"error-messages\":_vm.userCodeErrors},model:{value:(_vm.userCodeInput),callback:function ($$v) {_vm.userCodeInput=$$v},expression:\"userCodeInput\"}}),_c('div',{staticClass:\"v-messages error--text mb-8 w-full px-4\",staticStyle:{\"margin-top\":\"-0.5em\",\"height\":\"14px\"}},[_vm._v(\" \"+_vm._s(_vm.userCodeErrors[0] || \" \")+\" \")]),_c(VBtn,{staticStyle:{\"width\":\"50%\"},attrs:{\"elevation\":\"0\",\"color\":\"primary\"},on:{\"click\":_vm.validateCode}},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.continue\"))+\" \")])],1):_vm._e(),(_vm.step === 2 && !_vm.done)?_c('div',{staticClass:\"px-12 d-flex flex-column justify-center\",staticStyle:{\"align-items\":\"center\"}},[_c(VIcon,{staticClass:\"primary--text loading-spinner display-4\"},[_vm._v(\"mdi-key\")]),_c('div',{staticClass:\"caption-1 my-4 text-center\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.confirmDeviceCode\"))+\" \")]),_c('div',{staticClass:\"display-1 block mt-4 mb-12\"},[_c('code',[_vm._v(_vm._s(_vm.userCodeFormatted(_vm.userCodeInput)))])]),_c('div',{staticClass:\"caption-1 mt-2 mb-8 text-center\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.notInitiated\"))+\" \")]),_c('div',[_c(VBtn,{staticClass:\"mx-1\",attrs:{\"elevation\":\"0\"},on:{\"click\":function($event){_vm.step = 1}}},[_vm._v(_vm._s(_vm.$t(\"confirmDeviceSection.cancel\")))]),_c(VBtn,{staticClass:\"mx-1\",attrs:{\"elevation\":\"0\",\"color\":\"primary\"},on:{\"click\":_vm.submit}},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.confirm\"))+\" \")])],1)],1):_vm._e(),(_vm.done)?_c('div',{staticClass:\"px-12 d-flex flex-column justify-center\",staticStyle:{\"align-items\":\"center\"}},[_c(VIcon,{staticClass:\"primary--text loading-spinner display-4\"},[_vm._v(\"mdi-check-circle-outline\")]),_c('h1',{staticClass:\"text-center\",staticStyle:{\"width\":\"100%\"}},[_c('span',[_vm._v(_vm._s(_vm.$t(\"confirmDeviceSection.deviceConfirmed\")))])]),_c('div',{staticClass:\"caption-1 mb-6 text-center\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.deviceConnected\"))+\" \")]),_c(VBtn,{attrs:{\"block\":\"\",\"elevation\":\"0\",\"color\":\"primary\"},on:{\"click\":function($event){return _vm.$router.push('/')}}},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.contApp\"))+\" \")])],1):_vm._e(),(_vm.loading)?_c('div',{staticClass:\"px-12 d-flex flex-column justify-center\",staticStyle:{\"align-items\":\"center\"}},[_c('div',{staticClass:\"display-1 mb-4 text-center font-weight-bold\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"confirmDeviceSection.wait\"))+\" \")]),_c(VProgressCircular,{attrs:{\"indeterminate\":\"\",\"size\":\"32\"}})],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Vue from \"vue\";\r\nimport { Action } from \"vuex-class\";\r\nimport { Component } from \"vue-property-decorator\";\r\nimport { validationMixin } from \"vuelidate\";\r\nimport { minLength, maxLength, required } from \"vuelidate/lib/validators\";\r\nimport api from \"@/core/utils/api\";\r\n\r\n@Component({\r\n mixins: [validationMixin],\r\n validations: {\r\n userCodeInput: {\r\n required,\r\n minLength: minLength(6),\r\n maxLength: maxLength(6),\r\n },\r\n },\r\n})\r\nexport default class ConfirmDevice extends Vue {\r\n @Action(\"displaySnackbar\") displaySnackbar!: (s: string) => void;\r\n @Action(\"clearEverything\") clearEverything!: (reroute: boolean) => void;\r\n @Action(\"profile/verifyDeviceCode\") verifyDeviceCode!: (\r\n data: any,\r\n ) => Promise;\r\n\r\n userCodeInput: number | undefined = 0;\r\n\r\n step = 1;\r\n loading = true;\r\n done = false;\r\n\r\n userCodeFormatted = (userCode: number) => {\r\n if (userCode)\r\n return (\r\n userCode.toString().substring(0, 3) +\r\n \" \" +\r\n userCode.toString().substring(3)\r\n );\r\n\r\n return \"- - - - - -\";\r\n };\r\n\r\n get userCodeErrors() {\r\n const errors: any[] = [];\r\n if (!this.$v.userCodeInput!.$dirty) return errors;\r\n if (!this.$v.userCodeInput!.required)\r\n errors.push(this.$t(\"confirmDeviceSection.codeRequired\"));\r\n if (!this.$v.userCodeInput!.minLength)\r\n errors.push(this.$t(\"confirmDeviceSection.codeMin\", { min: 6 }));\r\n !this.$v.userCodeInput!.maxLength &&\r\n errors.push(this.$t(\"confirmDeviceSection.codeMax\", { max: 6 }));\r\n\r\n return errors;\r\n }\r\n\r\n async validateCode(): Promise {\r\n console.log(\"validating\");\r\n\r\n this.$v.$touch();\r\n if (!this.$v.$invalid) this.step = 2;\r\n }\r\n\r\n async skipOnSuccessReturn() {\r\n const { deviceCode, success } = this.$route.query;\r\n if (deviceCode && success) this.done = true;\r\n this.loading = false;\r\n }\r\n\r\n async submit(): Promise {\r\n this.loading = true;\r\n let deviceCode = \"\";\r\n console.log(\"submitting\");\r\n\r\n this.$v.$touch();\r\n if (!this.$v.$invalid) {\r\n console.log(\"valid form\");\r\n try {\r\n const end = \"/api/Account/VerifyDeviceCode\";\r\n const data = { userCode: this.userCodeInput };\r\n const res = (await api.post(end, data)) as any;\r\n deviceCode = res.deviceCode;\r\n\r\n console.log(\"device code forwarded to auth\");\r\n\r\n await this.$router.push(`/auth/login?deviceCode=${deviceCode}`);\r\n } catch (error) {\r\n this.displaySnackbar(this.$t(\"confirmDeviceSection.error\").toString());\r\n }\r\n } else\r\n this.displaySnackbar(\r\n this.$t(\"confirmDeviceSection.couldNotConfirm\").toString(),\r\n );\r\n\r\n this.loading = false;\r\n console.log(\"submitted\");\r\n }\r\n\r\n beforeDestroy() {\r\n this.userCodeInput = 0;\r\n }\r\n\r\n created() {\r\n this.skipOnSuccessReturn();\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ConfirmDevice.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ConfirmDevice.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ConfirmDevice.vue?vue&type=template&id=10731fca&\"\nimport script from \"./ConfirmDevice.vue?vue&type=script&lang=ts&\"\nexport * from \"./ConfirmDevice.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./ConfirmDevice.vue?vue&type=style&index=0&id=10731fca&prod&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../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"],"sourceRoot":""}