/home/ivoiecob/email.hirewise-va.com/adminpanel/js/3003.bf4b9ec8.js
(globalThis["webpackChunkadmin_panel_vue_webclient"]=globalThis["webpackChunkadmin_panel_vue_webclient"]||[]).push([[3003],{35358:(e,t,s)=>{var a={"./af":78188,"./af.js":78188,"./ar":50096,"./ar-dz":28495,"./ar-dz.js":28495,"./ar-kw":85891,"./ar-kw.js":85891,"./ar-ly":13194,"./ar-ly.js":13194,"./ar-ma":42195,"./ar-ma.js":42195,"./ar-sa":29393,"./ar-sa.js":29393,"./ar-tn":21867,"./ar-tn.js":21867,"./ar.js":50096,"./az":43224,"./az.js":43224,"./be":61330,"./be.js":61330,"./bg":85096,"./bg.js":85096,"./bm":28746,"./bm.js":28746,"./bn":29303,"./bn-bd":56554,"./bn-bd.js":56554,"./bn.js":29303,"./bo":30528,"./bo.js":30528,"./br":35499,"./br.js":35499,"./bs":29828,"./bs.js":29828,"./ca":35855,"./ca.js":35855,"./cs":68481,"./cs.js":68481,"./cv":1694,"./cv.js":1694,"./cy":98903,"./cy.js":98903,"./da":95908,"./da.js":95908,"./de":85528,"./de-at":21732,"./de-at.js":21732,"./de-ch":54146,"./de-ch.js":54146,"./de.js":85528,"./dv":81313,"./dv.js":81313,"./el":20138,"./el.js":20138,"./en-au":78067,"./en-au.js":78067,"./en-ca":82545,"./en-ca.js":82545,"./en-gb":50124,"./en-gb.js":50124,"./en-ie":6107,"./en-ie.js":6107,"./en-il":13196,"./en-il.js":13196,"./en-in":1654,"./en-in.js":1654,"./en-nz":79557,"./en-nz.js":79557,"./en-sg":35451,"./en-sg.js":35451,"./eo":21591,"./eo.js":21591,"./es":36843,"./es-do":61009,"./es-do.js":61009,"./es-mx":75169,"./es-mx.js":75169,"./es-us":37224,"./es-us.js":37224,"./es.js":36843,"./et":77058,"./et.js":77058,"./eu":61297,"./eu.js":61297,"./fa":46658,"./fa.js":46658,"./fi":75674,"./fi.js":75674,"./fil":45204,"./fil.js":45204,"./fo":74428,"./fo.js":74428,"./fr":80703,"./fr-ca":27812,"./fr-ca.js":27812,"./fr-ch":9411,"./fr-ch.js":9411,"./fr.js":80703,"./fy":89738,"./fy.js":89738,"./ga":21235,"./ga.js":21235,"./gd":96032,"./gd.js":96032,"./gl":16424,"./gl.js":16424,"./gom-deva":53793,"./gom-deva.js":53793,"./gom-latn":14714,"./gom-latn.js":14714,"./gu":33383,"./gu.js":33383,"./he":46660,"./he.js":46660,"./hi":37264,"./hi.js":37264,"./hr":63201,"./hr.js":63201,"./hu":35604,"./hu.js":35604,"./hy-am":61067,"./hy-am.js":61067,"./id":19262,"./id.js":19262,"./is":53423,"./is.js":53423,"./it":73038,"./it-ch":23512,"./it-ch.js":23512,"./it.js":73038,"./ja":87558,"./ja.js":87558,"./jv":86071,"./jv.js":86071,"./ka":95927,"./ka.js":95927,"./kk":62625,"./kk.js":62625,"./km":25499,"./km.js":25499,"./kn":79486,"./kn.js":79486,"./ko":89405,"./ko.js":89405,"./ku":77155,"./ku.js":77155,"./ky":13647,"./ky.js":13647,"./lb":42837,"./lb.js":42837,"./lo":91474,"./lo.js":91474,"./lt":96967,"./lt.js":96967,"./lv":48297,"./lv.js":48297,"./me":1545,"./me.js":1545,"./mi":2573,"./mi.js":2573,"./mk":77259,"./mk.js":77259,"./ml":33826,"./ml.js":33826,"./mn":45368,"./mn.js":45368,"./mr":30860,"./mr.js":30860,"./ms":96947,"./ms-my":99418,"./ms-my.js":99418,"./ms.js":96947,"./mt":76906,"./mt.js":76906,"./my":71837,"./my.js":71837,"./nb":24503,"./nb.js":24503,"./ne":31286,"./ne.js":31286,"./nl":17981,"./nl-be":58103,"./nl-be.js":58103,"./nl.js":17981,"./nn":19387,"./nn.js":19387,"./oc-lnc":30803,"./oc-lnc.js":30803,"./pa-in":66742,"./pa-in.js":66742,"./pl":30075,"./pl.js":30075,"./pt":81731,"./pt-br":23352,"./pt-br.js":23352,"./pt.js":81731,"./ro":21776,"./ro.js":21776,"./ru":5746,"./ru.js":5746,"./sd":74100,"./sd.js":74100,"./se":38395,"./se.js":38395,"./si":8823,"./si.js":8823,"./sk":39385,"./sk.js":39385,"./sl":3852,"./sl.js":3852,"./sq":3247,"./sq.js":3247,"./sr":64290,"./sr-cyrl":26189,"./sr-cyrl.js":26189,"./sr.js":64290,"./ss":32177,"./ss.js":32177,"./sv":49038,"./sv.js":49038,"./sw":9741,"./sw.js":9741,"./ta":86932,"./ta.js":86932,"./te":95784,"./te.js":95784,"./tet":13334,"./tet.js":13334,"./tg":23602,"./tg.js":23602,"./th":16947,"./th.js":16947,"./tk":46774,"./tk.js":46774,"./tl-ph":5868,"./tl-ph.js":5868,"./tlh":16695,"./tlh.js":16695,"./tr":22573,"./tr.js":22573,"./tzl":84509,"./tzl.js":84509,"./tzm":17118,"./tzm-latn":87078,"./tzm-latn.js":87078,"./tzm.js":17118,"./ug-cn":82617,"./ug-cn.js":82617,"./uk":56131,"./uk.js":56131,"./ur":56532,"./ur.js":56532,"./uz":69932,"./uz-latn":27220,"./uz-latn.js":27220,"./uz.js":69932,"./vi":20490,"./vi.js":20490,"./x-pseudo":32154,"./x-pseudo.js":32154,"./yo":49955,"./yo.js":49955,"./zh-cn":68355,"./zh-cn.js":68355,"./zh-hk":89547,"./zh-hk.js":89547,"./zh-mo":70374,"./zh-mo.js":70374,"./zh-tw":979,"./zh-tw.js":979};function n(e){var t=i(e);return s(t)}function i(e){if(!s.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}n.keys=function(){return Object.keys(a)},n.resolve=i,e.exports=n,n.id=35358},38755:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var a=s(61758);const n=["width","height"],i=["fill"];function r(e,t,s,r,o,l){return(0,a.uX)(),(0,a.CE)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 1024 1024",width:s.size,height:s.size},[(0,a.Lk)("path",{fill:s.color,d:"M510.687 147.375c-59.743 0-107.353 23.892-139.25 62.438-28.45 34.381-44.181 79.901-49.75 130-1.312 2.271-2.085 4.994-2.085 7.899 0 1.527 0.214 3.003 0.613 4.402-0.031-0.071-0.024-0.030-0.028 0.012-11.117 12.446-17.188 29.707-17.188 48.938 0 23.166 10.003 42.515 26.25 54.25 13.986 53.199 42.283 100.998 79.5 133.312-1.162 33.441-10.747 56.671-26.063 74.5-16.32 18.999-39.792 32.465-67.375 42.938-30.092 11.403-67.308 29.141-99.875 54.688s-60.952 59.404-69.812 102.75c-0.211 0.976-0.333 2.097-0.333 3.247 0 8.844 7.17 16.014 16.014 16.014 7.715 0 14.156-5.456 15.675-12.72 6.837-33.462 29.357-61.475 58.206-84.104s63.576-39.356 91.5-49.938c30.402-11.543 59.049-27.247 80.313-52 16.447-19.146 27.716-43.807 32.062-73.938 21.946 12.25 45.858 19.938 71.625 19.938 30.748 0 59.073-10.322 84.188-27.313 3.477 33.426 14.894 60.676 32.625 81.313 21.268 24.753 49.894 40.457 80.312 52 27.909 10.581 62.647 27.307 91.5 49.938s51.368 50.644 58.188 84c1.537 7.368 7.978 12.823 15.693 12.823 8.844 0 16.014-7.17 16.014-16.014 0-1.15-0.121-2.271-0.351-3.352-8.842-43.243-37.223-77.099-69.794-102.645s-69.8-43.285-99.875-54.688c-27.598-10.473-51.051-23.939-67.375-42.938s-26.5-43.667-26.5-80.812c0.002-0.082 0.002-0.178 0.002-0.275 0-1.412-0.183-2.782-0.527-4.086 31.017-31.404 54.404-74.458 66.963-121.326 17.937-11.017 29.25-31.211 29.25-55.562 0-20.347-7.717-37.757-20.25-50.25-4.318-54.827-20.492-104.846-51.437-141.812-31.889-38.093-79.262-61.625-138.625-61.625zM510.687 179.375c51.197 0 87.808 18.825 114.063 50.187 17.716 21.162 30.037 48.863 37.5 80.313-30.984 2.865-53.466-6.867-74.062-31.188-2.953-3.456-7.316-5.633-12.188-5.633-0.176 0-0.351 0.003-0.525 0.008-5.461 0.161-10.236 3.061-12.999 7.373-31.894 50.755-84.994 63.862-133.101 64.439-36.026 0.431-61.518-5.45-75.062-9 5.795-42.099 19.622-78.947 41.75-105.687 26.28-31.758 63.104-50.812 114.625-50.812zM578.625 310c24.671 22.015 54.412 34.951 89.125 31.875 0.618 5.283 1.648 10.309 2 15.75 0.334 5.068 2.98 9.455 6.884 12.153 5.337 3.651 12.366 15.811 12.366 31.285 0 19.011-10.397 31.355-15.375 32.625-5.663 1.502-10.028 5.888-11.475 11.451-21.879 85.925-83.742 152.861-151.462 152.861-67.971 0-130.076-67.453-151.687-153.687-1.278-5.041-4.822-9.057-9.456-10.961-5.233-2.077-14.544-14.505-14.544-32.289 0-14.134 5.797-25.642 10.938-30.062 1.154-1.026 2.147-2.199 2.959-3.495 16.503 4.11 43.178 9.822 80.852 9.37 49.615-0.595 109.038-16.222 148.875-66.875z"},null,8,i)],8,n)}const o={name:"TeamGroup",props:{size:{type:Number,default:32},color:{type:String,default:"#000"}}};var l=s(12807);const u=(0,l.A)(o,[["render",r]]),d=u},98254:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>It});var a=s(26115),n=(s(63150),s(34823),s(43436)),i=s.n(n),r=s(45895),o=s(61758),l=s(29104),u=s(58790);const d=e=>((0,o.Qi)("data-v-400859f8"),e=e(),(0,o.jt)(),e),h={class:"q-pa-lg"},p={class:"row q-mb-md"},c={key:0,class:"col text-h5"},m={key:1,class:"col text-h5"},E={class:"row q-mb-md"},g={class:"col-2"},A={class:"col-5 text-weight-medium"},N={class:"row q-mb-md"},T=d((()=>(0,o.Lk)("div",{class:"col-2"},null,-1))),C={class:"col-5"},I={key:0,class:"row q-mb-md"},L={class:"col-2"},b={class:"col-5 text-weight-medium"},v={key:1,class:"row q-mb-md"},_={class:"col-2"},R={class:"col-5 text-weight-medium"},f={key:0},k={key:1},D={key:2,class:"row"},j=d((()=>(0,o.Lk)("div",{class:"col-2"},null,-1))),U={class:"col-5"},w={key:3,class:"row q-mt-md"},S=d((()=>(0,o.Lk)("div",{class:"col-2"},null,-1))),O={class:"col-5"},M={key:4,class:"row q-mt-md"},P={class:"col-2 q-mt-sm"},$={class:"col-10"},y={key:0,class:"groups-container"},G={class:"ellipsis"},B={class:"q-pt-md text-right"};function W(e,t,s,a,n,i){const r=(0,o.g2)("q-input"),d=(0,o.g2)("q-checkbox"),W=(0,o.g2)("q-chip"),q=(0,o.g2)("q-item-section"),F=(0,o.g2)("q-item"),Q=(0,o.g2)("q-item-label"),V=(0,o.g2)("q-select"),x=(0,o.g2)("q-card-section"),X=(0,o.g2)("q-card"),z=(0,o.g2)("q-btn"),Y=(0,o.g2)("q-linear-progress"),H=(0,o.g2)("q-inner-loading"),K=(0,o.g2)("q-scroll-area"),J=(0,o.gN)("t"),Z=(0,o.gN)("close-popup");return(0,o.uX)(),(0,o.Wv)(K,{class:"full-height full-width relative-position"},{default:(0,o.k6)((()=>[(0,o.Lk)("div",h,[(0,o.Lk)("div",p,[s.createMode?(0,o.Q3)("",!0):(0,o.bo)(((0,o.uX)(),(0,o.CE)("div",c,null,512)),[[J,"COREWEBCLIENT.HEADING_COMMON_SETTINGS"]]),s.createMode?(0,o.bo)(((0,o.uX)(),(0,o.CE)("div",m,null,512)),[[J,"ADMINPANELWEBCLIENT.HEADING_CREATE_USER"]]):(0,o.Q3)("",!0)]),(0,o.bF)(X,{flat:"",bordered:"",class:"card-edit-settings"},{default:(0,o.k6)((()=>[(0,o.bF)(x,null,{default:(0,o.k6)((()=>[((0,o.uX)(),(0,o.Wv)((0,o.$y)(n.mainDataComponent),{ref:"mainDataComponent",currentTenantId:i.currentTenantId,user:n.user,createMode:s.createMode,onSave:i.handleSave},null,40,["currentTenantId","user","createMode","onSave"])),(0,o.Lk)("div",E,[(0,o.bo)((0,o.Lk)("div",g,null,512),[[J,"ADMINPANELWEBCLIENT.LABEL_USER_NOTE"]]),(0,o.Lk)("div",A,[(0,o.bF)(r,{outlined:"",dense:"","bg-color":"white",autogrow:"",modelValue:n.note,"onUpdate:modelValue":t[0]||(t[0]=e=>n.note=e),onKeyup:(0,l.jR)((0,l.D$)(i.save,["exact"]),["enter"])},null,8,["modelValue","onKeyup"])])]),(0,o.Lk)("div",N,[T,(0,o.Lk)("div",C,[(0,o.bF)(d,{dense:"",modelValue:n.isDisabled,"onUpdate:modelValue":t[1]||(t[1]=e=>n.isDisabled=e),label:e.$t("ADMINPANELWEBCLIENT.ACTION_DEACTIVATE")},null,8,["modelValue","label"])])]),i.userCreatedAtString?((0,o.uX)(),(0,o.CE)("div",I,[(0,o.bo)((0,o.Lk)("div",L,null,512),[[J,"ADMINPANELWEBCLIENT.LABEL_USER_CREATED"]]),(0,o.Lk)("div",b,[(0,o.Lk)("span",null,(0,u.v_)(i.userCreatedAtString),1)])])):(0,o.Q3)("",!0),s.createMode?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.CE)("div",v,[(0,o.bo)((0,o.Lk)("div",_,null,512),[[J,"ADMINPANELWEBCLIENT.LABEL_USER_LAST_LOGIN"]]),(0,o.Lk)("div",R,[i.userLastLoginAtString?((0,o.uX)(),(0,o.CE)("span",f,(0,u.v_)(i.userLastLoginAtString),1)):(0,o.bo)(((0,o.uX)(),(0,o.CE)("span",k,null,512)),[[J,"ADMINPANELWEBCLIENT.LABEL_USER_NEVER_LOGIN"]])])])),i.allowMakeTenant?((0,o.uX)(),(0,o.CE)("div",D,[j,(0,o.Lk)("div",U,[(0,o.bF)(d,{dense:"",modelValue:n.isTenantAdmin,"onUpdate:modelValue":t[2]||(t[2]=e=>n.isTenantAdmin=e),label:e.$t("ADMINPANELWEBCLIENT.LABEL_USER_IS_TENANT_ADMIN")},null,8,["modelValue","label"])])])):(0,o.Q3)("",!0),!s.createMode&&i.isUserSuperAdmin?((0,o.uX)(),(0,o.CE)("div",w,[S,(0,o.Lk)("div",O,[(0,o.bF)(d,{dense:"",modelValue:n.writeSeparateLog,"onUpdate:modelValue":t[3]||(t[3]=e=>n.writeSeparateLog=e),label:e.$t("ADMINPANELWEBCLIENT.LABEL_LOGGING_SEPARATE_LOG_FOR_USER")},null,8,["modelValue","label"])])])):(0,o.Q3)("",!0),((0,o.uX)(!0),(0,o.CE)(o.FK,null,(0,o.pI)(n.otherDataComponents,(e=>((0,o.uX)(),(0,o.Wv)((0,o.$y)(e),{key:e.name,ref_for:!0,ref:"otherDataComponents",currentTenantId:i.currentTenantId,user:n.user,createMode:s.createMode,onSave:i.handleSave},null,40,["currentTenantId","user","createMode","onSave"])))),128)),!s.createMode&&i.allTenantGroups.length>0&&i.isUserSuperAdmin?((0,o.uX)(),(0,o.CE)("div",M,[(0,o.bo)((0,o.Lk)("div",P,null,512),[[J,"ADMINPANELWEBCLIENT.LABEL_USER_GROUPS"]]),(0,o.Lk)("div",$,[(0,o.bF)(V,{dense:"",outlined:"","bg-color":"white","use-input":"","use-chips":"",multiple:"",modelValue:n.selectedGroupOptions,"onUpdate:modelValue":t[4]||(t[4]=e=>n.selectedGroupOptions=e),options:n.groupOptions,onFilter:i.getGroupOptions},{selected:(0,o.k6)((()=>[n.selectedGroupOptions?((0,o.uX)(),(0,o.CE)("span",y,[((0,o.uX)(!0),(0,o.CE)(o.FK,null,(0,o.pI)(n.selectedGroupOptions,(e=>((0,o.uX)(),(0,o.Wv)(W,{flat:"",key:e.value,removable:"",onRemove:t=>i.removeFromSelectedGroups(e.value)},{default:(0,o.k6)((()=>[(0,o.Lk)("div",G,(0,u.v_)(e.label),1)])),_:2},1032,["onRemove"])))),128))])):(0,o.Q3)("",!0)])),"no-option":(0,o.k6)((()=>[(0,o.bF)(F,null,{default:(0,o.k6)((()=>[(0,o.bo)((0,o.bF)(q,{class:"text-grey"},null,512),[[J,"ADMINPANELWEBCLIENT.LABEL_GROUPS_NO_OPTIONS"]])])),_:1})])),option:(0,o.k6)((e=>[(0,o.bo)(((0,o.uX)(),(0,o.Wv)(F,(0,o.v6)(e.itemProps,(0,o.Tb)(e.itemEvents)),{default:(0,o.k6)((()=>[(0,o.bF)(q,{class:"non-selectable"},{default:(0,o.k6)((()=>[(0,o.bF)(Q,null,{default:(0,o.k6)((()=>[(0,o.eW)((0,u.v_)(e.opt.label),1)])),_:2},1024)])),_:2},1024)])),_:2},1040)),[[Z]])])),_:1},8,["modelValue","options","onFilter"])])])):(0,o.Q3)("",!0)])),_:1})])),_:1}),(0,o.Lk)("div",B,[s.createMode?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(z,{key:0,unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"negative",onClick:i.deleteUser,label:e.$t("ADMINPANELWEBCLIENT.ACTION_DELETE_USER")},null,8,["onClick","label"])),s.createMode?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(z,{key:1,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"primary",onClick:i.handleSave,label:e.$t("COREWEBCLIENT.ACTION_SAVE")},null,8,["onClick","label"])),s.createMode?((0,o.uX)(),(0,o.Wv)(z,{key:2,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"primary",onClick:i.handleSave,label:e.$t("COREWEBCLIENT.ACTION_CREATE")},null,8,["onClick","label"])):(0,o.Q3)("",!0),s.createMode?((0,o.uX)(),(0,o.Wv)(z,{key:3,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"secondary",onClick:i.cancel,label:e.$t("COREWEBCLIENT.ACTION_CANCEL")},null,8,["onClick","label"])):(0,o.Q3)("",!0)])]),(0,o.bF)(H,{style:{"justify-content":"flex-start"},showing:n.loading||i.deleting||n.saving},{default:(0,o.k6)((()=>[(0,o.bF)(Y,{query:""})])),_:1},8,["showing"])])),_:1})}s(39541),s(43218),s(28268),s(29344);var q=s(36720),F=s(38176),Q=s(35118),V=s(79134),x=s(64595),X=s(59368),z=s(85038),Y=s.n(z),H=s(84831);let K={};const J={name:"EditUser",props:{deletingIds:Array,createMode:Boolean},data(){return{mainDataComponent:null,otherDataComponents:[],user:null,publicId:"",isDisabled:!1,isTenantAdmin:!1,writeSeparateLog:!1,note:"",selectedGroupOptions:[],groupOptions:[],loading:!1,saving:!1}},computed:{createModeForEditUser(){const e=this.$route.path.indexOf("/create");return-1!==e&&e===this.$route.path.length-7},userCreatedAtString(){return this.user?.completeData?.CreatedAt?Y()(this.user?.completeData?.CreatedAt).format("L HH:mm"):null},userLastLoginAtString(){return this.user?.completeData?.LastLogin?Y()(this.user?.completeData?.LastLogin).format("L HH:mm"):null},currentTenantId(){return this.$store.getters["tenants/getCurrentTenantId"]},allTenantGroups(){const e=this.$store.getters["groups/getGroups"],t=Q.A.pArray(e[this.currentTenantId]);return t.filter((e=>!e.isTeam))},deleting(){return-1!==this.deletingIds.indexOf(this.user?.id)},isUserSuperAdmin(){const e=this.$store.getters["user/isUserSuperAdmin"];return e},allowMakeTenant(){const e=this.$store.getters["user/isUserSuperAdmin"];return e&&(X.A.getEnableMultiTenant()||!0)}},watch:{$route(){this.parseRoute()},"user.groups"(){i().isArray(this.user.groups)&&(this.selectedGroupOptions=this.user.groups.map((e=>({label:e.name,value:e.id}))))}},beforeRouteLeave(e,t,s){this.$root.doBeforeRouteLeave(e,t,s)},beforeRouteUpdate(e,t,s){this.$root.doBeforeRouteLeave(e,t,s)},mounted(){K=a.A.getUserRoles(),this.getUserMainDataComponent(),this.getUserOtherDataComponents(),this.loading=!1,this.saving=!1,this.parseRoute()},methods:{async getUserMainDataComponent(){this.mainDataComponent=await r.A.getUserMainDataComponent()},async getUserOtherDataComponents(){this.otherDataComponents=await r.A.getUserOtherDataComponents()},parseRoute(){if("/users"!==this.$route.path&&"/users/"!==this.$route.path)if(this.createMode||this.createModeForEditUser){const e=new H.A(this.currentTenantId,{});this.fillUp(e)}else{const e=Q.A.pPositiveInt(this.$route?.params?.id);this.user?.id!==e&&(this.user={id:e},this.populate(),this.getUserMainDataComponent())}},clear(){this.publicId="",this.isDisabled=!1,this.isTenantAdmin=!1,this.writeSeparateLog=!1,this.note=""},fillUp(e){this.user=e,this.publicId=e.publicId,this.isDisabled=e.disabled,this.isTenantAdmin=e.role===K.TenantAdmin,this.writeSeparateLog=e.writeSeparateLog,this.note=e.note,this.selectedGroupOptions=e.groups.map((e=>({label:e.name,value:e.id})))},populate(){this.clear(),this.loading=!0,x.A.getUser(this.currentTenantId,this.user.id).then((({user:e,userId:t})=>{t===this.user.id&&(this.loading=!1,e?this.fillUp(e):this.$emit("no-user-found"))}))},getGroupOptions(e,t,s){const a=e.toLowerCase(),n=this.selectedGroupOptions.map((e=>e.value));let i=this.allTenantGroups.filter((e=>-1===n.indexOf(e.id)));""!==a&&(i=i.filter((e=>-1!==e.name.toLowerCase().indexOf(a)))),t((()=>{this.groupOptions=i.map((e=>({label:e.name,value:e.id}))).slice(0,100)}))},removeFromSelectedGroups(e){this.selectedGroupOptions=this.selectedGroupOptions.filter((t=>t.value!==e))},hasChanges(){if(this.loading)return!1;const e=!!i().isFunction(this.$refs?.mainDataComponent?.hasChanges)&&this.$refs.mainDataComponent.hasChanges(),t=()=>!!Array.isArray(this.$refs?.otherDataComponents)&&this.$refs.otherDataComponents.some((e=>"function"===typeof e.hasChanges&&e.hasChanges()));return e||t()||this.isDisabled!==this.user?.disabled||this.isTenantAdmin!==(this.user?.role===K.TenantAdmin)||this.writeSeparateLog!==this.user?.writeSeparateLog||this.note!==this.user?.note||this.hasGroupChanges()},hasGroupChanges(){const e=this.selectedGroupOptions.map((e=>e.value)).sort(),t=(this.user.groups||[]).map((e=>e.id)).sort();return!i().isEqual(e,t)},revertChanges(){i().isFunction(this.$refs?.mainDataComponent?.revertChanges)&&this.$refs.mainDataComponent.revertChanges(),i().isFunction(this.$refs?.otherDataComponents?.forEach)&&this.$refs.otherDataComponents.forEach((e=>{i().isFunction(e.revertChanges)&&e.revertChanges()})),this.isDisabled=this.user?.disabled,this.isTenantAdmin=this.user?.role===K.TenantAdmin,this.writeSeparateLog=this.user?.writeSeparateLog,this.note=this.user?.note},isDataValid(){const e=!i().isFunction(this.$refs?.mainDataComponent?.isDataValid)||this.$refs.mainDataComponent.isDataValid(),t=()=>!Array.isArray(this.$refs?.otherDataComponents)||this.$refs.otherDataComponents.every((e=>!i().isFunction(e.isDataValid)||e.isDataValid()));return e&&t()},isUserEmailValid(){const e=this.$refs.mainDataComponent.getSaveParameters(),t=e.PublicId,s=t.slice(0,t.lastIndexOf("@")),a=/[@\s]/;return!a.test(s)&&s.length},handleSave(){this.isUserEmailValid()?this.save():F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_INVALID_EMAIL_USERNAME_PART"))},save(){if(!this.saving&&this.isDataValid()){this.saving=!0;const e=i().isFunction(this.$refs?.mainDataComponent?.getSaveParameters)?this.$refs.mainDataComponent.getSaveParameters():{},t=this.$store.getters["user/isUserSuperAdmin"];let s=i().extend({UserId:this.user.id,TenantId:this.user.tenantId,Role:t&&this.isTenantAdmin?K.TenantAdmin:K.NormalUser,IsDisabled:this.isDisabled,WriteSeparateLog:this.writeSeparateLog,Note:this.note,Forced:!0,GroupIds:t?this.selectedGroupOptions.map((e=>e.value)):null},e);i().isFunction(this.$refs?.otherDataComponents?.forEach)&&this.$refs.otherDataComponents.forEach((e=>{const t=i().isFunction(e.getSaveParameters)?e.getSaveParameters():{};s=i().extend(s,t)})),V.A.sendRequest({moduleName:"Core",methodName:this.createMode?"CreateUser":"UpdateUser",parameters:s}).then((e=>{this.saving=!1,this.createMode?this.handleCreateResult(e,s):this.handleUpdateResult(e,s)}),(e=>{this.saving=!1;const t=this.createMode?"ERROR_CREATE_ENTITY_USER":"ERROR_UPDATE_ENTITY_USER";F.A.showError(q.A.getTextFromResponse(e,this.$t("ADMINPANELWEBCLIENT."+t)))}))}},handleCreateResult(e,t){i().isSafeInteger(e)?(F.A.showReport(this.$t("ADMINPANELWEBCLIENT.REPORT_CREATE_ENTITY_USER")),this.user.update(t),this.$emit("user-created",e)):F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_CREATE_ENTITY_USER"))},handleUpdateResult(e,t){!0===e?(x.A.getUser(t.TenantId,t.UserId).then((({user:e})=>{e.update(t,this.allTenantGroups),this.populate(),this.$emit("user-updated",e.Id)})),F.A.showReport(this.$t("ADMINPANELWEBCLIENT.REPORT_UPDATE_ENTITY_USER"))):F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_UPDATE_ENTITY_USER"))},cancel(){this.revertChanges(),this.$emit("cancel-create")},deleteUser(){this.$emit("delete-user",this.user.id)}}};var Z=s(12807),ee=s(48958),te=s(23316),se=s(44189),ae=s(39270),ne=s(37022),ie=s(62606),re=s(66760),oe=s(90124),le=s(25173),ue=s(13796),de=s(56384),he=s(39035),pe=s(35859),ce=s(88672),me=s(98582),Ee=s.n(me);const ge=(0,Z.A)(J,[["render",W],["__scopeId","data-v-400859f8"]]),Ae=ge;function Ne(e,t,s,a,n,i){return(0,o.uX)(),(0,o.CE)("div")}Ee()(J,"components",{QScrollArea:ee.A,QCard:te.A,QCardSection:se.A,QInput:ae.A,QCheckbox:ne.A,QSelect:ie.A,QChip:re.A,QItem:oe.A,QItemSection:le.A,QItemLabel:ue.A,QBtn:de.A,QInnerLoading:he.A,QLinearProgress:pe.A}),Ee()(J,"directives",{ClosePopup:ce.A});const Te={name:"Empty"},Ce=(0,Z.A)(Te,[["render",Ne]]),Ie=Ce,Le={getAllUserRoutes(){let e=this.getUserRoutes();const t=this.getRouteChildren("User"),s=this.getUserFiltersRoutes(t);return s.forEach((s=>{const a=this.getUserRoutes(`${s.path}/`);e=e.concat(a),t.forEach((t=>{e.push({path:`${s.path}/${t.path}`,component:t.component})}))})),e=e.concat(t,s),e},getRouteChildren(e){const t=r.A.getAdminEntityTabs(`getAdmin${e}Tabs`);let s=[];return t.forEach((e=>{i().isArray(e.tabRouteChildren)&&(s=s.concat(e.tabRouteChildren))})),s},getUserRoutes(e=""){const t=[{path:e+"create",component:Ae},{path:e+"id/:id",component:Ae},{path:e+"search/:search",component:Ie},{path:e+"search/:search/id/:id",component:Ae},{path:e+"page/:page",component:Ie},{path:e+"page/:page/id/:id",component:Ae},{path:e+"search/:search/page/:page",component:Ie},{path:e+"search/:search/page/:page/id/:id",component:Ae}];return""===e&&t.push({path:"create",component:Ae}),t},getUserFiltersRoutes(){const e=r.A.getFiltersForUsers(),t=[];return e.forEach((e=>{t.push({path:e.filterRoute,component:Ie})})),e.length>1&&e.forEach((s=>{e.forEach((e=>{if(s.filterRoute!==e.filterRoute){const a=`${s.filterRoute}/${e.filterRoute}`;t.push({path:a,component:Ie})}}))})),t}};var be=s(55246);function ve(e,t){const s=localStorage.getItem(e);s&&(localStorage.removeItem(e),t&&localStorage.setItem(t,s))}function _e(){const e=[{old:"groups-list-splitter-width",new:"aurora_admin_groups_splitter-width"},{old:"system-splitter-width",new:"aurora_admin_system_splitter-width"},{old:"tenants-list-splitter-width",new:"aurora_admin_tenants_splitter-width"},{old:"tenants-tabs-splitter-width",new:"aurora_admin_tenants_tabs_splitter-width"},{old:"users-list-splitter-width",new:"aurora_admin_users_splitter-width"},{old:"users-tabs-splitter-width",new:"aurora_admin_users_tabs_splitter-width"},{old:"domains-list-splitter-width",new:"aurora_admin_domains_splitter-width"},{old:"domains-tabs-splitter-width",new:"aurora_admin_domains_tabs_splitter-width"},{old:"mailing-lists-list-splitter-width",new:"aurora_admin_mailing_lists_splitter-width"},{old:"adminpanelResizerWidth",new:""}];e.forEach((e=>{ve(e.old,e.new)}))}const Re={class:"q-pa-lg"},fe={class:"row q-mb-md"},ke={key:0,class:"col text-h5"},De={key:1,class:"col text-h5"},je={class:"row q-mb-md"},Ue={class:"col-2 q-mt-sm"},we={key:0,class:"col-5"},Se={key:1,class:"col-5 q-mt-sm"},Oe={class:"row q-mb-md"},Me={class:"col-2 q-mt-sm"},Pe={class:"col-5"},$e={class:"row q-mb-md"},ye={class:"col-2 q-mt-sm"},Ge={class:"col-5"},Be={class:"row"},We={class:"col-2 q-mt-sm"},qe={class:"col-5"},Fe={class:"q-py-md text-right"};function Qe(e,t,s,a,n,i){const r=(0,o.g2)("q-input"),l=(0,o.g2)("q-card-section"),d=(0,o.g2)("q-card"),h=(0,o.g2)("q-btn"),p=(0,o.g2)("q-linear-progress"),c=(0,o.g2)("q-inner-loading"),m=(0,o.g2)("q-scroll-area"),E=(0,o.gN)("t");return(0,o.uX)(),(0,o.Wv)(m,{class:"full-height full-width relative-position"},{default:(0,o.k6)((()=>[(0,o.Lk)("div",Re,[(0,o.Lk)("div",fe,[i.createMode?(0,o.Q3)("",!0):(0,o.bo)(((0,o.uX)(),(0,o.CE)("div",ke,null,512)),[[E,"COREWEBCLIENT.HEADING_COMMON_SETTINGS"]]),i.createMode?(0,o.bo)(((0,o.uX)(),(0,o.CE)("div",De,null,512)),[[E,"ADMINPANELWEBCLIENT.HEADING_CREATE_TENANT"]]):(0,o.Q3)("",!0)]),(0,o.bF)(d,{flat:"",bordered:"",class:"card-edit-settings"},{default:(0,o.k6)((()=>[(0,o.bF)(l,null,{default:(0,o.k6)((()=>[(0,o.Lk)("div",je,[(0,o.bo)((0,o.Lk)("div",Ue,null,512),[[E,"ADMINPANELWEBCLIENT.LABEL_PRODUCT_NAME"]]),i.createMode?((0,o.uX)(),(0,o.CE)("div",we,[(0,o.bF)(r,{outlined:"",dense:"","bg-color":"white",modelValue:n.tenantName,"onUpdate:modelValue":t[0]||(t[0]=e=>n.tenantName=e)},null,8,["modelValue"])])):(0,o.Q3)("",!0),i.createMode?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.CE)("div",Se,(0,u.v_)(n.tenantName),1))]),(0,o.Lk)("div",Oe,[(0,o.bo)((0,o.Lk)("div",Me,null,512),[[E,"ADMINPANELWEBCLIENT.LABEL_DESCRIPTION"]]),(0,o.Lk)("div",Pe,[(0,o.bF)(r,{outlined:"",dense:"","bg-color":"white",modelValue:n.description,"onUpdate:modelValue":t[1]||(t[1]=e=>n.description=e)},null,8,["modelValue"])])]),(0,o.Lk)("div",$e,[(0,o.bo)((0,o.Lk)("div",ye,null,512),[[E,"ADMINPANELWEBCLIENT.LABEL_WEB_DOMAIN"]]),(0,o.Lk)("div",Ge,[(0,o.bF)(r,{outlined:"",dense:"","bg-color":"white",modelValue:n.webDomain,"onUpdate:modelValue":t[2]||(t[2]=e=>n.webDomain=e)},null,8,["modelValue"])])]),(0,o.Lk)("div",Be,[(0,o.bo)((0,o.Lk)("div",We,null,512),[[E,"COREWEBCLIENT.LABEL_SITENAME"]]),(0,o.Lk)("div",qe,[(0,o.bF)(r,{outlined:"",dense:"","bg-color":"white",modelValue:n.tenantSiteName,"onUpdate:modelValue":t[3]||(t[3]=e=>n.tenantSiteName=e)},null,8,["modelValue"])])]),((0,o.uX)(),(0,o.Wv)((0,o.$y)(n.otherDataComponents),{onUpdateParent:i.getTenantData},null,40,["onUpdateParent"]))])),_:1})])),_:1}),(0,o.Lk)("div",Fe,[!i.createMode&&i.isUserSuperAdmin?((0,o.uX)(),(0,o.Wv)(h,{key:0,unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"negative",onClick:i.deleteTenant,label:e.$t("ADMINPANELWEBCLIENT.ACTION_DELETE_TENANT")},null,8,["onClick","label"])):(0,o.Q3)("",!0),i.createMode?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(h,{key:1,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"primary",onClick:i.save,label:e.$t("COREWEBCLIENT.ACTION_SAVE")},null,8,["onClick","label"])),i.createMode?((0,o.uX)(),(0,o.Wv)(h,{key:2,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"primary",onClick:i.save,label:e.$t("COREWEBCLIENT.ACTION_CREATE")},null,8,["onClick","label"])):(0,o.Q3)("",!0),i.createMode?((0,o.uX)(),(0,o.Wv)(h,{key:3,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"secondary",onClick:i.cancel,label:e.$t("COREWEBCLIENT.ACTION_CANCEL")},null,8,["onClick","label"])):(0,o.Q3)("",!0)])]),(0,o.bF)(c,{style:{"justify-content":"flex-start"},showing:n.loading||i.deleting||n.saving},{default:(0,o.k6)((()=>[(0,o.bF)(p,{query:""})])),_:1},8,["showing"])])),_:1})}var Ve=s(78296);const xe={name:"EditTenant",props:{deletingIds:Array},data(){return{tenant:null,tenantId:0,tenantName:"",tenantSiteName:"",description:"",webDomain:"",saving:!1,loading:!1,otherDataComponents:null,enableBusinessTenant:!1,enableGroupWare:!1}},computed:{currentTenantId(){return this.$store.getters["tenants/getCurrentTenantId"]},createMode(){return 0===this.tenant?.id},deleting(){return-1!==this.deletingIds.indexOf(this.tenant?.id)},isUserSuperAdmin(){return this.$store.getters["user/isUserSuperAdmin"]}},beforeRouteLeave(e,t,s){this.$root.doBeforeRouteLeave(e,t,s)},beforeRouteUpdate(e,t,s){this.$root.doBeforeRouteLeave(e,t,s)},async mounted(){this.loading=!1,this.saving=!1,this.parseRoute(),this.otherDataComponents=await r.A.getTenantOtherDataComponents()},watch:{$route(){this.parseRoute()},"$store.state.tenants.tenants":{handler:function(){this.populate()},deep:!0}},methods:{getTenantData(e){this.enableBusinessTenant=e.enableBusinessTenant,this.enableGroupWare=e.enableGroupWare},parseRoute(){if("/tenants/create"===this.$route.path){const e=new Ve.A;this.fillUp(e)}else{const e=Q.A.pPositiveInt(this.$route?.params?.id);this.tenant?.id!==e&&(this.tenant={id:e},this.populate())}},populate(){this.$store.dispatch("tenants/completeTenantData",this.tenant.id);const e=this.$store.getters["tenants/getTenant"](this.tenant.id);e&&(this.fillUp(e),this.loading=void 0===e.completeData.Description)},fillUp(e){this.tenant=e,this.tenantId=e.id,this.tenantName=e.name,this.tenantSiteName=e.siteName,this.description=e.completeData?.Description,this.webDomain=e.completeData?.WebDomain},hasChanges(){return!this.loading&&(this.tenant?.name!==this.tenantName||this.tenant?.siteName!==this.tenantSiteName||this.tenant?.completeData?.Description!==this.description||this.tenant?.completeData?.WebDomain!==this.webDomain)},revertChanges(){this.fillUp(this.tenant)},cancel(){this.revertChanges(),this.$emit("cancel-create")},isValid(){return""===this.tenantName?(F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_TENANT_NAME_EMPTY")),!1):!/[\\/:*?"<>|]/gi.test(this.tenantName)||(F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_TENANT_NAME_INVALID")),!1)},save(){if(!this.saving&&this.isValid()){this.saving=!0;const e={Name:this.tenantName,Description:this.description,WebDomain:this.webDomain,SiteName:this.tenantSiteName,"CoreUserGroupsLimits::IsBusiness":this.enableBusinessTenant,"CoreUserGroupsLimits::EnableGroupware":this.enableGroupWare},t=this.createMode;t||(e.TenantId=this.currentTenantId),V.A.sendRequest({moduleName:"Core",methodName:t?"CreateTenant":"UpdateTenant",parameters:e}).then((s=>{t?this.handleCreateResult(s,e):this.handleUpdateResult(s,e),this.saving=!1}),(e=>{this.saving=!1;const s=t?"ERROR_CREATE_ENTITY_TENANT":"ERROR_UPDATE_ENTITY_TENANT";F.A.showError(q.A.getTextFromResponse(e,this.$t("ADMINPANELWEBCLIENT."+s)))}))}},handleCreateResult(e){i().isSafeInteger(e)?(F.A.showReport(this.$t("ADMINPANELWEBCLIENT.REPORT_CREATE_ENTITY_TENANT")),this.loading=!1,this.revertChanges(),this.$emit("tenant-created",e)):F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_CREATE_ENTITY_TENANT"))},handleUpdateResult(e,t){!0===e?(this.$store.commit("tenants/updateTenant",{id:this.tenantId,data:t}),F.A.showReport(this.$t("ADMINPANELWEBCLIENT.REPORT_UPDATE_ENTITY_TENANT"))):F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_UPDATE_ENTITY_TENANT"))},deleteTenant(){this.$emit("delete-tenant",this.tenant.id)}}},Xe=(0,Z.A)(xe,[["render",Qe]]),ze=Xe;Ee()(xe,"components",{QScrollArea:ee.A,QCard:te.A,QCardSection:se.A,QInput:ae.A,QBtn:de.A,QInnerLoading:he.A,QLinearProgress:pe.A});const Ye={class:"q-pa-lg"},He={class:"row q-mb-md"},Ke={key:0,class:"col text-h5"},Je={key:1,class:"col text-h5"},Ze={key:0,class:"row q-mb-md"},et={class:"col-7 q-mt-sm"},tt={class:"row q-mb-md"},st={class:"col-2 q-mt-sm"},at={class:"col-5"},nt={key:1,class:"row q-mb-md"},it=(0,o.Lk)("div",{class:"col-2 q-mt-sm"},null,-1),rt={class:"col-5"},ot={class:"q-py-md text-right"};function lt(e,t,s,a,n,i){const r=(0,o.g2)("q-item-label"),u=(0,o.g2)("q-input"),d=(0,o.g2)("q-card-section"),h=(0,o.g2)("q-card"),p=(0,o.g2)("q-btn"),c=(0,o.g2)("q-linear-progress"),m=(0,o.g2)("q-inner-loading"),E=(0,o.g2)("q-scroll-area"),g=(0,o.gN)("t");return(0,o.uX)(),(0,o.Wv)(E,{class:"full-height full-width relative-position"},{default:(0,o.k6)((()=>[(0,o.Lk)("div",Ye,[(0,o.Lk)("div",He,[i.createMode?(0,o.Q3)("",!0):(0,o.bo)(((0,o.uX)(),(0,o.CE)("div",Ke,null,512)),[[g,"COREWEBCLIENT.HEADING_COMMON_SETTINGS"]]),i.createMode?(0,o.bo)(((0,o.uX)(),(0,o.CE)("div",Je,null,512)),[[g,"ADMINPANELWEBCLIENT.HEADING_CREATE_GROUP"]]):(0,o.Q3)("",!0)]),(0,o.bF)(h,{flat:"",bordered:"",class:"card-edit-settings"},{default:(0,o.k6)((()=>[(0,o.bF)(d,null,{default:(0,o.k6)((()=>[n.isTeamGroup?((0,o.uX)(),(0,o.CE)("div",Ze,[(0,o.Lk)("div",et,[n.enableMultiTenant?(0,o.bo)(((0,o.uX)(),(0,o.Wv)(r,{key:0,caption:""},null,512)),[[g,"ADMINPANELWEBCLIENT.INFO_TEAM_GROUP_IN_TENANT"]]):(0,o.bo)(((0,o.uX)(),(0,o.Wv)(r,{key:1,caption:""},null,512)),[[g,"ADMINPANELWEBCLIENT.INFO_TEAM_GROUP_IN_SYSTEM"]])])])):(0,o.Q3)("",!0),(0,o.Lk)("div",tt,[(0,o.bo)((0,o.Lk)("div",st,null,512),[[g,"ADMINPANELWEBCLIENT.LABEL_GROUP_NAME"]]),(0,o.Lk)("div",at,[(0,o.bF)(u,{outlined:"",dense:"","bg-color":"white",modelValue:n.groupName,"onUpdate:modelValue":t[0]||(t[0]=e=>n.groupName=e),disable:n.isTeamGroup,onKeyup:(0,l.jR)(i.save,["enter"])},null,8,["modelValue","disable","onKeyup"])])]),i.createMode?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.CE)("div",nt,[it,(0,o.Lk)("div",rt,[(0,o.bo)((0,o.Lk)("a",{href:"javascript:void(0)",onClick:t[1]||(t[1]=(...e)=>i.showGroupUsers&&i.showGroupUsers(...e))},null,512),[[g,"ADMINPANELWEBCLIENT.ACTION_SHOW_GROUP_USERS"]])])]))])),_:1})])),_:1}),(0,o.Lk)("div",ot,[i.createMode||n.isTeamGroup?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(p,{key:0,unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"negative",onClick:i.deleteGroup,label:e.$t("ADMINPANELWEBCLIENT.ACTION_DELETE_GROUP")},null,8,["onClick","label"])),i.createMode||n.isTeamGroup?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(p,{key:1,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"primary",onClick:i.save,label:e.$t("COREWEBCLIENT.ACTION_SAVE")},null,8,["onClick","label"])),i.createMode?((0,o.uX)(),(0,o.Wv)(p,{key:2,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"primary",onClick:i.save,label:e.$t("COREWEBCLIENT.ACTION_CREATE")},null,8,["onClick","label"])):(0,o.Q3)("",!0),i.createMode?((0,o.uX)(),(0,o.Wv)(p,{key:3,unelevated:"","no-caps":"",dense:"",class:"q-px-sm q-ml-sm",ripple:!1,color:"secondary",onClick:i.cancel,label:e.$t("COREWEBCLIENT.ACTION_CANCEL")},null,8,["onClick","label"])):(0,o.Q3)("",!0)])]),(0,o.bF)(m,{style:{"justify-content":"flex-start"},showing:n.loading||i.deleting||n.saving},{default:(0,o.k6)((()=>[(0,o.bF)(c,{query:""})])),_:1},8,["showing"])])),_:1})}var ut=s(10173);const dt={name:"EditGroup",props:{deletingIds:Array},data(){return{enableMultiTenant:X.A.getEnableMultiTenant(),group:null,groupId:0,groupName:"",isTeamGroup:!1,saving:!1,loading:!1}},computed:{currentTenantId(){return this.$store.getters["tenants/getCurrentTenantId"]},allGroups(){return this.$store.getters["groups/getGroups"]},createMode(){return 0===this.group?.id},deleting(){return-1!==this.deletingIds.indexOf(this.group?.id)}},beforeRouteLeave(e,t,s){this.$root.doBeforeRouteLeave(e,t,s)},beforeRouteUpdate(e,t,s){this.$root.doBeforeRouteLeave(e,t,s)},async mounted(){this.loading=!1,this.saving=!1,this.parseRoute()},watch:{$route(){this.parseRoute()},allGroups(){this.populate()}},methods:{parseRoute(){if("/groups/create"===this.$route.path){const e=new ut.A({TenantId:this.currentTenantId});this.fillUp(e)}else{const e=Q.A.pPositiveInt(this.$route?.params?.id);this.group?.id!==e&&(this.group={id:e},this.populate())}},populate(){const e=this.$store.getters["groups/getGroup"](this.currentTenantId,this.group.id);e&&this.fillUp(e)},fillUp(e){this.group=e,this.groupId=e.id,this.groupName=e.name,this.isTeamGroup=e.isTeam},cancel(){this.revertChanges(),this.$emit("cancel-create")},hasChanges(){return!this.loading&&this.group?.name!==this.groupName},revertChanges(){this.groupName=this.group?.name},isValid(){return""!==i().trim(this.groupName)||(F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_GROUP_NAME_EMPTY")),!1)},getSaveParameters(){const e={Name:this.groupName,TenantId:this.group.tenantId};return this.createMode||(e.GroupId=this.group.id),e},save(){if(this.isTeamGroup||this.saving||!this.isValid())return;this.saving=!0;const e=this.createMode,t=this.getSaveParameters();V.A.sendRequest({moduleName:"Core",methodName:e?"CreateGroup":"UpdateGroup",parameters:t}).then((s=>{this.saving=!1,e?this.handleCreateResult(s,t):this.handleUpdateResult(s,t)}),(t=>{this.saving=!1;const s=e?"ERROR_CREATE_ENTITY_GROUP":"ERROR_UPDATE_ENTITY_GROUP";F.A.showError(q.A.getTextFromResponse(t,this.$t("ADMINPANELWEBCLIENT."+s)))}))},handleCreateResult(e){i().isSafeInteger(e)?(F.A.showReport(this.$t("ADMINPANELWEBCLIENT.REPORT_CREATE_ENTITY_GROUP")),this.loading=!1,this.revertChanges(),this.$emit("group-created",e)):F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_CREATE_ENTITY_GROUP"))},handleUpdateResult(e,t){!0===e?(this.$store.commit("groups/updateGroup",{tenantId:this.currentTenantId,id:this.groupId,data:t}),this.populate(),F.A.showReport(this.$t("ADMINPANELWEBCLIENT.REPORT_UPDATE_ENTITY_GROUP"))):F.A.showError(this.$t("ADMINPANELWEBCLIENT.ERROR_UPDATE_ENTITY_GROUP"))},deleteGroup(){this.$emit("delete-group",this.group.id)},showGroupUsers(){this.$router.push(`/users/group/${this.group.id}`)}}},ht=(0,Z.A)(dt,[["render",lt]]),pt=ht;Ee()(dt,"components",{QScrollArea:ee.A,QCard:te.A,QCardSection:se.A,QItemLabel:ue.A,QInput:ae.A,QBtn:de.A,QInnerLoading:he.A,QLinearProgress:pe.A});const ct={key:0},mt={class:"ellipsis",style:{"max-width":"250px"}};function Et(e,t,s,a,n,i){const r=(0,o.g2)("IconTeamGroup"),l=(0,o.g2)("q-item-label"),d=(0,o.g2)("q-item-section"),h=(0,o.g2)("q-item"),p=(0,o.g2)("q-select"),c=(0,o.gN)("close-popup");return n.filterOptions.length>0?((0,o.uX)(),(0,o.CE)("div",ct,[(0,o.bF)(p,{outlined:"",dense:"",class:"bg-white",modelValue:n.currentFilter,"onUpdate:modelValue":t[0]||(t[0]=e=>n.currentFilter=e),options:n.filterOptions},{selected:(0,o.k6)((()=>[(0,o.Lk)("div",mt,(0,u.v_)(n.currentFilter.label),1)])),option:(0,o.k6)((e=>[(0,o.bo)(((0,o.uX)(),(0,o.Wv)(h,(0,o.v6)(e.itemProps,(0,o.Tb)(e.itemEvents)),{default:(0,o.k6)((()=>[(0,o.bF)(d,{class:"non-selectable"},{default:(0,o.k6)((()=>[(0,o.bF)(l,null,{default:(0,o.k6)((()=>[(0,o.Lk)("span",null,(0,u.v_)(e.opt.label),1),e.opt.isTeam?((0,o.uX)(),(0,o.Wv)(r,{key:0,class:"on-right vertical-bottom",size:18})):(0,o.Q3)("",!0)])),_:2},1024)])),_:2},1024)])),_:2},1040)),[[c]])])),_:1},8,["modelValue","options"])])):(0,o.Q3)("",!0)}s(26003);var gt=s(38755);const At={name:"GroupFilterForUsers",filterRoute:"group/:group",data(){return{allowGroups:X.A.getAllowGroups(),filterOptions:[],filterValue:null,currentFilter:null}},components:{IconTeamGroup:gt.A},computed:{currentTenantId(){return this.$store.getters["tenants/getCurrentTenantId"]},visible(){return this.filterOptions.length>0},allGroupLists(){return this.$store.getters["groups/getGroups"]},groups(){return Q.A.pArray(this.allGroupLists[this.currentTenantId])}},watch:{$route(e,t){this.fillUpFilterValue(),this.currentFilter=this.findCurrentFilter()},filterOptions(){this.fillUpFilterValue(),this.currentFilter=this.findCurrentFilter()},currentTenantId(){this.requestGroups()},currentFilter(e){this.selectFilter(e.value)},groups(){this.fillUpFilterOptions()}},mounted(){this.fillUpFilterOptions(),this.requestGroups()},methods:{requestGroups(){this.allowGroups&&this.$store.dispatch("groups/requestGroups",{tenantId:this.currentTenantId})},fillUpFilterOptions(){const e=this.groups.map((e=>({label:e.name,value:e.id,isTeam:e.isTeam})));e.length>0&&(e.unshift({label:this.$t("ADMINPANELWEBCLIENT.LABEL_ALL_GROUPS"),value:-1,isTeam:!1}),e.push({label:this.$t("ADMINPANELWEBCLIENT.LABEL_NOT_IN_ANY_GROUP"),value:0,isTeam:!1})),this.filterOptions=e,this.currentFilter=this.findCurrentFilter()},findCurrentFilter(){if(this.filterOptions.length){const e=this.filterOptions.find((e=>e.value===this.filterValue));return e||this.filterOptions[0]}return""},fillUpFilterValue(){this.filterValue=Q.A.pInt(this.$route?.params?.group,-1),this.$emit("filter-filled-up",{GroupId:this.filterValue})},selectFilter(e){-1===e?this.$emit("filter-selected",{routeName:"group"}):this.$emit("filter-selected",{routeName:"group",routeValue:e})}}},Nt=(0,Z.A)(At,[["render",Et]]),Tt=Nt;Ee()(At,"components",{QSelect:ie.A,QItem:oe.A,QItemSection:le.A,QItemLabel:ue.A}),Ee()(At,"directives",{ClosePopup:ce.A});const Ct=a.A.getUserRoles(),It={moduleName:"AdminPanelWebclient",requiredModules:[],init(e){_e(),X.A.init(e);const t=X.A?.getCommonSettingData()?.siteName;t&&(document.title=t)},getRoutes(){const e=[{name:"login",path:"/",component:()=>Promise.all([s.e(4121),s.e(4668)]).then(s.bind(s,64668)),pageUserRoles:[Ct.Anonymous]},{name:"system",path:"/system",component:()=>Promise.all([s.e(4121),s.e(996),s.e(676)]).then(s.bind(s,24256)),children:Le.getRouteChildren("System"),pageUserRoles:[Ct.SuperAdmin],pageTitle:"ADMINPANELWEBCLIENT.HEADING_SYSTEM_SETTINGS_TABNAME"}];return X.A.getAllowGroups()&&e.push({name:"groups",path:"/groups",component:()=>Promise.all([s.e(4121),s.e(996),s.e(7734)]).then(s.bind(s,92459)),children:[{path:"id/:id",component:pt},{path:"create",component:pt},{path:"search/:search",component:Ie},{path:"search/:search/id/:id",component:pt},{path:"page/:page",component:Ie},{path:"page/:page/id/:id",component:pt},{path:"search/:search/page/:page",component:Ie},{path:"search/:search/page/:page/id/:id",component:pt}],pageUserRoles:[Ct.SuperAdmin],pageTitle:"ADMINPANELWEBCLIENT.HEADING_GROUPS_SETTINGS_TABNAME"}),e},getUserRoutes(){return{name:"users",path:"/users",component:()=>Promise.all([s.e(4121),s.e(996),s.e(8626)]).then(s.bind(s,4063)),children:Le.getAllUserRoutes(),pageUserRoles:[Ct.SuperAdmin,Ct.TenantAdmin],pageTitle:"ADMINPANELWEBCLIENT.HEADING_USERS_SETTINGS_TABNAME"}},getTenantRoutes(){return{name:"tenants",path:"/tenants",component:()=>Promise.all([s.e(4121),s.e(996),s.e(9846)]).then(s.bind(s,40683)),children:[{path:"id/:id",component:ze},{path:"create",component:ze},{path:"search/:search",component:Ie},{path:"search/:search/id/:id",component:ze},{path:"page/:page",component:Ie},{path:"page/:page/id/:id",component:ze},{path:"search/:search/page/:page",component:Ie},{path:"search/:search/page/:page/id/:id",component:ze}].concat(Le.getRouteChildren("Tenant")),pageUserRoles:[Ct.SuperAdmin,Ct.TenantAdmin],pageTitle:"ADMINPANELWEBCLIENT.HEADING_TENANTS_SETTINGS_TABNAME"}},getAdminSystemTabs(){return[{tabName:"admin-security",tabTitle:"ADMINPANELWEBCLIENT.LABEL_SECURITY_SETTINGS_TAB",tabRouteChildren:[{path:"admin-security",component:()=>s.e(8555).then(s.bind(s,48555))}]},{tabName:"admin-db",tabTitle:"ADMINPANELWEBCLIENT.HEADING_DB_SETTINGS",tabRouteChildren:[{path:"admin-db",component:()=>Promise.all([s.e(996),s.e(5636)]).then(s.bind(s,85636))}]},{tabName:"about",tabTitle:"ADMINPANELWEBCLIENT.LABEL_ABOUT_SETTINGS_TAB",tabRouteChildren:[{path:"about",component:()=>s.e(1931).then(s.bind(s,61931))}]}]},getFiltersForUsers(){const e=be.A.getters["user/isUserSuperAdmin"];return e?[Tt]:[]}}}}]);