{"version":3,"sources":["webpack:///../../../src/components/VCard/index.ts","webpack:///./src/components/customer/SelectPrimaryContact.vue","webpack:///./src/components/customer/SelectPrimaryContact.vue?d059","webpack:///./src/components/customer/SelectPrimaryContact.vue?f3f9","webpack:///./src/components/customer/SelectPrimaryContact.vue?9c87"],"names":["VCardActions","createSimpleFunctional","VCardSubtitle","VCardText","VCardTitle","VCard","attrs","scopedSlots","_vm","model","value","newPrimaryContactId","callback","$$v","expression","currentPrimaryContactId","staticClass","slot","_c","loading","dialog","_v","on","key","fn","snackBar","snackBarText","staticRenderFns","setInteractionMode","extend","required","message","Vue","name","components","ValidationObserver","ValidationProvider","mounted","this","getUsers","props","clientPersons","type","Boolean","data","customerenm","CustomerEnum","clientenm","ClientEnum","timeLeft","watch","persons","deep","handler","console","log","computed","getAcl","_this$$route$name","$route","includes","Customer","$store","state","acl","ClientOrganization","enm","_this$$route$name2","displayPrimaryContactAcl","_this$$route$name3","_this$$route$name4","ui","DisplayPrimaryContact","ClientDisplayPrimaryContact","viewPrimaryContactAcl","_this$$route$name5","_this$$route$name6","ViewPrimaryContact","ClientViewPrimaryContact","managePrimaryContactAcl","_this$$route$name7","_this$$route$name8","ManagePrimaryContact","ClientManagePrimaryContact","hit","$vStore","context","find","client","clientId","selectedClient","id","person","isPrimaryContact","primaryContactSelectList","list","map","text","displayName","noOne","unshift","newPrimaryContactDisplayName","currentPrimaryContactDisplayName","methods","Promise","resolve","downloadTimer","setInterval","clearInterval","reset","length","getClientPersons","getPersons","dispatch","confirm","cancel","updateClientPrimaryContact","updateCustomerPrimaryContact","isValid","$refs","clientObserver","validate","countDownTimer","requestAnimationFrame","$router","push","e","JSON","stringify","observer","component"],"mappings":"kHAAA,oKAGA,MAAMA,EAAeC,eAAuB,mBACtCC,EAAgBD,eAAuB,oBACvCE,EAAYF,eAAuB,gBACnCG,EAAaH,eAAuB,iBAYtCI,Q,qKClB4UC,EAAM,W,IAAC,EAAM,KAAoB,EAAC,WAACC,EAAYC,MAAM,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AC1GX,KAAKb,UAAW,QACVa,KAAKoF,iBAEXC,sBAAsB,KAEjBrF,KAAKiF,MAAMU,UAEZ3F,KAAKiF,MAAcU,SAASpB,UAOhCvE,KAAK+C,QAAQ4B,SAAS,wBACtB3E,KAAK+C,QAAQ4B,SAAS,kBACtB3E,KAAKsF,QAAQC,KAAK,CAAC5F,KAAM,YAKzB,MAAO6F,GACRxF,KAAKuE,QACLvE,KAAKb,UAAW,EAChBa,KAAKZ,aAAe,2EAA6EqG,KAAKC,UAAUF,GAEjHxF,KAAKnB,SAAU,EACfmB,KAAKlB,QAAS,MC5R+Y,I,YCO5Z8G,EAAY,eACd,EACA,EACAvG,GACA,EACA,KACA,KACA,MAIa,aAAAuG,E","file":"js/chunk-8b002ed2.d8e02f90.js","sourcesContent":["import VCard from './VCard'\nimport { createSimpleFunctional } from '../../util/helpers'\n\nconst VCardActions = createSimpleFunctional('v-card__actions')\nconst VCardSubtitle = createSimpleFunctional('v-card__subtitle')\nconst VCardText = createSimpleFunctional('v-card__text')\nconst VCardTitle = createSimpleFunctional('v-card__title')\n\nexport {\n VCard,\n VCardActions,\n VCardSubtitle,\n VCardText,\n VCardTitle,\n}\n\nexport default {\n $_vuetify_subcomponents: {\n VCard,\n VCardActions,\n VCardSubtitle,\n VCardText,\n VCardTitle,\n },\n}\n","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return (_vm.displayPrimaryContactAcl || _vm.viewPrimaryContactAcl)?_c('v-card',{staticClass:\"my-2 pa-2\",attrs:{\"elevation\":\"0\",\"color\":\"transparent\"}},[(_vm.clientPersons)?_c('validation-observer',{ref:\"clientObserver\"},[_c('validation-provider',{attrs:{\"name\":\"newPrimaryContact\"},scopedSlots:_vm._u([{key:\"default\",fn:function(provider){return [_c('v-select',{attrs:{\"disabled\":_vm.loading || !_vm.managePrimaryContactAcl,\"items\":_vm.primaryContactSelectList,\"error-messages\":provider.errors[0],\"data-vv-name\":\"select\",\"required\":\"\",\"loading\":_vm.loading},on:{\"change\":_vm.confirm},model:{value:(_vm.newPrimaryContactId),callback:function ($$v) {_vm.newPrimaryContactId=$$v},expression:\"newPrimaryContactId\"}},[(_vm.currentPrimaryContactId !== _vm.newPrimaryContactId && !_vm.loading)?_c('fa',{staticClass:\"warning--text\",attrs:{\"slot\":\"append\",\"icon\":\"pen\"},slot:\"append\"}):_vm._e()],1)]}}],null,false,1499977374)})],1):_c('validation-observer',{ref:\"observer\"},[_c('validation-provider',{attrs:{\"name\":\"newPrimaryContact\"},scopedSlots:_vm._u([{key:\"default\",fn:function(provider){return [_c('v-select',{attrs:{\"items\":_vm.primaryContactSelectList,\"error-messages\":provider.errors[0],\"data-vv-name\":\"select\",\"required\":\"\",\"disabled\":_vm.loading || !_vm.managePrimaryContactAcl,\"loading\":_vm.loading},on:{\"change\":_vm.confirm},model:{value:(_vm.newPrimaryContactId),callback:function ($$v) {_vm.newPrimaryContactId=$$v},expression:\"newPrimaryContactId\"}},[(_vm.currentPrimaryContactId !== _vm.newPrimaryContactId && !_vm.loading)?_c('fa',{staticClass:\"warning--text\",attrs:{\"slot\":\"append\",\"icon\":\"pen\"},slot:\"append\"}):_vm._e()],1)]}}],null,false,472807422)})],1),_c('v-dialog',{attrs:{\"width\":\"800\"},model:{value:(_vm.dialog),callback:function ($$v) {_vm.dialog=$$v},expression:\"dialog\"}},[(_vm.dialog)?_c('v-card',[_c('v-card-title',[_c('span',{staticClass:\"title\"},[_vm._v(\"Update Primary Contact\")])]),_c('v-divider',{staticClass:\"mb-2\"}),_c('v-card-text',[_c('v-container',{attrs:{\"fluid\":\"\"}},[_c('v-row',[_c('v-col',{attrs:{\"cols\":\"12\"}},[_c('p',[_c('b',[_vm._v(\"New Primary Contact: \"+_vm._s(_vm.newPrimaryContactDisplayName))])]),_c('p',[_c('b',[_vm._v(\"Previous Primary Contact: \"+_vm._s(_vm.currentPrimaryContactDisplayName))])]),_c('p',[_vm._v(\"Are you sure you want to change the primary contact? You will not be able to undo this, unless you ask the new primary contact to assign you back!\")])])],1)],1)],1),_c('v-divider',{staticClass:\"mb-2\"}),_c('v-card-actions',[_c('v-col',{staticClass:\"text-right\"},[_c('v-btn',{staticClass:\"mr-2\",attrs:{\"color\":\"primary darken-1\",\"disabled\":_vm.loading,\"loading\":_vm.loading},on:{\"click\":_vm.updatePrimaryContact}},[_vm._v(\" Update \")]),_c('v-btn',{attrs:{\"color\":\"info darken-1\",\"disabled\":_vm.loading},on:{\"click\":_vm.cancel}},[_vm._v(\" Cancel \")])],1)],1)],1):_vm._e()],1),_c('v-snackbar',{staticClass:\"px-10\",attrs:{\"timeout\":\"20000\",\"vertical\":true,\"color\":\"white\",\"max-height\":\"none\",\"max-width\":\"none\"},scopedSlots:_vm._u([{key:\"action\",fn:function({ attrs }){return [_c('v-btn',_vm._b({attrs:{\"plain\":\"\",\"loading\":_vm.loading,\"color\":\"info darken-1 black--text\"},on:{\"click\":function($event){_vm.snackBar = false}}},'v-btn',attrs,false),[_vm._v(\" Close \")])]}}],null,false,3684289820),model:{value:(_vm.snackBar),callback:function ($$v) {_vm.snackBar=$$v},expression:\"snackBar\"}},[_c('p',{staticClass:\"black--text\",domProps:{\"innerHTML\":_vm._s(_vm.snackBarText)}})])],1):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\nimport Vue from \"vue\"\nimport { required } from \"vee-validate/dist/rules\"\nimport { extend, ValidationObserver, ValidationProvider, setInteractionMode } from \"vee-validate\"\nimport { CustomerEnum, ClientEnum } from \"@/types/enums\"\nimport { Client, Person, AclExtract } from \"@/types/responses\"\n\n\n/************************\n * VALIDATION OBSERVERS *\n ***********************/\nsetInteractionMode(\"eager\")\nextend(\"required\", {\n\t...required,\n\tmessage: \"{_field_} cannot be empty\",\n})\n\nexport default Vue.extend({\n\tname: \"SelectPrimaryContact\",\n\tcomponents: {\n\t\tValidationObserver,\n\t\tValidationProvider,\n\t},\n\tmounted() {\n\t\tthis.getUsers()\n\t},\n props: {\n clientPersons: {\n type: Boolean,\n required: true\n }\n },\n\tdata(): {\n\t\tsnackBar: boolean\n\t\tsnackBarText: string\n\t\tdialog: boolean\n\t\tnewPrimaryContactId: string | null\n\t\tloading: boolean\n\t\tcustomerenm: typeof CustomerEnum\n\t\tclientenm: typeof ClientEnum\n\t\ttimeLeft: number\n\t} {\n\t\treturn {\n\t\t\tsnackBar: false,\n\t\t\tsnackBarText: \"\",\n\t\t\tdialog: false,\n\t\t\tnewPrimaryContactId: null,\n\t\t\tloading: false,\n\t\t\tcustomerenm: CustomerEnum,\n\t\t\tclientenm: ClientEnum,\n\t\t\ttimeLeft: 3,\n\t\t}\n\t},\n watch:{\n persons: {\n deep: true,\n handler(){\n console.log(\"persons updated\")\n }\n }\n },\n\tcomputed: {\n\t\tgetAcl(): AclExtract {\n\t\t\tif(this.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.$store.state.acl[this.customerenm.Customer]\n\t\t\t}\n\t\t\treturn this.$store.state.acl[this.clientenm.ClientOrganization]\n\t\t},\n\t\tenm(): typeof CustomerEnum | typeof ClientEnum {\n\t\t\tif(this.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.customerenm\n\t\t\t}\n\n\t\t\treturn this.clientenm\n\t\t},\n\t\tdisplayPrimaryContactAcl(): boolean {\n\t\t\tif(\n\t\t\t\t!this.clientPersons &&\n\t\t\t\tthis.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.getAcl.ui.includes(this.customerenm.DisplayPrimaryContact)\n\t\t\t} else if (\n\t\t\t\tthis.clientPersons &&\n\t\t\t\tthis.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.getAcl.ui.includes(this.customerenm.ClientDisplayPrimaryContact)\n\t\t\t} \n\n\t\t\treturn this.getAcl.ui.includes(this.clientenm.ClientDisplayPrimaryContact)\n\t\t},\n\t\tviewPrimaryContactAcl(): boolean {\n\t\t\tif(\n\t\t\t\t!this.clientPersons &&\n\t\t\t\tthis.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.getAcl.ui.includes(this.customerenm.ViewPrimaryContact)\n\t\t\t} else if (\n\t\t\t\tthis.clientPersons &&\n\t\t\t\tthis.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.getAcl.ui.includes(this.customerenm.ClientViewPrimaryContact)\n\t\t\t} \n\n\t\t\treturn this.getAcl.ui.includes(this.clientenm.ClientViewPrimaryContact)\n\t\t},\n\t\tmanagePrimaryContactAcl(): boolean {\n\t\t\tconsole.log(this.$route.name)\n\t\t\tif(\n\t\t\t\t!this.clientPersons &&\n\t\t\t\tthis.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.getAcl.ui.includes(this.customerenm.ManagePrimaryContact)\n\t\t\t} else if (\n\t\t\t\tthis.clientPersons &&\n\t\t\t\tthis.$route.name?.includes(this.customerenm.Customer)){\n\t\t\t\treturn this.getAcl.ui.includes(this.customerenm.ClientManagePrimaryContact)\n\t\t\t} \n\t\t\t\n\t\t\treturn this.getAcl.ui.includes(this.clientenm.ClientManagePrimaryContact)\n\t\t},\n\t\tpersons(): Person[] {\n if(this.clientPersons){\n const hit = this.$vStore.state.context.clientPersons.find(client => {\n return client.clientId === this.selectedClient\n })\n if(hit) return hit.persons;\n } else {\n if(this.$vStore.state.context!.persons) return this.$vStore.state.context.persons\n }\n \n return []\n\t\t},\n\t\tselectedClient(): string {\n\t\t\treturn this.$vStore.state.context.selectedClient!.id;\n\t\t},\n\t\tcurrentPrimaryContactId(): string|null {\n\t\t\tconst hit = this.persons.find(person => {\n\t\t\t\treturn person.isPrimaryContact === true\n\t\t\t})\n\t\t\treturn hit ? hit.id : null\n\t\t},\n\t\tprimaryContactSelectList(): Array<{text: string, value: string|null}> {\n\t\t\tconst list: Array<{ text: string, value: string|null }> = this.persons.map(person => {\n\t\t\t\treturn {text: person.displayName, value: person.id}\n\t\t\t})\n\t\t\tconst noOne = { text: \"No primary contact\", value: null }\n\t\t\tlist.unshift(noOne)\n\t\t\treturn list\n\t\t},\n\t\tnewPrimaryContactDisplayName(): string {\n\t\t\tconst hit = this.persons.find(person => {\n\t\t\t\treturn person.id === this.newPrimaryContactId\n\t\t\t})\n\t\t\treturn hit ? hit.displayName : \"\"\n\t\t},\n\t\tcurrentPrimaryContactDisplayName(): string {\n\t\t\tconst hit = this.persons.find(person => {\n\t\t\t\treturn person.id === this.currentPrimaryContactId\n\t\t\t})\n\t\t\treturn hit ? hit.displayName : \"No primary contact\"\n\t\t}\n\t},\n\tmethods: {\n\t\tasync countDownTimer(): Promise {\n\t\t\tthis.timeLeft = 3\n\t\t\treturn new Promise((resolve) => {\n\t\t\t\tconst downloadTimer = setInterval(() => {\n\t\t\t\t\tthis.timeLeft--\n\t\t\t\t\tthis.snackBarText = `Successfully updated the primary contact.

Will reload permissions in ${this.timeLeft} seconds.. `\n\t\t\t\t\tif (this.timeLeft <= 0) {\n\t\t\t\t\t\tclearInterval(downloadTimer)\n\t\t\t\t\t\tresolve()\n\t\t\t\t\t}\n\t\t\t\t}, 900)\n\t\t\t})\n\t\t},\n\t\treset() {\n\t\t\tthis.newPrimaryContactId = this.currentPrimaryContactId\n\t\t},\n\t\tasync getUsers(): Promise {\n\t\t\tif (this.persons.length > 0) {\n\t\t\t\tthis.newPrimaryContactId = this.currentPrimaryContactId\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tthis.loading = true\n\n\t\t\t\tif(this.clientPersons) await this.getClientPersons()\n else await this.getPersons()\n\n\t\t\t\tthis.newPrimaryContactId = this.currentPrimaryContactId\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n async getPersons(): Promise {\n\t\t\tawait this.$vStore.dispatch(\"context/updatePersons\")\n },\n async getClientPersons(): Promise {\n await this.$vStore.dispatch(\"context/updateClientPersons\")\n },\n\t\tconfirm(): void {\n\t\t\tthis.dialog = true\n\t\t},\n\t\tcancel(): void {\n\t\t\tthis.reset()\n\t\t\tthis.dialog = false\n\t\t\tthis.loading = false\n\t\t},\n async updatePrimaryContact(): Promise {\n if(this.clientPersons) await this.updateClientPrimaryContact()\n else await this.updateCustomerPrimaryContact()\n },\n async updateClientPrimaryContact(): Promise {\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\t// eslint-disable-next-line\n\t\t\t\tconst isValid = await (this.$refs.clientObserver as any).validate()\n\t\t\t\tif (!isValid) return\n\t\t\t\t//if (this.newPrimaryContactId && (this.$vStore.state.context.persons.find(person => person.id === this.newPrimaryContactId) !== undefined) ) {\n\t\t\t\t\tthis.$vStore.dispatch(\"context/setClientPrimaryContact\", this.newPrimaryContactId)\n\n\t\t\t\t\tthis.dialog = false\n\t\t\t\t\tthis.snackBarText = `Successfully updated the primary contact.

Will reload permissions in ${this.timeLeft} seconds.. `\n\t\t\t\t\tthis.snackBar = true\n\t\t\t\t\tawait this.countDownTimer()\n\t\t\t\t\t// Reset validators! You should call it on the next frame\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\t\tif (this.$refs.clientObserver) {\n\t\t\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\t\t\t;(this.$refs as any).clientObserver.reset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\t/************************/\n\t\t\t\t\t/** START FROM SCRATCH **/\n\t\t\t\t\t/************************/\n\t\t\t\t\tthis.$vStore.dispatch(\"context/resetContext\")\n\t\t\t\t\tthis.$vStore.dispatch(\"acl/resetState\")\n\t\t\t\t\tthis.$router.push({name: \"Context\"})\n\t\t\t\t//} else {\n\t\t\t\t//\tthis.snackBar = true\n\t\t\t\t//\tthis.snackBarText = \"No change in primary contact\"\n\t\t\t\t//}\n\t\t\t} catch (e) {\n\t\t\t\tthis.reset()\n\t\t\t\tthis.snackBar = true\n\t\t\t\tthis.snackBarText = \"Something happened while updating the primary contact!.

Error: \" + JSON.stringify(e)\n\t\t\t}\n\t\t\tthis.loading = false\n\t\t\tthis.dialog = false\n\t\t},\n async updateCustomerPrimaryContact(): Promise {\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\t// eslint-disable-next-line\n\t\t\t\tconst isValid = await (this.$refs.observer as any).validate()\n\t\t\t\tif (!isValid) return\n\t\t\t\t//if (this.newPrimaryContactId && (this.$vStore.state.context.persons.find(person => person.id === this.newPrimaryContactId) !== undefined) ) {\n\t\t\t\t\tthis.$vStore.dispatch(\"context/setPrimaryContact\", this.newPrimaryContactId)\n\n\t\t\t\t\tthis.dialog = false\n\t\t\t\t\tthis.snackBarText = `Successfully updated the primary contact.

Will reload permissions in ${this.timeLeft} seconds.. `\n\t\t\t\t\tthis.snackBar = true\n\t\t\t\t\tawait this.countDownTimer()\n\t\t\t\t\t// Reset validators! You should call it on the next frame\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\t\tif (this.$refs.observer) {\n\t\t\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\t\t\t;(this.$refs as any).observer.reset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\t/************************/\n\t\t\t\t\t/** START FROM SCRATCH **/\n\t\t\t\t\t/************************/\n\t\t\t\t\tthis.$vStore.dispatch(\"context/resetContext\")\n\t\t\t\t\tthis.$vStore.dispatch(\"acl/resetState\")\n\t\t\t\t\tthis.$router.push({name: \"Context\"})\n\t\t\t\t//} else {\n\t\t\t\t//\tthis.snackBar = true\n\t\t\t\t//\tthis.snackBarText = \"No change in primary contact\"\n\t\t\t\t//}\n\t\t\t} catch (e) {\n\t\t\t\tthis.reset()\n\t\t\t\tthis.snackBar = true\n\t\t\t\tthis.snackBarText = \"Something happened while updating the primary contact!.

Error: \" + JSON.stringify(e)\n\t\t\t}\n\t\t\tthis.loading = false\n\t\t\tthis.dialog = false\n\t\t},\n\t},\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--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SelectPrimaryContact.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--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SelectPrimaryContact.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./SelectPrimaryContact.vue?vue&type=template&id=0d5774e8\"\nimport script from \"./SelectPrimaryContact.vue?vue&type=script&lang=ts\"\nexport * from \"./SelectPrimaryContact.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":""}