1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bba54465-75ac-4a89-9459-2a915c46280a",e._sentryDebugIdIdentifier="sentry-dbid-bba54465-75ac-4a89-9459-2a915c46280a")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2468],{68933:function(e,n,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/hr/[tenant]/performance/cycles",function(){return s(29778)}])},18183:function(e,n,s){"use strict";var t=s(52322),a=s(13980),r=s.n(a),l=s(2784),i=s(63798),o=s(29825);let c=e=>{let{departments:n=[],value:s=null,onChange:a,name:r="department_id",label:c,error:d}=e,u=(0,l.useMemo)(()=>{let e=(0,o.w8)(n);return(0,o.Z8)(e,{excludeArchived:!0}).map(e=>({value:e.did,label:"".concat("\xa0\xa0\xa0\xa0".repeat(e.depth)).concat(e.name)}))},[n]);return(0,t.jsx)(i.P,{defaultOption:"Select a department...",error:d,label:c,name:r,onChange:e=>a(e.target.value||null),options:u,selected:null!=s?s:""})};c.propTypes={departments:r().arrayOf(r().object),value:r().string,onChange:r().func.isRequired,name:r().string,label:r().string,error:r().string},n.Z=c},29778:function(e,n,s){"use strict";s.r(n),s.d(n,{default:function(){return ed}});var t=s(52322),a=s(5632),r=s(13980),l=s.n(r),i=s(2784),o=s(62202),c=s(47023),d=s(65232),u=s(17047),p=s(77590),m=s(30900),h=s(82292),y=s(23627),g=s(97203),f=s(75588),b=s(79663),v=s(65405),x=s(51634),w=s(84475),j=s(79337),_=s(99157),R=s(30591),N=s(83619),k=s(76467);let C=Object.freeze({draft:"drafts",nominating:"inProgress",collecting:"inProgress",calibrating:"inProgress",moderating:"inProgress",closed:"finished",released:"finished",cancelled:"finished"}),E=Object.freeze(["drafts","inProgress","finished"]),O=e=>Object.prototype.hasOwnProperty.call(C,e)?C[e]:null,P=e=>Object.keys(C).filter(n=>C[n]===e),Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,n)=>{let s=O(null==n?void 0:n.status)||"uncategorised";return{...e,[s]:e[s]+1}},{drafts:0,inProgress:0,finished:0,uncategorised:0})},S=e=>{let n=(Array.isArray(e)?e:[e]).map(O);return 0===n.length||n.some(e=>null===e)?[...E]:E.filter(e=>n.includes(e))},D={drafts:{label:"Drafts",one:"Draft"},inProgress:{label:"Running"},finished:{label:"Closed"}},I=e=>e.includes("inProgress")?"inProgress":e[0],A=(e,n)=>1===n&&D[e].one?D[e].one:D[e].label,T=e=>1===e?"1 cycle listed below is not counted above.":"".concat(e," cycles listed below are not counted above."),L=e=>{let{cycles:n,isVisible:s,statusFilter:a}=e;if(!s)return null;let r=Z(n),l=S(a),i=I(l),o=[i,...l.filter(e=>e!==i)];return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-4",children:o.map(e=>(0,t.jsx)(N.Z,{className:e===i?"sm:col-span-2":void 0,emphasis:e===i?"primary":"secondary",label:A(e,r[e]),value:r[e]},e))}),(0,t.jsx)(k.Z,{color:"text-gray-500",variant:"caption",children:"Counts cover the cycles listed below, not every cycle in your workspace."}),r.uncategorised>0&&(0,t.jsx)(k.Z,{color:"text-gray-500",variant:"caption",children:T(r.uncategorised)})]})};L.propTypes={cycles:l().arrayOf(l().object).isRequired,isVisible:l().bool.isRequired,statusFilter:l().oneOfType([l().string,l().arrayOf(l().string)])};var M=s(10988),q=s(16936),F=s(67001),W=s(90938),U=s(19317),V=s(61416),z=s(31515),B=s(79147);let Y=[{key:"name",header:"Cycle"},{key:"type",header:"Cadence"},{key:"purpose",header:"Purpose"},{key:"closes",header:"Reviews close"},{key:"completion",header:"Completion"},{key:"status",header:"Status"},{align:"right",key:"actions",header:"Actions"}],K="No close date set",Q=new Set(["nominating","collecting"]),X=e=>Q.has(e.status)?(0,t.jsx)(F.Z,{fallback:K,value:e.review_closes_at,verb:"closes"}):(0,t.jsx)(k.Z,{as:"span",color:"text-gray-600",variant:"caption",children:(0,z.mn)(e.review_closes_at,K)}),H=e=>{if(Q.has(e.status))return X(e);let n=(0,z.mn)(e.review_closes_at,null);return(0,t.jsx)(k.Z,{as:"span",color:"text-gray-600",variant:"caption",children:n?"Reviews close: ".concat(n):K})},$=e=>{let n=e.subjects_count;return Number.isInteger(n)?0===n&&"draft"===e.status?"Nobody added yet":null:"Coverage not counted"},G=e=>$(e)||(1===e.subjects_count?"1 person":"".concat(e.subjects_count," people")),J=e=>e===B.tt.EVALUATION?"orange":"blue",ee=e=>"closed"===e.status||"released"===e.status?"Not shown to you":"cancelled"===e.status?"Not measured":"draft"===e.status?"Not launched yet":"Nobody to count yet",en=e=>{var n,s;return null!==(s=null!==(n=e.completion_rate)&&void 0!==n?n:e.live_completion_rate)&&void 0!==s?s:null},es=e=>null===e.completion_rate||void 0===e.completion_rate,et="text-blue rounded-sm underline-offset-2 hover:underline focus-visible:underline focus-visible:ring-2 focus-visible:ring-blue focus-visible:ring-offset-1",ea=e=>{let{cycles:n,tenantName:s,isLoading:a,isError:r,isFetching:l,errorMessage:i,errorDescription:o,pagination:d,onPageChange:u,onLaunch:p,onRemind:m,canRemind:h}=e,y=e=>"/hr/".concat(s,"/performance/cycles/").concat(e.rcid),g=e=>{let n=[];return e.can_launch&&n.push({text:"Launch",promoted:"Launch",action:()=>p(e)}),h(e)&&n.push({text:"Remind everyone",promoted:"Remind",action:()=>m(e)}),n.push({text:"Open",promoted:"Open",href:y(e)}),n},f=(e,n)=>{let s=(0,t.jsxs)(k.Z,{as:"span",className:"sr-only",variant:"caption",children:[" ",n.name]});return e.action?(0,t.jsxs)(c.Z,{className:et,design:"plain",onClick:e.action,size:"sm",type:"button",children:[e.promoted,s]}):(0,t.jsxs)(c.Z,{className:et,design:"link",href:y(n),size:"sm",children:[e.promoted,s]})},b=e=>{let[n,...s]=g(e);return(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[f(n,e),s.length>0&&(0,t.jsx)(U.C,{buttonLabel:"More actions for ".concat(e.name),buttonSentryComponent:"CyclesTableRowActions",menuItems:s,subject:e})]})};return(0,t.jsx)(q.Z,{columns:Y,emptyDescription:"Create one to start collecting feedback.",emptyMessage:"No review cycles yet",errorDescription:o||"Refresh the page, and let an admin know if it keeps happening.",errorMessage:i||"We could not load your review cycles",isError:!!r,isFetching:!!l,isLoading:!!a,onPageChange:u,pagination:d,renderMobileCard:e=>(0,t.jsxs)("div",{className:"rounded border border-gray-200 p-3 flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)(k.Z,{variant:"labelValue",weight:"font-semibold",children:e.name}),b(e)]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(M.Z,{color:J(e.purpose),label:e.purpose_label}),(0,t.jsx)(W.Co,{label:e.status_label,lifecycle:"cycle",status:e.status}),H(e)]}),(0,t.jsxs)(k.Z,{color:"text-gray-600",variant:"caption",children:[e.type_label," \xb7 ",G(e)]}),(0,t.jsx)(V.Z,{label:"Completion for ".concat(e.name),showLabel:!1,size:"sm",unmeasuredText:ee(e),value:en(e)}),!!(null!==en(e)&&es(e))&&(0,t.jsx)(k.Z,{color:"text-gray-500",variant:"caption",children:"So far"})]}),renderRow:e=>{let n=$(e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(k.Z,{as:"span",variant:"labelValue",children:e.name}),!!n&&(0,t.jsx)(k.Z,{as:"span",color:"text-gray-500",variant:"caption",children:n})]})}),(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)(k.Z,{as:"span",color:"text-gray-600",variant:"caption",children:e.type_label})}),(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)(M.Z,{color:J(e.purpose),label:e.purpose_label})}),(0,t.jsx)("td",{className:"px-4 py-3",children:X(e)}),(0,t.jsxs)("td",{className:"px-4 py-3 min-w-[9rem]",children:[(0,t.jsx)(V.Z,{label:"Completion for ".concat(e.name),showLabel:!1,size:"sm",unmeasuredText:ee(e),value:en(e)}),!!(null!==en(e)&&es(e))&&(0,t.jsx)(k.Z,{as:"span",color:"text-gray-500",variant:"caption",children:"So far"})]}),(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)(W.Co,{label:e.status_label,lifecycle:"cycle",status:e.status})}),(0,t.jsx)("td",{className:"px-4 py-3 text-right",children:b(e)})]})},rowKey:e=>e.rcid,rows:n})};ea.propTypes={cycles:l().arrayOf(l().object).isRequired,tenantName:l().string.isRequired,isLoading:l().bool.isRequired,isError:l().bool.isRequired,isFetching:l().bool,errorMessage:l().string,errorDescription:l().string,pagination:l().object,onPageChange:l().func.isRequired,onLaunch:l().func.isRequired,onRemind:l().func.isRequired,canRemind:l().func.isRequired};let er=[{token:"all",label:"All",status:void 0},{token:"running",label:"Running",statuses:P("inProgress")},{token:"draft",label:"Draft",status:"draft"},{token:"closed",label:"Closed",statuses:P("finished")}],el=er.map(e=>e.token),ei=new Map([[h.l5.FEATURE_DISABLED,{message:"Review cycles are not available yet",description:"Elevolt switches this on, not your settings. Contact support if you need it."}],[h.l5.SUBSCRIPTION_REQUIRED,{message:"Review cycles are not on your plan",description:"Ask an admin to add the Performance module to your subscription."}],[h.l5.FORBIDDEN,{message:"You do not have access to review cycles",description:"Check you are signed in to the right workspace, then ask an admin to confirm your access."}]]),eo=e=>el.includes(e)?e:"all",ec=e=>{var n,s,r,l,w;let{tenantName:N}=e,k=(0,a.useRouter)(),C=(0,h.jC)(),[E,O]=(0,i.useState)(1),[P,Z]=(0,i.useState)(null),S=eo(k.query.status),D=er.find(e=>e.token===S)||er[0],{track:I}=(0,y.Ke)({app:"portal"}),A=(0,h.lM)({status:D.status,statuses:D.statuses,page:E,perPage:15}),T=null===(n=A.data)||void 0===n?void 0:n.data,M=(null===(s=A.data)||void 0===s?void 0:s.meta)||{},{cycleError:q,isMissingContext:F,isUnreadable:W}=A,U=(0,h.os)(),V=null===(r=A.data)||void 0===r?void 0:r.can,z=!!(null==V?void 0:V.create_review_cycle),B=!!(null==V?void 0:V.launch_review_cycle),Y=!!(null==V?void 0:V.update_review_cycle),K=(0,i.useMemo)(()=>{let e=Array.isArray(T)?T:[];return B?e:e.map(e=>({...e,can_launch:!1}))},[B,T]),Q=(0,i.useCallback)(e=>Y&&(0,h.xE)(e),[Y]),X=(0,i.useCallback)(()=>Z(null),[]),H=(0,i.useCallback)(()=>{C({rcid:null==P?void 0:P.rcid})},[C,P]),$=(0,i.useCallback)(e=>{(0,u.Z)({handler:async()=>{var n;let s=await U.mutateAsync({rcid:e.rcid});
1if(I(m.dW.PERF_REMINDER_SENT_MANUAL,{scope:"cycle",reminded:null!==(n=null==s?void 0:s.reminded)&&void 0!==n?n:0,surface:m.S9.PERFORMANCE_REVIEWS}),(null==s?void 0:s.reason)==="dispatch_failed"){o.default.error((0,R.i)(s));return}o.default.success((0,R.i)(s))},suppressRecording:!0,title:"Remind everyone outstanding",message:'Every reviewer in "'.concat(e.name,'" who has not answered yet will be emailed. Reviewers reminded in the last day are skipped.'),confirmButtonText:"Send reminders",cancelButtonText:"Cancel"})},[U,I]),G=(0,i.useCallback)(e=>{let n=er[e]||er[0];O(1),k.push({pathname:k.pathname,query:{...k.query,status:n.token}},void 0,{shallow:!0})},[k]);(0,i.useEffect)(()=>{O(1)},[S]),(0,i.useEffect)(()=>{let e=M.last_page;Number.isInteger(e)&&!(e<1)&&O(n=>Math.min(n,e))},[M.last_page]);let J=!F&&!A.isPending&&!q&&!W,ee=null!==(l=M.total)&&void 0!==l?l:0,en=(0,i.useRef)(null);(0,i.useEffect)(()=>{J&&en.current!==S&&(en.current=S,I(m.dW.PERF_CYCLE_LIST_VIEWED,{status:S,cycle_count:ee,surface:m.S9.PERFORMANCE_REVIEWS}))},[J,S,ee,I]);let es=(0,i.useRef)(!1);(0,i.useEffect)(()=>{es.current||(null==q?void 0:q.reason)!==h.l5.SUBSCRIPTION_REQUIRED||(es.current=!0,I(m.dW.PAYWALL_SHOWN,{reason:m.V$.PERFORMANCE_MODULE,surface:m.S9.PERFORMANCE_REVIEWS}))},[q,I]);let et=(0,i.useMemo)(()=>[{href:"/hr/".concat(N,"/performance"),name:"Performance",nodeType:"Link"},{href:"/hr/".concat(N,"/performance/cycles"),name:"Review cycles",nodeType:"Link"}],[N]),ec=(0,i.useMemo)(()=>F?{message:"We could not tell which workspace you are in",description:"Check you are signed in to the right workspace, then try again."}:W?{message:"We could not read your review cycles",description:"What came back was not a list we could read, so this is not a sign your workspace has none. Refresh the page, and let an admin know if it keeps happening."}:ei.get(null==q?void 0:q.reason)||{description:null==q?void 0:q.message},[q,F,W]),ed=(0,t.jsx)(ea,{canRemind:Q,cycles:K,errorDescription:ec.description,errorMessage:ec.message,isError:!!(q||F||W),isFetching:A.isFetching,isLoading:!F&&A.isPending,onLaunch:Z,onPageChange:O,onRemind:$,pagination:M,tenantName:N});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{thirdParty:!1,title:"".concat((0,p.kC)((0,p.parseUnderScore)(N))," - Review cycles")}),(0,t.jsxs)("main",{className:"container flex flex-col gap-4 mx-auto px-4 md:px-8 lg:px-12 pb-6",children:[(0,t.jsx)(f.Z,{actions:!!z&&(0,t.jsx)(c.Z,{href:"/hr/".concat(N,"/performance/cycles/new"),children:"New cycle"}),breadcrumbs:et,description:"Set up review rounds, watch them run, and launch them when you are ready",tenantName:N,title:"Review cycles"}),(0,t.jsx)(L,{cycles:K,isVisible:J,statusFilter:null!==(w=D.status)&&void 0!==w?w:D.statuses}),(0,t.jsx)(d.ZP,{children:(0,t.jsx)(d.eW,{padding:0,children:(0,t.jsxs)(b.ZP,{activeIndex:el.indexOf(S),onChange:G,syncWithUrl:!1,children:[er.map(e=>(0,t.jsx)(v.Z,{label:e.label},e.token)),er.map(e=>(0,t.jsx)(x.Z,{padding:4,children:S===e.token&&ed},e.token))]})})})]}),!!P&&(0,t.jsx)(g.B,{maxWidth:"640px",onClose:X,show:!0,title:"Launch review cycle",children:(0,t.jsx)(_.Z,{cycle:P,onLaunched:H,secondaryAction:(0,t.jsx)(c.Z,{design:"secondary",onClick:X,type:"button",children:"Close"})})})]})};ec.getInitialProps=async e=>{let{tenant:n}=e.query;return{tenantName:n}},ec.propTypes={tenantName:l().string.isRequired};var ed=(0,w.withAuthSync)(ec)},67001:function(e,n,s){"use strict";var t=s(52322),a=s(13980),r=s.n(a),l=s(10988),i=s(31515);let o={due:{imminent:"Due",past:"Overdue",future:"Due"},closes:{imminent:"Closes",past:"Closed",future:"Closes"},opens:{imminent:"Opens",past:"Opened",future:"Opens"}},c=(e,n)=>n?"red":null===e?"gray":e<=2?"red":e<=7?"orange":"gray",d=(e,n,s)=>{let{label:t,isOverdue:a,dayDelta:r}=s,l=o[n];return null===r?t:a?"due"===n?t:"".concat(l.past," ").concat((0,i.mn)(e)):0===r?"".concat(l.imminent," today"):1===r?"".concat(l.imminent," tomorrow"):"".concat(l.future," in ").concat(r," days")},u=e=>{let{value:n,verb:s="due",fallback:a="No date set",now:r,size:o="sm",className:u}=e,p=(0,i.ci)(n,{fallback:a,...r?{now:r}:{}});return(0,t.jsx)(l.Z,{className:u,color:c(p.dayDelta,p.isOverdue),label:d(n,s,p),size:o})};u.propTypes={value:r().oneOfType([r().instanceOf(Date),r().string,r().number]),verb:r().oneOf(["due","closes","opens"]),fallback:r().string,now:r().instanceOf(Date),size:r().oneOf(["sm","md"]),className:r().str
1ing},n.Z=u}},function(e){e.O(0,[5351,6383,1985,3587,974,1282,9277,2292,248,610,6441,7721,2888,9774,179],function(){return e(e.s=68933)}),_N_E=e.O()}]);
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.