{"version":3,"sources":["webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_exterior/verify-user.vue?37f3","webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_exterior/verify-user.vue?8022","webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_exterior/verify-user.vue?fa8e","webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_exterior/verify-user.vue","webpack:///./node_modules/@glittr/frontend-core/src/services/generated/types/model/request/VerifyRequestModel.ts","webpack:///./node_modules/@glittr/frontend-core/src/services/viewModel/request/Me/VerifyRequestViewModel.ts","webpack:///./node_modules/@glittr/frontend-core/src/services/generated/types/model/request/ResendVerificationCodeRequestModel.ts","webpack:///./node_modules/@glittr/frontend-core/src/services/viewModel/request/Me/ResendVerificationCodeRequestViewModel.ts","webpack:///./node_modules/@glittr/frontend-core/src/plugins/validation/queryBuilder.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","_v","_s","$t","staticClass","verifyModel","on","$event","type","indexOf","_k","keyCode","key","doVerify","model","value","callback","$$v","$set","expression","isLoading","code","doResendVerificationCode","requestError","requestInfo","staticRenderFns","extend","auth","layout","data","undefined","VerifyRequestViewModel","methods","validate","$service","api","core","me","verify","$auth","refresh","$router","replace","email","user","query","ResendVerificationCodeRequestViewModel","fromModel","resendVerificationCode","component","dto","transformFromQuery","queries","schema","queryBuilder","properties","required","transformToDTO","transformFromDTO","pattern","validationPatterns","deepSetProperty","property","setRequired","propertyPath","split","currentNode","nodes","forEach","prop","i","push","lastNode","length","lastProp","constValues","propValues","propsRequired","Object","keys","const","if","ifNot","not","thenRequired","propNames","then","thenValue","elseRequired","else","elseValue","computedRequired","computedProps","filteredValue","sameAs","isObject","$validation","REF_PREFIX","nestedProps"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,cAAc,CAACA,EAAG,QAAQ,CAACA,EAAG,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M,CAAEjC,SAAU6B,KAE7BK,UAAA,SAAUd,EAAiCC,QAAA,IAAAA,OAAA,GACzC,IAAMtB,EAAa5D,KAAKgF,YAAYC,EAAYC,GAChD,MAAO,CAAEY,KAAMlC,IAGjBA,WAAA,SAAW,GAAX,WACQoC,EAAmB,GACzBb,OAAOC,KAAK,GAAYX,SAAQ,SAACxD,GAC3B,EAAWA,GAAK4C,UAClBmC,EAAiBpB,KAAK3D,MAG1B,IAAMgF,EAAgB,GActB,OAbAd,OAAOC,KAAK,GAAYX,SAAQ,SAACxD,GAC/B,GAA6B,WAAzB,EAAWA,GAAKJ,KAApB,CAKA,IAAM,EAAiC,EAAWI,GAA7BiF,GAAL,WAAkB,iBAA5B,eAEND,EAAchF,GAAOiF,EACjBA,EAAcC,QAAU,OAAEC,SAASH,EAAchF,MAClDgF,EAAchF,GAAqB+C,QAAU,UAAG,OAAIqC,YAAYC,YAAU,OAAGJ,EAAcC,aAT9F,CACE,IAAMI,EAAc,EAAWtF,GAAK2C,WACpCqC,EAAchF,GAAO,EAAK2C,WAAW2C,OAUlC,CACL1F,KAAM,SACNgD,SAAUmC,EACVpC,WAAYqC,KAKH","file":"js/chunk-044690fe.bc940775.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p-container',[_c('p-row',[_c('p-col',{attrs:{\"xs12\":\"\"}},[_c('p-row',{attrs:{\"column\":\"\",\"dense\":\"\"}},[_c('h3',[_vm._v(\" \"+_vm._s(_vm.$t(\"core.page.verifyUser.page.title\"))+\" \")]),_c('p',{staticClass:\"caption-1\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"core.page.verifyUser.page.description\"))+\" \")])])],1),_c('p-col',{attrs:{\"xs12\":\"\"}},[_c('p-form',{attrs:{\"model\":_vm.verifyModel,\"no-summary\":\"\"}},[_c('p-text-field',{attrs:{\"label\":_vm.$t('core.page.verifyUser.label.verificationCode')},on:{\"keyup\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }return _vm.doVerify()}},model:{value:(_vm.verifyModel.code),callback:function ($$v) {_vm.$set(_vm.verifyModel, \"code\", $$v)},expression:\"verifyModel.code\"}})],1)],1),_c('p-col',{attrs:{\"xs12\":\"\"}},[_c('p-row',[_c('p-button',{attrs:{\"loading\":_vm.isLoading,\"disabled\":_vm.isLoading || !_vm.verifyModel.code},on:{\"click\":function($event){return _vm.doVerify()}}},[_vm._v(\" \"+_vm._s(_vm.$t(\"core.page.verifyUser.button.verify\"))+\" \")]),_c('p-button',{attrs:{\"tertiary\":\"\",\"link\":\"\",\"loading\":_vm.isLoading,\"disabled\":_vm.isLoading},on:{\"click\":function($event){return _vm.doResendVerificationCode()}}},[_vm._v(\" \"+_vm._s(_vm.$t(\"core.page.verifyUser.button.resendCode\"))+\" \")])],1)],1),_c('p-col',{attrs:{\"xs12\":\"\"}},[_c('p-request-alert',{model:{value:(_vm.requestError),callback:function ($$v) {_vm.requestError=$$v},expression:\"requestError\"}}),_c('p-alert',{attrs:{\"dismissable\":false,\"type\":\"info\"},model:{value:(_vm.requestInfo),callback:function ($$v) {_vm.requestInfo=$$v},expression:\"requestInfo\"}},[_vm._v(\" \"+_vm._s(_vm.$t('core.page.verifyUser.label.verificationCodeResent'))+\" \")])],1)],1)],1)}\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\nimport Vue from 'vue';\nimport VerifyRequestViewModel from '../../../services/viewModel/request/Me/VerifyRequestViewModel';\nimport ResendVerificationCodeRequestViewModel from '../../../services/viewModel/request/Me/ResendVerificationCodeRequestViewModel';\n\nexport default Vue.extend({\n auth: true,\n layout: ['layout-exterior', '_exterior'],\n data: () => ({\n isLoading: false,\n requestError: undefined,\n requestInfo: undefined as string | undefined,\n verifyModel: new VerifyRequestViewModel(),\n }),\n methods:\n {\n async doVerify() {\n if (!this.verifyModel.validate()) {\n return;\n }\n this.isLoading = true;\n this.requestError = undefined;\n this.requestInfo = undefined;\n try {\n await this.$service.api.core.me.verify(this.verifyModel);\n await this.$auth.refresh();\n Vue.$router.replace('/');\n } catch (error: any) {\n this.requestError = error;\n }\n this.isLoading = false;\n },\n async doResendVerificationCode() {\n this.isLoading = true;\n this.requestInfo = undefined;\n this.requestError = undefined;\n const email = this.$auth.user?.email;\n try {\n const query = new ResendVerificationCodeRequestViewModel().fromModel({ email: email! });\n await this.$service.api.core.me.resendVerificationCode(query);\n this.requestInfo = this.$t('core.page.verifyUser.label.verificationCodeResent');\n } catch (error: any) {\n this.requestError = error;\n }\n this.isLoading = false;\n },\n },\n});\n\n","import mod from \"-!../../../../../../cache-loader/dist/cjs.js??ref--14-0!../../../../../../thread-loader/dist/cjs.js!../../../../../../babel-loader/lib/index.js!../../../../../../@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../../cache-loader/dist/cjs.js??ref--1-0!../../../../../../vue-loader/lib/index.js??vue-loader-options!./verify-user.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../cache-loader/dist/cjs.js??ref--14-0!../../../../../../thread-loader/dist/cjs.js!../../../../../../babel-loader/lib/index.js!../../../../../../@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../../cache-loader/dist/cjs.js??ref--1-0!../../../../../../vue-loader/lib/index.js??vue-loader-options!./verify-user.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./verify-user.vue?vue&type=template&id=417ded16&\"\nimport script from \"./verify-user.vue?vue&type=script&lang=ts&\"\nexport * from \"./verify-user.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../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","// ╭────────────────────────────────────────────────────────────────────────────────────╮\r\n// ┊ This file was automatically generated\r\n// ┊ Please do not modify manually\r\n// ┊ ©gl it 2022 - http://www.gl-it.ch\r\n// ╰────────────────────────────────────────────────────────────────────────────────────╯\r\n\r\nimport BaseModel from '../../../../../plugins/servicelayer/serviceTypes/baseModel';\r\nimport VerifyRequestDTO from '../../dto/request/VerifyRequestDTO';\r\n\r\nexport default abstract class VerifyRequestModel extends BaseModel {\r\n // #region ──BodyRequest──────────────────────────╮\r\n // #endregion ───────────────────────────────────────╯\r\n // #region ──HeaderRequest──────────────────────────╮\r\n // #endregion ─────────────────────────────────────────╯\r\n // #region ──QueryRequest──────────────────────────╮\r\n /**\r\n */\r\n get code() { return this.dto.code; }\r\n set code(value) { this.dto.code = value; }\r\n // #endregion ────────────────────────────────────────╯\r\n\r\n protected transformFromQuery(queries: Record): void {\r\n let value: any;\r\n this.dto.code = queries.code;\r\n }\r\n}\r\n","import Vue from 'vue';\r\nimport VerifyRequestModel from '../../../generated/types/model/request/VerifyRequestModel';\r\nimport { IJSONSchema } from '../../../../plugins/validation/IJSONSchema';\r\nimport queryBuilder from '../../../../plugins/validation/queryBuilder';\r\n\r\nexport default class VerifyRequestViewModel extends VerifyRequestModel {\r\n protected transformToDTO() {}\r\n protected transformFromDTO() {}\r\n\r\n schema = {\r\n ...queryBuilder.properties({\r\n code: { required: true },\r\n }),\r\n } as IJSONSchema;\r\n}\r\n","// ╭────────────────────────────────────────────────────────────────────────────────────╮\r\n// ┊ This file was automatically generated\r\n// ┊ Please do not modify manually\r\n// ┊ ©gl it 2022 - http://www.gl-it.ch\r\n// ╰────────────────────────────────────────────────────────────────────────────────────╯\r\n\r\nimport BaseModel from '../../../../../plugins/servicelayer/serviceTypes/baseModel';\r\nimport ResendVerificationCodeRequestDTO from '../../dto/request/ResendVerificationCodeRequestDTO';\r\n\r\nexport default abstract class ResendVerificationCodeRequestModel extends BaseModel {\r\n // #region ──BodyRequest──────────────────────────╮\r\n // #endregion ───────────────────────────────────────╯\r\n // #region ──HeaderRequest──────────────────────────╮\r\n // #endregion ─────────────────────────────────────────╯\r\n // #region ──QueryRequest──────────────────────────╮\r\n /**\r\n * @type {email}\r\n */\r\n get email() { return this.dto.email; }\r\n set email(value) { this.dto.email = value; }\r\n // #endregion ────────────────────────────────────────╯\r\n\r\n protected transformFromQuery(queries: Record): void {\r\n let value: any;\r\n this.dto.email = queries.email;\r\n }\r\n}\r\n","import { IJSONSchema } from '../../../../plugins/validation/IJSONSchema';\r\nimport queryBuilder from '../../../../plugins/validation/queryBuilder';\r\nimport validationPatterns from '../../../../plugins/validation/validationPatterns';\r\nimport ResendVerificationCodeRequestModel from '../../../generated/types/model/request/ResendVerificationCodeRequestModel';\r\n\r\nexport default class ResendVerificationCodeRequestViewModel extends ResendVerificationCodeRequestModel {\r\n protected transformToDTO() {}\r\n protected transformFromDTO() { }\r\n\r\n schema = {\r\n ...queryBuilder.properties({\r\n email: { required: true, pattern: validationPatterns.email },\r\n }),\r\n } as IJSONSchema;\r\n}\r\n","import Vue from 'vue';\r\nimport _ from '../../utils';\r\nimport { IJSONSchema } from './IJSONSchema';\r\n\r\ntype PropertiesOptions = Omit & {\r\n required?: boolean,\r\n sameAs?: string\r\n properties?: Record,\r\n};\r\n\r\nconst queryBuilder = {\r\n deepSetProperty(schema: IJSONSchema, property: string, value: Record, setRequired: boolean = false) {\r\n const propertyPath = property.split('.');\r\n let currentNode = schema ?? {};\r\n const nodes = [] as IJSONSchema[];\r\n propertyPath.forEach((prop, i) => {\r\n currentNode.properties = currentNode.properties ?? {};\r\n currentNode.type = currentNode.type ?? 'object';\r\n currentNode.properties[prop] = currentNode.properties[prop] ?? {};\r\n nodes.push(currentNode);\r\n currentNode = currentNode.properties[prop] as IJSONSchema;\r\n });\r\n const lastNode = nodes[nodes.length - 1];\r\n const lastProp = propertyPath[propertyPath.length - 1];\r\n if (setRequired) {\r\n lastNode.required = [...(lastNode.required ?? []), lastProp];\r\n }\r\n if (value) {\r\n lastNode.properties![lastProp] = { ...lastNode.properties![lastProp] as {}, ...value };\r\n }\r\n },\r\n constValues(propValues: Record, propsRequired: boolean = false) {\r\n const schema: IJSONSchema = {};\r\n Object.keys(propValues).forEach((key) => {\r\n this.deepSetProperty(schema, key, { const: propValues[key] }, propsRequired);\r\n });\r\n return schema;\r\n },\r\n if(propValues: Record, propsRequired: boolean = true) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { if: properties };\r\n },\r\n ifNot(propValues: Record, propsRequired: boolean = true) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { if: { not: properties } };\r\n },\r\n thenRequired(propNames: string[]) {\r\n return { then: { required: propNames } };\r\n },\r\n thenValue(propValues: Record, propsRequired: boolean = false) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { then: properties };\r\n },\r\n elseRequired(propNames: string[]) {\r\n return { else: { required: propNames } };\r\n },\r\n elseValue(propValues: Record, propsRequired: boolean = false) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { else: properties };\r\n },\r\n\r\n properties(properties: Record) {\r\n const computedRequired = [] as string[];\r\n Object.keys(properties).forEach((key) => {\r\n if (properties[key].required) {\r\n computedRequired.push(key);\r\n }\r\n });\r\n const computedProps = {} as NonNullable;\r\n Object.keys(properties).forEach((key) => {\r\n if (properties[key].type === 'object') {\r\n const nestedProps = properties[key].properties;\r\n computedProps[key] = this.properties(nestedProps as Record);\r\n return;\r\n }\r\n const { required, ...filteredValue } = properties[key];\r\n // In nested cases this has already been converted above, so casting to any here\r\n computedProps[key] = filteredValue as any;\r\n if (filteredValue.sameAs && _.isObject(computedProps[key])) {\r\n (computedProps[key] as IJSONSchema).pattern = `${Vue.$validation.REF_PREFIX}${filteredValue.sameAs}`;\r\n }\r\n });\r\n return {\r\n type: 'object' as IJSONSchema['type'],\r\n required: computedRequired as IJSONSchema['required'],\r\n properties: computedProps as IJSONSchema['properties'],\r\n };\r\n },\r\n};\r\n\r\nexport default queryBuilder;\r\n"],"sourceRoot":""}