1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="81ec5399-c50a-49d0-8bd2-43de3b572de9",e._sentryDebugIdIdentifier="sentry-dbid-81ec5399-c50a-49d0-8bd2-43de3b572de9")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2292],{38183:function(e,t,r){r.d(t,{Ak:function(){return K},GI:function(){return R},HW:function(){return P},I7:function(){return N},Is:function(){return k},Nt:function(){return W},S7:function(){return b},XD:function(){return I},c3:function(){return S}});var n=r(59820),a=r(14010),o=r(87686),i=r(60418),l=r(2784),u=r(62202),s=r(88393),c=r(47477),d=r(31515),v=r(67516),y=r(82036),g=r(84475),h=r(45558);let f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(y.JW,"tenant/").concat((0,c.d_)(),"/").concat(e)},p="reviewModerationsForCycle",w="reviewModerationsPending",m=e=>Object.fromEntries(Object.entries(e||{}).filter(e=>{let[,t]=e;return!!t})),b={cycleRoot:e=>[p,e],forCycle:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return[p,e,m(t)]},pendingRoot:[w],pending:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return[w,e,m(t)]}};Object.freeze({PENDING:"pending",APPROVED:"approved",RETURNED:"returned"});let _=new Set(["__proto__","constructor","prototype"]),E=e=>{let t=null==e?void 0:e.reason;return"string"!=typeof t||_.has(t)?null:t},P=new Map([["illegal_moderation_transition","This review cannot move to that stage from where it is."],["moderation_already_approved","This review has already been approved and can no longer be returned to the manager."],["return_comments_required","Add a comment explaining what the manager needs to change before returning this review."],["moderation_disabled","Moderation is not available for this review cycle right now."],["unmoderated_subjects","This review cycle still has reviews awaiting moderation and cannot close until they are approved."]]),j=e=>{var t,r;let n=null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.blocking;return!n||"object"!=typeof n||Array.isArray(n)?null:{count:Number.isInteger(n.count)?n.count:null,rows:Array.isArray(n.blocking)?n.blocking:[],truncated:!0===n.truncated}},R=function(e){var t,r,n;let{fallback:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{status:null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status,reason:E(null==e?void 0:null===(r=e.response)||void 0===r?void 0:r.data),message:(0,h.g8)(null==e?void 0:null===(n=e.response)||void 0===n?void 0:n.status,e,{fallback:a}),fieldErrors:(0,h._I)(e),blocking:j(e)}},F=(e,t)=>{let{fallback:r,context:n}=t,a=R(e,{fallback:r});(0,s.N2)(e,n,{statusCode:a.status}),401!==a.status&&403!==a.status&&(404===a.status&&v.x.notifyOnNotFound||u.default.error(a.message))},S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),r=(0,d.w0)(e);if(null===r)return null;let n=(0,d.w0)(t);if(null===n)return null;let a=n.getTime()-r.getTime();return a<=0?0:Math.floor(a/864e5)},k=e=>!!e&&"object"==typeof e&&!Array.isArray(e)&&!("comments"in e),A=(e,t)=>e.isSuccess&&!t,q=(e,t)=>
1(0,l.useMemo)(()=>e?R(e,{fallback:t}):null,[e,t]),C=(e,t)=>{(null==t?void 0:t.rcid)&&e.invalidateQueries({queryKey:b.cycleRoot(t.rcid)}),e.invalidateQueries({queryKey:b.pendingRoot})},D=e=>null===e?{comments:null}:"string"==typeof e&&e.trim().length>0?{comments:e}:{},I=function(){var e;let{rcid:t,status:r,page:a,perPage:o,enabled:l=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=!(0,c.Xu)()||!t,s=b.forCycle(t,{status:r,page:a,per_page:o}),[,,d]=s,v=(0,n.a)({queryKey:s,enabled:!!l&&!u,queryFn:async()=>(await i.Z.get(f("review-cycles/".concat(t,"/moderations")),{params:d,headers:(0,g.g0)({realm:"hr"})})).data}),y=q(v.error,"We could not load the reviews awaiting moderation. Please try again.");return{...v,isMissingContext:u,moderationError:y,isUnreadable:A(v,Array.isArray(null===(e=v.data)||void 0===e?void 0:e.data))}},N=function(){var e;let{uid:t,page:r,perPage:a,enabled:o=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=!(0,c.Xu)()||!t,u=b.pending(t,{page:r,per_page:a}),[,,s]=u,d=(0,n.a)({queryKey:u,enabled:!!o&&
1!l,queryFn:async()=>(await i.Z.get(f("users/".concat(t,"/moderations/pending")),{params:s,headers:(0,g.g0)({realm:"hr"})})).data}),v=q(d.error,"We could not load the reviews waiting on you. Please try again.");return{...d,isMissingContext:l,moderationError:v,isUnreadable:A(d,Array.isArray(null===(e=d.data)||void 0===e?void 0:e.data))}},W=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rmid:r,comments:n}=e;return null===(t=(await i.Z.post(f("review-moderations/".concat(r,"/approve")),D(n),{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{C(u,r),null==e||e(t,r,n)},onError:(e,r,n)=>{F(e,{fallback:"We could not approve this review. Please try again.",context:"useApproveModeration"}),null==t||t(e,r,n)},onSettled:r})},K=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rmid:r,comments:n}=e;return null===(t=(await i.Z.post(f("review-moderations/".concat(r,"/return")),{comments:n},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{C(u,r),null==e||e(t,r,n)},onError:(e,r,n)=>{F(e,{fallback:"We could not return this review to the manager. Please try again.",context:"useReturnModerationToManager"}),null==t||t(e,r,n)},onSettled:r})}},82292:function(e,t,r){r.d(t,{$Q:function(){return ey},Ae:function(){return J},C:function(){return ek},DH:function(){return ew},Dl:function(){return G},Em:function(){return ee},HC:function(){return V},HG:function(){return eg},Hi:function(){return H},I6:function(){return O},IV:function(){return el},JP:function(){return eu},Md:function(){return ei},Py:function(){return Y},QK:function(){return er},QY:function(){return ef},VE:function(){return eo},VF:function(){return K},cd:function(){return eW},d2:function(){return ev},d8:function(){return I},dR:function(){return eF},ds:function(){return eq},i:function(){return ej},iw:function(){return eP},jC:function(){return $},kU:function(){return es},l5:function(){return Z},lM:function(){return B},mN:function(){return ea},nE:function(){return eh},oI:function(){return eN},os:function(){return ep},pi:function(){return eS},s$:function(){return eD},tF:function(){return z},tZ:function(){return ed},tv:function(){return M},uJ:function(){return e_},ve:function(){return eA},xA:function(){return eI},xE:function(){return et},xL:function(){return eC}});var n=r(59820),a=r(14010),o=r(87686),i=r(60418),l=r(2784),u=r(62202),s=r(88393),c=r(47477),d=r(31515),v=r(67516),y=r(82036),g=r(84475),h=r(45558),f=r(29825),p=r(38183);let w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(y.JW,"tenant/").concat((0,c.d_)(),"/").concat(e)},m="reviewCycleList",b="reviewCycleLaunch",_="reviewCycleSubjects",E="reviewCycleParticipants",P="reviewSubjectParticipants",j="reviewSubjectsForUser",R="employeeReviewHistory",F="reviewNominationCandidates",S="We could not work out who this cycle would cover. Please try again.",k=e=>Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return!!t})),A=e=>Array.isArray(e)&&e.length>0,q=e=>e.map(String).sort().join(","),C=function(){let{scopeType:e,departmentIds:t,includeSubDepartments:r,userIds:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return["reviewCycleScopePreview",{scope_type:e,include_sub_departments:!!r,...A(t)&&{department_ids:q(t)},...A(n)&&{user_ids:q(n)}}]},D=e=>{let{scopeType:t,departmentIds:r,includeSubDepartments:n,userIds:a}=e;return{scope_type:t,include_sub_departments:(0,f.Yg)(n),...A(r)&&{department_ids:r},...A(a)&&{user_ids:a}}},I=Object.freeze({TEAM:"team",CYCLE:"cycle"}),N=function(){let{status:e,needsAttention:t,needsManager:r,departmentId:n,scope:a,page:o,perPage:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...e?{status:e}:{},..."boolean"==typeof t&&{needs_attention:t},..."boolean"==typeof r&&{needs_manager:r},...n?{department_id:n}:{},...a?{scope:a}:{},...o?{page:o}:{},...i?{per_page:i}:{}}},W=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,"boolean"==typeof r?(0,f.Yg)(r):r]})),K={listRoot:[m],list:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[m,k(e)]},detail:e=>["reviewCycleDetail",e],launchRoot:[b],launch:e=>[b,e],scopePreview:e=>C(e),cycleScopePreview:e=>["reviewCycleScopePreview",e],subjectsForCycle:e=>[_,e],subjects:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return[_,e,N(t)]},participantsForCycle:e=>[E,e],participants:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return[E,e,k(t)]},progress:e=>["reviewCycleProgress",e],results:e=>["reviewCycleResults",e],subject:e=>["reviewSubjectDetail",e],subjectResults:e=>["reviewSubjectResults",e],subjectParticipantsForSubject:e=>[P,e],subjectParticipants:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return[P,e,k(t)]},nominationCandidatesForSubject:e=>[F,e],nominationCandidates:(e,t)=>[F,e,k({search:t})],mySubjectsRoot:e=>[j,e],mySubjects:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return[j,e,N(t)]},employeeReviewHistoryRoot:e=>[R,e],employeeReviewHistory:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return[R,e,N(t)]}},Z={FEATURE_DISABLED:"feature_disabled",SUBSCRIPTION_REQUIRED:"subscription_required",FORBIDDEN:"forbidden"},M=new Set(Object.values(Z)),Q=new Set(["__proto__","constructor","prototype"]),L=e=>{let t=null==e?void 0:e.reason;return"string"!=typeof t||Q.has(t)?null:t},T=(e,t)=>
1{if(403!==e){let e=L(t);return M.has(e)?null:e}return(null==t?void 0:t.subscription_required)?Z.SUBSCRIPTION_REQUIRED:(null==t?void 0:t.reason)==="reviews_disabled"?Z.FEATURE_DISABLED:Z.FORBIDDEN},O=function(e){var t,r;let{fallback:n,messages:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status;return{status:o,reason:T(o,null==e?void 0:null===(r=e.response)||void 0===r?void 0:r.data),message:(0,h.g8)(o,e,{fallback:n,messages:a}),fieldErrors:(0,h._I)(e)}},U=e=>!!e&&"object"==typeof e&&!Array.isArray(e),x=(e,t)=>e.isSuccess&&!t,X=(e,t)=>{let{fallback:r,context:n}=t,a=O(e,{fallback:r});(0,s.N2)(e,n,{statusCode:a.status}),401!==a.status&&403!==a.status&&(404===a.status&&v.x.notifyOnNotFound||u.default.error(a.message))},G=e=>(null==e?void 0:e.status)==="pending"||(null==e?void 0:e.status)==="processing",H=e=>{var t;if(!G(e))return!1;let r=(0,d.w0)(null!==(t=e.started_at)&&void 0!==t?t:e.created_at);return!r||Date.now()-r.getTime()>18e4},B=function(){var e;let{status:t,statuses:r,type:a,purpose:o,page:u,perPage:s,enabled:d=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},v=K.list({status:t,statuses:A(r)?r:void 0,type:a,purpose:o,page:u,per_page:s}),[,y]=v,h=!(0,c.Xu)(),f=(0,n.a)({queryKey:v,enabled:!!d&&!h,queryFn:async()=>(await i.Z.get(w("review-cycles"),{params:y,headers:(0,g.g0)({realm:"hr"})})).data}),p=(0,l.useMemo)(()=>f.error?O(f.error,{fallback:"We could not load your review cycles. Please try again."}):null,[f.error]);return{...f,isMissingContext:h,cycleError:p,isUnreadable:x(f,Array.isArray(null===(e=f.data)||void 0===e?void 0:e.data))}},z=function(){let{scopeType:e,departmentIds:t,includeSubDepartments:r,userIds:a,enabled:o=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=!(0,c.Xu)()||!e,s=(0,n.a)({queryKey:C({scopeType:e,departmentIds:t,includeSubDepartments:r,userIds:a}
1),enabled:!!o&&!u,queryFn:async()=>{var n;return null===(n=(await i.Z.get(w("review-cycles/scope-preview"),{params:D({scopeType:e,departmentIds:t,includeSubDepartments:r,userIds:a}),headers:(0,g.g0)({realm:"hr"})})).data)||void 0===n?void 0:n.data}}),d=(0,l.useMemo)(()=>s.error?O(s.error,{fallback:S}):null,[s.error]);return{...s,isMissingContext:u,cycleError:d}},J=function(){let{rcid:e,enabled:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(0,c.Xu)()||!e,a=(0,n.a)({queryKey:K.cycleScopePreview(e),enabled:!!t&&!r,queryFn:async()=>{var t;return null===(t=(await i.Z.get(w("review-cycles/".concat(e,"/scope-preview")),{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data}}),o=(0,l.useMemo)(()=>a.error?O(a.error,{fallback:S}):null,[a.error]);return{...a,isMissingContext:r,cycleError:o}},Y=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;return null===(t=(await i.Z.post(w("review-cycles"),e,{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{u.invalidateQueries({queryKey:K.listRoot}),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not create this review cycle. Please try again.",context:"useCreateReviewCycle"}),null==t||t(e,r,n)},onSettled:r})},V=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rcid:r}=e;return null===(t=(await i.Z.post(w("review-cycles/".concat(r,"/launch")),{},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{u.setQueryData(K.launch(r.rcid),t),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not launch this review cycle. Please try again.",context:"useLaunchReviewCycle"}),null==t||t(e,r,n)},onSettled:r})},$=()=>{let e=(0,a.NL)();return(0,l.useCallback)(function(){let{rcid:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.invalidateQueries({queryKey:K.listRoot}),t&&e.invalidateQueries({queryKey:K.detail(t)})},[e])},ee=function(){let{rcid:e,enabled:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(0,c.Xu)()||!e,a=(0,n.a)({queryKey:K.launch(e),enabled:!!t&&!r,queryFn:async()=>{var t;return null===(t=(await i.Z.get(w("review-cycles/".concat(e,"/launch")),{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},refetchInterval:e=>!!G(e.state.data)&&!H(e.state.data)&&5e3,refetchIntervalInBackground:!1}),o=(0,l.useMemo)(()=>a.error?O(a.error,{fallback:"We could not check this launch. Please try again."}):null,[a.error]);return{...a,isMissingContext:r,cycleError:o}},et=e=>(null==e?void 0:e.status)==="collecting",er=Object.freeze({PENDING:"pending",PROCESSING:"processing",COMPLETED:"completed",COMPLETED_WITH_FAILURES:"completed_with_failures",FAILED:"failed"}),en=e=>(null==e?void 0:e.status)===er.PENDING||(null==e?void 0:e.status)===er.PROCESSING,ea=e=>{if(!en(e))return!1;let t=(0,d.w0)(e.started_at);return!t||Date.now()-t.getTime()>3e5},eo=function(){var e;let{rcid:t,enabled:r=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=!(0,c.Xu)()||!t,o=(0,n.a)({queryKey:K.detail(t),enabled:!!r&&!a,queryFn:async()=>(await i.Z.get(w("review-cycles/".concat(t)),{headers:(0,g.g0)({realm:"hr"})})).data}),u=(0,l.useMemo)(()=>o.error?O(o.error,{fallback:"We could not load this review cycle. Please try again."}):null,[o.error]);return{...o,isMissingContext:a,cycleError:u,isUnreadable:x(o,U(null===(e=o.data)||void 0===e?void 0:e.data))}},ei=function(){var e;let{rcid:t,status:r,needsAttention:a,needsManager:o,departmentId:u,scope:s,page:d,perPage:v,enabled:y=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=!(0,c.Xu)()||!t,f=K.subjects(t,{status:r,needsAttention:a,needsManager:o,departmentId:u,scope:s,page:d,perPage:v}),[,,p]=f,m=(0,n.a)({queryKey:f,enabled:!!y&&!h,queryFn:async()=>(await i.Z.get(w("review-cycles/".concat(t,"/subjects")),{params:W(p),headers:(0,g.g0)({realm:"hr"})})).data}),b=(0,l.useMemo)(()=>m.error?O(m.error,{fallback:"We could not load the people in this cycle. Please try again."}):null,[m.error]);
1return{...m,isMissingContext:h,cycleError:b,isUnreadable:x(m,Array.isArray(null===(e=m.data)||void 0===e?void 0:e.data))}},el=function(){var e;let{rcid:t,status:r,relationship:a,departmentId:o,page:u,perPage:s,enabled:d=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},v=!(0,c.Xu)()||!t,y=K.participants(t,{status:r,relationship:a,department_id:o,page:u,per_page:s}),[,,h]=y,f=(0,n.a)({queryKey:y,enabled:!!d&&!v,queryFn:async()=>(await i.Z.get(w("review-cycles/".concat(t,"/participants")),{params:h,headers:(0,g.g0)({realm:"hr"})})).data}),p=(0,l.useMemo)(()=>f.error?O(f.error,{fallback:"We could not load this cycleâs reviewers. Please try again."}):null,[f.error]);return{...f,isMissingContext:v,cycleError:p,isUnreadable:x(f,Array.isArray(null===(e=f.data)||void 0===e?void 0:e.data))}},eu=function(){let{rcid:e,status:t,enabled:r=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=!(0,c.Xu)()||!e,o=(0,n.a)({queryKey:K.progress(e),enabled:!!r&&!a,queryFn:async()=>{var t;return null===(t=(await i.Z.get(w("review-cycles/".concat(e,"/progress")),{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},refetchInterval:e=>{let r=e.state.data;return!!et({status:r&&"object"==typeof r&&"status"in r?r.status:t})&&3e4},refetchIntervalInBackground:!1}),u=(0,l.useMemo)(()=>o.error?O(o.error,{fallback:"We could not check how far this cycle has got. Please try again."}):null,[o.error]);return{...o,isMissingContext:a,cycleError:u,isUnreadable:x(o,U(o.data))}},es=function(){let{rcid:e,enabled:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(0,c.Xu)()||!e,a=(0,n.a)({queryKey:K.results(e),enabled:!!t&&!r,queryFn:async()=>{var t;return null===(t=(await i.Z.get(w("review-cycles/".concat(e,"/results-computation")),{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},refetchInterval:e=>!!en(e.state.data)&&!ea(e.state.data)&&5e3,refetchIntervalInBackground:!1}),o=(0,l.useMemo)(()=>a.error?O(a.error,{fallback:"We could not check this cycleâs results. Please try again."}):null,[a.error]);return{...a,isMissingContext:r,cycleError:o,isUnreadable:x(a,U(a.data))}},ec=(e,t)=>{e.invalidateQueries({queryKey:K.listRoot}),t&&(e.invalidateQueries({queryKey:K.detail(t)}),e.invalidateQueries({queryKey:K.progress(t)}),e.invalidateQueries({queryKey:K.subjectsForCycle(t)}),e.invalidateQueries({queryKey:K.participantsForCycle(t)}))},ed=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rcid:r,body:n}=e;return null===(t=(await i.Z.put(w("review-cycles/".concat(r)),n,{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{ec(u,null==r?void 0:r.rcid),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not save this review cycle. Please try again.",context:"useUpdateReviewCycle"}),null==t||t(e,r,n)},onSettled:r})},ev=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{let{rcid:t,force:r}=e;return(await i.Z.post(w("review-cycles/".concat(t,"/close")),"boolean"==typeof r?{force:r}:{},{headers:(0,g.g0)({realm:"hr"})})).data},onMutate:n,onSuccess:(t,r,n)=>{ec(u,null==r?void 0:r.rcid),(null==r?void 0:r.rcid)&&u.invalidateQueries({queryKey:K.results(r.rcid)}),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not close this review cycle. Please try again.",context:"useCloseReviewCycle"}),null==t||t(e,r,n)},onSettled:r})},ey=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{let{rcid:t}=e;return(await i.Z.post(w("review-cycles/".concat(t,"/release")),{},{headers:(0,g.g0)({realm:"hr"})})).data},onMutate:n,onSuccess:(t,r,n)=>{ec(u,null==r?void 0:r.rcid),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not release these results. Please try again.",context:"useReleaseReviewCycle"}),null==t||t(e,r,n)},onSettled:r})},eg=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{let{rcid:t}=e;return(await i.Z.post(w("review-cycles/".concat(t,"/enter-moderation")),{},{headers:(0,g.g0)({realm:"hr"})})).data},onMutate:n,onSuccess:(t,r,n)=>
1{ec(u,null==r?void 0:r.rcid),(null==r?void 0:r.rcid)&&u.invalidateQueries({queryKey:p.S7.cycleRoot(r.rcid)}),u.invalidateQueries({queryKey:p.S7.pendingRoot}),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not move this review cycle into moderation. Please try again.",context:"useEnterModerationReviewCycle"}),null==t||t(e,r,n)},onSettled:r})},eh=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rcid:r,note:n}=e;return null===(t=(await i.Z.post(w("review-cycles/".concat(r,"/cancel")),n?{note:n}:{},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{ec(u,null==r?void 0:r.rcid),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not cancel this review cycle. Please try again.",context:"useCancelReviewCycle"}),null==t||t(e,r,n)},onSettled:r})},ef=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rpid:r}=e;return null===(t=(await i.Z.post("".concat(y.JW,"tenant/").concat((0,c.d_)(),"/review-participants/").concat(r,"/remind"),{},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{(null==r?void 0:r.rcid)&&u.invalidateQueries({queryKey:K.participantsForCycle(r.rcid)}),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not send that reminder. Please try again.",context:"useRemindParticipant"}),null==t||t(e,r,n)},onSettled:r})},ep=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rcid:r,status:n,relationship:a,departmentId:o}=e;return null===(t=(await i.Z.post(w("review-cycles/".concat(r,"/remind")),{...n?{status:n}:{},...a?{relationship:a}:{},...o?{department_id:o}:{}},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{(null==r?void 0:r.rcid)&&(u.invalidateQueries({queryKey:K.participantsForCycle(r.rcid)}),u.invalidateQueries({queryKey:K.progress(r.rcid)})),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not send those reminders. Please try again.",context:"useRemindCycle"}),null==t||t(e,r,n)},onSettled:r})},ew=Object.freeze({AGGREGATE:"aggregate",ROSTER:"roster"}),em=Object.freeze([]),eb=e=>!Array.isArray(e)&&(null==e?void 0:e.view)===ew.AGGREGATE,e_=function(){let{rsid:e,enabled:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(0,c.Xu)()||!e,a=(0,n.a)({queryKey:K.subject(e),enabled:!!t&&!r,queryFn:async()=>{var t;return null===(t=(await i.Z.get(w("review-subjects/".concat(e)),{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data}}),o=(0,l.useMemo)(()=>a.error?O(a.error,{fallback:"We could not load this personâs review. Please try again."}):null,[a.error]);return{...a,isMissingContext:r,cycleError:o,isUnreadable:x(a,U(a.data))}},eE=e=>{var t;return U(e)&&Array.isArray(null===(t=e.results)||void 0===t?void 0:t.groups)},eP=function(){let{rsid:e,enabled:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(0,c.Xu)()||!e,a=(0,n.a)({queryKey:K.subjectResults(e),enabled:!!t&&!r,queryFn:async()=>{var t;return null===(t=(await i.Z.get(w("review-subjects/".concat(e,"/results")),{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data}}),o=(0,l.useMemo)(()=>a.error?O(a.error,{fallback:"We could not load these review results. Please try again.",messages:{403:"You do not have access to these review results. If you think that is wrong, ask an admin."}}):null,[a.error]),u=(null==o?void 0:o.status)===409;return{...a,isMissingContext:r,cycleError:o,isUnreadable:x(a,eE(a.data)),isNotComputed:u,notComputedMessage:u?o.message:null}},ej=function(){var e,t,r,a,o;let{rsid:u,status:s,relationship:d,page:v,perPage:y,enabled:h=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},f=!(0,c.Xu)()||!u,p=K.subjectParticipants(u,{status:s,relationship:d,page:v,per_page:y}),[,,m]=p,b=(0,n.a)({queryKey:p,enabled:!!h&&!f,queryFn:async()=>(await i.Z.get(w("review-subjects/".concat(u,"/participants")),{params:m,headers:(0,g.g0)({realm:"hr"})})).data}),_=null===(e=b.data)||void 0===e?void 0:e.data,E=eb(_),P=Array.isArray(_),j=(0,l.useMemo)(()=>b.error?O(b.error,{fallback:"We could not load who is reviewing this person. Please try again."}):null,[b.error]),R=null;return E?R=ew.AGGREGATE:P&&(R=ew.ROSTER),{...b,isMissingContext:f,cycleError:j,view:R,rows:P?_:em,meta:null!==(a=null===(t=b.data)||void 0===t?void 0:t.meta)&&void 0!==a?a:null,aggregate:E?_:null,permissions:null!==(o=null===(r=b.data)||void 0===r?void 0:r.can)&&void 0!==o?o:null}},eR=function(e){let{rsid:t,rcid:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(e.invalidateQueries({queryKey:K.subjectParticipantsForSubject(t)}
1),e.invalidateQueries({queryKey:K.subject(t)})),r&&(e.invalidateQueries({queryKey:K.subjectsForCycle(r)}),e.invalidateQueries({queryKey:K.participantsForCycle(r)}))},eF=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rpid:r}=e;return null===(t=(await i.Z.post(w("review-participants/".concat(r,"/approve")),{},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{eR(u,r),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not approve that reviewer. Please try again.",context:"useApproveParticipant"}),null==t||t(e,r,n)},onSettled:r})},eS=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rpid:r,reason:n}=e;return null===(t=(await i.Z.post(w("review-participants/".concat(r,"/reject")),{reason:n},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{eR(u,r),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not reject that reviewer. Please try again.",context:"useRejectParticipant"}),null==t||t(e,r,n)},onSettled:r})},ek=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{let{rpid:t}=e;return(await i.Z.delete(w("review-participants/".concat(t)),{headers:(0,g.g0)({realm:"hr"})})).data},onMutate:n,onSuccess:(t,r,n)=>{eR(u,r),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not remove that reviewer. Please try again.",context:"useRemoveParticipant"}),null==t||t(e,r,n)},onSettled:r})},eA=function(){var e,t;let{uid:r,page:a,perPage:o,enabled:u=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=!(0,c.Xu)()||!r,d=K.employeeReviewHistory(r,{page:a,perPage:o}),[,,v]=d,y=(0,n.a)({queryKey:d,enabled:!!u&&!s,queryFn:async()=>(await i.Z.get(w("users/".concat(r,"/review-history")),{params:W(v),headers:(0,g.g0)({realm:"hr"})})).data}),h=(0,l.useMemo)(()=>y.error?O(y.error,{fallback:"We could not load this employeeâs review history. Please try again."}):null,[y.error]);return{...y,isMissingContext:s,cycleError:h,isUnreadable:x(y,Array.isArray(null===(e=y.data)||void 0===e?void 0:e.data)),subjects:Array.isArray(null===(t=y.data)||void 0===t?void 0:t.data)?y.data.data:em}},eq=function(){var e;let{uid:t,status:r,needsAttention:a,needsManager:o,departmentId:u,page:s,perPage:d,enabled:v=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},y=!(0,c.Xu)()||!t,h=K.mySubjects(t,{status:r,needsAttention:a,needsManager:o,departmentId:u,page:s,perPage:d}),[,,f]=h,p=(0,n.a)({queryKey:h,enabled:!!v&&!y,queryFn:async()=>(await i.Z.get(w("users/".concat(t,"/review-subjects")),{params:W(f),headers:(0,g.g0)({realm:"hr"})})).data}),m=(0,l.useMemo)(()=>p.error?O(p.error,{fallback:"We could not load your reviews. Please try again."}):null,[p.error]);return{...p,isMissingContext:y,cycleError:m,isUnreadable:x(p,Array.isArray(null===(e=p.data)||void 0===e?void 0:e.data))}},eC=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rsid:r,note:n}=e,a="string"==typeof n&&n.trim().length>0;return null===(t=(await i.Z.post(w("review-subjects/".concat(r,"/acknowledge")),a?{acknowledgement_note:n}:{},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{(null==r?void 0:r.rsid)&&u.invalidateQueries({queryKey:K.subject(r.rsid)}),(null==r?void 0:r.uid)&&u.invalidateQueries({queryKey:K.mySubjectsRoot(r.uid)}),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not record your acknowledgement. Please try again.",context:"useAcknowledgeReviewSubject"}),null==t||t(e,r,n)},onSettled:r})},eD=3,eI=100,eN=function(){var e,t,r;let{rsid:a,search:o,enabled:u=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s="string"==typeof o?o.trim():"",d=s.length<eD,v=!(0,c.Xu)()||!a,y=(0,n.a)({queryKey:K.nominationCandidates(a,s),enabled:!!u&&!v&&!d,queryFn:async()=>(await i.Z.get(w("review-subjects/".concat(a,"/nomination-candidates")),{params:{search:s},headers:(0,g.g0)({realm:"hr"})})).data,staleTime:3e4}),h=null===(e=y.data)||void 0===e?void 0:e.data,f=Array.isArray(h),p=(0,l.useMemo)(()=>y.error?O(y.error,{fallback:"We could not search your colleagues. Please try again."}):null,[y.error]);return{...y,isMissingContext:v,isBelowMinChars:d,cycleError:p,candidates:f?h:em,isTruncated:(null===(r=y.data)||void 0===r?void 0:null===(t=r.meta)||void 0===t?void 0:t.truncated)===!0,isUnreadable:x(y,f)}},eW=function(){let{onSuccess:e,onError:t,onSettled:r,onMutate:n,...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(0,a.NL)();return(0,o.D)({...l,mutationFn:async e=>{var t;let{rsid:r,nominees:n}=e;return null===(t=(await i.Z.post(w("review-subjects/".concat(r,"/nominations")),{nominees:n},{headers:(0,g.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data},onMutate:n,onSuccess:(t,r,n)=>{(null==r?void 0:r.rsid)&&(u.invalidateQueries({queryKey:K.subject(r.rsid)}
1),u.invalidateQueries({queryKey:K.subjectParticipantsForSubject(r.rsid)})),null==e||e(t,r,n)},onError:(e,r,n)=>{X(e,{fallback:"We could not save your nominations. Please try again.",context:"useSubmitNomination"}),null==t||t(e,r,n)},onSettled:r})}}}]);
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.