PageSourceSearch

https://assets.productive.io/assets/-embroider-route-entrypoint.js_route_organization-dsibjkq0.js

js productive.io collected 2026-10-02 04:12:47 UTC 75,580 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/context-COtBVUVZ.js","assets/common-DdYwb9D_.js","assets/rolldown-runtime-BEU_UCik.js","assets/common-D1oDIdhb.css"])))=>i.map(i=>d[i]);
2import{r as e}from"./rolldown-runtime-BEU_UCik.js";import{AK as o,Ab as t,Az as n,BJ as s,BT as i,Ba as l,By as r,Bz as a,CJ as p,CT as d,CW as m,DJ as u,DW as c,EE as h,EJ as f,EL as y,EW as v,FT as g,FW as b,Fx as k,Gx as M,HJ as w,IW as T,JC as F,KC as _,LN as C,LO as I,MJ as R,M_ as S,Mp as A,NN as N,OL as E,Oz as U,PT as W,RK as P,RU as x,Ry as D,SJ as L,SW as O,UT as H,Ua as V,Ux as z,Vv as q,Vx as B,Vz as Q,XS as J,YJ as j,Yj as Y,_C as G,_O as K,_j as X,aw as Z,gC as $,gH as ee,gR as oe,hE as te,h_ as ne,iG as se,iU as ie,i_ as le,jJ as re,jW as ae,kz as pe,mR as de,oU as me,pb as ue,qx as ce,rY as he,sO as fe,tS as ye,uS as ve,vJ as ge,wC as be,wJ as ke,wU as Me,wW as we,xW as Te,xz as Fe,yE as _e,yO as Ce,yR as Ie,yW as Re,yY as Se,zJ as Ae,za as Ne,zy as Ee}from"./common-DdYwb9D_.js";var Ue,We={description:"_description_1ex0g_1"},Pe=new WeakMap,xe=new WeakMap,De=new WeakMap,Le=new WeakMap,Oe=new WeakMap,He=new WeakMap,Ve=class extends Q{constructor(e,o){super(e,o),he(this,Pe,void ke(this,"store")),he(this,xe,void ke(this,"can")),he(this,De,void ke(this,"ui")),he(this,Le,void ke(this,"formsHandler")),he(this,Oe,void ke(this,"flags")),he(this,He,void ke(this,"form")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){const e=yield this.store.findRecord("person",this.args.personId);e.ability.canUpdateProfile||this.args.close(),this.form=this.formsHandler.createForm(V,[e])}}),null,"loadModelTask",null)),this.loadModelTask.perform()}async submitForm(e){await this.formsHandler.submitForm(e),this.closeModal()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}buildCompaniesQuery(){return X.on(this).withCommonOptions({})}};L((Ue=Ve).prototype,"store",[w]),L(Ue.prototype,"can",[w]),L(Ue.prototype,"ui",[w]),L(Ue.prototype,"formsHandler",[w]),L(Ue.prototype,"flags",[w]),L(Ue.prototype,"form",[R]),p(Ue.prototype,"submitForm",[j]),p(Ue.prototype,"closeModal",[j]),p(Ue.prototype,"buildCompaniesQuery",[j]),s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-contact-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n  "],[10,0],[15,0,[32,2,["description"]]],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.edit-contact-modal.description"],null]],[1,"\\n  "],[13],[1,"\\n\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,3],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,4],null,[["@form","@submitForm","@cancel","@buildCompaniesQuery","@isAvatarHidden"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["closeModal"]],[30,0,["buildCompaniesQuery"]],[30,0,["flags","avatarInlineEdit"]]]],null],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,styles:We,LoadingSpinner:_,ContactForm:ne}),isStrictMode:!0}),Ue);var ze,qe=s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n"],[41,[30,2,["model","timeUnlockedStartDate"]],[[[41,[30,2,["model","timeUnlockedEndDate"]],[[[1,"      "],[1,[28,[32,1],["components.people.lock-timetracking-form.timeEntriesFor"],[["personName"],[[30,2,["model","name"]]]]]],[1,"\\n"],[1,"      "],[10,"b"],[12],[1,"\\n        "],[1,[52,[28,[32,2],[[32,3,["CUSTOM"]],[28,[31,1],[[30,2,["model","timeUnlockedPeriodId"]]],null]],null],[28,[31,1],[[28,[32,4],[[28,[32,5],[[30,2,["model","timeUnlockedStartDate"]]],null]," - ",[28,[32,5],[[30,2,["model","timeUnlockedEndDate"]]],null]],null]],null],[28,[31,1],[[28,[32,6],[[28,[32,4],["consts.timeInterval.",[30,2,["model","timeUnlockedPeriodId"]]],null]],null]],null]]],[1,"\\n      "],[13],[1,"\\n      "],[1,[28,[32,1],["components.people.lock-timetracking-form.manuallyUnlocked"],null]],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,2,["model","timeUnlockedUntil"]],[[[1,"      "],[1,[28,[32,1],["components.people.lock-timetracking-form.automaticLock"],[["date","htmlSafe"],[[28,[32,5],[[30,2,["model","timeUnlockedUntil"]]],null],true]]]],[1,"\\n"]],[]],null],[1,"\\n    "],[10,"br"],[12],[13],[1,"\\n    "],[10,"br"],[12],[13],[1,"\\n    "],[1,[28,[32,1],["components.people.lock-timetracking-form.lockNow"],null]],[1,"\\n    "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,1],["components.people.lock-timetracking-form.lockTimeEntries"],null],[30,5]]],null],[1,"\\n"]],[]],[[[1,"    "],[1,[28,[32,1],["components.people.lock-timetracking-form.notUnlocked"],null]],[1,"\\n"]],[]]]],[4]]]]]],["&attrs","@form","@submitForm","f","@cancel"],["if","unbound"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:ve,t:a,__keyword__eq:v,TimeInterval:x,concat:we,formatDate:J,labelFor:z}),isStrictMode:!0}),o()),Be=class extends de{constructor(...e){super(...e),Se(this,"allowSaveIfNotDirty",!0)}get shouldRegisterFormLossPreventer(){return!1}async beforeSubmit(){await super.beforeSubmit(),this.model.timeUnlocked=!1,this.model.timeUnlockedOn=void 0,this.model.timeUnlockedStartDate=void 0,this.model.timeUnlockedEndDate=void 0,this.model.timeUnlockedInterval=void 0,this.model.timeUnlockedPeriodId=void 0}},Qe=new WeakMap,Je=new WeakMap,je=new WeakMap,Ye=new WeakMap,Ge=new WeakMap,Ke=new WeakMap,Xe=class extends Q{constructor(e,o){super(e,o),he(this,Qe,void ke(this,"store")),he(this,Je,void ke(this,"can")),he(this,je,void ke(this,"session")),he(this,Ye,void ke(this,"formsHandler")),he(this,Ge,void ke(this,"ui")),he(this,Ke,void ke(this,"form")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){var e;const o=yield this.store.findRecord("person",this.args.personId);o.ability.canManageLockedTimeEntries&&(null===(e=this.session.organization)||void 0===e?void 0:e.timeLocking)||this.args.close(),this.form=this.formsHandler.createForm(Be,[o])}}),null,"loadModelTask",null)),this.loadModelTask.perform()}async submitForm(e){await this.formsHandler.submitForm(e),this.closeModal()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}};L((ze=Xe).prototype,"store",[w]),L(ze.prototype,"can",[w]),L(ze.prototype,"session",[w]),L(ze.prototype,"formsHandler",[w]),L(ze.prototype,"ui",[w]),L(ze.prototype,"form",[R]),p(ze.prototype,"submitForm",[j]),p(ze.prototype,"closeModal",[j]),s(Ae({i
2d:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-lock-timetracking-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,2],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,3],null,[["@form","@submitForm","@cancel"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["closeModal"]]]],null],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,LoadingSpinner:_,LockTimetrackingForm:qe}),isStrictMode:!0}),ze);var Ze,$e={description:"_description_1ex0g_1"},eo=new WeakMap,oo=new WeakMap,to=new WeakMap,no=new WeakMap,so=new WeakMap,io=new WeakMap,lo=new WeakMap,ro=class extends Q{constructor(e,o){super(e,o),he(this,eo,void ke(this,"store")),he(this,oo,void ke(this,"can")),he(this,to,void ke(this,"formsHandler")),he(this,no,void ke(this,"ui")),he(this,so,void ke(this,"flags")),he(this,io,void ke(this,"session")),he(this,lo,void ke(this,"form")),Se(this,"person",void 0),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){var e;this.person=yield this.store.findRecord("person",this.args.personId),(null===(e=this.person.approvalPolicyAssignment)||void 0===e?void 0:e.approvalPolicy)&&this.session.addons.isTimeOffApprovalEnabled&&(yield Y.on(this).withActiveEvent().forApprovalPolicy(this.person.approvalPolicyAssignment.approvalPolicy).includes(e=>e.add("approvalPolicy")).withContext("edit-user-manager-workflows").depaginate().run()),this.person.ability.canSetManager?this.form=this.formsHandler.createForm(Ee,[this.person]):this.args.close()}}),null,"loadModelTask",null)),this.loadModelTask.perform()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}async submitForm(e){try{await this.formsHandler.submitForm(e,{successFlashMessage:"Manager saved"}),this.closeModal()}catch(o){await this.ui.showSaveErrorFlash("Failed to save manager")}}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}preloadManagerCandidates(){return ie.on(this).preloadManagerCandidatesForPerson(this.person)}};L((Ze=ro).prototype,"store",[w]),L(Ze.prototype,"can",[w]),L(Ze.prototype,"formsHandler",[w]),L(Ze.prototype,"ui",[w]),L(Ze.prototype,"flags",[w]),L(Ze.prototype,"session",[w]),L(Ze.prototype,"form",[R]),p(Ze.prototype,"submitForm",[j]),p(Ze.prototype,"closeModal",[j]),p(Ze.prototype,"preloadManagerCandidates",[j]),s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-manager-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n  "],[10,0],[15,0,[32,2,["description"]]],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.edit-user-manager-modal.description"],null]],[1,"\\n  "],[13],[1,"\\n\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,3],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,4],null,[["@form","@submit","@cancel","@preloadManagerCandidates"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["closeModal"]],[30,0,["preloadManagerCandidates"]]]],null],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,styles:$e,LoadingSpinner:_,ManagerForm0:D}),isStrictMode:!0}),Ze);var ao,po={bannerNote:"_bannerNote_1exf2_1",bannerMention:"_bannerMention_1exf2_5"},mo=s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n  "],[8,[32,1],[[24,0,"form-for__field"]],[["@tone"],["info"]],[["default"],[[[[1,"\\n    "],[8,[30,5,["Content"]],null,null,[["default"],[[[[1,"\\n      "],[8,[30,5,["Description"]],null,null,[["default"],[[[[1,"\\n        "],[1,[28,[32,2],["components.people.nickname-form.nicknameTip"],[["classNote","classMention","htmlSafe"],[[32,3,["bannerNote"]],[32,3,["bannerMention"]],true]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[]]]]],[1,"\\n  "]],[5]]]]],[1,"\\n\\n  "],[8,[30,4,["InputField"]],null,[["@propertyName","@label","@autofocus"],["nickname",[28,[32,2],["components.people.nickname-form.nicknameLabel"],null],true]],null],[1,"\\n\\n  "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,2],["components.people.nickname-form.updateNickname"],null],[30,6]]],null],[1,"\\n"]],[4]]]]]],["&attrs","@form","@onSubmit","f","B","@onCancel"],[]]',moduleName:"(unknown template module)",scope:()=>({FormFor:ve,Banner:U,t:a,styles:po}),isStrictMode:!0}),o()),uo=new WeakMap,co=class extends de{constructor(...e){super(...e),he(this,uo,void ke(this,"nickname"))}};L(co.prototype,"nickname",[oe({validations:{length:{maxInclusive:255}},applyValue(e,o){e.model.nickname=o||null}})]);var ho=new WeakMap,fo=new WeakMap,yo=new WeakMap,vo=new WeakMap,go=new WeakMap,bo=new WeakMap,ko=class extends Q{constructor(e,o){super(e,o),he(this,ho,void ke(this,"store")),he(this,fo,void ke(this,"can")),he(this,yo,void ke(this,"formsHandler")),he(this,vo,void ke(this,"ui")),he(this,go,void ke(this,"intl")),he(this,bo,void ke(this,"form")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){const e=yield this.store.findRecord("person",this.args.personId);e.ability.canUpdateNickname||this.args.close(),this.form=this.formsHandler.createForm(co,[e])}}),null,"loadModelTask",null)),this.loadModelTask.perform()}async submitForm(e){try{await this.formsHandler.submitForm(e,{successFlashMessage:this.intl.t("components.people.edit-user-nickname-modal.successMessage")}),this.closeModal()}catch(o){await this.ui.showSaveErrorFlash(this.intl.t("components.people.edit-user-nickname-modal.errorMessage"))}}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}};L((ao=ko).prototype,"store",[w]),L(ao.prototype,"can",[w]),L(ao.prototype,"formsHandler",[w]),L(ao.prototype,"ui",[w]),L(ao.prototype,"intl",[w]),L(ao.prototype,"form",[R]),p(ao.prototype,"submitForm",[j]),p(ao.prototype,"closeModal",[j]),s(Ae({i
2d:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-nickname-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,2],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,3],null,[["@form","@onSubmit","@onCancel"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["closeModal"]]]],null],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,LoadingSpinner:_,NicknameForm0:mo}),isStrictMode:!0}),ao);var Mo,wo=class extends W{get id(){return this.model.id}get label(){return this.model.name}},To=class{constructor(e,o,t){Se(this,"groupName",void 0),Se(this,"options",void 0),Se(this,"position",void 0),this.groupName=e,this.options=o,this.position=t}},Fo=class extends W{get id(){return"custom-permission-sets"}get label(){return"Custom permission sets"}get isParent(){return!0}get items(){return this.model.options.map(e=>new wo({adapter:this.adapter,model:e,parentItem:this}))}},_o=class extends W{get id(){return"system-permission-sets"}get label(){return"System permission sets"}get isParent(){return!0}get items(){return this.model.options.reduce((e,o)=>o.baseRoleId===u.CONTRACTOR?[...e]:[...e,new wo({adapter:this.adapter,model:o,parentItem:this})],[])}},Co=[u.JUNIOR_COORDINATOR,u.JUNIOR_MANAGER,u.JUNIOR_PROFITABILITY_MANAGER],Io=class extends g{get isRestrictedRolesAvailable(){var e;return!!(null===(e=this.context.subscription.features)||void 0===e?void 0:e.restrictedUserRoles.isAvailable)}get systemPermissionSets(){var e;const o=null===(e=this.context.session.currentPerson)||void 0===e?void 0:e.customRole,t=null==o?void 0:o.baseRoleId;return t?this.customRoles.filter(e=>!(e.editableByUser||e.principalType!==this.principalType||e.userTypeId!==this.userTypeId||Co.includes(e.baseRoleId)&&!this.isRestrictedRolesAvailable)&&(!!o.editableByUser||ee[t].includes(e.baseRoleId))).sort((e,o)=>{var t,n;return(null!==(t=e.name)&&void 0!==t?t:"").localeCompare(null!==(n=o.name)&&void 0!==n?n:"")}):[]}get customPermissionSets(){var e;return(null===(e=this.context.subscription.features)||void 0===e?void 0:e.customRoles.isAvailable)&&this.canAssignCustomRoles?this.customRoles.filter(e=>e.editableByUser&&e.principalType===this.principalType&&e.userTypeId===this.userTypeId).sort((e,o)=>{var t,n;return(null!==(t=e.name)&&void 0!==t?t:"").localeCompare(null!==(n=o.name)&&void 0!==n?n:"")}):[]}mapModelsToItems(){const e=[new _o({adapter:this,model:new To("System permission sets",this.systemPermissionSets,1)})];return this.customPermissionSets.length&&e.push(new Fo({adapter:this,model:new To("Custom permission sets",this.customPermissionSets,2)})),e}},Ro=s(Ae({id:null,block:'[[[11,"svg"],[24,"width","20"],[24,"height","20"],[24,"viewBox","0 0 20 20"],[24,"fill","none"],[24,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[17,1],[12],[10,"g"],[14,"transform","translate(0 2.91667) scale(0.83333)"],[12],[10,"path"],[14,"d","M20 15c1.105 0 2-.893 2-1.992V1.992C22 .892 21.102 0 20.01 0H3.99C2.89 0 2 .893 2 1.992v11.016C2 14.108 2.895 15 4 15H0v2h24v-2h-4zM4 2h16v11H4V2z"],[14,"fill","currentColor"],[14,"fill-rule","evenodd"],[12],[13],[13],[13]],["&attrs"],[]]',moduleName:"(unknown template module)",isStrictMode:!0}),o()),So=new WeakMap,Ao=new WeakMap,No=new WeakMap,Eo=new WeakMap,Uo=new WeakMap,Wo=class extends Q{constructor(...e){var o,t;super(...e),he(this,So,void ke(this,"can")),he(this,Ao,void ke(this,"session")),he(this,No,void ke(this,"store")),he(this,Eo,void ke(this,"subscription")),he(this,Uo,void ke(this,"intl")),Se(this,"initialUserType",this.args.form.userType),Se(this,"initialSubsidiary",null===(o=this.args.form.model)||void 0===o?void 0:o.subsidiary),Se(this,"initialCompany",null===(t=this.args.form.model)||void 0===t?void 0:t.company),Se(this,"preloadRoleOptionsTask",ge(()=>({context:this,generator:function*(){yield I.on(this).forUsers().depaginate().withContext("permissions-form").run()}}),null,"preloadRoleOptionsTask",null))}get initialRole(){var e,o,t,n;return(null===(e=this.form.model)||void 0===e?void 0:e.customRole)?null===(o=this.form.model)||void 0===o?void 0:o.customRole:this.form.userType===H.CLIENT?null===(t=this.form.systemRoles)||void 0===t?void 0:t.find(e=>e.baseRoleId===u.CLIENT_STAFF):this.form.userType===H.EMPLOYEE?null===(n=this.form.systemRoles)||void 0===n?void 0:n.find(e=>e.baseRoleId===u.STAFF):void 0}get userTypeOptions(){return[...this.can.app.canManageTeamMembers?[{value:H.EMPLOYEE,icon:Ro,label:this.intl.t("components.people.permissions-form.employee")}]:[],...this.personAbility.canManageClientRoles?[{value:H.CLIENT,icon:r,label:this.intl.t("components.people.permissions-form.client"),isDisabled:this.isClientOptionDisabled,disabledTooltip:this.isClientOptionDisabled?this.intl.t("components.people.permissions-form.clientOutsideOwnSubsidiary"):void 0}]:[],...this.can.app.canManageTeamMembers?[{value:H.CONTRACTOR,icon:t,label:this.intl.t("components.people.permissions-form.contractor")}]:[]]}get rolesAdapter(){return new class extends Io{get customRoles(){return this.context.store.peekAll("role").slice()}get canAssignCustomRoles(){return this.context.personAbility.canAssignCustomRoles}get selectedItem(){return this.context.args.form.role}get userTypeId(){return this.context.args.form.userType===H.CLIENT?me.CLIENT:me.TIME_TRACKER}get principalType(){return C.USER}}(this)}get form(){return this.args.form}get seatsChanged(){var e;const{userType:o,model:t}=this.form,n=(null==t||null===(e=t.customRole)||void 0===e?void 0:e.isTimeTracker)?1:0;return(o===H.CLIENT?0:1)-n}get changePermissionsDisabledTooltip(){var e;const o=(null===(e=this.session.organization)||void 0===e?void 0:e.owner)===this.args.form.model&&this.intl.t("components.people.permissions-form.ownerRoleCannotBeChanged"),t=!this.personAbility.canUpdatePermissions&&this.intl.t("components.people.permissions-form.cannotChangePermissions");return o||t||this.intl.t("components.people.permissions-form.permissionsCannotBeChanged")}get isClientOptionDisabled(){return this.can.app.isRestrictedToOwnSubsidiary&&!!this.initialSubsidiary&&this.initialSubsidiary!==this.session.currentSubsidiary}get isUpdateUserTypeDisabled(){var e;return(null===(e=this.session.organization)||void 0===e?void 0:e.owner)===this.args.form.model||!this.personAbility.canUpdateUserType}get isUpdatePermissionsDisabled(){var e;return(null===(e=this.session.organization)||void 0===e?void 0:e.owner)===this.args.form.model||!this.personAbility.canUpdatePermissions}get personAbility(){return this.can.abilityFor("person",this.args.form.model)}setUserType(e){var o,t,n;e&&(this.form.userType=e,this.form.company=null!==(t=this.getCompanyForUserType(e))&&void 0!==t?t:void 0,this.form.subsidiary=null!==(n=this.getSubsidiaryForUserType(e))&&void 0!==n?n:void 0,this.args.form.role=this.form.model.customRole&&this.initialUserType!==e&&!(null===(o=this.form.model)||void 0===o?void 0:o.isVirtual)?void 0:this.initialRole)}getCompanyForUserType(e){return e===H.EMPLOYEE?this.session.currentCompany:this.initialCompany!==this.session.currentCompany?this.initialCompany:null}getSubsidiaryForUserType(e){var o;return this.initialUserType!==H.CLIENT?e===H.CLIENT?null:this.initialSubsidiary?this.initialSubsidiary:this.can.app.isRestrictedToOwnSubsidiary?this.session.currentSubsidiary:null===(o=this.session.organization)||void 0===o?void 0:o.activeSubsidiaries[0]:null}preloadRoleOptions(){this.preloadRoleOptionsTask.perform()}onRoleSelect(e){this.form.role=e}buildCompaniesQuery(e={}){return X.on(this).withCommonOptions(e)}get subsidiariesQuery(){return fe.on(this).assignableAndSorted()}createNewCompany(e){return Fe.on(this).withName(e).create()}};L((Mo=Wo).prototype,"can",[w]),L(Mo.prototype,"session",[w]),L(Mo.prototype,"store",[w]),L(Mo.prototype,"subscription",[w]),L(Mo.prototype,"intl",[w]),p(Mo.prototype,"rolesAdapter",[re]),p(Mo.prototype,"personAbility",[re]),p(Mo.prototype,"setUserType",[j]),p(Mo.prototype,"preloadRoleOptions",[j]),p(Mo.prototype,"onRoleSelect",[j]),p(Mo.prototype,"buildCompaniesQuery",[j]),p(Mo.prototype,"createNewCompany",[j]),s(Ae({i
2d:null,block:'[[[11,0],[24,0,"person-permissions-form"],[17,1],[12],[1,"\\n  "],[1,[28,[32,0],[[30,0,["preloadRoleOptions"]]],null]],[1,"\\n"],[41,[30,0,["preloadRoleOptionsTask","isRunning"]],[[[1,"    "],[8,[32,1],null,[["@size"],["medium"]],null],[1,"\\n"]],[]],[[[1,"    "],[8,[32,2],null,[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n      "],[10,0],[12],[1,"\\n        "],[1,[28,[32,0],[[28,[32,3],[[30,0,["setUserType"]],[30,2,["userType"]]],null]],null]],[1,"\\n        "],[8,[30,4,["RadioFieldSelect"]],[[24,0,"person-permissions-form__user-type-field form-for__field"]],[["@propertyName","@label","@isDisabled","@options","@onChange"],["userType","",[30,0,["isUpdateUserTypeDisabled"]],[30,0,["userTypeOptions"]],[30,0,["setUserType"]]]],null],[1,"\\n\\n"],[41,[30,0,["isUpdateUserTypeDisabled"]],[[[1,"          "],[8,[32,4],null,null,[["default"],[[[[1,[30,0,["changePermissionsDisabledTooltip"]]]],[]]]]],[1,"\\n"]],[]],null],[1,"      "],[13],[1,"\\n\\n      "],[10,0],[14,0,"person-permissions-form__user-type-fields"],[12],[1,"\\n"],[41,[28,[32,5],[[30,2,["userType"]],[32,6,["EMPLOYEE"]]],null],[[[1,"          "],[10,0],[14,0,"person-permissions-form__description-text"],[12],[1,"\\n            "],[1,[28,[32,7],["components.people.permissions-form.employeeDescription"],null]],[1,"\\n          "],[13],[1,"\\n          "],[10,0],[14,0,"flex items-center person-permissions-form__flex-cell"],[12],[1,"\\n            "],[10,0],[14,0,"flex-1 min-w-0"],[12],[1,"\\n              "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@adapter","@onChange","@isClearButtonEnabled","@isDisabled","@searchPlaceholder"],["role",[28,[32,7],["components.people.permissions-form.permissionSet"],null],[30,0,["rolesAdapter"]],[30,0,["onRoleSelect"]],false,[30,0,["isUpdatePermissionsDisabled"]],[28,[32,7],["components.people.permissions-form.searchPermissionSets"],null]]],[["default","footer"],[[[[1,"\\n"],[41,[30,6,["isInTrigger"]],[[[1,"                    "],[8,[30,6,["ItemComponent"]],null,[["@label"],[[30,5,["name"]]]],null],[1,"\\n"]],[]],null],[1,"                "]],[5,6]],[[[1,"\\n"],[41,[28,[32,8],[[30,0,["subscription","features","customRoles","isAvailable"]]],null],[[[1,"                    "],[10,0],[14,0,"person-permissions-form__permission-select-footer"],[12],[1,"\\n                      "],[10,2],[14,0,"person-permissions-form__permission-select-footer-text"],[12],[1,"\\n                        "],[1,[28,[32,7],["components.people.permissions-form.customPermissionSetsUnavailable"],[["htmlSafe"],[true]]]],[1,"\\n                      "],[13],[1,"\\n                      "],[8,[32,9],[[24,0,"person-permissions-form__permission-select-footer-button"]],[["@feature"],[[30,0,["subscription","features","customRoles"]]]],null],[1,"\\n                    "],[13],[1,"\\n"]],[]],null],[1,"                "]],[]]]]],[1,"\\n            "],[13],[1,"\\n            "],[10,0],[14,0,"flex-1 min-w-0"],[12],[1,"\\n"],[41,[28,[32,10],[[30,0,["can","app","canShowWorkplace"]],[28,[32,8],[[30,2,["model","subsidiary"]]],null]],null],[[[1,"                "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@optionLabelPath","@preloadOptions","@isClearButtonEnabled"],["subsidiary",[28,[32,7],["components.people.permissions-form.subsidiary"],null],"name",[30,0,["subsidiariesQuery","tryPreload"]],false]],null],[1,"\\n"]],[]],null],[1,"            "],[13],[1,"\\n          "],[13],[1,"\\n\\n"],[41,[30,2,["role","description"]],[[[1,"            "],[10,0],[14,0,"person-permissions-form__description-text"],[12],[1,"\\n              "],[1,[30,2,["role","description"]]],[1,"\\n            "],[13],[1,"\\n"]],[]],null]],[]],[[[41,[28,[32,5],[[30,2,["userType"]],[32,6,["CLIENT"]]],null],[[[1,"          "],[10,0],[14,0,"person-permissions-form__description-text"],[12],[1,"\\n            "],[1,[28,[32,7],["components.people.permissions-form.clientDescription"],null]],[1,"\\n          "],[13],[1,"\\n\\n          "],[10,0],[14,0,"flex items-center person-permissions-form__flex-cell"],[12],[1,"\\n            "],[10,0],[14,0,"flex-1 min-w-0"],[12],[1,"\\n              "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@adapter","@onChange","@isClearButtonEnabled","@isDisabled","@searchPlaceholder"],["role",[28,[32,7],["components.people.permissions-form.permissionSet"],null],[30,0,["rolesAdapter"]],[30,0,["onRoleSelect"]],false,[30,0,["isUpdatePermissionsDisabled"]],[28,[32,7],["components.people.permissions-form.searchPermissionSets"],null]]],[["default","footer"],[[[[1,"\\n"],[41,[30,8,["isInTrigger"]],[[[1,"                    "],[8,[30,8,["ItemComponent"]],null,[["@label"],[[30,7,["name"]]]],null],[1,"\\n"]],[]],null],[1,"                "]],[7,8]],[[[1,"\\n"],[41,[28,[32,8],[[30,0,["subscription","features","customRoles","isAvailable"]]],null],[[[1,"                    "],[10,0],[14,0,"person-permissions-form__permission-select-footer"],[12],[1,"\\n                      "],[10,2],[14,0,"person-permissions-form__permission-select-footer-text"],[12],[1,"\\n                        "],[1,[28,[32,7],["components.people.permissions-form.customPermissionSetsUnavailable"],[["htmlSafe"],[true]]]],[1,"\\n                      "],[13],[1,"\\n                      "],[8,[32,9],[[24,0,"person-permissions-form__permission-select-footer-button"]],[["@feature"],[[30,0,["subscription","features","customRoles"]]]],null],[1,"\\n                    "],[13],[1,"\\n"]],[]],null],[1,"                "]],[]]]]],[1,"\\n            "],[13],[1,"\\n            "],[10,0],[14,0,"flex-1 min-w-0"],[12],[1,"\\n              "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@optionLabelPath","@optionIconPath","@buildQuery","@createNewItem","@isClearButtonEnabled","@modelName"],["company",[28,[32,7],["components.people.permissions-form.company"],null],"name","avatarUrl",[28,[32,3],[[30,0,["buildCompaniesQuery"]],[28,[32,11],null,[["excludeOrganization"],[true]]]],null],[52,[30,0,["can","app","canCreateCompanyInline"]],[30,0,["createNewCompany"]]],false,"company"]],null],[1,"\\n            "],[13],[1,"\\n          "],[13],[1,"\\n\\n          "],[10,0],[14,0,"form-for__flex-row"],[12],[1,"\\n            "],[10,0],[12],[1,"\\n"],[41,[30,2,["role","description"]],[[[1,"                "],[10,0],[14,0,"person-permissions-form__description-text"],[12],[1,"\\n                  "],[1,[30,2,["role","description"]]],[1,"\\n                "],[13],[1,"\\n"]],[]],null],[1,"            "],[13],[1,"\\n          "],[13],[1,"\\n"]],[]],[[[41,[28,[32,5],[[30,2,["userType"]],[32,6,["CONTRACTOR"]]],null],[[[1,"          "],[10,0],[14,0,"person-permissions-form__description-text"],[12],[1,"\\n            "],[1,[28,[32,7],["components.people.permissions-form.contractorDescription"],null]],[1,"\\n          "],[13],[1,"\\n\\n          "],[10,0],[14,0,"flex items-center person-permissions-form__flex-cell"],[12],[1,"\\n            "],[10,0],[14,0,"flex-1 min-w-0"],[12],[1,"\\n              "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@optionLabelPath","@optionIconPath","@buildQuery","@createNewItem","@isClearButtonEnabled","@modelName"],["company",[28,[32,7],["components.people.permissions-form.company"],null],"name","avatarUrl",[28,[32,3],[[30,0,["buildCompaniesQuery"]],[28,[32,11],null,[["excludeOrganization"],[true]]]],null],[52,[30,0,["can","app","canCreateCompanyInline"]],[30,0,["createNewCompany"]]],false,"company"]],null],[1,"\\n            "],[13],[1,"\\n\\n            "],[10,0],[14,0,"flex-1 min-w-0"],[12],[1,"\\n"],[41,[28,[32,10],[[30,0,["can","app","canShowWorkplace"]],[28,[32,8],[[30,2,["model","subsidiary"]]],null]],null],[[[1,"                "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@optionLabelPath","@preloadOptions","@isClearButtonEnabled"],["subsidiary",[28,[32,7],["components.people.permissions-form.subsidiary"],null],"name",[30,0,["subsidiariesQuery","tryPreload"]],false]],null],[1,"\\n"]],[]],null],[1,"            "],[13],[1,"\\n          "],[13],[1,"\\n        "]],[]],null]],[]]]],[]]],[1,"\\n"],[41,[30,2,["model","isInvitable"]],[[[1,"          "],[8,[30,4,["CheckboxField"]],null,[["@propertyName"],["sendEmail"]],[["default"],[[[[1,"\\n            "],[1,[28,[32,7],["components.people.permissions-form.sendInvitation"],null]],[1,"\\n\\n            "],[10,1],[12],[1,"\\n              "],[8,[32,12],null,null,null],[1,"\\n              "],[8,[32,4],null,
2null,[["default"],[[[[1," "],[1,[28,[32,7],["components.people.permissions-form.inviteLater"],null]],[1," "]],[]]]]],[1,"\\n            "],[13],[1,"\\n          "]],[]]]]],[1,"\\n"]],[]],null],[1,"      "],[13],[1,"\\n\\n      "],[8,[32,13],[[24,0,"person-permissions-form__pricing-info"]],[["@seatsChanged"],[[30,0,["seatsChanged"]]]],null],[1,"\\n\\n      "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,7],["components.people.permissions-form.inviteOrUpdatePerson"],[["isInvitable"],[[30,2,["isInvitable"]]]]],[30,9]]],[["default"],[[[[1,"\\n        "],[8,[30,4,["FormErrors"]],null,[["@mode"],["popover"]],null],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[4]]]]],[1,"\\n"]],[]]],[13]],["&attrs","@form","@submitForm","f","item","options","item","options","@cancel"],["if"]]',moduleName:"(unknown template module)",scope:()=>({effect:h,LoadingSpinner:_,FormFor:ve,__keyword__fn:c,TooltipOnParent:d,__keyword__eq:v,UserType:H,t:a,__keyword__not:b,KacunkoButton:be,__keyword__and:O,__keyword__hash:ae,IconInfo:_e,PricingInfo:E}),isStrictMode:!0}),Mo);var Po,xo,Do=s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@size","@title","@close"],["large",[30,2],[30,3]]],[["default"],[[[[1,"\\n"],[41,[30,4,["model","email"]],[[[1,"    "],[8,[32,1],null,[["@form","@submitForm","@cancel"],[[30,4],[30,5],[30,3]]],null],[1,"\\n"]],[]],[[[41,[30,4,["model"]],[[[1,"    "],[8,[32,2],null,
2null,[["default"],[[[[1,"\\n      "],[1,[28,[32,3],["components.people.edit-permissions.emailRequired"],null]],[1,"\\n\\n      "],[8,[32,4],null,[["@params"],[[28,[32,5],[[28,[32,6],null,[["edit-contact"],[[30,4,["model","id"]]]]]],null]]],[["default"],[[[[1,"\\n        "],[1,[28,[32,3],["components.people.edit-permissions.addEmailLink"],null]],[1,"\\n      "]],[]]]]],[1,"\\n\\n      "],[1,[28,[32,3],["components.people.edit-permissions.beforeInviting"],null]],[1,"\\n    "]],[]]]]],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs","@title","@close","@form","@submitForm"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,PermissionsForm:Wo,Typography:pe,t:a,Link:n,routeParams:M,__keyword__hash:ae}),isStrictMode:!0}),o()),Lo=new WeakMap,Oo=new WeakMap,Ho=new WeakMap,Vo=new WeakMap,zo=new WeakMap,qo=new WeakMap,Bo=new WeakMap,Qo=new WeakMap,Jo=new WeakMap,jo=new WeakMap,Yo=new WeakMap,Go=new WeakMap,Ko=new WeakMap,Xo=class extends de{constructor(...e){super(...e),he(this,Lo,void ke(this,"subscription")),he(this,Oo,void ke(this,"apiAction")),he(this,Ho,void ke(this,"session")),Se(this,"allowSaveIfNotDirty",this.args.shouldInvite),he(this,Vo,void ke(this,"company")),he(this,zo,void ke(this,"subsidiary")),he(this,qo,void ke(this,"sendEmail")),he(this,Bo,void ke(this,"userType")),he(this,Qo,void ke(this,"role")),he(this,Jo,void ke(this,"isEmployeeCrmStaff")),he(this,jo,void ke(this,"isEmployeeTimeStaff")),he(this,Yo,void ke(this,"isEmployeeJuniorManager")),he(this,Go,void ke(this,"isClientManager")),he(this,Ko,void ke(this,"isEmployeeJuniorCoordinator"))}get isRestrictedUserRolesFeatureAvailable(){var e,o;return null!==(o=null===(e=this.subscription.features)||void 0===e?void 0:e.restrictedUserRoles.isAvailable)&&void 0!==o&&o}get isMultipleSubsidiariesFeatureAvailable(){var e,o;return null!==(o=null===(e=this.subscription.features)||void 0===e?void 0:e.subsidiaries.isAvailable)&&void 0!==o&&o}get systemRoles(){var e;return null===(e=this.model.organization)||void 0===e?void 0:e.roles}get isInvitable(){return this.model.isInvitable&&this.args.shouldInvite}get isEmployeeSeniorManager(){return!this.isEmployeeJuniorManager}set isEmployeeSeniorManager(e){this.isEmployeeJuniorManager=!e}get isEmployeeCoordinator(){return!this.isEmployeeJuniorCoordinator}set isEmployeeCoordinator(e){this.isEmployeeJuniorCoordinator=!e}get isNotClient(){return this.userType!==H.CLIENT}get isNotContractor(){return this.userType!==H.CONTRACTOR}get isSubsidiaryRequired(){return this.isNotClient&&this.isMultipleSubsidiariesFeatureAvailable}async beforeSubmit(){var e,o,t;await super.beforeSubmit();let n=u.STAFF,s=null;const i=this.userType,l=this.role;return i===H.CONTRACTOR?n=u.CONTRACTOR:((null==l?void 0:l.baseRoleId)&&(n=l.baseRoleId),s=l),null!==(e=s)&&void 0!==e||(s=null===(o=this.systemRoles)||void 0===o?void 0:o.find(e=>!e.editableByUser&&e.baseRoleId===n)),this.model.customRole=s,this.model.roleId=n,(null===(t=this.company)||void 0===t?void 0:t.isNew)?this.company.save():null}submit(e){return this.isInvitable?this.invite().catch(e=>{this.handleSubmitErrorResponse(e)}):super.submit(e)}invite(){return this.apiAction.memberAction("invite",this.model,{context:{skipInvite:!this.sendEmail}})}};L((Po=Xo).prototype,"subscription",[w]),L(Po.prototype,"apiAction",[w]),L(Po.prototype,"session",[w]),L(Po.prototype,"company",[oe({alwaysApplyValue:!0,getValue:e=>e.args.shouldInvite?e.session.currentCompany:e.model.company,validations:{presence:!0}})]),L(Po.prototype,"subsidiary",[oe({validations:{presence:e=>e.isSubsidiaryRequired}})]),L(Po.prototype,"sendEmail",[oe({})]),L(Po.prototype,"userType",[oe({alwaysApplyValue:!0,getValue(e){var o;const t=e.model.ability;if(!t.canManageEmployeeRoles)return H.CLIENT;const n=null===(o=e.model.customRole)||void 0===o?void 0:o.baseRoleId;return t.canManageClientRoles?n===u.CONTRACTOR?H.CONTRACTOR:n===u.CLIENT_MANAGER||n===u.CLIENT_STAFF?H.CLIENT:H.EMPLOYEE:n===u.CONTRACTOR?H.CONTRACTOR:H.EMPLOYEE}})]),L(Po.prototype,"role",[oe({alwaysApplyValue:!0,getValue(e){var o;return null===(o=e.model)||void 0===o?void 0:o.customRole},validations:{presence:e=>e.isNotContractor}})]),L(Po.prototype,"isEmployeeCrmStaff",[oe({alwaysApplyValue:!0,getValue(e){var o,t;return(null===(o=e.model.customRole)||void 0===o?void 0:o.baseRoleId)===u.CRM_STAFF||(null===(t=e.model.customRole)||void 0===t?void 0:t.baseRoleId)===u.CRM_TIME_STAFF||!1}})]),L(Po.prototype,"isEmployeeTimeStaff",[oe({alwaysApplyValue:!0,getValue(e){var o,t;return(null===(o=e.model.customRole)||void 0===o?void 0:o.baseRoleId)===u.TIME_STAFF||(null===(t=e.model.customRole)||void 0===t?void 0:t.baseRoleId)===u.CRM_TIME_STAFF||!1}})]),L(Po.prototype,"isEmployeeJuniorManager",[oe({alwaysApplyValue:!0,getValue(e){var o;return e.isRestrictedUserRolesFeatureAvailable&&(f(null===(o=e.model.customRole)||void 0===o?void 0:o.baseRoleId)||e.model.isContact)||!1}})]),L(Po.prototype,"isClientManager",[oe({alwaysApplyValue:!0,getValue(e){var o;return(null===(o=e.model.customRole)||void 0===o?void 0:o.baseRoleId)===u.CLIENT_MANAGER||!1}})]),L(Po.prototype,"isEmployeeJuniorCoordinator",[oe({alwaysApplyValue:!0,getValue(e){var o;return e.isRestrictedUserRolesFeatureAvailable&&((null===(o=e.model.customRole)||void 0===o?void 0:o.baseRoleId)===u.JUNIOR_COORDINATOR||e.model.isContact)||!1}})]);var Zo,$o=new WeakMap,et=new WeakMap,ot=new WeakMap,tt=new WeakMap,nt=new WeakMap,st=new WeakMap,it=new WeakMap,lt=new WeakMap,rt=class extends Q{constructor(e,o){super(e,o),he(this,$o,void ke(this,"store")),he(this,et,void ke(this,"can")),he(this,ot,void ke(this,"ui")),he(this,tt,void ke(this,"formsHandler")),he(this,nt,void ke(this,"apiAction")),he(this,st,void ke(this,"session")),he(this,it,void ke(this,"subscription")),he(this,lt,void ke(this,"form")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){const e=yield this.store.findRecord("person",this.args.personId);this.args.isInviteMode&&!e.ability.canInvite||!this.args.isInviteMode&&!e.ability.canUpdatePermissions?this.args.close():(this.form=this.formsHandler.createForm(Xo,[e,{shouldInvite:this.args.isInviteMode}]),fe.on(this).active().depaginate().withContext("edit-user-permissions-modal").run())}}),null,"loadModelTask",null)),this.loadModelTask.perform()}async submitForm(e){try{await this.formsHandler.submitForm(e),this.args.close()}catch(o){if(!new se(o).isAdapterError)throw o}}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}};L((xo=rt).prototype,"store",[w]),L(xo.prototype,"can",[w]),L(xo.prototype,"ui",[w]),L(xo.prototype,"formsHandler",[w]),L(xo.prototype,"apiAction",[w]),L(xo.prototype,"session",[w]),L(xo.prototype,"subscription",[w]),L(xo.prototype,"form",[R]),p(xo.prototype,"submitForm",[j]),p(xo.prototype,"closeModal",[j]),s(Ae({i
2d:null,block:'[[[41,[30,0,["loadModelTask","isRunning"]],[[[1,"  "],[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-permissions-modal.inviteContatsOrEditPermissions"],[["isInviteMode"],[[30,2]]]],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n    "],[8,[32,2],null,null,null],[1,"\\n  "]],[]]]]],[1,"\\n"]],[]],[[[41,[30,0,["form","model"]],[[[1,"  "],[8,[32,3],null,[["@title","@form","@close","@submitForm"],[[28,[32,1],["components.people.edit-user-permissions-modal.inviteContatsOrEditPermissions"],[["isInviteMode"],[[30,2]]]],[30,0,["form"]],[30,0,["closeModal"]],[30,0,["submitForm"]]]],null],[1,"\\n"]],[]],null]],[]]]],["&attrs","@isInviteMode"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,LoadingSpinner:_,EditPermissions:Do}),isStrictMode:!0}),xo);var at,pt=new WeakMap,dt=class extends Q{constructor(...e){super(...e),he(this,pt,void ke(this,"session"))}};L((Zo=dt).prototype,"session",[w]),s(Ae({id:null,block:'[[[8,[32,0],[[24,0,"person-user-profile-form"],[17,1]],[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n"],[41,[28,[32,1],[[30,5,["canUpdateProfile"]],[28,[32,2],[[30,6]],null]],null],[[[1,"    "],[8,[30,4,["AvatarField"]],null,[["@propertyName","@modelName","@label","@fileFieldPlaceholder","@fileFieldHint"],["avatarUrl","person",[28,[32,3],["components.people.user-profile-form.changeProfilePicture"],null],[28,[32,3],["components.people.user-profile-form.addProfilePicture"],null],[28,[32,3],["components.people.user-profile-form.imageHint"],null]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,5,["canUpdateProfile"]],[[[1,"    "],[10,0],[14,0,"form-for__flex-row"],[12],[1,"\\n      "],[8,[30,4,["InputField"]],null,[["@propertyName","@label"],["firstName",[28,[32,3],["components.people.user-profile-form.firstName"],null]]],null],[1,"\\n\\n      "],[8,[30,4,["InputField"]],null,[["@propertyName","@label"],["lastName",[28,[32,3],["components.people.user-profile-form.lastName"],null]]],null],[1,"\\n    "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,5,["canManageEmail"]],[[[1,"    "],[8,[30,4,["InputField"]],null,[["@propertyName","@label","@isDisabled"],["email",[28,[32,3],["shared.form-fields.email"],null],[28,[32,1],[[30,5,["isModelCurrentUser"]],[30,0,["session","user","ssoProvision"]]],null]]],[["default"],[[[[1,"\\n"],[41,[28,[32,1],[[30,5,["isModelCurrentUser"]],[30,0,["session","user","ssoProvision"]]],null],[[[1,"        "],[8,[32,4],null,null,[["default"],[[[[1,"\\n          "],[1,[28,[32,3],["components.people.user-profile-form.ssoEmailTooltip"],null]],[1,"\\n        "]],[]]]]],[1,"\\n"]],[]],null],[1,"    "]],[]]]]],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,7],[[[1,"    "],[8,[32,5],null,[["@tone"],["info"]],[["default"],[[[[1,"\\n      "],[8,[30,8,["Content"]],null,null,[["default"],[[[[1,"\\n        "],[8,[30,8,["Description"]],null,null,[["default"],[[[[1,[28,[32,3],["components.people.user-profile-form.infoMessage"],null]]],[]]]]],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[8]]]]],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,3],["components.people.user-profile-form.updateProfile"],null],[30,9]]],null],[1,"\\n"]],[4]]]]]],["&attrs","@form","@submitForm","f","@personAbility","@isAvatarHidden","@showInfoMessage","B","@cancel"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:ve,__keyword__and:O,__keyword__not:b,t:a,TooltipOnParent:d,Banner:U}),isStrictMode:!0}),Zo);var mt,ut=new WeakMap,ct=new WeakMap,ht=new WeakMap,ft=new WeakMap,yt=new WeakMap,vt=new WeakMap,gt=new WeakMap,bt=class extends de{constructor(...e){super(...e),he(this,ut,void ke(this,"formsHandler")),he(this,ct,void ke(this,"intl")),he(this,ht,void ke(this,"firstName")),he(this,ft,void ke(this,"lastName")),he(this,yt,void ke(this,"avatarUrl")),he(this,vt,void ke(this,"avatar")),he(this,gt,void ke(this,"email"))}get id(){return this.model.id}get initials(){return this.model.initials}async beforeSubmit(){await super.beforeSubmit(),y(this)&&await this.formsHandler.confirmExternalSyncIfNeeded(this.model)}};L((at=bt).prototype,"formsHandler",[w]),L(at.prototype,"intl",[w]),L(at.prototype,"firstName",[oe({validations:{presence:!0,inline(e,o){if(Ie(e))return[o.intl.t("forms.person-bundle.user-profile-form.cantContainLinks")]}}})]),L(at.prototype,"lastName",[oe({validations:{inline(e,o){if(Ie(e))return[o.intl.t("forms.person-bundle.user-profile-form.cantContainLinks")]}}})]),L(at.prototype,"avatarUrl",[oe({})]),L(at.prototype,"avatar",[oe({})]),L(at.prototype,"email",[oe({validations:{presence:!0,email:!0}})]);var kt,Mt=new WeakMap,wt=new WeakMap,Tt=new WeakMap,Ft=new WeakMap,_t=new WeakMap,Ct=new WeakMap,It=new WeakMap,Rt=new WeakMap,St=class extends Q{get showInfoMessage(){var e;const o=null===(e=this.form)||void 0===e?void 0:e.model;return o instanceof N&&o.organizationMemberships.slice().length>1}constructor(e,o){super(e,o),he(this,Mt,void ke(this,"store")),he(this,wt,void ke(this,"can")),he(this,Tt,void ke(this,"session")),he(this,Ft,void ke(this,"formsHandler")),he(this,_t,void ke(this,"ui")),he(this,Ct,void ke(this,"flags")),he(this,It,void ke(this,"form")),he(this,Rt,void ke(this,"person")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){this.person=yield this.store.findRecord("person",this.args.personId),this.person.ability.canUpdateProfile||this.person.ability.canManageEmail||this.args.close();const e=this.session.currentPerson===this.person?this.session.user:this.person;e&&(this.form=this.formsHandler.createForm(bt,[e]))}}),null,"loadModelTask",null)),this.loadModelTask.perform()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}async submitForm(e){await this.formsHandler.submitForm(e),this.session.currentPerson===this.person&&this.store.findRecord("person",this.args.personId,{reload:!0}),this.closeModal()}};L((mt=St).prototype,"store",[w]),L(mt.prototype,"can",[w]),L(mt.prototype,"session",[w]),L(mt.prototype,"formsHandler",[w]),L(mt.prototype,"ui",[w]),L(mt.prototype,"flags",[w]),L(mt.prototype,"form",[R]),L(mt.prototype,"person",[R]),p(mt.prototype,"closeModal",[j]),p(mt.prototype,"submitForm",[j]),s(Ae({i
2d:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-profile-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,2],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,3],null,[["@showInfoMessage","@form","@personAbility","@isAvatarHidden","@submitForm","@cancel"],[[30,0,["showInfoMessage"]],[30,0,["form"]],[28,[32,4],["person",[30,0,["person"]]],null],[30,0,["flags","avatarInlineEdit"]],[30,0,["submitForm"]],[30,0,["closeModal"]]]],null],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,LoadingSpinner:_,UserProfileForm:dt,ability:A}),isStrictMode:!0}),mt);var At=new WeakMap,Nt=new WeakMap,Et=class extends de{constructor(...e){super(...e),he(this,At,void ke(this,"store")),he(this,Nt,void ke(this,"serviceTypes"))}get modelServiceTypes(){var e,o;return null!==(o=null===(e=this.model.serviceTypeAssignments)||void 0===e?void 0:e.map(e=>e.serviceType))&&void 0!==o?o:[]}async submit(){const e=this.modelServiceTypes,o=P(this.serviceTypes,e),t=P(e,this.serviceTypes);try{for(const t of o)await this.store.createRecord("service-type-assignment",{serviceType:t,person:this.model}).save();const e=t.map(e=>{var o,t;return(null!==(t=null===(o=this.model.serviceTypeAssignments)||void 0===o?void 0:o.slice())&&void 0!==t?t:[]).find(o=>o.serviceType===e)}).filter(Boolean);for(const o of e)await o.destroyRecord()}catch(n){this.handleSubmitErrorResponse(n)}}};L((kt=Et).prototype,"store",[w]),L(kt.prototype,"serviceTypes",[oe({getValue:e=>e.modelServiceTypes,applyValue(){}})]);var Ut,Wt={description:"_description_1ex0g_1"},Pt=new WeakMap,xt=new WeakMap,Dt=new WeakMap,Lt=new WeakMap,Ot=new WeakMap,Ht=class extends Q{constructor(e,o){super(e,o),he(this,Pt,void ke(this,"store")),he(this,xt,void ke(this,"can")),he(this,Dt,void ke(this,"formsHandler")),he(this,Lt,void ke(this,"ui")),he(this,Ot,void ke(this,"form")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){const e=yield this.store.findRecord("person",this.args.personId);e.ability.canUpdateServiceTypeAssignments||this.args.close(),yield Ce.on(this).forPerson(e).depaginate().withContext("edit-user-service-type-assignments-modal").run(),this.form=this.formsHandler.createForm(Et,[e])}}),null,"loadModelTask",null)),this.loadModelTask.perform()}async submitForm(e){await this.formsHandler.submitForm(e),this.closeModal()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}loadAllServiceTypes(){return K.on(this).loadAllServiceTypes()}};L((Ut=Ht).prototype,"store",[w]),L(Ut.prototype,"can",[w]),L(Ut.prototype,"formsHandler",[w]),L(Ut.prototype,"ui",[w]),L(Ut.prototype,"form",[R]),p(Ut.prototype,"submitForm",[j]),p(Ut.prototype,"closeModal",[j]),p(Ut.prototype,"loadAllServiceTypes",[j]),s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-service-type-assignments-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n  "],[10,0],[15,0,[32,2,["description"]]],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.edit-user-service-type-assignments-modal.description"],null]],[1,"\\n  "],[13],[1,"\\n\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,3],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,4],null,[["@object","@submitForm"],[[30,0,["form"]],[30,0,["submitForm"]]]],[["default"],[[[[1,"\\n      "],[8,[30,2,["SelectField"]],[[24,0,"field"]],[["@propertyName","@preloadOptions","@optionLabelPath","@placeholder","@isMultiselect","@modelName","@dropdownMatchTriggerWidth","@dropdownPositionRule"],["serviceTypes",[30,0,["loadAllServiceTypes"]],"name",[28,[32,1],["components.people.edit-user-service-type-assignments-modal.selectPlaceholder"],null],true,"service-type",true,"vertical|below-above|left-center-right"]],null],[1,"\\n\\n      "],[8,[30,2,["FormActions"]],null,[["@secondaryAction"],[[30,3]]],null],[1,"\\n    "]],[2]]]]],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs","f","@close"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,styles:Wt,LoadingSpinner:_,FormFor:ve}),isStrictMode:!0}),Ut);var Vt,zt=Me(fe,e=>e.activeAndSorted()),qt=s(Ae({id:null,block:'[[[8,[32,0],[[24,0,"person-user-subsidiary-form"],[17,1]],[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n  "],[8,[30,4,["SelectField"]],null,[["@propertyName","@label","@optionLabelPath","@buildQuery","@isClearButtonEnabled"],["subsidiary",[28,[32,1],["components.people.user-sub
2sidiary-form.subsidiary"],null],"name",[32,2],false]],null],[1,"\\n\\n  "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,1],["components.people.user-subsidiary-form.updatePerson"],null],[30,5]]],null],[1,"\\n"]],[4]]]]]],["&attrs","@form","@submitForm","f","@cancel"],[]]',moduleName:"(unknown template module)",scope:()=>({FormFor:ve,t:a,subsidiaryQuery:zt}),isStrictMode:!0}),o()),Bt=new WeakMap,Qt=new WeakMap,Jt=class extends de{constructor(...e){super(...e),he(this,Bt,void ke(this,"formsHandler")),he(this,Qt,void ke(this,"subsidiary"))}async beforeSubmit(){await super.beforeSubmit(),y(this)&&await this.formsHandler.confirmExternalSyncIfNeeded(this.model)}};L((Vt=Jt).prototype,"formsHandler",[w]),L(Vt.prototype,"subsidiary",[oe({})]);var jt,Yt={description:"_description_1ex0g_1"},Gt=new WeakMap,Kt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,$t=new WeakMap,en=class extends Q{constructor(e,o){super(e,o),he(this,Gt,void ke(this,"store")),he(this,Kt,void ke(this,"formsHandler")),he(this,Xt,void ke(this,"ui")),he(this,Zt,void ke(this,"can")),he(this,$t,void ke(this,"form")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){const e=yield this.store.findRecord("person",this.args.personId);e.ability.canUpdatePersonSubsidiary?this.form=this.formsHandler.createForm(Jt,[e]):this.args.close()}}),null,"loadModelTask",null)),this.loadModelTask.perform()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}async submitForm(e){return this.formsHandler.submitForm(e).then(()=>{this.closeModal()})}};L((jt=en).prototype,"store",[w]),L(jt.prototype,"formsHandler",[w]),L(jt.prototype,"ui",[w]),L(jt.prototype,"can",[w]),L(jt.prototype,"form",[R]),p(jt.prototype,"closeModal",[j]),p(jt.prototype,"submitForm",[j]),s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-subsidiary-modal.modalTitleSubsidiary"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n  "],[10,0],[15,0,[32,2,["description"]]],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.edit-user-subsidiary-modal.descriptionSubsidiary"],null]],[1,"\\n  "],[13],[1,"\\n\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,3],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,4],null,[["@form","@submitForm","@cancel"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["closeModal"]]]],null],[1,"\\n  "]],[]],null]],[]]],[1,"\\n"],[41,[30,0,["can","app","canManageSubsidiaries"]],[[[1,"    "],[8,[32,5],null,[["@params"],[[28,[32,6],["organization.settings.subsidiaries"],null]]],[["default"],[[[[1,"\\n      "],[1,[28,[32,1],["components.people.edit-user-subsidiary-modal.addNewSubsidiary"],null]],[1,"\\n    "]],[]]]]],[1,"\\n"]],[]],null]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,styles:Yt,LoadingSpinner:_,UserSubsidiaryForm:qt,Link:n,__keyword__array:m}),isStrictMode:!0}),jt);var on,tn=s(Ae({id:null,block:'[[[8,[32,0],[[24,0,"person-user-title-form"],[17,1]],[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n  "],[8,[30,4,["InputField"]],null,[["@propertyName","@label","@autofocus"],["title",[28,[32,1],["components.people.user-title-form.jobTitle"],null],true]],null],[1,"\\n\\n  "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,1],["components.people.user-title-form.updateUser"],null],[30,5]]],[["default"],[[[[1,"\\n    "],[8,[30,4,["FormErrors"]],null,[["@mode"],["popover"]],null],[1,"\\n  "]],[]]]]],[1,"\\n"]],[4]]]]]],["&attrs","@form","@submitForm","f","@cancel"],[]]',moduleName:"(unknown template module)",scope:()=>({FormFor:ve,t:a}),isStrictMode:!0}),o()),nn=new WeakMap,sn=new WeakMap,ln=class extends de{constructor(...e){super(...e),he(this,nn,void ke(this,"formsHandler")),he(this,sn,void ke(this,"title"))}async beforeSubmit(){await super.beforeSubmit(),y(this)&&await this.formsHandler.confirmExter
2nalSyncIfNeeded(this.model)}};L((on=ln).prototype,"formsHandler",[w]),L(on.prototype,"title",[oe({})]);var rn,an,pn={description:"_description_1ex0g_1"},dn=new WeakMap,mn=new WeakMap,un=new WeakMap,cn=new WeakMap,hn=class extends Q{constructor(...e){super(...e),he(this,dn,void ke(this,"store")),he(this,mn,void ke(this,"formsHandler")),he(this,un,void ke(this,"ui")),Se(this,"personRequest",ye(this,async()=>{const e=await this.store.findRecord("person",this.args.personId);return e.ability.canUpdateTitle||this.args.close(),e})),he(this,cn,void ke(this,"form"))}async submitForm(e){await this.formsHandler.submitForm(e),this.closeModal()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}};L((rn=hn).prototype,"store",[w]),L(rn.prototype,"formsHandler",[w]),L(rn.prototype,"ui",[w]),L(rn.prototype,"form",[Te],function(){return Re(({on:e})=>{const o=this.personRequest.value;if(!o)return;const t=this.formsHandler.createForm(ln,[o]);return e.cleanup(()=>{t.destroy()}),t})}),p(rn.prototype,"submitForm",[j]),p(rn.prototype,"closeModal",[j]),s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-title-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n  "],[10,0],[15,0,[32,2,["description"]]],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.edit-user-title-modal.description"],null]],[1,"\\n  "],[13],[1,"\\n\\n"],[41,[30,0,["form"]],[[[1,"    "],[8,[32,3],null,[["@form","@submitForm","@cancel"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["closeModal"]]]],null],[1,"\\n"]],[]],[[[1,"    "],[8,[32,4],null,null,null],[1,"\\n"]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,styles:pn,UserTitleForm:tn,LoadingSpinner:_}),isStrictMode:!0}),rn);var fn,yn=class extends Q{constructor(...e){super(...e),Se(this,"timeUnlockedMaxDate",new Date)}onTimeIntervalChange(e){const{intervalId:o,startDate:t,endDate:n}=e;
2this.args.form.timeUnlockedStartDate=t,this.args.form.timeUnlockedEndDate=n,this.args.form.timeUnlockedPeriodId=o}};p((an=yn).prototype,"onTimeIntervalChange",[j]),s(Ae({id:null,block:'[[[8,[32,0],[[24,0,"person-unlock-timetracking-form"],[17,1]],[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n  "],[10,0],[14,0,"person-unlock-timetracking-form__description-text"],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.unlock-timetracking-form.description"],null]],[1,"\\n  "],[13],[1,"\\n  "],[10,0],[14,0,"person-unlock-timetracking-form__subtitle"],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.unlock-timetracking-form.settings"],null]],[1,"\\n  "],[13],[1,"\\n  "],[10,0],[14,0,"person-unlock-timetracking-form__description-text"],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.unlock-timetracking-form.settingsDescription"],null]],[1,"\\n  "],[13],[1,"\\n  "],[10,0],[14,0,"person-unlock-timetracking-form__row"],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.unlock-timetracking-form.unlock"],null]],[1,"\\n    "],[8,[32,2],[[24,0,"person-unlock-timetracking-form__time-interval-field person-unlock-timetracking-form__inbetween-field"]],[["@startDate","@endDate","@maxDate","@intervalId","@onChange","@enabledDateIntervalTypes"],[[30,2,["timeUnlockedStartDate"]],[30,2,["timeUnlockedEndDate"]],[30,0,["timeUnlockedMaxDate"]],[30,2,["timeUnlockedPeriodId"]],[30,0,["onTimeIntervalChange"]],[28,[32,3],[[32,4,["RELATIVE"]],[32,4,["CALENDAR"]]],null]]],null],[1,"\\n  "],[13],[1,"\\n  "],[10,0],[14,0,"person-unlock-timetracking-form__row"],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.unlock-timetracking-form.keepUnlockedFor"],null]],[1,"\\n    "],[8,[30,4,["InputField"]],[[24,0,"person-unlock-timetracking-form__inbetween-field person-unlock-timetracking-form__interval-input-field"]],[["@propertyName","@isInline","@min"],["timeUnlockedInterval",true,1]],null],[1,"\\n\\n    "],[1,[28,[32,1],["components.people.unlock-timetracking-form.dayOrDays"],[["count"],[[30,2,["timeUnlockedInterval"]]]]]],[1,"\\n  "],[13],[1,"\\n  "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,1],["components.people.unlock-timetracking-form.unlockTimeEntries"],null],[30,5]]],null],[1,"\\n"]],[4]]]]]],["&attrs","@form","@submitForm","f","@cancel"],[]]',moduleName:"(unknown template module)",scope:()=>({FormFor:ve,t:a,TimeIntervalField:q,__keyword__array:m,DateIntervalType:te}),isStrictMode:!0}),an);var vn,gn=new WeakMap,bn=new WeakMap,kn=new WeakMap,Mn=new WeakMap,wn=class extends de{constructor(...e){super(...e),he(this,gn,void ke(this,"timeUnlockedStartDate")),he(this,bn,void ke(this,"timeUnlockedEndDate")),he(this,kn,void ke(this,"timeUnlockedInterval")),he(this,Mn,void ke(this,"timeUnlockedPeriodId"))}async beforeSubmit(){await super.beforeSubmit(),this.model.timeUnlockedOn=new Date,this.model.timeUnlocked=!0}};L((fn=wn).prototype,"timeUnlockedStartDate",[oe({validations:{presence:!0}})]),L(fn.prototype,"timeUnlockedEndDate",[oe({validations:{presence:!0}})]),L(fn.prototype,"timeUnlockedInterval",[oe({getValue(){},validations:{presence:!0,numericality:{onlyInteger:!0,greaterThanOrEqualTo:1}}})]),L(fn.prototype,"timeUnlockedPeriodId",[oe({getValue(){},validations:{presence:!0}})]);var Tn=new WeakMap,Fn=new WeakMap,_n=new WeakMap,Cn=new WeakMap,In=new WeakMap,Rn=new WeakMap,Sn=class extends Q{constructor(e,o){super(e,o),he(this,Tn,void ke(this,"store")),he(this,Fn,void ke(this,"can")),he(this,_n,void ke(this,"formsHandler")),he(this,Cn,void ke(this,"ui")),he(this,In,void ke(this,"session")),he(this,Rn,void ke(this,"form")),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){var e;const o=yield this.store.findRecord("person",this.args.personId);o.ability.canManageLockedTimeEntries&&(null===(e=this.session.organization)||void 0===e?void 0:e.timeLocking)||this.args.close(),this.form=this.formsHandler.createForm(wn,[o])}}),null,"loadModelTask",null)),this.loadModelTask.perform()}async submitForm(e){await this.formsHandler.submitForm(e),this.closeModal()}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}};L((vn=Sn).prototype,"store",[w]),L(vn.prototype,"can",[w]),L(vn.prototype,"formsHandler",[w]),L(vn.prototype,"ui",[w]),L(vn.prototype,"session",[w]),L(vn.prototype,"form",[R]),p(vn.prototype,"submitForm",[j]),p(vn.prototype,"closeModal",[j]),s(Ae({i
2d:null,block:'[[[8,[32,0],[[17,1]],[["@title","@close"],[[28,[32,1],["components.people.edit-user-unlock-timetracking-modal.modalTitle"],null],[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,2],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,3],null,[["@form","@submitForm","@cancel"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["closeModal"]]]],null],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,LoadingSpinner:_,UnlockTimetrackingForm:yn}),isStrictMode:!0}),vn);var An,Nn,En=s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@object","@submitForm"],[[30,2],[30,3]]],[["default"],[[[[1,"\\n  "],[10,0],[14,0,"person-modal-merge-contact-form__description"],[12],[1,"\\n    "],[1,[28,[32,1],["components.people.merge-contact-form.description"],null]],[1,"\\n  "],[13],[1,"\\n\\n  "],[10,0],[14,0,"person-modal-merge-contact-form__form-section"],[12],[1,"\\n    "],[10,0],[14,0,"person-modal-merge-contact-form__loser-label"],[12],[1,[28,[32,1],["components.people.merge-contact-form.loserContact"],null]],[13],[1,"\\n    "],[10,0],[14,0,"person-modal-merge-contact-form__loser-person"],[12],[1,"\\n      "],[8,[32,2],[[24,0,"mr-3"]],[["@model"],[[30,2,["model"]]]],null],[1,"\\n\\n      "],[10,0],[14,0,"person-modal-merge-contact-form__name"],[12],[1," "],[1,[30,2,["model","fullName"]]],[1," "],[13],[1,"\\n    "],[13],[1,"\\n    "],[10,0],[14,0,"person-modal-merge-contact-form__loser-email"],[12],[1,"\\n      "],[8,[32,3],[[24,0,"person-modal-merge-contact-form__email-icon"]],null,null],[1,"\\n      "],[1,[30,2,["model","email"]]],[1,"\\n    "],[13],[1,"\\n\\n    "],[8,[32,4],[[24,0,"person-modal-merge-contact-form__arrow"]],null,null],[1,"\\n\\n    "],[10,0],[14,0,"person-modal-merge-contact-form__winner-label"],[12],[1,[28,[32,1],["components.people.merge-contact-form.winnerContact"],null]],[13],[1,"\\n    "],[8,[30,4,["SelectField"]],[[24,0,"person-modal-merge-contact-form__winner-select"]],[["@propertyName","@optionLabelPath","@optionIconPath","@placeholder","@searchAction","@isClearButtonEnabled"],["winner","name","avatarUrl",[28,[32,1],["components.people.merge-contact-form.selectContact"],null],[30,5],false]],[["default"],[[[[1,"\\n"],[41,[30,7,["isInTrigger"]],[[[1,"        "],[8,[30,7,["ItemComponent"]],null,null,null],[1,"\\n"]],[]],[[[1,"        "],[8,[30,7,["ItemComponent"]],[[24,0,"person-modal-merge-contact-form__select-item"]],null,[["default"],[[[[1,"\\n          "],[10,0],[14,0,"person-modal-merge-contact-form__select-item-email"],[12],[1," "],[1,[30,6,["email"]]],[1," "],[13],[1,"\\n        "]],[]]]]],[1,"\\n"]],[]]],[1,"    "]],[6,7]]]]],[1,"\\n\\n"],[41,[30,2,["winner"]],[[[1,"      "],[10,0],[14,0,"person-modal-merge-contact-form__winner-email"],[12],[1,"\\n        "],[8,[32,3],[[24,0,"person-modal-merge-contact-form__email-icon"]],null,null],[1,"\\n        "],[1,[30,2,["winner","email"]]],[1,"\\n      "],[13],[1,"\\n"]],[]],null],[1,"  "],[13],[1,"\\n\\n"],[41,[30,2,["winner"]],[[[1,"    "],[10,0],[14,0,"person-modal-merge-contact-form__warning"],[12],[1,"\\n      "],[1,[28,[32,1],["components.people.merge-contact-form.mergeWarning"],[["loserName","winnerName","htmlSafe"],[[30,2,["model","fullName"]],[30,2,["winner","fullName"]],true]]]],[1,"\\n    "],[13],[1,"\\n"]],[]],null],[1,"\\n  "],[8,[30,4,["FormActions"]],null,[["@submitLabel","@secondaryAction"],[[28,[32,1],["components.people.merge-contact-form.mergeContact"],null],[30,8]]],null],[1,"\\n"]],[4]]]]]],["&attrs","@form","@submitForm","f","@searchContacts","item","options","@cancel"],["if"]]',moduleName:"(unknown template module)",scope:()=>({FormFor:ve,t:a,ModelAvatar:k,IconEnvelopeSimple:ue,IconArrowRight:ce}),isStrictMode:!0}),o()),Un=new WeakMap,Wn=new WeakMap,Pn=class extends de{constructor(...e){super(...e),he(this,Un,void ke(this,"apiAction")),he(this,Wn,void ke(this,"winner"))}async submit(){await this.apiAction.memberAction("merge",this.model,{context:this.winner})}};L((An=Pn).prototype,"apiAction",[w]),L(An.prototype,"winner",[oe({applyValue:()=>{},validations:{presence:!0}})]);var xn=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,On=new WeakMap,Hn=new WeakMap,Vn=class extends Q{constructor(e,o){super(e,o),he(this,xn,void ke(this,"store")),he(this,Dn,void ke(this,"formsHandler")),he(this,Ln,void ke(this,"ui")),he(this,On,void ke(this,"routing")),he(this,Hn,void ke(this,"form")),Se(this,"person",void 0),Se(this,"loadModelTask",ge(()=>({context:this,generator:function*(){this.person=yield this.store.findRecord("person",this.args.personId),this.person.ability.canMerge||this.args.close(),this.form=this.formsHandler.createForm(Pn,[this.person])}}),null,"loadModelTask",null)),this.loadModelTask.perform()}searchContacts(e){return ie.on(this).active().query(e).perPageForSearch().withContext("merge-contact-modal").run().then(e=>e.filter(e=>e!==this.person))}async submitForm(e){const o=e.winner;await this.formsHandler.submitForm(e),this.routing.transitionTo("organization.person",o)}async closeModal(){var e;(null===(e=this.form)||void 0===e?void 0:e.isDirty)&&!(await this.ui.confirmFormLoss([this.form]))||this.args.close()}willDestroy(){var e;super.willDestroy(),null===(e=this.form)||void 0===e||e.destroy()}};L((Nn=Vn).prototype,"store",[w]),L(Nn.prototype,"formsHandler",[w]),L(Nn.prototype,"ui",[w]),L(Nn.prototype,"rout
2ing",[w]),L(Nn.prototype,"form",[R]),p(Nn.prototype,"searchContacts",[j]),p(Nn.prototype,"submitForm",[j]),p(Nn.prototype,"closeModal",[j]),s(Ae({id:null,block:'[[[8,[32,0],[[17,1]],[["@title","@size","@close"],[[28,[32,1],["components.people.merge-contact-modal.title"],null],"large",[30,0,["closeModal"]]]],[["default"],[[[[1,"\\n"],[41,[30,0,["loadModelTask","isRunning"]],[[[1,"    "],[8,[32,2],null,null,null],[1,"\\n"]],[]],[[[41,[30,0,["form"]],[[[1,"    "],[8,[32,3],null,[["@form","@submitForm","@searchContacts","@cancel"],[[30,0,["form"]],[30,0,["submitForm"]],[30,0,["searchContacts"]],[30,0,["closeModal"]]]],null],[1,"\\n  "]],[]],null]],[]]]],[]]]]]],["&attrs"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Modal:F,t:a,LoadingSpinner:_,MergeContactForm:En}),isStrictMode:!0}),Nn);var zn,qn=e({default:()=>es}),Bn=new WeakMap,Qn=new WeakMap,Jn=new WeakMap,jn=new WeakMap,Yn=new WeakMap,Gn=new WeakMap,Kn=new WeakMap,Xn=new WeakMap,Zn=new WeakMap,$n=class extends Q{constructor(...e){super(...e),he(this,Bn,void ke(this,"apiAction")),he(this,Qn,void ke(this,"ui")),he(this,Jn,void ke(this,"intl")),he(this,jn,void ke(this,"metrics")),he(this,Yn,void ke(this,"subscription")),he(this,Gn,void ke(this,"settings")),he(this,Kn,void ke(this,"routing")),he(this,Xn,void ke(this,"flags")),he(this,Zn,void ke(this,"lazyAiContext"))}resendInvitation(e){this.args.controller.isInviting=!0,this.apiAction.newAction("person:resendInvitation",[e]).then(()=>this.ui.buildModal().title(this.intl.t("templates.organization.person.invitationResent",{fullName:e.fullName})).alert()).finally(()=>{this.args.controller.isInviting=!1})}openOffboardingModal(){this.args.controller.set("isOffboardingModalActive",!0)}async activatePerson(e){var o;const t=(null===(o=e.customRole)||void 0===o?void 0:o.isTimeTracker)?1:0;return this.ui.buildModal().title(this.intl.t("templates.organization.person.questionPersonActivation")).withComponent(E,{seatsChanged:t}).withLoadingAction(()=>this.apiAction.newAction("person:activate",[e]).then(()=>{var e;null===(e=this.subscription.organizationSubscription)||void 0===e||e.reload(),this.metrics.event("person-activate").track()})).confirm({returnResult:!0})}async archivePerson(e){await this.ui.buildModal().title(this.intl.t("templates.organization.person.questionContactArchival")).confirm({returnResult:!0})&&(await this.ui.adapterCall({run:()=>this.apiAction.newAction("person:archive",[e])}),this.ui.buildFlash().message(this.intl.t("templates.organization.person.contactArchivation")).showInfo())}async restorePerson(e){await this.ui.buildModal().title(this.intl.t("templates.organization.person.questionContactRestoration")).confirm({returnResult:!0})&&(await this.ui.adapterCall({run:()=>this.apiAction.newAction("person:restore",[e])}),this.ui.buildFlash().message(this.intl.t("templates.organization.person.contactRestoration")).showInfo())}async convertToNonVirtualUser(e){await this.ui.buildModal().title(this.intl.t("templates.organization.person.questionConversion",{fullName:e.fullName})).withLoadingAction(()=>(e.virtual=!1,e.save().then(()=>this.ui.buildFlash().message(this.intl.t("templates.organization.person.userConvertion")).showInfo()))).confirm({returnResult:!0})}async convertToVirtualUser(e){await this.ui.buildModal().title(this.intl.t("templates.organization.person.questionLoginRevocation",{fullName:e.fullName})).withLoadingAction(async()=>{try{const o=await this.apiAction.newAction("person:virtualize",[e]);this.ui.showSaveSuccessFlash(this.intl.t("templates.organization.person.loginRevocation",{fullName:o.fullName}))}catch(o){this.ui.showSaveErrorFlash(this.intl.t("templates.organization.person.loginRevokeFailure",{fullName:e.fullName}))}}).confirm({returnResult:!0})}closePersonModal(){this.args.controller.route.closeModal()}closeModal(){this.args.controller.set("isOffboardingModalActive",!1)}};L((zn=$n).prototype,"apiAction",[w]),L(zn.prototype,"ui",[w]),L(zn.prototype,"intl",[w]),L(zn.prototype,"metrics",[w]),L(zn.prototype,"subscription",[w]),L(zn.prototype,"settings",[w]),L(zn.prototype,"routing",[w]),L(zn.prototype,"flags",[w]),L(zn.prototype,"lazyAiContext",[Te],function(){return $(async()=>(await i(async()=>{const{default:e}=await import("./context-COtBVUVZ.js");return{default:e}},__vite__mapDeps([0,1,2,3]))).default)}),p(zn.prototype,"resendInvitation",[j]),p(zn.prototype,"openOffboardingModal",[j]),p(zn.prototype,"activatePerson",[j]),p(zn.prototype,"archivePerson",[j]),p(zn.prototype,"restorePerson",[j]),p(zn.prototype,"convertToNonVirtualUser",[j]),p(zn.prototype,"convertToVirtualUser",[j]),p(zn.prototype,"closePersonModal",[j]),p(zn.prototype,"closeModal",[j]),s(Ae({i
2d:null,block:'[[[1,[28,[32,0],[[30,1,["fullName"]]],null]],[1,"\\n\\n"],[8,[30,0,["lazyAiContext","component"]],null,[["@contextItem"],[[28,[32,1],null,[["type","title","person"],["person",[28,[32,2],[[30,1,["fullName"]],""],null],[28,[32,1],null,[["id"],[[30,1,["id"]]]]]]]]]],null],[1,"\\n\\n"],[8,[32,3],null,[["@ariaLabel","@isFlat","@isSidebar","@isCloseButtonHidden","@hasBigHeader","@isHeaderInContainer","@close"],[[28,[32,4],["templates.organization.person.person"],null],true,[30,0,["settings","personInSidebarLayout"]],true,true,false,[30,0,["closePersonModal"]]]],[["header","default"],[[[[1,"\\n"],[41,[30,2,["personFormAggregate"]],[[[1,"      "],[8,[32,5],null,[["@person","@formAggregate","@closeModal","@activatePerson","@archivePerson","@restorePerson","@resendInvitation","@convertToNonVirtualUser","@convertToVirtualUser","@deactivatePerson","@isInviting"],[[30,2,["person"]],[30,2,["personFormAggregate"]],[30,0,["closePersonModal"]],[30,0,["activatePerson"]],[30,0,["archivePerson"]],[30,0,["restorePerson"]],[30,0,["resendInvitation"]],[30,0,["convertToNonVirtualUser"]],[30,0,["convertToVirtualUser"]],[30,0,["openOffboardingModal"]],[30,2,["isInviting"]]]],null],[1,"\\n"]],[]],null],[1,"  "]],[]],[[[1,"\\n    "],[46,[28,[31,2],null,null],null,null,null],[1,"\\n  "]],[]]]]],[1,"\\n\\n"],[41,[30,2,["isOffboardingModalActive"]],[[[1,"  "],[8,[32,6],null,[["@person","@close"],[[30,2,["person"]],[30,0,["closeModal"]]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[8,[32,7],null,[["@qp"],["edit-profile"]],[["default"],[[[[1,"\\n"],[41,[30,3],[[[1,"    "],[8,[32,8],null,[["@personId","@close"],[[30,3],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-profile"],null]]],null],[1,"\\n"]],[]],null]],[3]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-user-nickname"]],[["default"],[[[[1,"\\n"],[41,[30,4],[[[1,"    "],[8,[32,10],null,[["@personId","@close"],[[30,4],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-user-nickname"],null]]],null],[1,"\\n"]],[]],null]],[4]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-user-title"]],[["default"],[[[[1,"\\n"],[41,[30,5],[[[1,"    "],[8,[32,11],null,[["@personId","@close"],[[30,5],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-user-title"],null]]],null],[1,"\\n"]],[]],null]],[5]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-user-subsidiary"]],[["default"],[[[[1,"\\n"],[41,[30,6],[[[1,"    "],[8,[32,12],null,[["@personId","@close"],[[30,6],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-user-subsidiary"],null]]],null],[1,"\\n"]],[]],null]],[6]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-manager"]],[["default"],[[[[1,"\\n"],[41,[30,7],[[[1,"    "],[8,[32,13],null,[["@personId","@close"],[[30,7],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-manager"],null]]],null],[1,"\\n"]],[]],null]],[7]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-user-service-type-assignments"]],[["default"],[[[[1,"\\n"],[41,[30,8],[[[1,"    "],[8,[32,14],null,[["@personId","@close"],[[30,8],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-user-service-type-assignments"],null]]],null],[1,"\\n"]],[]],null]],[8]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-contact"]],[["default"],[[[[1,"\\n"],[41,[30,9],[[[1,"    "],[8,[32,15],null,[["@personId","@close"],[[30,9],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-contact"],null]]],null],[1,"\\n"]],[]],null]],[9]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-user-lock-timetracking"]],[["default"],[[[[1,"\\n"],[41,[30,10],[[[1,"    "],[8,[32,16],null,[["@personId","@close"],[[30,10],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-user-lock-timetracking"],null]]],null],[1,"\\n"]],[]],null]],[10]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-user-unlock-timetracking"]],[["default"],[[[[1,"\\n"],[41,[30,11],[[[1,"    "],[8,[32,17],null,[["@personId","@close"],[[30,11],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-user-unlock-timetracking"],null]]],null],[1,"\\n"]],[]],null]],[11]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["merge-contact"]],[["default"],[[[[1,"\\n"],[41,[30,12],[[[1,"    "],[8,[32,18],null,[["@personId","@close"],[[30,12],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"merge-contact"],null]]],null],[1,"\\n"]],[]],null]],[12]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["
2invite-contact"]],[["default"],[[[[1,"\\n"],[41,[30,13],[[[1,"    "],[8,[32,19],null,[["@personId","@close","@isInviteMode"],[[30,13],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"invite-contact"],null],true]],null],[1,"\\n"]],[]],null]],[13]]]]],[1,"\\n\\n"],[8,[32,7],null,[["@qp"],["edit-permissions"]],[["default"],[[[[1,"\\n"],[41,[30,14],[[[1,"    "],[8,[32,19],null,[["@personId","@close","@isInviteMode"],[[30,14],[28,[32,9],[[30,0,["routing","clearQueryParam"]],"edit-permissions"],null],false]],null],[1,"\\n"]],[]],null]],[14]]]]]],["@model","@controller","qpVal","qpVal","qpVal","qpVal","qpVal","qpVal","qpVal","qpVal","qpVal","qpVal","qpVal","qpVal"],["if","component","-outlet"]]',moduleName:"(unknown template module)",scope:()=>({pageTitle:G,__keyword__hash:ae,__keyword__or:T,FullscreenModal:S,t:a,PersonProfileHeader:le,OffboardingModal:l,OnQueryParam:B,EditUserProfileModal:St,__keyword__fn:c,EditUserNicknameModal:ko,EditUserTitleModal:hn,EditUserSubsidiaryModal:en,EditUserManagerModal:ro,EditUserServiceTypeAssignmentsModal:Ht,EditContactModal:Ve,EditUserLockTimetrackingModal:Xe,EditUserUnlockTimetrackingModal:Sn,MergeContactModal:Vn,EditUserPermissionsModal:rt}),isStrictMode:!0}),zn);var es=Z($n),os={};os["productive/templates/organization/person"]=qn,os["productive/routes/organization/person"]=Ne;export{os as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.