PageSourceSearch

https://hr.sdu.edu.kz/assets/Page-BwcdBfZZ.js

js sdu.edu.kz collected 2026-10-02 03:27:23 UTC 38,930 bytes, 84 lines download raw bytes

1import{B as Ae,b6 as qe,at as Fe,i as be,aP as ge,be as Be,bh as Ee,bi as Re,bl as ze,bb as oe,bj as se,bk as Ue,az as ee,bp as te,aw as pe,m as $,av as Ne,an as Ge,o as s,h as I,a as C,ah as He,c as T,q as he,ao as me,l as S,t as L,r as fe,w as M,b as K,aq as Qe,k as le,F as R,C as G,e as ne,E as je,f as q,H as Ze,Z as Y,g as m,S as F,K as ie,T as ke,aa as ae,L as U,R as H,d as Q,D as Ye,s as j,y as r,ae as re,a3 as E,Y as ce,O as W,aG as We,aT as ye,G as Ce,ag as Je,P as Ie,a6 as Xe,M as we,N as xe}from"./index-z4Y8wKMa.js";import{s as de}from"./index-BJkC9QTU.js";import{u as Le}from"./index-DC2Aa-GC.js";import{i as N}from"./invalidateProfileQueries-BCDxIOoW.js";import{s as et}from"./index-Cz4J9ZgO.js";import{u as tt}from"./index-DySVJfXJ.js";import{u as nt}from"./index-qTPx00i4.js";import{_ as it}from"./FilePreviewModal.vue_vue_type_script_setup_true_lang-BTPxXfh_.js";import"./enums-CNosjovb.js";import"./enums-qLN8jgzO.js";import"./enums-B2K47oZZ.js";var at=`
2    .p-menu {
3        background: dt('menu.background');
4        color: dt('menu.color');
5        border: 1px solid dt('menu.border.color');
6        border-radius: dt('menu.border.radius');
7        min-width: 12.5rem;
8    }
9
10    .p-menu-list {
11        margin: 0;
12        padding: dt('menu.list.padding');
13        outline: 0 none;
14        list-style: none;
15        display: flex;
16        flex-direction: column;
17        gap: dt('menu.list.gap');
18    }
19
20    .p-menu-item-content {
21        transition:
22            background dt('menu.transition.duration'),
23            color dt('menu.transition.duration');
24        border-radius: dt('menu.item.border.radius');
25        color: dt('menu.item.color');
26        overflow: hidden;
27    }
28
29    .p-menu-item-link {
30        cursor: pointer;
31        display: flex;
32        align-items: center;
33        text-decoration: none;
34        overflow: hidden;
35        position: relative;
36        color: inherit;
37        padding: dt('menu.item.padding');
38        gap: dt('menu.item.gap');
39        user-select: none;
40        outline: 0 none;
41    }
42
43    .p-menu-item-label {
44        line-height: 1;
45    }
46
47    .p-menu-item-icon {
48        color: dt('menu.item.icon.color');
49    }
50
51    .p-menu-item.p-focus .p-menu-item-content {
52        color: dt('menu.item.focus.color');
53        background: dt('menu.item.focus.background');
54    }
55
56    .p-menu-item.p-focus .p-menu-item-icon {
57        color: dt('menu.item.icon.focus.color');
58    }
59
60    .p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
61        color: dt('menu.item.focus.color');
62        background: dt('menu.item.focus.background');
63    }
64
65    .p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {
66        color: dt('menu.item.icon.focus.color');
67    }
68
69    .p-menu-overlay {
70        box-shadow: dt('menu.shadow');
71    }
72
73    .p-menu-submenu-label {
74        background: dt('menu.submenu.label.background');
75        padding: dt('menu.submenu.label.padding');
76        color: dt('menu.submenu.label.color');
77        font-weight: dt('menu.submenu.label.font.weight');
78    }
79
80    .p-menu-separator {
81        border-block-start: 1px solid dt('menu.separator.border.color');
82    }
83`,ot={root:function(t){var n=t.props;return["p-menu p-component",{"p-menu-overlay":n.popup}]},start:"p-menu-start",list:"p-menu-list",submenuLabel:"p-menu-submenu-label",separator:"p-menu-separator",end:"p-menu-end",item:function(t){var n=t.instance;return["p-menu-item",{"p-focus":n.id===n.focusedOptionId,"p-disabled":n.disabled()}]},itemContent:"p-menu-item-content",itemLink:"p-menu-item-link",itemIcon:"p-menu-item-icon",itemLabel:"p-menu-item-label"},st=Ae.extend({name:"menu",style:at,classes:ot}),lt={name:"BaseMenu",extends:be,props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:[String,Object],default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:st,provide:function(){return{$pcMenu:this,$parentInstance:this}}},Se={name:"Menuitem",hostName:"Menu",extends:be,inheritAttrs:!1,emits:["item-click","item-mousemove"],props:{item:null,templates:null,id:null,focusedOptionId:null,index:null},methods:{getItemProp:function(t,n){return t&&t.item?Ne(t.item[n]):void 0},getPTOptions:function(t){return this.ptm(t,{context:{item:this.item,index:this.index,focused:this.isItemFocused(),disabled:this.disabled()}})},isItemFocused:function(){return this.focusedOptionId===this.id},onItemClick:function(t){var n=this.getItemProp(this.item,"command");n&&n({originalEvent:t,item:this.item.item}),this.$emit("item-click",{originalEvent:t,item:this.item,id:this.id})},onItemMouseMove:function(t){this.$emit("item-mousemove",{originalEvent:t,item:this.item,id:this.id})},visible:function(){return typeof this.item.visible=="function"?this.item.visible():this.item.visible!==!1},disabled:function(){return typeof this.item.disabled=="function"?this.item.disabled():this.item.disabled},label:function(){return typeof this.item.label=="function"?this.item.label():this.item.label},getMenuItemProps:function(t){return{action:$({class:this.cx("itemLink"),tabindex:"-1"},this.getPTOptions("itemLink")),icon:$({class:[this.cx("itemIcon"),t.icon]},this.getPTOptions("itemIcon")),label:$({class:this.cx("itemLabel")},this.getPTOptions("itemLabel"))}}},computed:{dataP:function(){return ge({focus:this.isItemFocused(),disabled:this.disabled()})}},directives:{ripple:Fe}}
83,rt=["id","aria-label","aria-disabled","data-p-focused","data-p-disabled","data-p"],ut=["data-p"],ct=["href","target"],dt=["data-p"],pt=["data-p"];function mt(e,t,n,a,p,i){var f=Ge("ripple");return i.visible()?(s(),I("li",$({key:0,id:n.id,class:[e.cx("item"),n.item.class],role:"menuitem",style:n.item.style,"aria-label":i.label(),"aria-disabled":i.disabled(),"data-p-focused":i.isItemFocused(),"data-p-disabled":i.disabled()||!1,"data-p":i.dataP},i.getPTOptions("item")),[C("div",$({class:e.cx("itemContent"),onClick:t[0]||(t[0]=function(g){return i.onItemClick(g)}),onMousemove:t[1]||(t[1]=function(g){return i.onItemMouseMove(g)}),"data-p":i.dataP},i.getPTOptions("itemContent")),[n.templates.item?n.templates.item?(s(),T(me(n.templates.item),{key:1,item:n.item,label:i.label(),props:i.getMenuItemProps(n.item)},null,8,["item","label","props"])):S("",!0):He((s(),I("a",$({key:0,href:n.item.url,class:e.cx("itemLink"),target:n.item.target,tabindex:"-1"},i.getPTOptions("itemLink")),[n.templates.itemicon?(s(),T(me(n.templates.itemicon),{key:0,item:n.item,class:he(e.cx("itemIcon"))},null,8,["item","class"])):n.item.icon?(s(),I("span",$({key:1,class:[e.cx("itemIcon"),n.item.icon],"data-p":i.dataP},i.getPTOptions("itemIcon")),null,16,dt)):S("",!0),C("span",$({class:e.cx("itemLabel"),"data-p":i.dataP},i.getPTOptions("itemLabel")),L(i.label()),17,pt)],16,ct)),[[f]])],16,ut)],16,rt)):S("",!0)}Se.render=mt;function ve(e){return bt(e)||vt(e)||yt(e)||ft()}function ft(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
84In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yt(e,t){if(e){if(typeof e=="string")return ue(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(e,t):void 0}}function vt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bt(e){if(Array.isArray(e))return ue(e)}function ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}var De={name:"Menu",extends:lt,inheritAttrs:!1,emits:["show","hide","focus","blur"],data:function(){return{overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted:function(){this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount:function(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&se.clear(this.container),this.container=null},methods:{itemClick:function(t){var n=t.item;this.disabled(n)||(n.command&&n.command(t),this.overlayVisible&&this.hide(),!this.popup&&this.focusedOptionIndex!==t.id&&(this.focusedOptionIndex=t.id))},itemMouseMove:function(t){this.focused&&(this.focusedOptionIndex=t.id)},onListFocus:function(t){this.focused=!0,!this.popup&&this.changeFocusedOptionIndex(0),this.$emit("focus",t)},onListBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onListKeyDown:function(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Enter":case"NumpadEnter":this.onEnterKey(t);break;case"Space":this.onSpaceKey(t);break;case"Escape":this.popup&&(ee(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide();break}},onArrowDownKey:function(t){var n=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(n),t.preventDefault()},onArrowUpKey:function(t){if(t.altKey&&this.popup)ee(this.target),this.hide(),t.preventDefault();else{var n=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(n),t.preventDefault()}},onHomeKey:function(t){this.changeFocusedOptionIndex(0),t.preventDefault()},onEndKey:function(t){this.changeFocusedOptionIndex(te(this.container,'li[data-pc-section="item"][data-p-disabled="false"]').length-1),t.preventDefault()},onEnterKey:function(t){var n=pe(this.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),a=n&&pe(n,'a[data-pc-section="itemlink"]');this.popup&&ee(this.target),a?a.click():n&&n.click(),t.preventDefault()},onSpaceKey:function(t){this.onEnterKey(t)},findNextOptionIndex:function(t){var n=te(this.container,'li[data-pc-section="item"][data-p-disabled="false"]'),a=ve(n).findIndex(function(p){return p.id===t});return a>-1?a+1:0},findPrevOptionIndex:function(t){var n=te(this.container,'li[data-pc-section="item"][data-p-disabled="false"]'),a=ve(n).findIndex(function(p){return p.id===t});return a>-1?a-1:0},changeFocusedOptionIndex:function(t){var n=te(this.container,'li[data-pc-section="item"][data-p-disabled="false"]'),a=t>=n.length?n.length-1:t<0?0:t;a>-1&&(this.focusedOptionIndex=n[a].getAttribute("id"))},toggle:function(t,n){this.overlayVisible?this.hide():this.show(t,n)},show:function(t,n){this.overlayVisible=!0,this.target=n??t.currentTarget},hide:function(){this.overlayVisible=!1,this.target=null},onEnter:function(t){Ue(t,{position:"absolute",top:"0"}),this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&se.set("menu",t,this.baseZIndex||this.$primevue.config.zIndex.menu),this.popup&&ee(this.list),this.$emit("show")},onLeave:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave:function(t){this.autoZIndex&&se.clear(t)},alignOverlay:function(){ze(this.container,this.target);var t=oe(this.target);t>oe(this.container)&&(this.container.style.minWidth=oe(this.target)+"px")},bindOutsideClickListener:function(){var t=this;this.outsideClickListener||(this.outsideClickListener=function(n){var a=t.container&&!t.container.contains(n.target),p=!(t.target&&(t.target===n.target||t.target.contains(n.target)));t.overlayVisible&&a&&p?t.hide():!t.popup&&a&&p&&(t.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener,!0))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener,!0),this.outsideClickListener=null)},bindScrollListener:function(){var t=this;this.scrollHandler||(this.scrollHandler=new Re(this.target,function(){t.overlayVisible&&t.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var t=this;this.resizeListener||(this.resizeListener=function(){t.overlayVisible&&!Ee()&&t.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:function(t){return typeof t.visible=="function"?t.visible():t.visible!==!1},disabled:function(t){return typeof t.disabled=="function"?t.disabled():t.disabled},label:function(t){return typeof t.label=="function"?t.label():t.label},onOverlayClick:function(t){Be.emit("overlay-click",{originalEvent:t,target:this.target})},containerRef:function(t){this.container=t},listRef:function(t){this.list=t}},computed:{focusedOptionId:function(){return this.focusedOptionIndex!==-1?this.focusedOptionIndex:null},dataP:function(){return ge({popup:this.popup})}},components:{PVMenuitem:Se,Portal:qe}}
84,gt=["id","data-p"],ht=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],kt=["id"];function Ct(e,t,n,a,p,i){var f=fe("PVMenuitem"),g=fe("Portal");return s(),T(g,{appendTo:e.appendTo,disabled:!e.popup},{default:M(function(){return[K(Qe,$({name:"p-anchored-overlay",onEnter:i.onEnter,onLeave:i.onLeave,onAfterLeave:i.onAfterLeave},e.ptm("transition")),{default:M(function(){return[!e.popup||p.overlayVisible?(s(),I("div",$({key:0,ref:i.containerRef,id:e.$id,class:e.cx("root"),onClick:t[3]||(t[3]=function(){return i.onOverlayClick&&i.onOverlayClick.apply(i,arguments)}),"data-p":i.dataP},e.ptmi("root")),[e.$slots.start?(s(),I("div",$({key:0,class:e.cx("start")},e.ptm("start")),[le(e.$slots,"start")],16)):S("",!0),C("ul",$({ref:i.listRef,id:e.$id+"_list",class:e.cx("list"),role:"menu",tabindex:e.tabindex,"aria-activedescendant":p.focused?i.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return i.onListFocus&&i.onListFocus.apply(i,arguments)}),onBlur:t[1]||(t[1]=function(){return i.onListBlur&&i.onListBlur.apply(i,arguments)}),onKeydown:t[2]||(t[2]=function(){return i.onListKeyDown&&i.onListKeyDown.apply(i,arguments)})},e.ptm("list")),[(s(!0),I(R,null,G(e.model,function(o,l){return s(),I(R,{key:i.label(o)+l.toString()},[o.items&&i.visible(o)&&!o.separator?(s(),I(R,{key:0},[o.items?(s(),I("li",$({key:0,id:e.$id+"_"+l,class:[e.cx("submenuLabel"),o.class],role:"none"},{ref_for:!0},e.ptm("submenuLabel")),[le(e.$slots,e.$slots.submenulabel?"submenulabel":"submenuheader",{item:o},function(){return[ne(L(i.label(o)),1)]})],16,kt)):S("",!0),(s(!0),I(R,null,G(o.items,function(v,u){return s(),I(R,{key:v.label+l+"_"+u},[i.visible(v)&&!v.separator?(s(),T(f,{key:0,id:e.$id+"_"+l+"_"+u,item:v,templates:e.$slots,focusedOptionId:i.focusedOptionId,unstyled:e.unstyled,onItemClick:i.itemClick,onItemMousemove:i.itemMouseMove,pt:e.pt},null,8,["id","item","templates","focusedOptionId","unstyled","onItemClick","onItemMousemove","pt"])):i.visible(v)&&v.separator?(s(),I("li",$({key:"separator"+l+u,class:[e.cx("separator"),o.class],style:v.style,role:"separator"},{ref_for:!0},e.ptm("separator")),null,16)):S("",!0)],64)}),128))],64)):i.visible(o)&&o.separator?(s(),I("li",$({key:"separator"+l.toString(),class:[e.cx("separator"),o.class],style:o.style,role:"separator"},{ref_for:!0},e.ptm("separator")),null,16)):(s(),T(f,{key:i.label(o)+l.toString(),id:e.$id+"_"+l,item:o,index:l,templates:e.$slots,focusedOptionId:i.focusedOptionId,unstyled:e.unstyled,onItemClick:i.itemClick,onItemMousemove:i.itemMouseMove,pt:e.pt},null,8,["id","item","index","templates","focusedOptionId","unstyled","onItemClick","onItemMousemove","pt"]))],64)}),128))],16,ht),e.$slots.end?(s(),I("div",$({key:1,class:e.cx("end")},e.ptm("end")),[le(e.$slots,"end")],16)):S("",!0)],16,gt)):S("",!0)]}),_:3},16,["onEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo","disabled"])}De.render=Ct;const Z=je(Ze.profileContractsStore,()=>{const e=q(!1),t=q({visible:!1}),n=q({visible:!1}),a=q(!1),p=q();function i(){e.value=!0}function f(){e.value=!1}function g(b){e.value=!1,t.value={visible:!0,employeeId:b}}function o(){t.value={visible:!1}}function l(b){e.value=!1,n.value={visible:!0,...b}}function v(){n.value={visible:!1}}function u(b){p.value=b,a.value=!0}function h(){a.value=!1,p.value=void 0}return{isPickerDialogVisible:e,uploadSignDialog:t,generateDialog:n,isViewDialogVisible:a,selectedContract:p,openPickerDialog:i,closePickerDialog:f,openUploadSignDialog:g,closeUploadSignDialog:o,openGenerateDialog:l,closeGenerateDialog:v,openViewDialog:u,closeViewDialog:h}});var z=(e=>(e.queryKey="get:contract/employee/[id]/profile/get-contracts",e))(z||{});function Te(e){const t=m(()=>[z.queryKey,e.value]);return{query:Y({queryKey:t,queryFn:async()=>(await F.get(`contract/employee/${e.value.employeeId}/profile/get-contracts`)).data.data,enabled:m(()=>{var a;return!!((a=e.value)!=null&&a.employeeId)})})}}async function Oe(e){return(await F.post(`contract/${e}/send-contract-to-sign`)).data.success}var Pe=(e=>(e.queryKey="get:document-template/available",e))(Pe||{});function $e(){return{query:Y({queryKey:[Pe.queryKey],queryFn:async()=>(await F.get("document-template/available")).data.data})}}var _e=(e=>(e.mutationKey="post:contract/[id]/send-contract-to-sign",e))(_e||{});function It(){const{t:e}=ie(),t=ke(),n=ae(),{currentEmployeeId:a}=U(Le()),p=Z(),{query:i}=Te(m(()=>({employeeId:a.value}))),f=m(()=>i.data.value??[]),g=m(()=>{const w=new Map;for(const c of f.value)c.type&&(w.has(c.type.id)||w.set(c.type.id,{typeId:c.type.id,typeName:c.type.name,contracts:[]}),w.get(c.type.id).contracts.push(c));for(const c of w.values())c.contracts.sort((x,_)=>_.id-x.id);return[...w.values()]}),{query:o}=$e(),l=m(()=>o.data.value??[]),v=m(()=>{const w=new Map;for(const c of l.value)if(c.parentContractTypeId){const x=w.get(c.parentContractTypeId)??[];x.push(c),w.set(c.parentContractTypeId,x)}return w}),u=m(()=>o.isLoading.value);function h(){p.openPickerDialog()}function b(w,c){a.value&&p.openGenerateDialog({templateId:w,employeeId:a.value,parentContractId:c})}const k=H({mutationFn:Oe,mutationKey:[_e.mutationKey]});function O(w){t.require({message:e("profileContracts.confirmSendToSign"),header:e("common.confirmation"),icon:"pi pi-exclamation-triangle",rejectLabel:e("common.cancel"),rejectProps:{label:e("common.cancel"),severity:"secondary",outlined:!0},acceptProps:{label:e("profileContracts.sendToSign"),severity:"success"},accept:async()=>{await k.mutateAsync(w.id),n.invalidateQueries({queryKey:[z.queryKey]}),N(n)}})}return{contractsQuery:i,contracts:f,contractGroups:g,childTemplatesByParentType:v,templatesLoading:u,openPickerDialog:h,openGenerateDialog:b,sendToSign:O,sendToSignMutation:k}}const wt={class:"flex items-center gap-2"},xt={class:"flex flex-col gap-2 text-sm"},Lt={key:0,class:"flex items-center gap-2"},St={class:"text-muted-color"},Dt=["title"],Tt={class:"flex items-center gap-2"},Ot={class:"text-muted-color"},Pt={class:"flex items-center gap-2"},$t={class:"text-muted-color"},_t={key:1,class:"flex items-center gap-2"},Mt={class:"text-muted-color"},Kt={class:"flex flex-wrap justify-end gap-2"},Vt=Q({__name:"ContractCard",props:{contract:{},isHR:{type:Boolean},childTemplates:{default:()=>[]}},emits:["generateChild"],setup(e,{emit:t}){const n=e,a=t,{openViewDialog:p}=Z(),i=m(()=>{var u,h,b;return(b=(h=(u=n.contract.file)==null?void 0:u.names)==null?void 0:h[0])==null?void 0:b.value}),f=m(()=>{var h;
84const u=(h=n.contract.status)==null?void 0:h.id;return u===0?"warn":u===1?"info":u===2?"success":"secondary"});function g(u){return E("name",u).value||u.code}const o=q(),l=m(()=>n.childTemplates.map(u=>({label:g(u),icon:"pi pi-file",command:()=>a("generateChild",u.id)})));function v(u){o.value.toggle(u)}return(u,h)=>{const b=j,k=Ye;return s(),T(k,null,{title:M(()=>{var O;return[C("div",wt,[h[2]||(h[2]=C("i",{class:"bi bi-file-earmark-text text-xl text-primary"},null,-1)),C("span",null,L(((O=e.contract.type)==null?void 0:O.name)||u.$t("profileContracts.contract")),1),e.contract.status?(s(),T(r(et),{key:0,severity:f.value,value:e.contract.status.description},null,8,["severity","value"])):S("",!0)])]}),content:M(()=>[C("div",xt,[i.value?(s(),I("div",Lt,[C("span",St,L(u.$t("profileContracts.card.name"))+":",1),C("span",{class:"truncate",title:i.value},L(i.value),9,Dt)])):S("",!0),C("div",Tt,[C("span",Ot,L(u.$t("profileContracts.card.number"))+":",1),C("span",null,L(e.contract.id),1)]),C("div",Pt,[C("span",$t,L(u.$t("profileContracts.card.createdAt"))+":",1),C("span",null,L(r(re)(e.contract.createdAt)),1)]),e.contract.sentForSignatureAt?(s(),I("div",_t,[C("span",Mt,L(u.$t("profileContracts.card.sentForSignature"))+":",1),C("span",null,L(r(re)(e.contract.sentForSignatureAt)),1)])):S("",!0)])]),footer:M(()=>[C("div",Kt,[e.contract.file?(s(),T(b,{key:0,label:u.$t("profileContracts.view"),icon:"bi bi-eye",size:"small",onClick:h[0]||(h[0]=O=>r(p)(e.contract))},null,8,["label"])):S("",!0),e.isHR&&e.childTemplates.length===1?(s(),T(b,{key:1,label:g(e.childTemplates[0]),icon:"bi bi-file-plus",size:"small",severity:"secondary",outlined:"",onClick:h[1]||(h[1]=O=>a("generateChild",e.childTemplates[0].id))},null,8,["label"])):e.isHR&&e.childTemplates.length>1?(s(),T(b,{key:2,label:u.$t("profileContracts.generateDocument"),icon:"bi bi-file-plus",size:"small",severity:"secondary",outlined:"",onClick:v},null,8,["label"])):S("",!0),e.isHR&&e.childTemplates.length>1?(s(),T(r(De),{key:3,ref_key:"childMenu",ref:o,model:l.value,popup:!0},null,8,["model"])):S("",!0)])]),_:1})}}});function At(){const{t:e}=ie(),t=Z(),{isPickerDialogVisible:n}=U(t),{currentEmployeeId:a}=U(Le()),p=m({get:()=>n.value,set:c=>{c||t.closePickerDialog()}}),{query:i}=$e(),{query:f}=Te(m(()=>({employeeId:a.value}))),g=q({}),o=m(()=>{const c=new Map;for(const x of f.data.value??[]){if(!x.type)continue;const _=c.get(x.type.id)??[];
84_.push(x),c.set(x.type.id,_)}for(const x of c.values())x.sort((_,B)=>B.id-_.id);return c});function l(c){return E("name",c).value||c.code}function v(c){return`#${c.id} — ${re(c.createdAt)}`}const u=m(()=>{var x,_,B;const c=new Map;for(const A of i.data.value??[]){const D=A.parentContractTypeId,d=D?o.value.get(D)??[]:[],y={template:A,label:l(A),parentTypeName:D?((x=A.parentContractType)==null?void 0:x.name)??String(D):null,parentOptions:d.map(V=>({label:v(V),value:V.id})),isBlocked:!!D&&d.length===0},P=String(((_=A.contractType)==null?void 0:_.id)??"other"),J=c.get(P)??{key:P,label:((B=A.contractType)==null?void 0:B.name)??e("profileContracts.otherDocuments"),variants:[]};J.variants.push(y),c.set(P,J)}return[...c.values()]}),h=m(()=>i.isLoading.value||f.isLoading.value),b=m(()=>u.value.some(c=>c.variants.length));function k(c){var x;if(c.parentTypeName)return g.value[c.template.id]??((x=c.parentOptions[0])==null?void 0:x.value)}function O(c){c.isBlocked||!a.value||t.openGenerateDialog({templateId:c.template.id,employeeId:a.value,parentContractId:k(c)})}function w(){a.value&&t.openUploadSignDialog(a.value)}return{isVisible:p,isLoading:h,groups:u,hasVariants:b,selectedParentByTemplate:g,pick:O,openUploadSignDialog:w}}const qt={key:0,class:"flex justify-center py-8"},Ft={key:1,class:"flex flex-col gap-5"},Bt={class:"flex flex-col"},Et={class:"font-semibold"},Rt={class:"text-sm text-muted-color"},zt={key:0,class:"py-6 text-center text-surface-500"},Ut={class:"text-sm font-semibold uppercase text-muted-color"},Nt={class:"flex flex-col gap-2"},Gt=["onClick"],Ht={class:"flex min-w-0 grow flex-col"},Qt={class:"truncate"},jt={key:0,class:"text-xs text-orange-500"},Zt={key:1,class:"text-xs text-muted-color"},Yt=Q({__name:"GenerateContractDialog",setup(e){const{isVisible:t,isLoading:n,groups:a,hasVariants:p,selectedParentByTemplate:i,pick:f,openUploadSignDialog:g}=At();return(o,l)=>{const v=We,u=j,h=ce;return s(),T(h,{visible:r(t),"onUpdate:visible":l[2]||(l[2]=b=>W(t)?t.value=b:null),modal:"","dismissable-mask":"",class:"w-[46rem]",header:o.$t("profileContracts.generateContract")},{default:M(()=>[r(n)?(s(),I("div",qt,[K(r(de))])):(s(),I("div",Ft,[C("button",{type:"button",class:"flex w-full items-center gap-3 rounded-lg border border-dashed border-primary bg-primary-50 p-4 text-left transition-colors hover:bg-primary-100 dark:bg-transparent dark:hover:bg-primary-950",onClick:l[0]||(l[0]=(...b)=>r(g)&&r(g)(...b))},[l[3]||(l[3]=C("i",{class:"bi bi-file-earmark-arrow-up text-2xl text-primary"},null,-1)),C("div",Bt,[C("span",Et,L(o.$t("profileContracts.uploadSign.title")),1),C("span",Rt,L(o.$t("profileContracts.uploadSign.subtitle")),1)]),l[4]||(l[4]=C("i",{class:"bi bi-chevron-right ml-auto text-muted-color"},null,-1))]),r(p)?S("",!0):(s(),I("div",zt,L(o.$t("profileContracts.noTemplates")),1)),(s(!0),I(R,null,G(r(a),b=>(s(),I("div",{key:b.key,class:"flex flex-col gap-2"},[C("h3",Ut,L(b.label),1),C("div",Nt,[(s(!0),I(R,null,G(b.variants,k=>(s(),I("div",{key:k.template.id,class:he(["flex flex-wrap items-center gap-3 rounded-lg border border-surface-200 p-3 dark:border-surface-700",k.isBlocked?"opacity-60":"cursor-pointer hover:border-primary"]),onClick:O=>!k.isBlocked&&r(f)(k)},[l[5]||(l[5]=C("i",{class:"bi bi-file-earmark-text text-lg text-primary"},null,-1)),C("div",Ht,[C("span",Qt,L(k.label),1),k.isBlocked?(s(),I("span",jt,L(o.$t("profileContracts.requiresParentContract",{type:k.parentTypeName})),1)):k.parentTypeName?(s(),I("span",Zt,L(o.$t("profileContracts.basedOn",{type:k.parentTypeName})),1)):S("",!0)]),k.parentOptions.length>1?(s(),T(v,{key:0,"model-value":r(i)[k.template.id]??k.parentOptions[0].value,options:k.parentOptions,"option-label":"label","option-value":"value",size:"small",class:"w-48",onClick:l[1]||(l[1]=ye(()=>{},["stop"])),"onUpdate:modelValue":O=>r(i)[k.template.id]=O},null,8,["model-value","options","onUpdate:modelValue"])):S("",!0),K(u,{label:o.$t("profileContracts.generate"),icon:"bi bi-plus-lg",size:"small",disabled:k.isBlocked,onClick:ye(O=>r(f)(k),["stop"])},null,8,["label","disabled","onClick"])],10,Gt))),128))])]))),128))]))]),_:1},8,["visible","header"])}}});async function Wt(e){const t=new FormData;return t.append("file",e.file),t.append("employeeId",String(e.employeeId)),t.append("name",e.name),e.additionalInfo&&t.append("additionalInfo",e.additionalInfo),(await F.post("contract/upload-and-send-to-sign",t,{headers:{"Content-Type":"multipart/form-data"}})).data.data}var Me=(e=>(e.mutationKey="post:contract/upload-and-send-to-sign",e))(Me||{});const Jt=20*1024*1024;function Xt(){const{t:e}=ie(),t=ae(),n=Z(),{uploadSignDialog:a}=U(n),p=q({name:"",file:null}),i=m({get:()=>a.value.visible,set:l=>{l||n.closeUploadSignDialog()}});Ce(()=>a.value.visible,l=>{l&&(p.value={name:"",file:null})});const f=m(()=>[{type:"text",name:"name",label:e("profileContracts.uploadSign.name"),required:!0,class:"col-span-12"},{type:"file",name:"file",label:e("profileContracts.uploadSign.file"),required:!0,class:"col-span-12",props:{accept:"application/pdf",maxFileSize:Jt,multiple:!1,customUpload:!0,showUploadButton:!1,showCancelButton:!1}}]),g=H({mutationFn:Wt,mutationKey:[Me.mutationKey]});async function o(){const l=a.value.employeeId,{name:v,file:u}=p.value;!l||!u||!v.trim()||(await g.mutateAsync({employeeId:l,name:v.trim(),file:u}),t.invalidateQueries({queryKey:[z.queryKey]}),N(t),n.closeUploadSignDialog())}return{isVisible:i,formValues:p,formFields:f,uploadMutation:g,submit:o}}const en={class:"flex items-center justify-end gap-2"},tn=Q({__name:"UploadContractDialog",setup(e){const{isVisible:t,formValues:n,formFields:a,uploadMutation:p,submit:i}=Xt(),f=m(()=>p.isPending.value);return(g,o)=>{const l=Je,v=j,u=ce;return s(),T(u,{visible:r(t),"onUpdate:visible":o[2]||(o[2]=h=>W(t)?t.value=h:null),modal:"",class:"w-[36rem]",closable:!f.value,header:g.$t("profileContracts.uploadSign.title")},{default:M(()=>[K(l,{severity:"info",closable:!1,class:"mb-2"},{default:M(()=>[ne(L(g.$t("profileContracts.uploadSign.hint")),1)]),_:1}),K(Ie,{modelValue:r(n),"onUpdate:modelValue":o[1]||(o[1]=h=>W(n)?n.value=h:null),fields:r(a),loading:f.value,onSubmit:r(i)},{submit:M(()=>[C("div",en,[K(v,{type:"button",severity:"secondary",outlined:"",disabled:f.value,label:g.$t("common.cancel"),onClick:o[0]||(o[0]=h=>t.value=!1)},null,8,["disabled","label"]),K(v,{type:"submit",disabled:f.value,loading:f.value},{default:M(()=>[ne(L(g.$t(f.value?"common.loading":"profileContracts.sendToSign")),1)]),_:1},8,["disabled","loading"])])]),_:1},8,["modelValue","fields","loading","onSubmit"])]),_:1},8,["visible","closable","header"])}}});async function nn(e){return(await F.post(`document-template/${e.templateId}/generate`,e.data)).data.data}function an(){const e=ae(),t=Z(),{generateDialog:n}=U(t),a=m(()=>n.value.templateId),p=m(()=>n.value.employeeId),{query:i}=tt(a);function f(d){return m(()=>{var y;return((y=i.data.value)==null?void 0:y.fields.some(P=>P.resourceCode===d))??!1})}const{data:g}=Y({queryKey:m(()=>["generate-dialog:offers",p.value]),queryFn:async()=>(await F.get("offer",{params:{employeeId:p.value,page:1,limit:100}})).data.data,enabled:f("offers")}),o=m(()=>{var d;return(((d=g.value)==null?void 0:d.data)??[]).map(y=>({label:`#${y.id} - ${E("title",y.vacancy).value}
84 (${y.amount.toLocaleString()} ₸)`,value:y.id}))}),{data:l}=Y({queryKey:["generate-dialog:departments"],queryFn:async()=>(await F.get("department")).data.data,enabled:f("departments")}),v=m(()=>(l.value??[]).map(d=>({label:E("title",d).value,value:d.id}))),u=q(""),h=Xe(u,300),{data:b}=Y({queryKey:m(()=>["generate-dialog:employees",h.value]),queryFn:async()=>(await F.get("employee",{params:{page:1,limit:100,...h.value?{employee:h.value}:{}}})).data.data,enabled:f("employees")}),k=m(()=>{var d;return(((d=b.value)==null?void 0:d.data)??[]).map(y=>({label:`${y.surname} ${y.name}`,value:y.id}))}),O=m(()=>{var d;return((d=i.data.value)==null?void 0:d.fields.some(y=>y.fieldType==="select_speciality"))??!1}),{query:w}=nt(p,{enabled:m(()=>!!p.value&&O.value)}),c=m(()=>(w.data.value??[]).map(d=>{const y=d.endDate?` (${new Date(d.endDate).getFullYear()})`:"";return{label:`${E("universityName",d).value} — ${E("title",d.educationLevel).value}${y}`,items:[{lang:"EN",name:d.specialityNameEn},{lang:"RU",name:d.specialityNameRu},{lang:"KZ",name:d.specialityNameKz}].filter(P=>P.name).map(P=>({label:`${P.name} — ${P.lang}`,value:P.name}))}}).filter(d=>d.items.length)),x=q({});Ce(()=>i.data.value,d=>{if(!d)return;const y={};for(const P of d.fields)y[P.code]=P.defaultValue??null;x.value=y},{immediate:!0});const _=m(()=>{const d=i.data.value;return d?d.fields.map(y=>{const P=E("label",y).value,J=y.colSpan??12,V={label:P,name:y.code,class:`col-span-${J}`,required:y.isRequired===1};switch(y.fieldType){case"number":return{...V,type:"text",props:{type:"number"}};case"date":return{...V,type:"date"};case"select_speciality":return{...V,type:"select",options:c.value,props:{showClear:!0,optionGroupLabel:"label",optionGroupChildren:"items"}};case"select":return y.resourceCode==="offers"?{...V,type:"select",options:o.value,props:{filter:!0,showClear:!0}}:y.resourceCode==="employees"?{...V,type:"select",options:k.value,props:{filter:!0,showClear:!0},events:{filter:X=>{u.value=X.value}}}:y.resourceCode==="departments"?{...V,type:"select",options:v.value,props:{filter:!0,showClear:!0}}:{...V,type:"select",options:y.selectOptions.map(X=>({label:E("label",X).value,value:X.value}))};default:return{...V,type:"text"}}}):[]}),B=H({mutationFn:nn});async function A(){const d=a.value,y=p.value;!d||!y||(await B.mutateAsync({templateId:d,data:{employeeId:y,parentContractId:n.value.parentContractId,fieldValues:{...x.value}}}),e.invalidateQueries({queryKey:[z.queryKey]}),N(e),t.closeGenerateDialog(),x.value={})}const D=m(()=>{const d=i.data.value;return d?E("name",d).value||d.code:""});return{generateDialog:n,templateQuery:i,formFields:_,formValues:x,generate:A,generateMutation:B,dialogTitle:D}}const on={class:"block grow"},sn={key:0,class:"flex justify-center py-4"},ln={class:"flex items-center justify-end"},rn={key:2,class:"flex flex-col items-center gap-4 py-4"},un={class:"text-center text-surface-600"},cn=Q({__name:"GenerateDocumentDialog",setup(e){const{generateDialog:t,templateQuery:n,formFields:a,formValues:p,generate:i,generateMutation:f,dialogTitle:g}=an(),o=m(()=>f.isPending.value);return(l,v)=>{const u=j,h=ce;return s(),T(h,{visible:r(t).visible,"onUpdate:visible":v[1]||(v[1]=b=>r(t).visible=b),modal:"",class:"w-[40rem]",closable:!o.value},{header:M(()=>[C("div",on,[C("div",null,L(r(g)),1)])]),default:M(()=>[r(n).isLoading.value?(s(),I("div",sn,[K(r(de))])):r(a).length?(s(),T(Ie,{key:1,modelValue:r(p),"onUpdate:modelValue":v[0]||(v[0]=b=>W(p)?p.value=b:null),fields:r(a),loading:o.value,onSubmit:r(i)},{submit:M(()=>[C("div",ln,[K(u,{disabled:o.value,type:"submit"},{default:M(()=>[ne(L(l.$t(o.value?"common.loading":"profileContracts.generate")),1)]),_:1},8,["disabled"])])]),_:1},8,["modelValue","fields","loading","onSubmit"])):r(n).data.value?(s(),I("div",rn,[C("p",un,L(l.$t("profileContracts.confirmGenerate",{name:r(g)})),1),K(u,{label:l.$t(o.value?"common.loading":"profileContracts.generate"),disabled:o.value,loading:o.value,severity:"success",onClick:r(i)},null,8,["label","disabled","loading","onClick"])])):S("",!0)]),_:1},8,["visible","closable"])}}});async function dn(e){return(await F.post(`contract/${e}/revoke`)).data}var Ke=(e=>(e.mutationKey="post:contract/[id]/revoke",e))(Ke||{}),Ve=(e=>(e.mutationKey="delete:contract/[id]",e))(Ve||{});function pn(){return{mutation:H({mutationKey:[Ve.mutationKey],mutationFn:async t=>(await F.delete(`contract/${t}`)).data.success})}}function mn(){const{t:e}=ie(),t=ke(),n=ae(),a=Z(),{isViewDialogVisible:p,selectedContract:i}=U(a),{closeViewDialog:f}=a,{hasPermission:g}=U(we()),o=m(()=>g.value(xe.ManageEmployeeProfile)),l=m({get:()=>p.value,set:D=>{D||f()}}),v=m(()=>{var D,d;return((d=(D=i.value)==null?void 0:D.type)==null?void 0:d.name)||e("profileContracts.contract")}),u=m(()=>{var D;return(D=i.value)!=null&&D.externalId?`https://test.trustme.kz/trust_contract_public_apis/doc/DownloadContractFile/${i.value.externalId}`:null}),h=m(()=>{var D,d,y;return o.value&&((d=(D=i.value)==null?void 0:D.status)==null?void 0:d.id)===0&&!((y=i.value)!=null&&y.sentForSignatureAt)}),b=m(()=>{var D,d,y;return o.value&&((D=i.value)==null?void 0:D.externalId)&&((y=(d=i.value)==null?void 0:d.status)==null?void 0:y.id)!==4}),k=m(()=>{var D;return o.value&&!((D=i.value)!=null&&D.sentForSignatureAt)}),O=H({mutationFn:Oe}),w=H({mutationFn:dn,mutationKey:[Ke.mutationKey]}),{mutation:c}=pn();function x(){u.value&&window.open(u.value,"_blank")}function _(){i.value&&t.require({message:e("profileContracts.confirmSendToSign"),header:e("common.confirmation"),icon:"pi pi-exclamation-triangle",rejectProps:{label:e("common.cancel"),severity:"secondary",outlined:!0},acceptProps:{label:e("profileContracts.sendToSign"),severity:"success"},accept:async()=>{await O.mutateAsync(i.value.id),n.invalidateQueries({queryKey:[z.queryKey]}),N(n),f()}})}function B(){i.value&&t.require({message:e("profileContracts.confirmRevoke"),header:e("common.confirmation"),icon:"pi pi-exclamation-triangle",rejectProps:{label:e("common.cancel"),severity:"secondary",outlined:!0},acceptProps:{label:e("profileContracts.revoke"),severity:"danger"},accept:async()=>{await w.mutateAsync(i.value.id),n.invalidateQueries({queryKey:[z.queryKey]}),N(n),f()}})}function A(){i.value&&t.require({message:e("profileContracts.confirmDelete"),header:e("common.confirmation"),icon:"pi pi-exclamation-triangle",rejectProps:{label:e("common.cancel"),severity:"secondary",outlined:!0},acceptProps:{label:e("profileContracts.delete"),severity:"danger"},accept:async()=>{await c.mutateAsync(i.value.id),n.invalidateQueries({queryKey:[z.queryKey]}),N(n),f()}})}return{isVisible:l,dialogHeader:v,selectedContract:i,trustMeUrl:u,canSendToSign:h,canRevoke:b,canDelete:k,sendToSignMutation:O,revokeMutation:w,deleteMutation:c,downloadFromTrustMe:x,handleSendToSign:_,handleRevoke:B,handleDelete:A}}const fn={class:"flex gap-2"},yn=Q({__name:"ContractViewDialog",setup(e){const{isVisible:t,selectedContract:n,trustMeUrl:a,canSendToSign:p,canRevoke:i,canDelete:f,sendToSignMutation:g,revokeMutation:o,deleteMutation:l,downloadFromTrustMe:v,handleSendToSign:u,handleRevoke:h,handleDelete:b}=mn();return(k,O)=>{var c,x;const w=j;return s(),T(it,{modelValue:r(t),"onUpdate:modelValue":O[0]||(O[0]=_=>W(t)?t.value=_:null),url:(x=(c=r(n))==null?void 0:c.file)==null?void 0:x.path},{buttons:M(()=>[C("div",fn,[r(a)?(s(),T(w,{key:0,label:k.$t("profileContracts.downloadFromTrustMe"),icon:"bi bi-download",severity:"secondary",outlined:"",onClick:r(v)},null,8,["label","onClick"])):S("",!0),r(f)?(s(),T(w,{key:1,label:k.$t("profileContracts.delete"),icon:"bi bi-trash",severity:"danger",outlined:"",loading:r(l).isPending.value,onClick:r(b)},null,8,["label","loading","onClick"])):S("",!0),r(i)?(s(),T(w,{key:2,label:k.$t("profileContracts.revoke"),icon:"bi bi-x-circle",severity:"danger",outlined:"",loading:r(o).isPending.value,onClick:r(h)},null,8,["label","loading","onClick"])):S("",!0),r(p)?(s(),T(w,{key:3,label:k.$t("profileContracts.sendToSign"),icon:"bi bi-send",severity:"success",loading:r(g).isPending.value,onClick:r(u)},null,8,["label","loading","onClick"])):S("",!0)])]),_:1},8,["modelValue","url"])}}}),vn={class:"flex flex-col gap-4"},bn={key:0,class:"flex flex-wrap items-center gap-2"},gn={key:1,class:"flex justify-center py-8"}
84,hn={key:2,class:"rounded bg-red-100 p-4 text-red-700"},kn={key:3,class:"py-8 text-center text-surface-500"},Cn={class:"mb-3 text-lg font-semibold"},In={class:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3"},Kn=Q({__name:"Page",setup(e){const{contractsQuery:t,contracts:n,contractGroups:a,childTemplatesByParentType:p,templatesLoading:i,openGenerateDialog:f,openPickerDialog:g}=It(),{hasPermission:o}=U(we()),l=m(()=>o.value(xe.ManageEmployeeProfile));return(v,u)=>{const h=j;return s(),I("div",vn,[l.value?(s(),I("div",bn,[K(h,{label:v.$t("profileContracts.generateContract"),icon:"pi pi-plus",loading:r(i),onClick:r(g)},null,8,["label","loading","onClick"])])):S("",!0),r(t).isLoading.value?(s(),I("div",gn,[K(r(de))])):r(t).isError.value?(s(),I("div",hn,L(v.$t("common.errorLoading")),1)):r(n).length?(s(!0),I(R,{key:4},G(r(a),b=>(s(),I("div",{key:b.typeId},[C("h3",Cn,L(b.typeName),1),C("div",In,[(s(!0),I(R,null,G(b.contracts,k=>{var O;return s(),T(Vt,{key:k.id,contract:k,isHR:l.value,childTemplates:r(p).get(((O=k.type)==null?void 0:O.id)??-1)??[],onGenerateChild:w=>r(f)(w,k.id)},null,8,["contract","isHR","childTemplates","onGenerateChild"])}),128))])]))),128)):(s(),I("div",kn,L(v.$t("profileContracts.noContracts")),1)),l.value?(s(),T(Yt,{key:5})):S("",!0),l.value?(s(),T(tn,{key:6})):S("",!0),K(cn),K(yn)])}}});export{Kn 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.