{"version":3,"sources":["webpack:///./src/components/registration/registration-form.component.vue?32fd","webpack:///./src/components/registration/registration-form.component.vue","webpack:///./src/components/registration/registration-form.component.vue?c8d7","webpack:///./src/components/registration/registration-form.component.vue?cf2a"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","_v","name","routeName","veterinarian","qrCodeStream","ref","on","$event","preventDefault","scopedSlots","_u","key","fn","classes","class","type","indexOf","_k","keyCode","stopPropagation","onSubmitCodeClick","model","value","callback","$$v","code","expression","staticRenderFns","registeredTagModule","store","RegistrationFormComponent","errors","getAllErrorMessages","$toasted","error","join","$refs","focus","success","form","validate","isTagRegistered","isTagRegisteredAction","errorResponse","doesTagExist","registered","$router","push","createRegistration","params","tagCode","deep","components","ValidationObserver","ValidationProvider","computed","component"],"mappings":"yHAAA,I,EAAIA,OAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,QAAQ,CAACE,YAAY,QAAQ,CAACF,EAAG,QAAQ,CAACE,YAAY,aAAaC,MAAM,CAAC,GAAK,KAAK,GAAK,KAAK,GAAK,MAAM,CAACH,EAAG,SAAS,CAACG,MAAM,CAAC,MAAQ,iBAAiB,CAACH,EAAG,IAAI,CAACJ,EAAIQ,GAAG,mGAAmGJ,EAAG,QAAQ,CAACG,MAAM,CAAC,UAAU,WAAW,CAACH,EAAG,QAAQ,CAACE,YAAY,eAAeC,MAAM,CAAC,GAAK,KAAK,GAAK,MAAM,CAACH,EAAG,MAAM,CAACE,YAAY,4EAA4E,CAACF,EAAG,WAAW,CAACG,MAAM,CAAC,QAAU,OAAO,GAAK,CAAEE,KAAMT,EAAIU,UAAUC,aAAaC,gBAAiB,CAACR,EAAG,cAAc,CAACG,MAAM,CAAC,aAAa,MAAM,CAACH,EAAG,qBAAqB,CAACG,MAAM,CAAC,QAAU,GAAG,MAAQ,MAAM,QAAU,WAAWH,EAA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,IAAI,IAAI,IAChjB2B,EAAkB,G,wJCwEtB,MAAMC,EAA2C,eAC/C,OACAC,EAAA,MAYF,IAAqB,EAArB,MAAqBC,kCAAkC,OAAvD,c,oBAGS,KAAAL,KAAO,GAOd,gBACE,OAAO,OAID,uBAAuBH,GAC7B,GAAIA,EAAO,CACT,MAAMS,EAAST,EAAMU,sBACrB,OAAOvC,KAAKwC,SAASC,MAAMH,EAAOI,SAI/B,UACL1C,KAAK2C,MAAMX,KAAKY,QAGX,0BACL,MAAMC,QAAyB7C,KAAK2C,MAAMG,KAAKC,WAE1CF,GAIL7C,KAAKgD,kBAGA,8BACCb,EAAoBc,sBAAsBjD,KAAKgC,OAEhDhC,KAAKkD,eAAiBlD,KAAKmD,eACzBnD,KAAKmD,aAAaC,WAQrBpD,KAAKwC,SAASC,MAASzC,KAAKgC,KAAR,2BAPpBhC,KAAKqD,QAAQC,KAAK,CAChB9C,KAAM,OAAUE,aAAa6C,mBAC7BC,OAAQ,CACNC,QAASzD,KAAKgC,WA7BxB,gBADC,eAAM,gBAAiB,CAAE0B,MAAM,I,2EACuB,oB,EAAA,qBAAjB,gBAAiB,W,iFAKtD,MApBkB,EAAyB,gBAT7C,eAAU,CACTC,WAAY,CACVC,mBAAA,OACAC,mBAAA,QAEFC,SAAU,kBACL,eAAS,OAA4B,CAAC,eAAgB,sBAGxC,WCzFmZ,I,YCOpaC,EAAY,eACd,EACAjE,OACAoC,GACA,EACA,KACA,KACA,MAIa,aAAA6B,E","file":"js/chunk-2d0e4539.dc3e4998.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{staticClass:\"mt-3\"},[_c('b-col',{staticClass:\"mx-md-auto\",attrs:{\"sm\":\"12\",\"md\":\"12\",\"lg\":\"6\"}},[_c('b-card',{attrs:{\"title\":\"Register Tag\"}},[_c('p',[_vm._v(\" Scan the QR code on the back of the Rabies Vaccination Tag using your smartphone or tablet. \")]),_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',{staticClass:\"mb-3 mb-md-0\",attrs:{\"sm\":\"12\",\"md\":\"6\"}},[_c('div',{staticClass:\"d-flex flex-column flex-md-row align-items-center justify-content-around\"},[_c('b-button',{attrs:{\"variant\":\"link\",\"to\":{ name: _vm.routeName.veterinarian.qrCodeStream }}},[_c('b-iconstack',{attrs:{\"font-scale\":\"5\"}},[_c('b-icon-square-fill',{attrs:{\"stacked\":\"\",\"scale\":\"0.8\",\"variant\":\"light\"}}),_c('b-icon-fullscreen',{attrs:{\"stacked\":\"\"}}),_c('b-icon-dash',{attrs:{\"stacked\":\"\",\"variant\":\"danger\",\"shift-h\":\"-2\"}}),_c('b-icon-dash',{attrs:{\"stacked\":\"\",\"variant\":\"danger\",\"shift-h\":\"2\"}})],1),_c('br'),_vm._v(\" Scan QR Code \")],1),_c('span',{staticClass:\"lead font-weight-bold\"},[_vm._v(\"- OR -\")])],1)]),_c('b-col',{staticClass:\"mb-3 mb-md-0\",attrs:{\"sm\":\"12\",\"md\":\"6\"}},[_c('ValidationObserver',{ref:\"form\"},[_c('form',{on:{\"submit\":function($event){$event.preventDefault();}}},[_c('label',[_vm._v(\"Manually Enter Code\")]),_c('ValidationProvider',{attrs:{\"rules\":\"required|min:6|max:6\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar classes = ref.classes;\nreturn [_c('b-input-group',[_c('b-form-input',{ref:\"code\",staticClass:\"w-50\",class:classes,attrs:{\"placeholder\":\"code\"},on:{\"keydown\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }$event.preventDefault();$event.stopPropagation();return _vm.onSubmitCodeClick($event)}},model:{value:(_vm.code),callback:function ($$v) {_vm.code=$$v},expression:\"code\"}}),_c('b-input-group-append',[_c('b-button',{on:{\"click\":_vm.onSubmitCodeClick}},[_vm._v(\"Submit\")])],1)],1)]}}])})],1)])],1)],1)],1)],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\n\n\n\n\n\n\n\n\n\n\nimport { Component, Vue, Watch } from 'vue-property-decorator';\nimport { ValidationProvider, ValidationObserver } from 'vee-validate';\nimport { routeName } from '@/constants/route.constants';\nimport RegisteredTagModule, {\n REGISTERED_TAG_MODULE_NAME\n} from '@/store/modules/registered-tag.module';\nimport { getModule } from 'vuex-module-decorators';\nimport store from '@/store';\nimport { mapState } from 'vuex';\nimport { CheckIfTagExistsResponse } from '@/models/DTO/registered-tag/check-if-tag-exists-response.model';\nimport { BaseAPIErrorModel } from '@/models/DTO/base-api-error.model';\n\nconst registeredTagModule: RegisteredTagModule = getModule(\n RegisteredTagModule,\n store\n);\n\n@Component({\n components: {\n ValidationObserver,\n ValidationProvider\n },\n computed: {\n ...mapState(REGISTERED_TAG_MODULE_NAME, ['doesTagExist', 'errorResponse'])\n }\n})\nexport default class RegistrationFormComponent extends Vue {\n public doesTagExist: CheckIfTagExistsResponse | null;\n public errorResponse: BaseAPIErrorModel | null;\n public code = '';\n\n public $refs: {\n form: HTMLFormElement;\n code: HTMLFormElement;\n };\n\n public get routeName(): typeof routeName {\n return routeName;\n }\n\n @Watch('errorResponse', { deep: true })\n private onErrorResponseChanged(value: BaseAPIErrorModel) {\n if (value) {\n const errors = value.getAllErrorMessages();\n return this.$toasted.error(errors.join());\n }\n }\n\n public mounted() {\n this.$refs.code.focus();\n }\n\n public async onSubmitCodeClick(): Promise {\n const success: boolean = await this.$refs.form.validate();\n\n if (!success) {\n return;\n }\n\n this.isTagRegistered();\n }\n\n public async isTagRegistered(): Promise {\n await registeredTagModule.isTagRegisteredAction(this.code);\n\n if (!this.errorResponse && this.doesTagExist) {\n if (!this.doesTagExist.registered) {\n this.$router.push({\n name: routeName.veterinarian.createRegistration,\n params: {\n tagCode: this.code\n }\n });\n } else {\n this.$toasted.error(`${this.code} is already registered.`);\n }\n }\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./registration-form.component.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./registration-form.component.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./registration-form.component.vue?vue&type=template&id=4bf3d1d4&\"\nimport script from \"./registration-form.component.vue?vue&type=script&lang=ts&\"\nexport * from \"./registration-form.component.vue?vue&type=script&lang=ts&\"\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":""}