{"version":3,"sources":["webpack:///./src/views/shared/InviteUser.vue?e276","webpack:///./src/views/shared/InviteUser.vue","webpack:///./src/views/shared/InviteUser.vue?07a8","webpack:///./src/shared/components/InputError.vue?5099","webpack:///./src/shared/components/InputError.vue","webpack:///./src/shared/components/InputError.vue?cdcf"],"names":["_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","key","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","render","_ctx","_cache","$props","$setup","$data","$options","_component_InputError","_resolveComponent","_component_Multiselect","_openBlock","_createElementBlock","this","invitationLink","_Fragment","_createElementVNode","_toDisplayString","$t","onClick","$event","copyUrl","onSubmit","submitForm","_withDirectives","_normalizeClass","error","v$","email","$error","type","placeholder","onBlur","$touch","_vModelText","_createBlock","$invalid","_createCommentVNode","driversOnly","_createVNode","modelValue","role","options","roles","label","valueProp","object","noOptionsText","isDriver","darkStore","darkstores","searchable","darkStoreSearchable","onOpen","onClose","shift","shifts","vehicle","vehicles","driverSearchable","isClientAdmin","client","clients","closeModal","disabled","defineComponent","components","InputError","Multiselect","setup","useVuelidate","mounted","$store","dispatch","VehiclesActions","FETCH_VEHICLES_AVAILABLE","pageNumber","pageSize","isFree","DarkStoresActions","FETCH_DARKSTORES","data","validations","required","requiredIf","checkRequiredDriver","props","Boolean","default","methods","mytext","navigator","clipboard","writeText","alert","$emit","event","preventDefault","payload","user_email","role_id","id","Object","assign","dark_store_id","vehicle_id","shift_id","client_id","DriverActions","INVITE_DRIVER","then","link","catch","name","computed","getters","getRoles","value","watch","val","length","find","WorkShiftActions","FETCH_WORK_SHIFTS","darkstoreId","ClientActions","FETCH_CLIENTS","page","size","__exports__","_component_BaseIcon","BaseIcon","String"],"mappings":"0JAEMA,EAAa,CAAEC,MAAO,sBACtBC,EAAa,CAAED,MAAO,oDACtBE,EAAa,CAAEF,MAAO,8EACtBG,EAAa,CAAEH,MAAO,4DACtBI,EAAa,CAAEJ,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MAIxDpD,UAhBK,SAgBMsE,GACT1G,KAAK0C,MAAQ,KACb1C,KAAK4C,QAAU,KACX8D,GACF1G,KAAK2D,OAAOC,SAAZ,qBAAmC,CAACiD,OAAiBC,oBACnD,CAAE/C,WAAY,EAAGC,SAAU,KAAM+C,YAAaL,EAAIlB,MAIxDzC,cAzBK,SAyBU2D,GACTA,IAAQ1G,KAAKiD,QAAQ0D,QACvB3G,KAAK2D,OAAOC,SAAZ,kBAAgCoD,OAAcC,eAAiB,CAAEC,KAAM,EAAGC,KAAM,U,qBC9IxF,MAAMC,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAShI,KAErD,gB,kDCLTd,EAAa,CAAEC,MAAO,sFACtBC,EAAa,CAAED,MAAO,uBAEtB,SAAUa,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,IAAM2H,EAAsBzH,8BAAkB,YAE9C,OAAQE,yBAAcC,gCAAoB,MAAOzB,EAAY,CAC3D6B,gCAAoB,MAAO,KAAM,CAC/BuB,yBAAa2F,EAAqB,CAChC9I,MAAO,eACP6H,KAAM,YAGVjG,gCAAoB,IAAK3B,EAAY4B,6BAAiBf,EAAKwB,OAAQ,K,gBCXxDuC,+BAAgB,CAC7BgD,KAAM,aACN/C,WAAY,CACViE,uBAEF7C,MAAO,CACL5D,MAAO,CACLI,KAAMsG,OACNjD,UAAU,M,qBCPhB,MAAM8C,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAShI,KAErD","file":"js/chunk-da64cba8.5936933b.js","sourcesContent":["import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, vModelText as _vModelText, normalizeClass as _normalizeClass, withDirectives as _withDirectives, resolveComponent as _resolveComponent, createBlock as _createBlock, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"flex flex-wrap p-8\" }\nconst _hoisted_2 = { class: \"text-lg text-center w-full mb-4 text-darkPrimary\" }\nconst _hoisted_3 = { class: \"border border-l-2 bg-backgroundGray p-2 basis-20 flex-grow-0 flex-shrink-0\" }\nconst _hoisted_4 = { class: \"p-2 text text-darkPrimary text-sm text-ellipsis truncate\" }\nconst _hoisted_5 = { class: \"form-group\" }\nconst _hoisted_6 = {\n key: 0,\n class: \"form-group\"\n}\nconst _hoisted_7 = {\n key: 1,\n class: \"form-group\"\n}\nconst _hoisted_8 = {\n key: 2,\n class: \"form-group\"\n}\nconst _hoisted_9 = {\n key: 3,\n class: \"form-group\"\n}\nconst _hoisted_10 = {\n key: 4,\n class: \"form-group\"\n}\nconst _hoisted_11 = { class: \"flex flex-wrap items-center justify-end w-full\" }\nconst _hoisted_12 = [\"disabled\"]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_InputError = _resolveComponent(\"InputError\")!\n const _component_Multiselect = _resolveComponent(\"Multiselect\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (this.invitationLink)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"p\", _hoisted_2, _toDisplayString(_ctx.$t('addDriver.invitationTitle')), 1),\n _createElementVNode(\"div\", {\n class: \"w-full border border-2 border-gray-200 rounded rounded-md flex items-center justify-start overflow-hidden cursor-pointer\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.copyUrl(this.invitationLink)))\n }, [\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(_ctx.$t('addDriver.copyUrl')), 1),\n _createElementVNode(\"span\", _hoisted_4, _toDisplayString(this.invitationLink), 1)\n ])\n ], 64))\n : (_openBlock(), _createElementBlock(\"form\", {\n key: 1,\n onSubmit: _cache[13] || (_cache[13] = ($event: any) => (_ctx.submitForm($event))),\n class: \"w-full\"\n }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([{error: _ctx.v$.email.$error}, \"h-42 form-control\"]),\n type: \"email\",\n placeholder: \" \",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((_ctx.email) = $event)),\n onBlur: _cache[2] || (_cache[2] = \n//@ts-ignore\n(...args) => (_ctx.v$.email.$touch && _ctx.v$.email.$touch(...args)))\n }, null, 34), [\n [_vModelText, _ctx.email]\n ]),\n _createElementVNode(\"label\", {\n class: _normalizeClass([{error: _ctx.v$.email.$error}, \"floating-label\"])\n }, _toDisplayString(_ctx.$t('addDriver.email')), 3),\n (_ctx.v$.email.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.v$.email.email.$invalid ? _ctx.$t('validation.email') : _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]),\n (!_ctx.driversOnly)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.role,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => ((_ctx.role) = $event)),\n options: _ctx.roles,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.role')\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\"]),\n (_ctx.v$.role.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.isDriver)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_7, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.darkStore,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event: any) => ((_ctx.darkStore) = $event)),\n options: _ctx.darkstores,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.darkstore'),\n searchable: _ctx.darkStoreSearchable,\n onOpen: _cache[5] || (_cache[5] = () => _ctx.darkStoreSearchable = true),\n onClose: _cache[6] || (_cache[6] = () => _ctx.darkStoreSearchable = false)\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\", \"searchable\"]),\n (_ctx.v$.darkStore.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.isDriver)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.shift,\n \"onUpdate:modelValue\": _cache[7] || (_cache[7] = ($event: any) => ((_ctx.shift) = $event)),\n options: _ctx.shifts,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.shift')\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\"]),\n (_ctx.v$.shift.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.isDriver)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_9, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.vehicle,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = ($event: any) => ((_ctx.vehicle) = $event)),\n options: _ctx.vehicles,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.vehicle'),\n searchable: _ctx.driverSearchable,\n onOpen: _cache[9] || (_cache[9] = () => _ctx.driverSearchable = true),\n onClose: _cache[10] || (_cache[10] = () => _ctx.driverSearchable = false)\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\", \"searchable\"]),\n (_ctx.v$.vehicle.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.isClientAdmin)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_10, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.client,\n \"onUpdate:modelValue\": _cache[11] || (_cache[11] = ($event: any) => ((_ctx.client) = $event)),\n options: _ctx.clients,\n label: \"name\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.client')\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\"]),\n (_ctx.v$.client.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_11, [\n _createElementVNode(\"button\", {\n onClick: _cache[12] || (_cache[12] = \n//@ts-ignore\n(...args) => (_ctx.closeModal && _ctx.closeModal(...args))),\n class: \"secondary m-1 w-32 px-4 py-2\"\n }, _toDisplayString(_ctx.$t('buttons.close')), 1),\n _createElementVNode(\"button\", {\n type: \"submit\",\n class: \"primary m-1 w-32 px-4 py-2\",\n disabled: _ctx.v$.$invalid\n }, _toDisplayString(_ctx.$t('buttons.inviteUser')), 9, _hoisted_12)\n ])\n ], 32))\n ]))\n}","\nimport { defineComponent } from 'vue'\nimport useVuelidate from '@vuelidate/core'\nimport { required, requiredIf } from '@/customValidators'\nimport { VehiclesActions } from '@/store/modules/vehicles/actions'\nimport { VehicleInterface } from '@/shared/interfaces/vehicle.interface'\nimport { email } from '@vuelidate/validators'\nimport { DriverActions } from '@/store/modules/drivers/actions'\nimport { DarkStoresActions } from '@/store/modules/darkstores/actions'\nimport InputError from '@/shared/components/InputError.vue'\nimport { WorkShiftActions } from '@/store/modules/work-shifts/actions'\nimport Multiselect from '@vueform/multiselect'\nimport { ClientActions } from '@/store/modules/clients/actions'\n\nexport default defineComponent({\n components: { InputError, Multiselect },\n setup: () => ({ v$: useVuelidate() }),\n mounted () {\n this.$store.dispatch('getUserRoles')\n this.$store.dispatch(`vehicles/${[VehiclesActions.FETCH_VEHICLES_AVAILABLE]}`, { pageNumber: 1, pageSize: 9999, isFree: 1 })\n // this.$store.dispatch(`vehicles/${[VehiclesActions.FETCH_VEHICLES]}`, { pageNumber: 1, pageSize: 100, unAssigned: true })\n this.$store.dispatch(`darkstores/${[DarkStoresActions.FETCH_DARKSTORES]}`, { pageNumber: 1, pageSize: 9999 })\n // this.$store.dispatch(`workShifts/${[WorkShiftActions.FETCH_WORK_SHIFTS]}`)\n },\n data () {\n return {\n email: '',\n role: null as any,\n vehicle: null as any,\n shift: null as any,\n darkStore: null as any,\n invitationLink: null as any,\n driverSearchable: false,\n darkStoreSearchable: false,\n client: null as any\n }\n },\n validations: function () {\n return {\n email: { required, email },\n role: { required },\n vehicle: {\n required: requiredIf(() => this.checkRequiredDriver())\n },\n shift: {\n required: requiredIf(() => this.checkRequiredDriver())\n },\n darkStore: {\n required: requiredIf(() => this.checkRequiredDriver())\n },\n client: {\n required: requiredIf(() => this.isClientAdmin)\n }\n }\n },\n props: {\n driversOnly: {\n type: Boolean,\n default: false\n }\n },\n methods: {\n async copyUrl (mytext: string) {\n try {\n await navigator.clipboard.writeText(mytext)\n } catch ($e) {\n alert('Cannot copy')\n }\n },\n closeModal (): void {\n this.$emit('close')\n },\n async submitForm (event: any): Promise {\n event.preventDefault()\n const payload = {\n user_email: this.email,\n role_id: this.role.id\n }\n if (this.isDriver) {\n Object.assign(payload, { dark_store_id: this.darkStore.id, vehicle_id: this.vehicle.id, shift_id: this.shift.id })\n }\n if (this.isClientAdmin) {\n Object.assign(payload, { client_id: this.client.id })\n }\n await this.$store.dispatch(`drivers/${[DriverActions.INVITE_DRIVER]}`, payload).then((link: string) => {\n this.invitationLink = link\n // this.$emit('close')\n this.$emit('refresh')\n }).catch(() => {\n // const toast = useToast()\n // toast.error(err?.info?.message, { timeout: 3000 })\n })\n },\n checkRequiredDriver (): boolean {\n return this.role?.name === 'driver'\n }\n },\n computed: {\n roles (): VehicleInterface[] {\n return this.$store.getters.getRoles\n },\n vehicles (): VehicleInterface[] {\n return this.$store.getters['vehicles/getVehiclesWithShiftId']\n },\n isDriver (): boolean {\n return this.role && this.role.value === 'Driver'\n },\n darkstores (): any[] {\n return this.$store.getters['darkstores/getDarkStoresAsDictionary']\n },\n shifts (): any[] {\n return this.$store.getters['workShifts/getWorkShiftsForSelect']\n },\n isClientAdmin (): boolean {\n return this.role && this.role.value === 'ClientAdmin'\n },\n clients (): any[] {\n return this.$store.getters['clients/getClients']\n }\n },\n watch: {\n roles (val) {\n if (val?.length && this.driversOnly) {\n this.role = val.find((role: any) => role.name === 'driver')\n }\n },\n role (val) {\n this.shift = null\n this.vehicle = null\n this.darkStore = null\n if (val) {\n this.$store.dispatch(`workShifts/${[WorkShiftActions.FETCH_WORK_SHIFTS]}`,\n { pageNumber: 1, pageSize: 9999, darkstoreId: val.id }\n )\n }\n },\n darkStore (val) {\n this.shift = null\n this.vehicle = null\n if (val) {\n this.$store.dispatch(`workShifts/${[WorkShiftActions.FETCH_WORK_SHIFTS]}`,\n { pageNumber: 1, pageSize: 9999, darkstoreId: val.id }\n )\n }\n },\n isClientAdmin (val) {\n if (val && !this.clients.length) {\n this.$store.dispatch(`clients/${ClientActions.FETCH_CLIENTS}`, { page: 1, size: 100 })\n }\n }\n // shift (val) {\n // this.vehicle = null\n // if (val) {\n // this.$store.dispatch(`vehicles/${[VehiclesActions.FETCH_VEHICLES_AVAILABLE]}`, { isAssigned: 0 })\n // }\n // }\n }\n})\n","import { render } from \"./InviteUser.vue?vue&type=template&id=88984394&ts=true\"\nimport script from \"./InviteUser.vue?vue&type=script&lang=ts\"\nexport * from \"./InviteUser.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/usr/src/app/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"flex items-center absolute start-0 top-42 text-textError text-start leading-3 pt-1\" }\nconst _hoisted_2 = { class: \"text-10px leading-3\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_BaseIcon = _resolveComponent(\"BaseIcon\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", null, [\n _createVNode(_component_BaseIcon, {\n class: \"me-1 w-4 h-4\",\n name: \"alert\"\n })\n ]),\n _createElementVNode(\"p\", _hoisted_2, _toDisplayString(_ctx.error), 1)\n ]))\n}","\nimport { defineComponent } from 'vue'\nimport BaseIcon from '@/shared/components/base-icon/BaseIcon.vue'\n\nexport default defineComponent({\n name: 'InputError',\n components: {\n BaseIcon\n },\n props: {\n error: {\n type: String,\n required: true\n }\n }\n})\n","import { render } from \"./InputError.vue?vue&type=template&id=6a181c68&ts=true\"\nimport script from \"./InputError.vue?vue&type=script&lang=ts\"\nexport * from \"./InputError.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/usr/src/app/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"sourceRoot":""}