PageSourceSearch

https://www.elevolt.co.ke/_next/static/chunks/pages/hr/[tenant]/payroll-a1382a6340546e17.js

js elevolt.co.ke collected 2026-10-04 21:47:53 UTC 25,710 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="7262fdb3-8b05-47e5-bf8a-970e94b1f6de",e._sentryDebugIdIdentifier="sentry-dbid-7262fdb3-8b05-47e5-bf8a-970e94b1f6de")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7956],{83965:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/hr/[tenant]/payroll",function(){return t(4880)}])},4880:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return U}});var l=t(52322),s=t(47023),n=t(25439),r=t(65232),o=t(63798),i=t(17047),d=t(1973),c=t(77590),u=t(18966),m=t(87236),p=t(23825),y=t(75588),f=t(42399),x=t(76467),g=t(84475),b=t(64792),h=t(59417),v=t(99603),w=t(36160),j=t.n(w),N=t(5632),k=t(13980),_=t.n(k),C=t(2784),P=t(62202),Z=t(79337),D=t(76974),S=t(10988),q=t(47477),T=t(40511),E=t(19317),F=t(74523),A=t(52184);let M=e=>{let{period:a,onView:t,onEdit:s,onDelete:n,onGenerate:r,onSubmitForReview:o,onApprove:i,onProcess:d,className:c}=e;if(!a)return null;let u=(0,F.oZ)(a),m=!!a.is_locked,p=(0,F.A1)(a.status),y=(0,F.IN)(a.status),f=(0,F.Cz)(a.status),g=(0,F.TS)(a.status),b=(0,F.Zc)(a.status,m),w=(0,F.pV)(a.status,m);return(0,l.jsx)("div",{className:"\n        p-4 bg-white border border-gray-200 rounded-lg hover:border-blue-300\n        hover:shadow-sm transition-all duration-150 cursor-pointer ".concat(c||"","\n      "),onClick:()=>t&&t(a),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t&&t(a))},role:"button",tabIndex:0,children:(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,l.jsx)(x.Z,{className:"truncate",variant:"labelValue",children:u||"Untitled Period"}),(0,l.jsx)(T.Z,{size:"sm",status:a.status,type:"period"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,l.jsx)(v.G,{className:"text-gray-400",icon:h.IV4,size:"sm"}),(0,l.jsxs)(x.Z,{variant:"caption",children:[(0,q.p6)(a.start_date)," - ",(0,q.p6)(a.end_date)]})]}),!!a.frequency&&(0,l.jsx)("div",{className:"mb-3",children:(0,l.jsx)(S.Z,{label:a.frequency.charAt(0).toUpperCase()+a.frequency.slice(1),size:"sm"})}),(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 pt-3 border-t border-gray-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(v.G,{className:"text-gray-400",icon:h.FVb,size:"sm"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)(x.Z,{className:"block",variant:"label",children:"Employees"}),(0,l.jsx)(x.Z,{variant:"labelValue",children:a.total_employees||0}),a.total_employees>0&&(0,l.jsxs)("div",{className:"mt-1",children:[(0,l.jsx)("div",{className:"w-full h-1.5 bg-gray-200 rounded-full overflow-hidden",children:(0,l.jsx)("div",{className:"h-full bg-green-500 rounded-full transition-all",style:{width:"".concat(Math.min(100,(a.approved_payslips_count||0)/a.total_employees*100),"%")}})}),(0,l.jsxs)("div",{className:"flex items-center gap-1 mt-0.5",children:[(0,l.jsxs)(x.Z,{className:"text-green-600",variant:"caption",children:[a.approved_payslips_count||0,"/",a.total_employees]}),(0,l.jsx)(v.G,{className:"text-green-500",icon:h.f8k,size:"xs"})]})]})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x.Z,{className:"block",variant:"label",children:"Total Gross"}),(0,l.jsx)(x.Z,{variant:"labelValue",children:(0,A.T4)(a.total_gross||0)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x.Z,{className:"block",variant:"label",children:"Deductions"}),(0,l.jsx)(x.Z,{className:"text-red-600",variant:"labelValue",children:(0,A.T4)(a.total_deductions||0)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x.Z,{className:"block",variant:"label",children:"Total Net"}),(0,l.jsx)(x.Z,{className:"text-green-600 font-semibold",variant:"labelValue",children:(0,A.T4)(a.total_net||0)})]})]}),!!a.payment_date&&(0,l.jsx)("div",{className:"mt-3",children:(0,l.jsxs)(x.Z,{variant:"caption",children:["Payment date: ",(0,q.p6)(a.payment_date)]})})]}),(0,l.jsx)("div",{className:"flex items-center ml-4 shrink-0",onClick:e=>e.stopPropagation(),children:(0,l.jsx)(E.Z,{menuIcon:(0,l.jsx)(v.G,{"aria-label":"Open payroll period actions menu",className:"text-lg text-gray-500 hover:text-gray-700 cursor-pointer",icon:h.iV1,size:"1x"}),menuItems:[{text:"View",icon:(0,l.jsx)(v.G,{className:"mr-1",icon:h.Mdf}),action:()=>t&&t(a)},{text:"Edit",icon:(0,l.jsx)(v.G,{className:"mr-1",icon:h.IwR}),action:()=>s&&s(a),show:()=>b&&!!s},{text:"Generate Payslips",icon:(0,l.jsx)(v.G,{className:"mr-1",icon:h.fab}),action:()=>r&&r(a),show:()=>p&&!!r},{text:"Submit for Review",icon:(0,l.jsx)(v.G,{className:"mr-1",icon:h.E9T}),action:()=>o&&o(a),show:()=>y&&!!o},{text:"Approve",icon:(0,l.jsx)(v.G,{className:"mr-1",icon:h.f8k}),action:()=>i&&i(a),show:()=>f&&!!i},{text:"Process Payment",icon:(0,l.jsx)(v.G,{className:"mr-1",icon:h.b7W}),action:()=>d&&d(a),show:()=>g&&!!d},{text:"Delete",icon:(0,l.jsx)(v.G,{className:"mr-1",icon:h.$aW}),action:()=>n&&n(a),show:()=>w&&!!n}],subject:a})})]})})};
1M.propTypes={period:_().shape({id:_().oneOfType([_().string,_().number]),name:_().string,frequency:_().string,start_date:_().string,end_date:_().string,payment_date:_().string,status:_().string,is_locked:_().bool,total_employees:_().number,approved_payslips_count:_().number,total_gross:_().number,total_deductions:_().number,total_net:_().number}).isRequired,onView:_().func,onEdit:_().func,onDelete:_().func,onGenerate:_().func,onSubmitForReview:_().func,onApprove:_().func,onProcess:_().func,className:_().string},M.defaultProps={onView:void 0,onEdit:void 0,onDelete:void 0,onGenerate:void 0,onSubmitForReview:void 0,onApprove:void 0,onProcess:void 0,className:""};var G=t(32128),I=t(95254),R=t(62372),z=t(97203),B=t(60315),V=t(20641),O=t(31583),L=t(7223);let Y=e=>{let{show:a,onClose:t,period:n,onSuccess:r}=e,i=!!(null==n?void 0:n.id),[d,c]=(0,C.useState)({name:"",frequency:"monthly",start_date:(0,B.default)((0,V.default)(new Date),"yyyy-MM-dd"),end_date:(0,B.default)((0,O.default)(new Date),"yyyy-MM-dd"),payment_date:"",notes:""}),[u,p]=(0,C.useState)(!1),[y,f]=(0,C.useState)(new Date().getFullYear()),{data:g=[]}=(0,m.n8)(),b=(0,m.l4)({onSuccess:()=>{P.default.success("Payroll period created successfully"),r&&r(),N()},onError:e=>{P.default.error((null==e?void 0:e.message)||"Failed to create payroll period")}}),h=(0,m.Um)({periodId:null==n?void 0:n.id,onSuccess:()=>{P.default.success("Payroll period updated successfully"),r&&r(),N()},onError:e=>{P.default.error((null==e?void 0:e.message)||"Failed to update payroll period")}}),v=(0,m.XF)({onSuccess:()=>{P.default.success("Generated payroll periods for ".concat(y)),r&&r(),N()},onError:e=>{P.default.error((null==e?void 0:e.message)||"Failed to generate periods")}});(0,C.useEffect)(()=>{n&&i&&c({name:n.name||"",frequency:n.frequency||"monthly",start_date:n.start_date||"",end_date:n.end_date||"",payment_date:n.payment_date||"",notes:n.notes||""})},[n,i]),(0,C.useEffect)(()=>{let e;if(!d.start_date||i)return;let a=new Date(d.start_date);switch(d.frequency){case"weekly":e=(0,L.default)(a,6);break;case"bi-weekly":e=(0,L.default)(a,13);break;default:e=(0,O.default)(a)}c(a=>({...a,end_date:(0,B.default)(e,"yyyy-MM-dd")}))},[d.start_date,d.frequency,i]),(0,C.useEffect)(()=>{if(i||d.name)return;let e=new Date(d.start_date),a="";switch(d.frequency){case"monthly":default:a=(0,B.default)(e,"MMMM yyyy");break;case"bi-weekly":case"weekly":a="".concat((0,B.default)(e,"MMM d")," - ").concat((0,B.default)(new Date(d.end_date),"MMM d, yyyy"))}c(e=>({...e,name:a}))},[d.start_date,d.end_date,d.frequency,i,d.name]);let w=(0,C.useCallback)(e=>{let{name:a,value:t}=e.target;c(e=>({...e,[a]:t}))},[]),j=(0,C.useCallback)(e=>{let a=e.target.value;c(e=>({...e,frequency:a,name:""}))},[]),N=(0,C.useCallback)(()=>{c({name:"",frequency:"monthly",start_date:(0,B.default)((0,V.default)(new Date),"yyyy-MM-dd"),end_date:(0,B.default)((0,O.default)(new Date),"yyyy-MM-dd"),payment_date:"",notes:""}),p(!1),t&&t()},[t]),k=(0,C.useCallback)(e=>{if(e.preventDefault(),u){v.mutate({year:y,frequency:d.frequency});return}i?h.mutate(d):b.mutate(d)},[d,i,u,y,b,h,v]),_=b.isPending||h.isPending||v.isPending,Z=new Date().getFullYear(),D=Array.from({length:3},(e,a)=>Z+a),S=g.length>0?g.map(e=>({value:e.value,label:e.label})):(0,F.xW)();return(0,l.jsx)(z.B,{centerY:!0,fullWidth:!0,maxWidth:"500px",onClose:N,show:a,title:i?"Edit Payroll Period":"Create Payroll Period",children:(0,l.jsxs)("form",{className:"space-y-4",onSubmit:k,children:[!i&&(0,l.jsxs)("div",{className:"p-3 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,l.jsx)(G.J,{checked:u,label:"Generate all periods for a year",name:"generateForYear",onChange:e=>p(e.target.checked)}),(0,l.jsx)(x.Z,{className:"mt-1 ml-6 block text-gray-600",variant:"caption",children:"Automatically create all payroll periods based on frequency"})]}),!!u&&(0,l.jsx)(o.P,{label:"Year",name:"year",onChange:e=>f(Number(e.target.value)),options:D.map(e=>({value:String(e),label:String(e)})),selected:String(y)}),(0,l.jsx)(o.P,{label:"Pay Frequency",name:"frequency",onChange:j,options:S,required:!0,selected:d.frequency}),!u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.o,{label:"Period Name",name:"name",onChange:w,placeholder:"e.g., January 2024",required:!0,value:d.name}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(I.o,{label:"Start Date",name:"start_date",onCh
1ange:w,required:!0,type:"date",value:d.start_date}),(0,l.jsx)(I.o,{label:"End Date",name:"end_date",onChange:w,required:!0,type:"date",value:d.end_date})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(I.o,{label:"Payment Date",name:"payment_date",onChange:w,type:"date",value:d.payment_date}),(0,l.jsx)(x.Z,{className:"mt-1 text-gray-500",variant:"caption",children:"Leave blank to use default from company settings"})]}),(0,l.jsx)(R.K,{label:"Notes",name:"notes",onChange:w,placeholder:"Optional notes about this period...",rows:3,value:d.notes})]}),(0,l.jsxs)("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-200",children:[(0,l.jsx)(s.Z,{disabled:_,onClick:N,outline:!0,type:"button",children:"Cancel"}),(0,l.jsx)(s.Z,{disabled:_,type:"submit",children:_?"Saving...":u?"Generate ".concat(y," Periods"):i?"Update Period":"Create Period"})]})]})})};Y.propTypes={show:_().bool.isRequired,onClose:_().func.isRequired,period:_().shape({id:_().oneOfType([_().string,_().number]),name:_().string,frequency:_().string,start_date:_().string,end_date:_().string,payment_date:_().string,notes:_().string}),onSuccess:_().func},Y.defaultProps={period:null,onSuccess:void 0};let K=e=>{let{tenantName:a}=e,t=(0,N.useRouter)(),{user:g}=(0,u.Eu)(),[w,k]=(0,C.useState)(1),[_,D]=(0,C.useState)(new Date().getFullYear()),[S,q]=(0,C.useState)(""),[T,E]=(0,C.useState)(""),[F,A]=(0,C.useState)(!1),[G,I]=(0,C.useState)(null),R=new Date().getFullYear(),z=Array.from({length:5},(e,a)=>R-a+1),{data:B,isLoading:V,isFetching:O,error:L,refetch:K}=(0,m.db)({page:w,limit:10,year:_,status:S||void 0,frequency:T||void 0}),[U,W]=(0,C.useState)(!1);(0,C.useEffect)(()=>{W(!0)},[]);let H=V||!U,J=(null==B?void 0:B.data)||[],X=(null==B?void 0:B.meta)||{},$=(null==B?void 0:B.statistics)||{},Q=(0,m.wz)({}),ee=(0,m.cj)({}),ea=(0,m.lZ)({}),et=(0,m.YP)({}),el=(0,m.Ac)({}),es=(0,C.useCallback)(e=>{k(e)},[]),en=(0,C.useCallback)(e=>{D(Number(e.target.value)),k(1)},[]),er=(0,C.useCallback)(e=>{q(e||""),k(1)},[]),eo=(0,C.useCallback)(e=>{E(e.target.value),k(1)},[]),ei=(0,C.useCallback)(e=>{t.push("/hr/".concat(a,"/payroll/periods/").concat(e.id))},[t,a]),ed=(0,C.useCallback)(e=>{(0,i.Z)({title:"Generate Payslips",message:'This will generate payslips for all active employees in the period "'.concat(e.name,'". Do you want to proceed?'),confirmButtonText:"Generate",cancelButtonText:"Cancel",handler:async()=>{try{await Q.mutateAsync({periodId:e.id}),P.default.success("Payslips generated successfully"),K()}catch(e){P.default.error((null==e?void 0:e.message)||"Failed to generate payslips")}}})},[Q,K]),ec=(0,C.useCallback)(e=>{(0,i.Z)({title:"Submit for Review",message:'Submit "'.concat(e.name,'" for approval review? Reviewers will be notified.'),confirmButtonText:"Submit for Review",cancelButtonText:"Cancel",handler:async()=>{try{await ee.mutateAsync({periodId:e.id}),P.default.success("Payroll period submitted for review"),K()}catch(e){P.default.error((null==e?void 0:e.message)||"Failed to submit for review")}}})},[ee,K]),eu=(0,C.useCallback)(e=>
1{(0,i.Z)({title:"Approve Payroll Period",message:'This will approve all payslips in "'.concat(e.name,'". Make sure you have reviewed all payslips before proceeding.'),confirmButtonText:"Approve All",cancelButtonText:"Cancel",handler:async()=>{try{await ea.mutateAsync({periodId:e.id}),P.default.success("Payroll period approved"),K()}catch(e){P.default.error((null==e?void 0:e.message)||"Failed to approve period")}}})},[ea,K]),em=(0,C.useCallback)(e=>{(0,i.Z)({title:"Process Payroll",message:'This will mark all payslips in "'.concat(e.name,'" as paid. This action cannot be undone.'),confirmButtonText:"Process Payment",cancelButtonText:"Cancel",handler:async()=>{try{await et.mutateAsync({periodId:e.id}),P.default.success("Payroll processed successfully"),K()}catch(e){P.default.error((null==e?void 0:e.message)||"Failed to process payroll")}}})},[et,K]),ep=(0,C.useCallback)(e=>{I(e)},[]),ey=(0,C.useCallback)(e=>{(0,i.Z)({title:"Delete Payroll Period",message:'Are you sure you want to delete "'.concat(e.name,'"? This action cannot be undone and will remove all associated data.'),confirmButtonText:"Delete",cancelButtonText:"Cancel",handler:async()=>{try{await el.mutateAsync({periodId:e.id}),P.default.success("Payroll period deleted successfully"),K()}catch(e){P.default.error((null==e?void 0:e.message)||"Failed to delete payroll period")}}})},[el,K]),ef=(0,C.useCallback)(()=>{I(null),K()},[K]),ex=[{href:"/hr/".concat(a,"/payroll"),name:"Payroll",nodeType:"Link"}];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Z.Z,{title:"".concat((0,c.kC)((0,c.parseUnderScore)(a))," - Payroll Dashboard")}),(0,l.jsx)(y.Z,{actions:(0,l.jsxs)(s.Z,{onClick:()=>A(!0),children:[(0,l.jsx)(v.G,{className:"mr-2",icon:h.r8p}),"Create Period"]}),breadcrumbs:ex,description:"Run each pay period from draft to paid, and generate payslips for the team",fullWidth:!1,tenantName:a,title:"Payroll"}),(0,l.jsxs)("main",{className:"container flex flex-col gap-4 mx-auto px-4 md:px-8 lg:px-12 pb-6",children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,l.jsxs)("div",{className:"bg-white p-3 rounded-xl text-left border flex flex-col gap-2 md:gap-3",children:[(0,l.jsx)(x.Z,{variant:"bodySmall",weight:"font-semibold",children:"Total Periods"}),(0,l.jsx)(x.Z,{size:"text-2xl",weight:"font-semibold",children:String($.total_periods||J.length||0)})]}),(0,l.jsxs)("div",{className:"bg-white p-3 rounded-xl text-left border flex flex-col gap-2 md:gap-3",children:[(0,l.jsx)(x.Z,{variant:"bodySmall",weight:"font-semibold",children:"YTD Payroll"}),(0,l.jsx)(x.Z,{size:"text-2xl",weight:"font-semibold",children:(0,b.x)($.ytd_total||0)})]}),(0,l.jsxs)("div",{className:"bg-white p-3 rounded-xl text-left border flex flex-col gap-2 md:gap-3",children:[(0,l.jsx)(x.Z,{variant:"bodySmall",weight:"font-semibold",children:"Active Employees"}),(0,l.jsx)(x.Z,{size:"text-2xl",weight:"font-semibold",children:String($.active_employees||0)})]}),(0,l.jsxs)("div",{className:"bg-white p-3 rounded-xl text-left border flex flex-col gap-2 md:gap-3",children:[(0,l.jsx)(x.Z,{variant:"bodySmall",weight:"font-semibold",children:"Pending Approval"}),(0,l.jsx)(x.Z,{size:"text-2xl",weight:"font-semibold",children:String($.pending_approval||0)})]})]}),(0,l.jsxs)(r.ZP,{children:[(0,l.jsx)(r.Ol,{padding:{y:0},children:(0,l.jsxs)("div",{className:"w-full flex justify-between items-center",children:[(0,l.jsx)(x.Z,{variant:"sectionHeader",children:"Payroll Periods"}),(0,l.jsxs)("div",{className:"flex items-center gap-3 py-1",children:[(0,l.jsx)(o.P,{name:"year",onChange:en,options:z.map(e=>({value:String(e),label:String(e)})),selected:String(_)}),(0,l.jsx)(o.P,{defaultOption:"All Frequencies",name:"frequency",onChange:eo,options:[{value:"weekly",label:"Weekly"},{value:"bi_weekly",label:"Bi-Weekly"},{value:"semi_monthly",label:"Semi-Monthly"},{value:"monthly",label:"Monthly"}],selected:T}),(0,l.jsx)(n.Z,{ariaLabel:"Filter by status",onChange:er,options:[{key:null,label:"All"},{key:"draft",label:"Draft"},{key:"ready_for_approval",label:"Pending"},{key:"approved",label:"Approved"},{key:"processed",label:"Processed"}],size:"sm",value:S||null})]})]})}),(0,l.jsxs)(r.eW,{padding:0,children:[!!(H||L||j()(J))&&(0,l.jsx)("div",{className:"w-full flex flex-col bg-white p-4 rounded",children:(0,l.jsx)(d.Z,{action:H||L?void 0:(0,l.jsxs)(s.Z,{onClick:()=>A(!0),size:"sm",children:[(0,l.jsx)(v.G,{className:"mr-2",icon:h.r8p}
1),"Create Period"]}),description:L?"Please try refreshing the page.":"Create your first payroll period to get started.",design:"wrapped",isError:!!L,isLoading:H,message:L?"Failed to load payroll periods":"No payroll periods found"})}),!!(!H&&!L&&!j()(J))&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)(p.Z,{isFetching:O,children:(0,l.jsx)("div",{className:"space-y-3",children:J.map(e=>(0,l.jsx)(M,{onApprove:eu,onDelete:ey,onEdit:ep,onGenerate:ed,onProcess:em,onSubmitForReview:ec,onView:ei,period:e},e.id))})}),X.last_page>1&&(0,l.jsx)("div",{className:"mt-6 flex justify-center",children:(0,l.jsx)(f.Z,{currentPage:X.current_page,onPageChange:es,totalPages:X.last_page})})]})]})]})]}),(0,l.jsx)(Y,{onClose:()=>{A(!1),I(null)},onSuccess:ef,period:G,show:F||!!G})]})};K.propTypes={tenantName:_().string.isRequired},K.getInitialProps=async e=>{let{tenant:a}=e.query;return{tenantName:a}};var U=(0,g.withAuthSync)((0,D.Z)(K))},7223:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return r}});var l=t(4254),s=t(49435),n=t(4895);function r(e,a){(0,n.Z)(2,arguments);var t=(0,s.default)(e),r=(0,l.Z)(a);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}},20641:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return n}});var l=t(49435),s=t(4895);function n(e){(0,s.Z)(1,arguments);var a=(0,l.default)(e);return a.setDate(1),a.setHours(0,0,0,0),a}},25439:function(e,a,t){"use strict";var l=t(52322),s=t(2369),n=t(92942),r=t(12524),o=t.n(r),i=t(13980),d=t.n(i),c=t(2784);let u={sm:"px-3 sm:px-4 py-2 text-xs",md:"px-4 sm:px-6 py-2.5 sm:py-3 text-xs sm:text-sm"},m={sm:"px-3 py-2 text-xs",md:"px-4 py-2.5 text-xs"},p={sm:"px-3 py-2 text-xs",md:"px-4 py-2.5 text-sm"},y=e=>{var a,t,r;let{options:i,value:d,onChange:y,ariaLabel:f="Filter options",className:x="",disabled:g=!1,size:b="md"}=e,[h,v]=(0,c.useState)(!1),w=(0,c.useRef)(null),j=null!==(r=null===(a=i.find(e=>e.key===d))||void 0===a?void 0:a.label)&&void 0!==r?r:null===(t=i[0])||void 0===t?void 0:t.label,N=e=>{!g&&y&&y(e)},k=(0,c.useCallback)(()=>{g||v(e=>!e)},[g]),_=(0,c.useCallback)(e=>{!g&&y&&y(e),v(!1)},[g,y]);(0,c.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let C=(0,c.useCallback)(e=>{if(!h){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g||v(!0));return}let a=i.findIndex(e=>e.key===d);switch(e.key){case"Escape":case"Enter":case" ":e.preventDefault(),v(!1);break;case"ArrowDown":e.preventDefault();{let e=a<i.length-1?a+1:0;_(i[e].key)}break;case"ArrowUp":e.preventDefault();{let e=a>0?a-1:i.length-1;_(i[e].key)}}},[h,g,i,d,_]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:o()("relative sm:hidden",x),ref:w,children:[(0,l.jsxs)("button",{"aria-expanded":h,"aria-haspopup":"listbox","aria-label":f,className:o()("flex w-full items-center justify-between rounded-lg border border-gray-300 font-medium transition-colors duration-200","focus:ring-2 focus:ring-blue focus:ring-inset focus:outline-none",m[b],{"bg-white text-gray-700":!g,"opacity-50 cursor-not-allowed bg-white text-gray-400":g}),disabled:g,onClick:k,onKeyDown:C,type:"button",children:[(0,l.jsx)("span",{children:j}),(0,l.jsx)(n.FontAwesomeIcon,{className:o()("ml-2 text-xs transition-transform duration-200",{"rotate-180":h}),icon:s.ptq})]}),!!h&&(0,l.jsx)("div",{"aria-label":f,className:"absolute top-full left-0 mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 overflow-hidden",role:"listbox",children:i.map((e,a)=>{var t;let s=d===e.key,n=a===i.length-1;return(0,l.jsx)("button",{"aria-selected":s,className:o()("w-full text-left font-medium transition-colors duration-200",p[b],{"bg-blue text-white":s,"bg-white text-gray-700 hover:bg-gray-50":!s,"border-b border-gray-200":!n}),onClick:()=>_(e.key),onKeyDown:C,role:"option",type:"button",children:e.label},null!==(t=e.key)&&void 0!==t?t:"__null__")})})]}),(0,l.jsx)("div",{"aria-label":f,className:o()("hidden sm:inline-flex sm:flex-row rounded-lg border border-gray-300 overflow-hidden",{"opacity-50 cursor-not-allowed":g},x),role:"group",children:i.map((e,a)=>{var t;let s=d===e.key,n=a===i.length-1;return(0,l.jsx)("button",{"aria-pressed":s,className:o()("w-auto text-center font-medium transition-colors duration-200","focus:ring-2 focus:ring-blue focus:ring-inset focus:outline-none",u[b],{"bg-blue text-white":s,"bg-white text-gray-700 hover:bg-gray-50":!s&&!g,"bg-white text-gray-400":!s&&g,"border-r border-gray-300":!n}),disabled:g,onClick:()=>N(e.key),type:"button",children:e.label},null!==(t=e.key)&&void 0!==t?t:"__null__")})})]})};y.propTypes={options:d().arrayOf(d().shape({key:d().string,label:d().string.isRequired})).isRequired,value:d().string,onChange:d().func.isRequired,ariaLabel:d().string,className:d().string,disabled:d().bool,size:d().oneOf(["sm","md"])},a.Z=y},17047:function(e,a,t){"use strict";var l=t(52322),s=t(2784),n=t(94217);t(56486);var r=t(47023),o=t(59578),i=t(42369),d=t(76467);let c=e=>{let{onClose:a,handler:t,preOnCloseFn:n,title:c,message:u,details:m,confirmButtonText:p,cancelButtonText:y,initialIsLoading:f,suppressRecording:x}
1=e,[g,b]=(0,s.useState)(!1),h=f||g,v=(0,s.useCallback)(async()=>{b(!0);try{await t(),n(),a()}catch(e){b(!1),(0,o.N2)(e,"ConfirmDialogContent")}},[t,n,a]),w=(0,s.useCallback)(()=>{g||(n(),a())},[g,n,a]);return(0,l.jsxs)("div",{className:"confirm-dialog flex flex-col bg-white py-3 px-3 sm:py-4 sm:px-4 rounded shadow-sm relative".concat(x?" ".concat("fs-exclude"):""),"data-hj-suppress":x||void 0,"data-hs-do-not-collect":x?"true":void 0,children:[!!h&&(0,l.jsx)(i.J,{fixed:!1,size:"sm"}),(0,l.jsx)("div",{className:"w-full border-gray-200",children:(0,l.jsx)(d.Z,{className:"leading-none",variant:"heading5",children:c})}),(0,l.jsx)("hr",{className:"-mx-3 sm:-mx-4 my-2 sm:my-3"}),(0,l.jsxs)("div",{className:"w-full py-2",children:[(0,l.jsx)(d.Z,{variant:"body",children:u}),!!m&&(0,l.jsx)(d.Z,{className:"mt-2 break-all",color:"text-gray-600",variant:"caption",children:m})]}),(0,l.jsx)("hr",{className:"-mx-3 sm:-mx-4 my-2 sm:my-3"}),(0,l.jsxs)("div",{className:"w-full flex flex-col-reverse sm:flex-row sm:justify-between gap-2 border-gray-200",children:[(0,l.jsx)(r.Z,{className:"w-full sm:w-auto",design:"secondary",disabled:g,onClick:w,children:y}),(0,l.jsx)(r.Z,{className:"w-full sm:w-auto",design:"primary",disabled:g,isLoading:g,onClick:v,children:p})]})]})};a.Z=e=>{let{handler:a,preOnCloseFn:t=()=>{},title:s="Are you sure?",message:r="It may not be possible to undo this action. Are you sure you want to proceed?",details:o="",confirmButtonText:i="Yes, Proceed.",cancelButtonText:d="No, Let me check.",canExit:u=!0,isLoading:m=!1,suppressRecording:p=!1}=e;(0,n._1)({closeOnEscape:u,closeOnClickOutside:u,customUI:e=>{let{onClose:n}=e;return(0,l.jsx)(c,{cancelButtonText:d,confirmButtonText:i,details:o,handler:a,initialIsLoading:m,message:r,onClose:n,preOnCloseFn:t,suppressRecording:p,title:s})}})}},62372:function(e,a,t){"use strict";t.d(a,{K:function(){return i}});var l=t(52322);t(2784);var s=t(13980),n=t.n(s),r=t(12524),o=t.n(r);let i=e=>{let{label:a,placeholder:t,name:s,error:n,rows:r,onChange:i,value:d,defaultValue:c,className:u,onKeyUp:m,onKeyDownHandler:p,onBlur:y,disabled:f,required:x=!1}=e,g=o()("block","text-sm","font-medium","tracking-wide","mb-1",{"text-gray-700":!n,"text-red-400":n}),b=o()("appearance-none","w-full","px-3","py-2","text-gray-700","bg-white","border","rounded-lg","leading-tight","transition-colors","duration-200","focus:outline-none","focus:ring-2","focus:ring-blue-500","focus:border-transparent","disabled:bg-gray-100","disabled:text-gray-500","disabled:cursor-not-allowed",{"border-gray-300":!n,"border-red-400":n,"focus:ring-red-500":n},u);return(0,l.jsxs)(l.Fragment,{children:[!!a&&(0,l.jsxs)("label",{className:g,htmlFor:s,children:[a,!!x&&(0,l.jsx)("span",{className:"text-red-400 text-xs ml-1",children:"*"})]}),(0,l.jsx)("textarea",{className:b,defaultValue:c,disabled:f,id:s,name:s,onBlur:y,onChange:i,onKeyDown:p,onKeyUp:m,placeholder:t,required:x,rows:r,value:d}),!!n&&(0,l.jsx)("span",{className:"text-red-400 text-xs mt-1 block",children:n})]})};i.propTypes={label:n().string,value:n().string,placeholder:n().string,name:n().string.isRequired,rows:n().number,error:n().string,onChange:n().func.isRequired,defaultValue:n().string,className:n().string,onKeyUp:n().func,onKeyDownHandler:n().func,onBlur:n().func,disabled:n().bool,required:n().bool}}},function(e){e.O(0,[4976,5351,9603,6383,1985,7568,974,2370,4806,2888,9774,179],function(){return e(e.s=83965)}),_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.