1"use strict";(self.webpackChunkclient=self.webpackChunkclient||[]).push([[6347],{1134:(e,t,a)=>{a.d(t,{O:()=>s});var n=a(90287),l=a(37645),r=a(38961);const o=n.A.create({baseURL:"/api/memberships"});(0,l.Cy)(o);const s=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const a=await o.get("/".concat(e.membership_id,"/id-card"),{params:{bleed:t},responseType:"blob"});(0,r.C)(a,"ID-Card.zip","application/zip")}},2731:(e,t,a)=>{a.d(t,{$U:()=>c,BN:()=>f,L9:()=>d,Mq:()=>s,Nl:()=>A,OU:()=>b,Q:()=>_,Rs:()=>x,UH:()=>j,Uy:()=>g,Xj:()=>v,_4:()=>i,aj:()=>o,ap:()=>m,er:()=>y,l5:()=>h,qE:()=>u,s_:()=>p});var n=a(90287),l=a(37645);const r=n.A.create({baseURL:"/api/employee-attendance"});(0,l.Cy)(r);const o=async function(e){let{faceVerified:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=new FormData,n=new File([e],"face-".concat(Date.now(),".jpg"),{type:"image/jpeg"});a.append("photo",n),t&&a.append("faceVerified","true");return(await r.post("/recognize",a,{headers:{"Content-Type":"multipart/form-data"}})).data},s=async function(e){let{faceVerified:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=new FormData,n=new File([e],"face-test-".concat(Date.now(),".jpg"),{type:"image/jpeg"});a.append("photo",n),t&&a.append("faceVerified","true");return(await r.post("/recognize-test",a,{headers:{"Content-Type":"multipart/form-data"}})).data},i=async function(e,t){let{replace:a=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new FormData,l=new File([t],"enroll-".concat(Date.now(),".jpg"),{type:"image/jpeg"});n.append("photo",l),n.append("replace",a?"true":"false");return(await r.post("/enroll/".concat(e),n,{headers:{"Content-Type":"multipart/form-data"}})).data},c=async e=>(await r.delete("/enroll/".concat(e))).data,d=async e=>(await r.get("/enroll/".concat(e))).data,u=async()=>(await r.get("/enroll/status/all")).data,m=async e=>(await r.get("/daily-report?date=".concat(e))).data,y=async e=>(await r.get("/monthly-report?month=".concat(e))).data,p=async()=>(await r.get("/staff-list")).data,h=async(e,t)=>(await r.get("/employee/".concat(e,"/punctuality"),{params:{month:t}})).data,x=async(e,t,a,n)=>(await r.post("/manual",{employeeId:e,date:t,status:a,notes:n})).data,f=async function(e){let{token:t=null,employeeId:a=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await r.post("/clock",{action:e,token:t,employeeId:a})).data},v=async(e,t)=>{const a=new FormData;if(e){const t=new File([e],"failed-".concat(Date.now(),".jpg"),{type:"image/jpeg"});a.append("photo",t)}a.append("reason",t||"no_match");return(await r.post("/failed-recognition",a,{headers:{"Content-Type":"multipart/form-data"}})).data},g=async()=>(await r.get("/employees")).data,j=async()=>(await r.get("/my-status")).data,b=async(e,t)=>(await r.post("/self-checkout/begin",{latitude:e,longitude:t})).data,A=async e=>(await r.post("/self-checkout",{token:e})).data,_=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(await r.get("/failed-recognitions",{params:e})).data}},7163:(e,t,a)=>{a.r(t),a.d(t,{default:()=>De});var n=a(9950),l=a(32856),r=a(28429),o=a(42074),s=a(19578),i=a(19602),c=a(85667),d=a(82990),u=a(76051),m=a(89008),y=a(1134),p=a(94121),h=a(58755),x=a(65455),f=a(10495),v=a(24513),g=a(95749),j=a(47738),b=a(41967),A=a(72760),_=a(31170),k=a(15458),S=a(30481),w=a(5280),C=a(35621),z=a(82056),E=a(9762),O=a(22256),I=a(42886),D=a(18246),F=a(44414);const N=e=>{var t;let{employee:a}=e;const n=[{key:"eid",label:"Employee ID",children:a.eid||"-"},{key:"title",label:"Title",children:a.employee_title||"-"},{key:"phone",label:"Phone",children:a.phone_number?(0,F.jsx)(D.A,{number:a.phone_number}):"-"},{key:"email",label:"Email",children:a.email?(0,F.jsx)("a",{href:"mailto:".concat(a.email),children:a.email}):"-"},{key:"dob",label:"Date of Birth",children:a.date_of_birth?(0,I.Yq)(a.date_of_birth):"-"},{key:"gender",label:"Gender",children:a.gender||"-"},{key:"joining",label:"Date of Joining",children:a.date_of_joining?(0,I.Yq)(a.date_of_joining):"-"},{key:"leaving",label:"Date of Leaving",children:a.date_of_leaving?(0,I.Yq)(a.date_of_leaving):"-"},...a.exit_reason?[{key:"exit_reason",label:"Reason for Leaving",children:a.exit_reason}]:[],{key:"blood_group",label:"Blood Group",children:a.blood_group||"-"},{key:"marital_status",label:"Marital Status",children:a.marital_status||"-"},{key:"father_name",label:"Father's Name",children:a.father_name||"-"}
1,{key:"mother_name",label:"Mother's Name",children:a.mother_name||"-"},{key:"spouse_name",label:"Spouse Name",children:a.spouse_name||"-"},{key:"qualification",label:"Qualification",children:a.qualification||"-"},{key:"current_address",label:"Current Address",children:a.current_address||"-"},{key:"permanent_address",label:"Permanent Address",children:a.permanent_address||"-"},...null!==(t=a.pickup_location)&&void 0!==t&&t.name?[{key:"pickup_location",label:"Pickup Location",children:a.pickup_location.link?(0,F.jsx)("a",{href:a.pickup_location.link,target:"_blank",rel:"noopener noreferrer",children:a.pickup_location.name}):a.pickup_location.name}]:[]];return a.roles&&a.roles.length>0&&n.splice(2,0,{key:"roles",label:"Roles",children:(0,F.jsx)("div",{children:a.roles.map(e=>(0,F.jsx)(C.A,{color:"blue",style:{marginBottom:4},children:e.display_name},e.id))})}),a.classrooms&&a.classrooms.length>0&&n.splice(3,0,{key:"classrooms",label:"Classrooms",children:(0,F.jsx)("div",{children:a.classrooms.map((e,t)=>(0,F.jsx)(C.A,{color:"green",style:{marginBottom:4},children:e.name},t))})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{style:{display:"flex",gap:16,flexWrap:"wrap",alignItems:"flex-start",marginBottom:24},children:(0,F.jsx)(z.A,{title:"Employee Details",style:{flex:1,minWidth:280},children:(0,F.jsx)(E.A,{items:n,column:{xs:1,sm:1,md:2,lg:2,xl:2},size:"small"})})}),"Teacher"===a.role&&(0,F.jsx)(z.A,{title:"Presentations",children:(0,F.jsx)(O.A,{membershipId:a.membership_id})})]})};var T=a(55480),M=a(43910),P=a(23072),B=a(25975),R=a(87094),W=a(41988),L=a(4159),Y=a.n(L),U=a(30540);const{Text:K}=T.A,q=e=>{let{currentSalary:t,onUpdate:a}=e;if(!t)return(0,F.jsx)(z.A,{children:(0,F.jsx)("div",{style:{textAlign:"center",padding:"40px 20px"},children:(0,F.jsx)(K,{type:"secondary",style:{fontSize:"16px"},children:'No salary structure found. Use the "Revise Salary" button above to create one.'})})});t.annual_ctc;const n=(t.salary_structure||[]).filter(e=>"earning"===e.component_type),l=(t.salary_structure||[]).filter(e=>"deduction"===e.component_type),r=(t.salary_structure||[]).filter(e=>"employer_contribution"===e.component_type),o=(t.salary_structure||[]).filter(e=>"benefit"===e.component_type),s=n.reduce((e,t)=>e+parseFloat(t.annual_amount||0),0),i=l.reduce((e,t)=>e+parseFloat(t.annual_amount||0),0),c=r.reduce((e,t)=>e+parseFloat(t.annual_amount||0),0),d=o.reduce((e,t)=>e+parseFloat(t.annual_amount||0),0),u=s/12,m=i/12,y=c/12,p=d/12;return(0,F.jsxs)("div",{children:[(0,F.jsxs)(z.A,{title:"Summary",style:{marginBottom:24},children:[(0,F.jsxs)(R.A,{align:"middle",style:{marginBottom:32},children:[(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsxs)(z.A,{size:"small",style:{textAlign:"center",minWidth:150},children:[(0,F.jsx)(K,{type:"secondary",strong:!0,children:"CTC"}),(0,F.jsxs)("div",{style:{fontSize:"16px",fontWeight:"bold",color:"var(--color-primary)"},children:[(0,U.vv)(s+c+d,0)," / yr"]}),(0,F.jsxs)("div",{style:{fontSize:"14px",color:"rgba(255, 255, 255, 0.85)"},children:[(0,U.vv)((s+c+d)/12,0)," ","/ mo"]})]})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsx)("span",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 16px"},children:"="})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsxs)(z.A,{size:"small",style:{textAlign:"center",minWidth:150},children:[(0,F.jsx)(K,{type:"secondary",strong:!0,children:"Gross Salary"}),(0,F.jsxs)("div",{style:{fontSize:"16px",fontWeight:"bold"},children:[(0,U.vv)(s,0)," / yr"]}),(0,F.jsxs)("div",{style:{fontSize:"14px",color:"rgba(255, 255, 255, 0.85)"},children:[(0,U.vv)(u,0)," / mo"]})]})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsx)("span",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 16px"},children:"+"})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsxs)(z.A,{size:"small",style:{textAlign:"center",minWidth:150},children:[(0,F.jsx)(K,{type:"secondary",strong:!0,children:"Employer Contributions"}),(0,F.jsxs)("div",{style:{fontSize:"16px",fontWeight:"bold"},children:[(0,U.vv)(c,0)," / yr"]}),(0,F.jsxs)("div",{style:{fontSize:"14px",color:"rgba(255, 255, 255, 0.85)"},children:[(0,U.vv)(y,0)," / mo"]})]})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsx)("span",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 16px"},children:"+"})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsxs)(z.A,{size:"small",style:{textAlign:"center",minWidth:150},children:[(0,F.jsx)(K,{type:"secondary",strong:!0,children:"Benefits"}),(0,F.jsxs)("div",{style:{fontSize:"16px",fontWeight:"bold"},children:[(0,U.vv)(d,0)," / yr"]}),(0,F.jsxs)("div",{style:{fontSize:"14px",color:"rgba(255, 255, 255, 0.85)"},children:[(0,U.vv)(p,0)," / mo"]})]})})]}),(0,F.jsxs)(R.A,{align:"middle",children:[(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsxs)(z.A,{size:"small",style:{textAlign:"center",minWidth:150},children:[(0,F.jsx)(K,{type:"secondary",strong:!0,children:"Net Pay"}),(0,F.jsxs)("div",{style:{fontSize:"16px",fontWeight:"bold",color:"var(--color-primary)"},children:[(0,U.vv)(s-i,0)," / yr"]}),(0,F.jsxs)("div",{style:{fontSize:"14px",color:"rgba(255, 255, 255, 0.85)"},children:[(0,U.vv)((s-i)/12,0)," / mo"]})]})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsx)("span",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 16px"},children:"="})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsxs)(z.A,{size:"small",style:{textAlign:"center",minWidth:150},children:[(0,F.jsx)(K,{type:"secondary",strong:!0,children:"Gross Salary"}),(0,F.jsxs)("div",{style:{fontSize:"16px",fontWeight:"bold"},children:[(0,U.vv)(s,0)," / yr"]}),(0,F.jsxs)("div",{style:{fontSize:"14px",color:"rgba(255, 255, 255, 0.85)"},children:[(0,U.vv)(u,0)," / mo"]})]})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsx)("span",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 16px"},children:"-"})}),(0,F.jsx)(W.A,{flex:"none",children:(0,F.jsxs)(z.A,{size:"small",style:{textAlign:"center",minWidth:150},children:[(0,F.jsx)(K,{type:"secondary",strong:!0,children:"Deductions"}),(0,F.jsxs)("div",{style:{fontSize:"16px",fontWeight:"bold"},children:[(0,U.vv)(i,0)," / yr"]}),(0,F.jsxs)("div",{style:{fontSize:"14px",color:"rgba(255, 255, 255, 0.85)"},children:[(0,U.vv)(m,0)," / mo"]})]})})]})]}),(0,F.jsxs)(R.A,{gutter:16,style:{marginBottom:16},children:[(0,F.jsx)(W.A,{span:12,children:(0,F.jsx)(z.A,{title:"Gross Salary",style:{height:"100%"},children:(0,F.jsx)(B.A,{columns:[{title:"",key:"component",render:(e,t)=>(0,F.jsx)(K,{strong:!0,children:t.component_name})},{title:"Monthly",key:"monthly_amount",render:(e,t)=>
1(0,U.vv)(parseFloat((t.annual_amount||0)/12),0),align:"right"},{title:"Yearly",key:"annual_amount",render:(e,t)=>(0,U.vv)(parseFloat(t.annual_amount||0),0),align:"right"}],dataSource:n,rowKey:"salary_component_id",pagination:!1,size:"small",locale:{emptyText:"No earnings found"},summary:e=>{const t=e.reduce((e,t)=>e+parseFloat(t.annual_amount||0),0),a=t/12;return(0,F.jsx)(B.A.Summary,{fixed:!0,children:(0,F.jsxs)(B.A.Summary.Row,{style:{backgroundColor:"var(--color-success-soft)",fontWeight:"bold"},children:[(0,F.jsx)(B.A.Summary.Cell,{children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-success)"},children:"Total"})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-success)"},children:(0,U.vv)(a,0)})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-success)"},children:(0,U.vv)(t,0)})})]})})}})})}),(0,F.jsx)(W.A,{span:12,children:(0,F.jsx)(z.A,{title:"Deductions",style:{height:"100%"},children:(0,F.jsx)(B.A,{columns:[{title:"",key:"component",render:(e,t)=>(0,F.jsxs)("div",{children:[(0,F.jsx)(K,{strong:!0,children:t.component_name}),t.is_statutory&&(0,F.jsx)("div",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:"Statutory"})]})},{title:"Monthly",key:"monthly_amount",render:(e,t)=>(0,U.vv)(parseFloat((t.annual_amount||0)/12),0),align:"right"},{title:"Yearly",key:"annual_amount",render:(e,t)=>(0,U.vv)(parseFloat(t.annual_amount||0),0),align:"right"}],dataSource:l,rowKey:"salary_component_id",pagination:!1,size:"small",locale:{emptyText:"No deductions found"},summary:e=>{const t=e.reduce((e,t)=>e+parseFloat(t.annual_amount||0),0),a=t/12;return(0,F.jsx)(B.A.Summary,{fixed:!0,children:(0,F.jsxs)(B.A.Summary.Row,{style:{backgroundColor:"var(--color-danger-soft)",fontWeight:"bold"},children:[(0,F.jsx)(B.A.Summary.Cell,{children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-danger)"},children:"Total"})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-danger)"},children:(0,U.vv)(a,0)})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-danger)"},children:(0,U.vv)(t,0)})})]})})}})})})]}),(0,F.jsxs)(R.A,{gutter:16,children:[(0,F.jsx)(W.A,{span:12,children:(0,F.jsx)(z.A,{title:"Employer Contributions",style:{height:"100%"},children:(0,F.jsx)(B.A,{columns:[{title:"",key:"component",render:(e,t)=>(0,F.jsxs)("div",{children:[(0,F.jsx)(K,{strong:!0,children:t.component_name}),t.is_statutory&&(0,F.jsx)("div",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:"Statutory"})]})},{title:"Monthly",key:"monthly_amount",render:(e,t)=>(0,U.vv)(parseFloat((t.annual_amount||0)/12),0),align:"right"},{title:"Yearly",key:"annual_amount",render:(e,t)=>(0,U.vv)(parseFloat(t.annual_amount||0),0),align:"right"}],dataSource:r,rowKey:"salary_component_id",pagination:!1,size:"small",locale:{emptyText:"No employer contributions added"},summary:e=>{const t=e.reduce((e,t)=>e+parseFloat(t.annual_amount||0),0),a=t/12;return(0,F.jsx)(B.A.Summary,{fixed:!0,children:(0,F.jsxs)(B.A.Summary.Row,{style:{backgroundColor:"var(--color-accent-soft)",fontWeight:"bold"},children:[(0,F.jsx)(B.A.Summary.Cell,{children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-accent)"},children:"Total"})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-accent)"},children:(0,U.vv)(a,0)})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-accent)"},children:(0,U.vv)(t,0)})})]})})}})})}),(0,F.jsx)(W.A,{span:12,children:(0,F.jsx)(z.A,{title:"Benefits",style:{height:"100%"},children:(0,F.jsx)(B.A,{columns:[{title:"",key:"component",render:(e,t)=>(0,F.jsx)(K,{strong:!0,children:t.component_name})},{title:"Monthly",key:"monthly_amount",render:(e,t)=>(0,U.vv)(parseFloat((t.annual_amount||0)/12),0),align:"right"},{title:"Yearly",key:"annual_amount",render:(e,t)=>(0,U.vv)(parseFloat(t.annual_amount||0),0),align:"right"}],dataSource:o,rowKey:"salary_component_id",pagination:!1,size:"small",locale:{emptyText:"No benefits added"},summary:e=>{const t=e.reduce((e,t)=>
1e+parseFloat(t.annual_amount||0),0),a=t/12;return(0,F.jsx)(B.A.Summary,{fixed:!0,children:(0,F.jsxs)(B.A.Summary.Row,{style:{backgroundColor:"var(--color-warning-soft)",fontWeight:"bold"},children:[(0,F.jsx)(B.A.Summary.Cell,{children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-warning)"},children:"Total"})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-warning)"},children:(0,U.vv)(a,0)})}),(0,F.jsx)(B.A.Summary.Cell,{align:"right",children:(0,F.jsx)(K,{strong:!0,style:{color:"var(--color-warning)"},children:(0,U.vv)(t,0)})})]})})}})})})]}),t.revision_reason&&(0,F.jsx)(z.A,{style:{marginTop:16},children:(0,F.jsxs)("div",{style:{padding:12,backgroundColor:"var(--color-success-soft)",borderRadius:6},children:[(0,F.jsxs)(K,{type:"secondary",strong:!0,children:["Revision Reason:"," "]}),(0,F.jsx)(K,{children:t.revision_reason})]})})]})};var H=a(7116);const{Text:V,Title:X}=T.A,G=e=>{let{employeeId:t,refreshEmployees:a}=e;const{message:l}=p.A.useApp(),[r,o]=(0,n.useState)(!1),[s,i]=(0,n.useState)(null),[c,d]=(0,n.useState)([]),[u,y]=(0,n.useState)(!1),x=async()=>{if(t)try{o(!0);const[e,a]=await Promise.all([m.Ay.getCurrentEmployeeSalary(t),m.Ay.getEmployeeSalaryRevisions(t)]);i(e),d(a||[])}catch(e){console.error("Error fetching salary data:",e),l.error("Failed to load salary data")}finally{o(!1)}};(0,n.useEffect)(()=>{t&&x()},[t]);const f=()=>{y(!0)},v=(0,n.useMemo)(()=>c&&0!==c.length?[...c].sort((e,t)=>{if(e.is_active&&!t.is_active)return-1;if(!e.is_active&&t.is_active)return 1;const a=Y()(t.effective_from).unix()-Y()(e.effective_from).unix();return 0!==a?a:Y()(t.created_at).unix()-Y()(e.created_at).unix()}):[],[c]),g=[{title:"Effective From",dataIndex:"effective_from",key:"effective_from",render:e=>Y()(e).format("DD-MM-YYYY"),width:120,sorter:(e,t)=>{const a=Y()(t.effective_from).unix()-Y()(e.effective_from).unix();return 0!==a?a:Y()(t.created_at).unix()-Y()(e.created_at).unix()},defaultSortOrder:"ascend"},{title:"Total CTC",dataIndex:"annual_ctc",key:"annual_ctc",render:e=>(0,U.vv)(parseFloat(e||0),0),width:120,align:"right"},{title:"% Change",key:"percentage_change",render:(e,t,a)=>{const n=v.findIndex(e=>e.id===t.id),l=v[n+1];if(!l)return(0,F.jsx)(V,{type:"secondary",children:"-"});const r=parseFloat(t.annual_ctc||0),o=parseFloat(l.annual_ctc||0);if(0===o)return(0,F.jsx)(V,{type:"secondary",children:"-"});const s=(r-o)/o*100,i=s>0,c=s<0;return(0,F.jsxs)(V,{style:{color:i?"var(--color-success)":c?"var(--color-danger)":"var(--color-text-secondary)"},children:[i?"+":"",s.toFixed(1),"%"]})},width:100,align:"right"},{title:"Status",dataIndex:"is_active",key:"is_active",render:e=>(0,F.jsx)(C.A,{color:e?"green":"default",children:e?"Active":"Inactive"}),width:80},{title:"Reason",dataIndex:"revision_reason",key:"revision_reason",render:e=>e||"-",width:200},{title:"Components",dataIndex:"salary_structure",key:"salary_structure",render:e=>Array.isArray(e)&&0!==e.length?(0,F.jsx)(M.A,{direction:"vertical",size:"small",children:e.map((e,t)=>(0,F.jsxs)("div",{style:{fontSize:"12px"},children:[(0,F.jsx)(V,{strong:!0,children:e.component_name}),": ",(0,U.vv)(parseFloat(e.annual_amount||0),0),(0,F.jsx)(C.A,{size:"small",color:"earning"===e.component_type?"green":"deduction"===e.component_type?"red":"employer_contribution"===e.component_type?"purple":"benefit"===e.component_type?"orange":"default",style:{marginLeft:4},children:e.component_type})]},t))}):(0,F.jsx)(V,{type:"secondary",children:"No components"})}];return r?(0,F.jsx)("div",{children:"Loading salary information..."}):(0,F.jsxs)("div",{style:{padding:"0 24px"},children:[(0,F.jsxs)("div",{style:{marginBottom:32},children:[(0,F.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,F.jsx)(X,{level:4,style:{margin:0,color:"var(--color-primary)"},children:"Current Salary"}),s&&(0,F.jsxs)(C.A,{color:"blue",children:["Effective from ",Y()(s.effective_from).format("DD-MM-YYYY")]})]}
1),(0,F.jsx)(h.Ay,{type:"primary",onClick:f,children:"Revise Salary"})]}),(0,F.jsx)(q,{currentSalary:s,onUpdate:f})]}),(0,F.jsx)(P.A,{}),(0,F.jsxs)("div",{children:[(0,F.jsx)(X,{level:4,style:{marginBottom:16,color:"var(--color-primary)"},children:"Salary Revisions History"}),(0,F.jsx)(z.A,{children:(0,F.jsx)(B.A,{columns:g,dataSource:v,rowKey:"id",pagination:{pageSize:10,showSizeChanger:!0,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," revisions")},size:"small",locale:{emptyText:"No salary revisions found"},scroll:{x:800}})})]}),(0,F.jsx)(H.A,{open:u,onCancel:()=>{y(!1)},onSubmit:()=>{y(!1),x(),a&&a()},employeeId:t,currentSalary:s})]})};var J=a(67376),Q=a(8750),Z=a(92163),$=a(99674),ee=a(20559),te=a(76538),ae=a(16895);const{Option:ne}=$.A,{Text:le,Title:re}=T.A,oe=e=>{let{open:t,onCancel:a,onSubmit:l,employeeId:r,bankAccount:o}=e;const{message:s}=p.A.useApp(),[i]=ee.A.useForm(),[c,d]=(0,n.useState)(!1),u=["Savings","Current","Salary"],y=async()=>{try{const e=await i.validateFields();d(!0),o?(await m.Ay.updateEmployeeBankAccount(o.id,e),s.success("Bank account updated successfully")):(await m.Ay.createEmployeeBankAccount(r,e),s.success("Bank account created successfully")),i.resetFields(),l&&l()}catch(a){var e,t;console.error("Error saving bank account:",a),s.error((null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.message)||"Failed to save bank account")}finally{d(!1)}};return(0,F.jsx)(x.A,{title:o?"Edit Bank Account":"Add Bank Account",open:t,onCancel:a,footer:null,width:650,maskClosable:!1,children:(()=>{const e=o?{account_holder_name:o.account_holder_name,bank_name:o.bank_name,account_number:o.account_number,account_type:o.account_type,ifsc_code:o.ifsc_code||"",branch_name:o.branch_name||"",is_salary_account:!!o.is_salary_account}:{is_salary_account:!0,account_type:"Savings"};return(0,F.jsxs)(ee.A,{form:i,layout:"vertical",initialValues:e,children:[(0,F.jsxs)("div",{style:{display:"flex",gap:16},children:[(0,F.jsx)("div",{style:{flex:1},children:(0,F.jsx)(ee.A.Item,{name:"account_holder_name",label:"Account Holder Name",rules:[{required:!0,message:"Please enter account holder name"}],children:(0,F.jsx)(te.A,{placeholder:"Full name as per bank records",autoFocus:!0})})}),(0,F.jsx)("div",{style:{flex:1},children:(0,F.jsx)(ee.A.Item,{name:"bank_name",label:"Bank Name",rules:[{required:!0,message:"Please enter bank name"}],children:(0,F.jsx)(te.A,{placeholder:"e.g., State Bank of India"})})})]}),(0,F.jsxs)("div",{style:{display:"flex",gap:16},children:[(0,F.jsx)("div",{style:{flex:1},children:(0,F.jsx)(ee.A.Item,{name:"account_number",label:"Account Number",rules:[{required:!0,message:"Please enter account number"},{pattern:/^[0-9]+$/,message:"Account number should contain only digits"}],children:(0,F.jsx)(te.A,{placeholder:"Account Number"})})}),(0,F.jsx)("div",{style:{flex:1},children:(0,F.jsx)(ee.A.Item,{name:"account_type",label:"Account Type",rules:[{required:!0,message:"Please select account type"}],children:(0,F.jsx)($.A,{placeholder:"Select account type",children:u.map(e=>(0,F.jsx)(ne,{value:e,children:e},e))})})})]}),(0,F.jsxs)("div",{style:{display:"flex",gap:16},children:[(0,F.jsx)("div",{style:{flex:1},children:(0,F.jsx)(ee.A.Item,{name:"ifsc_code",label:"IFSC Code",rules:[{required:!0,message:"Please enter IFSC code"},{pattern:/^[A-Z]{4}0[A-Z0-9]{6}$/,message:"Please enter a valid IFSC code (e.g., HDFC0000001)"}],children:(0,F.jsx)(te.A,{placeholder:"IFSC Code",style:{textTransform:"uppercase"}})})}),(0,F.jsx)("div",{style:{flex:1},children:(0,F.jsx)(ee.A.Item,{name:"branch_name",label:"Branch Name",children:(0,F.jsx)(te.A,{placeholder:"Branch Name (optional)"})})})]}),(0,F.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[(0,F.jsx)(ee.A.Item,{name:"is_salary_account",valuePropName:"checked",style:{marginBottom:0},children:(0,F.jsx)(ae.A,{})}),(0,F.jsx)(le,{children:"Use as salary account"})]}),(0,F.jsxs)("div",{style:{marginTop:16,display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,F.jsx)(h.Ay,{onClick:a,children:"Cancel"}
1),(0,F.jsx)(h.Ay,{type:"primary",loading:c,onClick:y,children:o?"Update":"Save"})]})]})})()})},se=e=>{let{employee:t,bankAccounts:a,onRefreshEmployee:l}=e;const{message:r}=p.A.useApp(),[o,s]=(0,n.useState)(null),[c,d]=(0,n.useState)(!1),u=e=>{const t=[{key:"edit",label:"Edit",onClick:()=>{s(e),d(!0)}},{key:"primary",label:e.is_primary?"Primary":"Set as Primary",disabled:e.is_primary,onClick:()=>(async e=>{try{await(0,i.gZ)(e),r.success("Primary bank account updated successfully"),l()}catch(n){var t,a;r.error((null===(t=n.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||"Failed to set primary bank account"),console.error(n)}})(e.id)}];return(0,F.jsx)(Z.A,{menu:{items:t},trigger:["click"],children:(0,F.jsx)(h.Ay,{className:"more-button",children:(0,F.jsx)("span",{style:{height:28},children:"..."})})})},m=(e,t)=>{navigator.clipboard.writeText(e).then(()=>{r.success("".concat(t," copied to clipboard"))}).catch(()=>{r.error("Failed to copy ".concat(t))})},y=[{title:"Bank Details",key:"bank_details",width:180,render:(e,t)=>(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{style:{fontWeight:600,fontSize:"14px"},children:t.bank_name}),t.branch_name&&(0,F.jsx)("div",{style:{fontSize:"12px",color:"var(--color-text-secondary)",marginTop:2},children:t.branch_name})]})},{title:"Account Holder",dataIndex:"account_holder_name",key:"account_holder_name",width:150},{title:"Account Number",key:"account_number",width:180,render:(e,t)=>(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{style:{fontFamily:"monospace",fontSize:"13px",fontWeight:500},children:t.account_number}),(0,F.jsx)("div",{style:{fontSize:"12px",color:"var(--color-text-secondary)",marginTop:2},children:t.account_type})]}),(0,F.jsx)(h.Ay,{type:"text",size:"small",icon:(0,F.jsx)(J.A,{}),onClick:()=>m(t.account_number,"Account number"),style:{color:"var(--color-primary)"}})]})},{title:"IFSC Code",key:"ifsc_code",width:140,render:(e,t)=>(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,F.jsx)("div",{style:{fontFamily:"monospace",fontSize:"13px",fontWeight:500},children:t.ifsc_code}),(0,F.jsx)(h.Ay,{type:"text",size:"small",icon:(0,F.jsx)(J.A,{}),onClick:()=>m(t.ifsc_code,"IFSC code"),style:{color:"var(--color-primary)"}})]})},{title:"Status",key:"status",width:120,render:(e,t)=>(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{style:{marginBottom:4},children:(0,F.jsx)(C.A,{color:t.is_active?"green":"red",children:t.is_active?"Active":"Inactive"})}),t.is_salary_account&&(0,F.jsx)("div",{style:{marginBottom:4},children:(0,F.jsx)(C.A,{color:"blue",size:"small",children:"Salary Account"})}),(0,F.jsx)("div",{style:{fontSize:"11px",color:"var(--color-text-tertiary)"},children:"verified"===t.verification_status?(0,F.jsx)("span",{style:{color:"var(--color-success)"},children:"\u2713 Verified"}):"failed"===t.verification_status?(0,F.jsx)("span",{style:{color:"var(--color-danger)"},children:"\u2717 Failed"}):(0,F.jsx)("span",{style:{color:"var(--color-warning)"},children:"\u23f3 Pending"})})]}),filters:[{text:"Active",value:!0},{text:"Inactive",value:!1}],onFilter:(e,t)=>t.is_active===e},{title:"",key:"actions",width:60,render:(e,t)=>u(t)}];return(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:16},children:(0,F.jsx)(h.Ay,{type:"primary",icon:(0,F.jsx)(Q.A,{}),onClick:()=>d(!0),children:"Add Bank Account"})}),(0,F.jsx)(B.A,{dataSource:a,columns:y,rowKey:"id",pagination:{pageSize:10},size:"middle"}),c&&(0,F.jsx)(oe,{open:c,onCancel:()=>d(!1),onSubmit:()=>{s(null),d(!1),l()},employeeId:t.employee_id,bankAccount:o})]})};var ie=a(12678),ce=a(98114),de=a(27499),ue=a(24254);const{Text:me}=T.A,ye=e=>{let{open:t,onCancel:a,payslip:l}=e;const[r,o]=(0,n.useState)(!1);if(!l)return(0,F.jsx)(x.A,{title:"Payslip Details",open:t,onCancel:a,footer:null,width:800,children:(0,F.jsx)("div",{style:{textAlign:"center",padding:"40px"},children:(0,F.jsx)(me,{type:"secondary",children:"No payslip data available"})})});const s=e=>e?Y()(e).format("DD MMM YYYY"):"";return(0,F.jsx)(x.A,{title:(0,F.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8},children:(0,F.jsxs)("span",{children:["Payslip Details - ",s(l.pay_period_start)," to ",s(l.pay_period_end)]})}
1),open:t,onCancel:a,width:1e3,footer:[(0,F.jsx)(h.Ay,{icon:(0,F.jsx)(ce.A,{}),onClick:async()=>{try{o(!0),await(0,ue.lP)(l)}catch(e){console.error("Error downloading payslip:",e)}finally{o(!1)}},type:"primary",loading:r,disabled:r,children:"Download PDF"},"download"),(0,F.jsx)(h.Ay,{onClick:a,children:"Close"},"close")],destroyOnHidden:!0,children:(0,F.jsx)(de.A,{payslip:l})})};var pe=a(91046);const he=e=>{let{employeeId:t}=e;const{message:a}=p.A.useApp(),[l,r]=(0,n.useState)([]),[o,s]=(0,n.useState)(!1),[i,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&y()},[t]);const y=async()=>{try{s(!0);const e=await m.Ay.getEmployeePayslips(t);r(e)}catch(e){console.error("Error fetching payslips:",e),a.error("Failed to load payslips")}finally{s(!1)}},x=(0,pe.EJ)({customActions:e=>(0,F.jsx)(h.Ay,{type:"primary",size:"small",icon:(0,F.jsx)(ie.A,{}),onClick:()=>(async e=>{try{const t=await m.Ay.getPayslipById(e.id);c(t),u(!0)}catch(t){console.error("Error fetching payslip details:",t),a.error("Failed to load payslip details")}})(e),title:"View Payslip",children:"View"})});return(0,F.jsxs)("div",{style:{padding:"24px 0"},children:[(0,F.jsx)(B.A,{columns:x,dataSource:l,rowKey:"id",loading:o,pagination:{pageSize:10,showSizeChanger:!0,showQuickJumper:!0,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," payslips")},size:"small",scroll:{x:1e3},locale:{emptyText:o?"Loading payslips...":"No payslips found"}}),(0,F.jsx)(ye,{open:d,onCancel:()=>{u(!1),c(null)},payslip:i})]})};var xe=a(89379),fe=a(96823),ve=a(20735),ge=a(27379),je=a(44070),be=a(51598),Ae=a(16554),_e=a(65358);const{Text:ke}=T.A,Se=e=>{let{membershipId:t,employee:a,readOnly:l=!1}=e;const{message:r,modal:o}=p.A.useApp(),[s,i]=(0,n.useState)({}),[c,d]=(0,n.useState)({}),u=(0,n.useCallback)(async()=>{if(t)try{const e=await(0,Ae.JD)(t);i(e)}catch(e){console.error("Error fetching documents:",e)}},[t]);(0,n.useEffect)(()=>{u()},[u]);const m=(0,n.useMemo)(()=>{const{isTeacher:e,isDriver:t}=(0,_e.zl)(null===a||void 0===a?void 0:a.roles);return(0,_e.Ly)(_e.zJ,{isTeacher:e,isDriver:t,alwaysIncludeKeys:new Set(Object.keys(s))})},[a,s]),y=e=>{const a=_e.zJ.find(t=>t.key===e),n=s[e],i=c[e],m=!l||!n;return(0,F.jsx)(z.A,{size:"small",style:{marginBottom:16},children:(0,F.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,F.jsx)(ve.A,{style:{marginRight:8,color:n?"var(--color-success)":"var(--color-text-tertiary)"}}),(0,F.jsxs)("div",{children:[(0,F.jsx)(ke,{strong:!0,children:null===a||void 0===a?void 0:a.label}),n&&(0,F.jsxs)("div",{style:{fontSize:"12px",color:"var(--color-text-secondary)"},children:["Uploaded: ",new Date(n.uploaded_at).toLocaleDateString()]})]})]}),(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n?(0,F.jsx)(b.A,{style:{color:"var(--color-success)",marginRight:8}}):(0,F.jsx)(ge.A,{style:{color:"var(--color-warning)",marginRight:8}}),n&&(0,F.jsx)(Z.A,{menu:{items:[{key:"view",label:"View Document",icon:(0,F.jsx)(ie.A,{}),onClick:()=>window.open(n.document_url,"_blank")},{key:"download",label:"Download",icon:(0,F.jsx)(ce.A,{}),onClick:()=>{const e=document.createElement("a");e.href=n.document_url,e.download="".concat(null===a||void 0===a?void 0:a.label,"_").concat(new Date(n.uploaded_at).toLocaleDateString()),document.body.appendChild(e),e.click(),document.body.removeChild(e)}},...l?[]:[{key:"delete",label:"Delete",icon:(0,F.jsx)(je.A,{}),danger:!0,onClick:()=>((e,a)=>{o.confirm({title:"Delete Document",content:"Are you sure you want to delete the ".concat(a,"?"),okText:"Delete",okType:"danger",onOk:async()=>{try{await(0,Ae.LU)(t,e),r.success("Document deleted successfully"),await u()}catch(a){console.error("Error deleting document:",a),r.error("Failed to delete document")}}})})(e,null===a||void 0===a?void 0:a.label)}]]},trigger:["click"],children:(0,F.jsx)(h.Ay,{size:"small",icon:(0,F.jsx)(ie.A,{}),children:"View"})}),m&&(0,F.jsx)(fe.A,{beforeUpload:a=>((async(e,a)=>{d(t=>(0,xe.A)((0,xe.A)({},t),{},{[e]:!0}));try{await(0,Ae.xu)(t,e,a),r.success("Document uploaded successfully"),await u()}catch(n){console.error("Error uploading document:",n),r.error("Failed to upload document")}finally{d(t=>(0,xe.A)((0,xe.A)({},t),{},{[e]:!1}))}}
1)(e,a),!1),accept:".pdf,.jpg,.jpeg,.png",showUploadList:!1,children:(0,F.jsx)(h.Ay,{size:"small",icon:(0,F.jsx)(be.A,{}),loading:i,type:n?"default":"primary",children:n?"Replace":"Upload"})})]})]})},e)};return(0,F.jsx)(z.A,{title:"Documents",children:m.map(e=>y(e.key))})};var we=a(82760),Ce=a(7408),ze=a(61821),Ee=a(80891),Oe=a(51796),Ie=a(2731);const De=()=>{var e,t,a,C,z;const{message:E}=p.A.useApp(),{employeeId:O}=(0,r.g)(),{currentUser:I}=(0,ze.As)(),[D,T]=(0,o.ok)(),[M,P]=(0,n.useState)(null),[B,R]=(0,n.useState)([]),[W,L]=(0,n.useState)(!0),[Y,U]=(0,n.useState)(!1),[K,q]=(0,n.useState)(!1),[H,V]=(0,n.useState)([]),[X,J]=(0,n.useState)([]),[Q,Z]=(0,n.useState)(!1),[$,ee]=(0,n.useState)(!0),[te,ae]=(0,n.useState)(!1),[ne,le]=(0,n.useState)(!1),re=(0,r.Zp)(),oe=(0,Ee.lb)(I),ie=null===I||void 0===I||null===(e=I.roles)||void 0===e?void 0:e.some(e=>["owner","staff_manager"].includes(e.name)),ce=null===I||void 0===I||null===(t=I.roles)||void 0===t?void 0:t.some(e=>["owner","super_admin","staff_manager"].includes(e.name)),de=null===I||void 0===I||null===(a=I.roles)||void 0===a?void 0:a.some(e=>["owner","hr_manager","staff_manager"].includes(e.name)),ue=null===I||void 0===I||null===(C=I.roles)||void 0===C?void 0:C.some(e=>["owner","super_admin","hr_manager"].includes(e.name)),me=null===I||void 0===I||null===(z=I.roles)||void 0===z?void 0:z.some(e=>["owner","super_admin","staff_manager"].includes(e.name)),ye=!1===(null===M||void 0===M?void 0:M.is_active),pe=D.get("tab")||"details",xe=(0,n.useCallback)(async()=>{try{const e=await(0,i.Fv)(O);P(e.employee);const[t,a]=await Promise.allSettled([m.Ay.getEmployeeBankAccounts(O),de?(0,Ie.L9)(O):Promise.resolve(null)]);R("fulfilled"===t.status&&t.value.bankAccounts||[]),"fulfilled"===a.status&&a.value&&U(a.value.enrolled)}catch(e){console.error("Error fetching employee:",e),P("Employee Not Found"),E.error("You don't have access to this record."),re("/staff-members")}finally{L(!1)}},[O,E]);if((0,n.useEffect)(()=>{xe()},[xe]),W)return(0,F.jsx)(s.A,{});const fe=[{key:"details",label:"Details",children:(0,F.jsx)(N,{employee:M})},{key:"bank-accounts",label:"Bank Accounts",children:(0,F.jsx)(se,{employee:M,bankAccounts:B,onRefreshEmployee:xe})},...ie?[{key:"schedule",label:"Schedule",children:(0,F.jsx)(we.A,{employeeId:null===M||void 0===M?void 0:M.employee_id})}]:[],...ce?[{key:"attendance",label:"Attendance",children:(0,F.jsx)(Ce.A,{employeeId:null===M||void 0===M?void 0:M.employee_id,onConfigureSchedule:()=>T({tab:"schedule"})})}]:[],...ie||String(null===I||void 0===I?void 0:I.currentMembershipId)===String(null===M||void 0===M?void 0:M.membership_id)?[{key:"documents",label:"Documents",children:(0,F.jsx)(Se,{membershipId:null===M||void 0===M?void 0:M.membership_id,employee:M,readOnly:!ie})}]:[],...oe?[{key:"salary-info",label:"Salary Info",children:(0,F.jsx)(G,{employeeId:null===M||void 0===M?void 0:M.employee_id,refreshEmployees:xe})},{key:"payslips",label:"Payslips",children:(0,F.jsx)(he,{employeeId:null===M||void 0===M?void 0:M.employee_id})}]:[]];return(0,F.jsxs)("div",{className:"employee-page",children:[(0,F.jsx)(l.mg,{children:(0,F.jsx)("title",{children:M?"".concat((0,Oe._K)(M.first_name,M.last_name)," | Maidan"):"Staff Member | Maidan"})}),M&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k.A,{items:[{title:"Staff",href:"/staff-members"},{title:(0,Oe._K)(M.first_name,M.last_name)}]}),(0,F.jsx)(S.A,{avatarSrc:M.profile_photo_url_compressed,avatarSize:80,name:(0,Oe._K)(M.first_name,M.last_name),tags:ye?[{label:"Exited",tone:"danger"}]:void 0,meta:M.transliterated_name,children:(0,F.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[ie&&(0,F.jsx)(h.Ay,{icon:(0,F.jsx)(v.A,{}),size:"small",onClick:async()=>{try{const[e,t]=await Promise.all([(0,c.O0)(),(0,i.Oc)()]);V(e),J(t.employees||[]),q(!0)}catch(e){E.error("Failed to load form data")}},children:"Edit"}),ie&&(0,F.jsx)(h.Ay,{icon:(0,F.jsx)(g.A,{}),size:"small",onClick:async()=>{try{await(0,y.O)(M)}catch(e){console.error("ID card download failed:",e),E.error("Failed to generate ID card")}},children:"ID Card"}),ue&&(0,F.jsx)(h.Ay,{icon:(0,F.jsx)(j.A,{}),size:"small",onClick:()=>{ee(!0),Z(!0)},children:"Experience Certificate"}),de&&!ye&&(0,F.jsx)(h.Ay,{icon:Y?(0,F.jsx)(b.A,{}):(0,F.jsx)(A.A,{}),onClick:()=>re("/employee-attendance/enroll/".concat(M.employee_id)),size:"small",type:Y?"default":"primary",children:Y?"Face Enrolled \u2014 Re-enroll":"Enroll Face"}),me&&!ye&&"Owner"!==M.role&&(0,F.jsx)(h.Ay,{icon:(0,F.jsx)(_.A,{}),size:"small",danger:!0,onClick:()=>le(!0),children:"Mark as Exited"})]})})]}),(0,F.jsx)(w.A,{tabs:fe.map(e=>{let{key:t,label:a}=e;return{key:t,label:a}}),activeKey:pe,onChange:e=>{T("details"===e?{}:{tab:e},{replace:!0})}}),(0,F.jsx)("div",{style:{marginTop:16},children:(fe.find(e=>e.key===pe)||fe[0]).children}),(0,F.jsx)(x.A,{title:"Edit \u2014 ".concat(null===M||void 0===M?void 0:M.first_name," ").concat((null===M||void 0===M?void 0:M.last_name)||""),open:K,onCancel:()=>
1q(!1),footer:null,width:"100vw",style:{top:0,paddingBottom:0,maxWidth:"none"},styles:{body:{height:"calc(100vh - 110px)",padding:"24px",overflow:"auto"}},destroyOnHidden:!0,children:K&&(0,F.jsx)(d.A,{employee:M,employees:X,roles:H,onFinish:async e=>{try{await(0,i.Y$)(M.employee_id,e),E.success("Employee updated"),q(!1),xe()}catch(t){E.error("Failed to update employee")}},refreshEmployees:xe,title:"".concat(null===M||void 0===M?void 0:M.first_name," ").concat((null===M||void 0===M?void 0:M.last_name)||"")})}),ne&&(0,F.jsx)(u.A,{employeeId:M.employee_id,employeeName:(0,Oe._K)(M.first_name,M.last_name),open:ne,onClose:()=>le(!1),onExited:xe}),(0,F.jsx)(x.A,{title:"Download Experience Certificate",open:Q,onCancel:()=>Z(!1),onOk:async()=>{ae(!0);try{E.loading({content:"Generating certificate\u2026",key:"exp-cert"}),await(0,i.wV)(M.employee_id,{includeSignature:$}),E.success({content:"Experience certificate downloaded",key:"exp-cert"}),Z(!1)}catch(n){var e;const l=null===n||void 0===n||null===(e=n.response)||void 0===e?void 0:e.status;if(403===l)E.error({content:"You don't have permission to issue experience certificates.",key:"exp-cert"});else if(404===l)E.error({content:"Employee not found.",key:"exp-cert"});else{var t,a;E.error({content:(null===n||void 0===n||null===(t=n.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Failed to generate certificate",key:"exp-cert"})}}finally{ae(!1)}},okText:"Download",confirmLoading:te,destroyOnHidden:!0,children:(0,F.jsx)(f.A,{checked:$,onChange:e=>ee(e.target.checked),children:"Include signature"})})]})}},7408:(e,t,a)=>{a.d(t,{A:()=>F});var n=a(9950),l=a(94121),r=a(58755),o=a(82056),s=a(41988),i=a(4499),c=a(1203),d=a(87094),u=a(26483),m=a(25975),y=a(35621),p=a(55480),h=a(4159),x=a.n(h),f=a(16335),v=a(81095),g=a(72528),j=a(55400),b=a(93245),A=a(85706),_=a(60158),k=a(44813),S=a(80294),w=a(19578),C=a(2731),z=a(44414);const{Text:E}=p.A,O="\u2014",I={on_time:{color:"green",label:"On-time"},late:{color:"red",label:"Late"},absent:{color:"default",label:"Absent"}},D="#ff4d4f",F=e=>{let{employeeId:t,onConfigureSchedule:a}=e;const{message:p}
1=l.A.useApp(),[h,F]=(0,n.useState)(x()()),[N,T]=(0,n.useState)(null),[M,P]=(0,n.useState)(!0),B=(0,n.useCallback)(async()=>{P(!0);try{const e=await(0,C.l5)(t,h.format("YYYY-MM"));T(e)}catch(e){console.error("Error fetching punctuality:",e),p.error("Failed to load punctuality"),T(null)}finally{P(!1)}},[t,h,p]);(0,n.useEffect)(()=>{B()},[B]);const R=(0,z.jsx)(i.A,{picker:"month",value:h,onChange:e=>e&&F(e),allowClear:!1,disabledDate:e=>e&&e.isAfter(x()().endOf("month"))}),W=null===N||void 0===N?void 0:N.summary,L=(null===N||void 0===N?void 0:N.days)||[],Y=L.map(e=>({day:x()(e.date).format("D"),date:e.date,lateMinutes:"absent"===e.status?null:e.lateMinutes,status:e.status,actualArrival:e.actualArrival})),U=Y.some(e=>null!=e.lateMinutes),K=[{title:"Date",dataIndex:"date",key:"date",render:e=>x()(e).format("ddd, MMM D")},{title:"Expected",key:"expected",render:(e,t)=>"".concat(t.expectedArrival," \u2013 ").concat(t.expectedDeparture)},{title:"Actual",key:"actual",render:(e,t)=>"absent"===t.status?O:"".concat(t.actualArrival," \u2013 ").concat(t.actualDeparture||"no check-out")},{title:"Late by",key:"lateBy",render:(e,t)=>"late"===t.status?(0,z.jsxs)(E,{style:{color:D},children:[t.lateMinutes,"m"]}):O},{title:"Left early by",key:"earlyBy",render:(e,t)=>t.earlyMinutes>0?(0,z.jsxs)(E,{style:{color:"#fa8c16"},children:[t.earlyMinutes,"m"]}):O},{title:"Status",key:"status",render:(e,t)=>{const a=I[t.status];return(0,z.jsx)(y.A,{color:a.color,children:a.label})}}];return(0,z.jsxs)(o.A,{variant:"borderless",styles:{body:{padding:0}},children:[(0,z.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12,marginBottom:16},children:[(0,z.jsx)(E,{type:"secondary",children:"Actual arrival and departure for each scheduled day this month, compared against the employee's expected times."}),R]}),M?(0,z.jsx)(w.A,{}):N?0===W.scheduledDays?(0,z.jsx)(c.A,{description:(0,z.jsx)("span",{children:"No schedule defined for this employee, so there's nothing to measure attendance against. Set expected arrival and departure times in the Schedule tab."}),children:a&&(0,z.jsx)(r.Ay,{type:"primary",onClick:a,children:"Go to Schedule"})}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(o.A,{styles:{body:{paddingBottom:4}},children:(0,z.jsxs)(d.A,{gutter:[16,16],children:[(0,z.jsx)(s.A,{xs:12,sm:8,md:5,children:(0,z.jsx)(u.A,{title:"On-time rate",value:null==W.onTimeRate?O:"".concat(W.onTimeRate,"%"),valueStyle:{fontSize:22}})}),(0,z.jsx)(s.A,{xs:12,sm:8,md:5,children:(0,z.jsx)(u.A,{title:"Late days",value:W.lateDays,valueStyle:{fontSize:22}})}),(0,z.jsx)(s.A,{xs:12,sm:8,md:5,children:(0,z.jsx)(u.A,{title:"Avg late",value:"".concat(W.avgLateMinutes," min"),valueStyle:{fontSize:22}})}),(0,z.jsx)(s.A,{xs:12,sm:8,md:4,children:(0,z.jsx)(u.A,{title:"Absent",value:"".concat(W.absentDays," ").concat(1===W.absentDays?"day":"days"),valueStyle:{fontSize:22}})}),(0,z.jsx)(s.A,{xs:12,sm:8,md:5,children:(0,z.jsx)(u.A,{title:"Present",value:"".concat(W.presentDays," / ").concat(W.scheduledDays),valueStyle:{fontSize:22}})})]})}),U&&(0,z.jsx)(o.A,{title:(0,z.jsxs)("div",{style:{padding:"4px 0"},children:[(0,z.jsx)("div",{style:{fontWeight:600},children:"Punctuality by day"}),(0,z.jsx)("div",{style:{fontSize:12,fontWeight:400,color:"var(--color-text-tertiary)"},children:"Above the line = minutes late \xb7 below = minutes early"})]}),style:{marginTop:16},styles:{body:{padding:"12px 8px 0 0"}},children:(0,z.jsx)(v.u,{width:"100%",height:260,children:(0,z.jsxs)(S.E,{data:Y,margin:{top:10,right:10,left:0,bottom:5},children:[(0,z.jsx)(b.d,{strokeDasharray:"3 3",vertical:!1,stroke:"var(--color-border)"}),(0,z.jsx)(_.W,{dataKey:"day",tick:{fontSize:11},interval:"preserveStartEnd"}),(0,z.jsx)(k.h,{tick:{fontSize:11},allowDecimals:!1,width:32}),(0,z.jsx)(j.e,{y:0,stroke:"var(--color-border)"}),(0,z.jsx)(f.m,{cursor:{fill:"var(--color-fill-tertiary, rgba(0,0,0,0.04))"},contentStyle:{borderRadius:"4px",border:"1px solid var(--color-border)"},labelFormatter:e=>x()("".concat(N.month,"-").concat(String(e).padStart(2,"0"))).format("ddd, MMM D"),formatter:(e,t,a)=>{var n,l,r;const o=null!==(n=null===a||void 0===a||null===(l=a.payload)||void 0===l?void 0:l.lateMinutes)&&void 0!==n?n:0;return[o>0?"".concat(o," min late"):"".concat(Math.abs(o)," min early"),"In ".concat((null===a||void 0===a||null===(r=a.payload)||void 0===r?void 0:r.actualArrival)||"")]}}),(0,z.jsx)(A.y,{dataKey:"lateMinutes",radius:[2,2,0,0],children:Y.map(e=>(0,z.jsx)(g.f,{fill:"late"===e.status?D:"#52c41a"},e.date))})]})})}),(0,z.jsx)(m.A,{style:{marginTop:16},columns:K,dataSource:L,rowKey:"date",size:"small",pagination:!1,scroll:{x:"max-content"}})]}):(0,z.jsx)(c.A,{description:"Could not load attendance"})]})}},15458:(e,t,a)=>{a.d(t,{A:()=>s});a(9950);var n=a(95436),l=a(6375),r=a(42074),o=a(44414);const s=e=>{let{items:t=[]}=e;const a=[{title:(0,o.jsx)(r.N_,{to:"/",children:(0,o.jsx)(l.A,{})})},...t.map((e,a)=>e.href&&a<t.length-1?{title:(0,o.jsx)(r.N_,{to:e.href,children:e.title})}:{title:e.title})];return(0,o.jsx)(n.A,{style:{marginBottom:16},items:a})}},16554:(e,t,a)=>{a.d(t,{Dk:()=>c,JD:()=>s,L6:()=>x,LU:()=>m,Rf:()=>v,Y0:()=>o,Yl:()=>y,Zx:()=>g,lk:()=>f,nN:()=>d,qx:()=>h,v0:()=>i,xu:()=>u});var n=a(90287),l=a(37645);const r=n.A.create({baseURL:"/api/memberships"});(0,l.Cy)(r);const o=async e=>{try{return(await r.get("/children/guardian/".concat(e))).data}catch(t){throw t}},s=async e=>{try{return(await r.get("/".concat(e,"/documents"))).data}catch(t){throw t}},i=async(e,t)=>{try{return(await r.get("/".concat(e,"/documents/").concat(t,"/versions"))).data}catch(a){throw a}},c=async(e,t)=>(await r.get("/".concat(e,"/documents/").concat(t,"/download-url"))).data,d=async e=>(await r.post("/documents/batch",{membershipIds:e})).data,u=async(e,t,a)=>{try{const n=new FormData;n.append("documentType",t),n.append("document",a);return(await r.post("/".concat(e,"/documents"),n,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(n){throw n}},m=async(e,t)=>{try{return(await r.delete("/".concat(e,"/documents/").concat(t))).data}catch(a){throw a}},y=async e=>{try{return(await r.get("/search?q=".concat(encodeURIComponent(e)))).data}catch(t){throw console.error("Error searching members:",t),t}},p=(e,t)=>{var a,n;if(null!==e&&void 0!==e&&null!==(a=e.response)&&void 0!==a&&null!==(n=a.data)&&void 0!==n&&n.message)throw new Error(e.response.data.message);throw new Error(t)},h=async()=>{try{return(await r.get("/me/profile")).data}catch(e){p(e,"Failed to load profile.")}},x=async e=>{try{return(await r.put("/me/profile",e)).data}catch(t){p(t,"Failed to update profile.")}},f=async e=>{try{const t=new FormData;t.append("profile_photo",e);return(await r.post("/me/profile-photo",t,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(t){p(t,"Failed to upload profile photo.")}},v=async(e,t)=>{try{const a=new FormData;a.append("documentType",e),a.append("document",t);return(await r.post("/me/documents",a,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(a){p(a,"Failed to upload document.")}},g=async e=>{try{return(await r.post("/me/bank-account",e)).data}catch(t){p(t,"Failed to add bank account.")}}},22256:(e,t,a)=>{a.d(t,{A:()=>g});var n=a(89379),l=a(9950),r=a(99674),o=a(4499),s=a(35621),i=a(31783),c=a(58755),d=a(1203),u=a(25975),m=a(19602),y=a(19578),p=a(27045),h=a(42886),x=a(51846),f=a(44414);const{Option:v}=r.A,g=e=>{let{membershipId:t,classroomId:a=null}=e;const g=(0,x.h)(),[j,b]=(0,l.useState)([]),[A,_]=(0,l.useState)(null),[k,S]=(0,l.useState)(null),[w,C]=(0,l.useState)(!0),[z,E]=(0,l.useState)(null),[O,I]=(0,l.useState)(0);let D=1;(0,l.useEffect)(()=>{(async()=>{try{C(!0),E(null);const e=await(0,m.E9)(t,a);b(e)}catch(e){E("Failed to load presentations data.")}finally{C(!1)}})()},[t,a,O]);const F=()=>(0,f.jsx)(o.A,{className:"date-picker",onChange:(e,t)=>
1S(e?{date:e,dateString:t}:null),value:null===k||void 0===k?void 0:k.date,style:{width:"100%"}}),N=()=>(0,f.jsx)(r.A,{className:"filter-select",placeholder:"Select a lesson",style:{width:"100%"},onChange:e=>_(e||null),value:A,allowClear:!0,children:M.map(e=>(0,f.jsx)(v,{value:e.id,children:e.name},e.id))}),T=[{component:(0,f.jsx)(F,{}),desktopSpan:4,mobileSpan:8},{component:(0,f.jsx)(N,{}),desktopSpan:4,mobileSpan:8}],M=(()=>{const e=new Map;return j.forEach(t=>{const a=t.lesson;e.has(a.id)||e.set(a.id,a)}),Array.from(e.values())})(),{desktopLayout:P}=(0,p.d)(T),B=[{title:"Date",dataIndex:"presentation_date",key:"presentation_date",render:e=>(0,f.jsx)("div",{children:(0,h.Yq)(e)})},{title:"Lesson",dataIndex:"lesson",key:"lesson",render:e=>(0,f.jsxs)("div",{children:[(0,f.jsx)("strong",{children:null===e||void 0===e?void 0:e.name}),(0,f.jsx)("div",{style:{color:"var(--color-text-secondary)"},children:null!==e&&void 0!==e&&e.parent_name?"Parent: ".concat(null===e||void 0===e?void 0:e.parent_name):"No Parent"}),(0,f.jsxs)("div",{style:{color:"var(--color-text-secondary)"},children:["Subject: ",null===e||void 0===e?void 0:e.subject_name]})]})},{title:g.Children,dataIndex:"children",key:"children",render:e=>Array.isArray(e)&&e.length>0?e.map(e=>(0,f.jsxs)(s.A,{children:[e.first_name," ",e.last_name]},"child-".concat(D++))):(0,f.jsxs)("span",{children:["No ",g.children]})}];return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"filters",children:P}),w?(0,f.jsx)(y.A,{}):z?(0,f.jsx)(i.Ay,{status:"warning",title:z,extra:(0,f.jsx)(c.Ay,{onClick:()=>I(e=>e+1),children:"Retry"})}):0===j.length?(0,f.jsx)(d.A,{style:{marginTop:48},image:d.A.PRESENTED_IMAGE_SIMPLE,description:"No presentations given by you."}):(0,f.jsx)(u.A,{columns:B,dataSource:j.map((e,t)=>(0,n.A)((0,n.A)({},e),{},{key:"".concat(e.presentation_date,"-").concat(e.lesson.id,"-").concat(t)})).filter(e=>{const t=!A||e.lesson.id===A,a=!k||new Date(e.presentation_date).toLocaleDateString()===new Date(k.dateString).toLocaleDateString();return t&&a}),pagination:{pageSize:10},bordered:!0})]})}},27379:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(58168),l=a(9950);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"};var o=a(25085),s=function(e,t){return l.createElement(o.A,(0,n.A)({},e,{ref:t,icon:r}))};const i=l.forwardRef(s)},30481:(e,t,a)=>{a.d(t,{A:()=>o});a(9950);var n=a(10296),l=a(79378),r=(a(73343),a(44414));const o=e=>{let{avatarSrc:t,avatarSize:a=72,name:o,tags:s,meta:i,subline:c,actions:d,children:u,className:m=""}=e;return(0,r.jsxs)("div",{className:"ui-profile-header ".concat(m),children:[(0,r.jsx)(n.A,{size:a,src:t,icon:!t&&(0,r.jsx)(l.A,{}),className:"ui-profile-header__avatar"}),(0,r.jsxs)("div",{className:"ui-profile-header__main",children:[(0,r.jsxs)("div",{className:"ui-profile-header__name-row",children:[(0,r.jsx)("h2",{className:"ui-profile-header__name",children:o}),s&&s.length>0&&(0,r.jsx)("div",{className:"ui-profile-header__tags",children:s.map((e,t)=>(0,r.jsx)("span",{className:"ui-pill ui-pill--".concat(e.tone||"neutral"," ui-pill--sm"),children:(0,r.jsx)("span",{className:"ui-pill__content",children:e.label})},t))})]}),i&&(0,r.jsx)("div",{className:"ui-profile-header__meta",children:i}),c&&(0,r.jsx)("div",{className:"ui-profile-header__subline",children:c}),u&&(0,r.jsx)("div",{className:"ui-profile-header__extra",children:u})]}),d&&(0,r.jsx)("div",{className:"ui-profile-header__actions",children:d})]})}},65358:(e,t,a)=>{a.d(t,{Ly:()=>l,zJ:()=>n,zl:()=>r});const n=[{key:"aadhaar_card",label:"Aadhaar Card"},{key:"pan_card",label:"PAN Card"},{key:"address_proof",label:"Address Proof"},{key:"resume",label:"Resume / CV"},{key:"tenth_marks_card",label:"10th Marks Card"},{key:"twelfth_marks_card",label:"12th Marks Card"},{key:"undergrad_certificate",label:"Undergraduate Certificate"},{key:"postgrad_certificate",label:"Postgraduate Certificate"},{key:"bed_certificate",label:"B.Ed Certificate",teacherOnly:!0}
1,{key:"montessori_diploma",label:"Montessori Diploma",teacherOnly:!0},{key:"experience_certificate",label:"Experience Certificate"},{key:"police_verification",label:"Police Verification"},{key:"medical_fitness",label:"Medical Fitness Certificate"},{key:"posh_certificate",label:"POSH Certificate"},{key:"first_aid_certificate",label:"First Aid Training Certificate"},{key:"signed_offer_letter",label:"Signed Offer Letter"},{key:"bank_passbook",label:"Bank Passbook"},{key:"drivers_license",label:"Driver's License",driverOnly:!0}],l=function(e){let{isTeacher:t=!1,isDriver:a=!1,alwaysIncludeKeys:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const l=n instanceof Set?n:new Set(n||[]);return e.filter(e=>!!l.has(e.key)||!(e.teacherOnly&&!t)&&!(e.driverOnly&&!a))},r=e=>{const t=(e||[]).map(e=>{var t;return null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean);return{isTeacher:t.includes("teacher"),isDriver:t.includes("driver")}}},82278:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(58168),l=a(9950);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};var o=a(25085),s=function(e,t){return l.createElement(o.A,(0,n.A)({},e,{ref:t,icon:r}))};const i=l.forwardRef(s)},95436:(e,t,a)=>{a.d(t,{A:()=>O});var n=a(9950),l=a(48738),r=a.n(l),o=a(50604),s=a(82795),i=a(39156),c=a(5741),d=a(94889),u=a(82088);const m=e=>{let{children:t}=e;const{getPrefixCls:a}=n.useContext(c.QO),l=a("breadcrumb");return n.createElement("li",{className:"".concat(l,"-separator"),"aria-hidden":"true"},""===t?t:t||"/")};m.__ANT_BREADCRUMB_SEPARATOR=!0;const y=m;var p=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(a[n[l]]=e[n[l]])}return a};function h(e,t,a,l){if(null===a||void 0===a)return null;const{className:o,onClick:i}=t,c=p(t,["className","onClick"]),d=Object.assign(Object.assign({},(0,s.A)(c,{data:!0,aria:!0})),{onClick:i});return void 0!==l?n.createElement("a",Object.assign({},d,{className:r()("".concat(e,"-link"),o),href:l}),a):n.createElement("span",Object.assign({},d,{className:r()("".concat(e,"-link"),o)}),a)}function x(e,t){return(a,n,l,r,o)=>{if(t)return t(a,n,l,r);const s=function(e,t){if(void 0===e.title||null===e.title)return null;const a=Object.keys(t).join("|");return"object"===typeof e.title?e.title:String(e.title).replace(new RegExp(":(".concat(a,")"),"g"),(e,a)=>t[a]||e)}(a,n);return h(e,a,s,o)}}var f=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(a[n[l]]=e[n[l]])}return a};const v=e=>{const{prefixCls:t,separator:a="/",children:l,menu:r,overlay:o,dropdownProps:s,href:i}=e;const c=(e=>{if(r||o){const a=Object.assign({},s);if(r){const e=r||{},{items:t}=e,l=f(e,["items"]);a.menu=Object.assign(Object.assign({},l),{items:null===t||void 0===t?void 0:t.map((e,t)=>{var{key:a,title:l,label:r,path:o}=e,s=f(e,["key","title","label","path"]);let c=null!==r&&void 0!==r?r:l;return o&&(c=n.createElement("a",{href:"".concat(i).concat(o)},c)),Object.assign(Object.assign({},s),{key:null!==a&&void 0!==a?a:t,label:c})})})}else o&&(a.overlay=o);return n.createElement(u.A,Object.assign({placement:"bottom"},a),n.createElement("span",{className:"".concat(t,"-overlay-link")},e,n.createElement(d.A,null)))}return e})(l);return void 0!==c&&null!==c?n.createElement(n.Fragment,null,n.createElement("li",null,c),a&&n.createElement(y,null,a)):null},g=e=>{const{prefixCls:t,children:a,href:l}=e,r=f(e,["prefixCls","children","href"]),{getPrefixCls:o}=n.useContext(c.QO),s=o("breadcrumb",t);return n.createElement(v,Object.assign({},r,{prefixCls:s}),h(s,r,a,l))};g.__ANT_BREADCRUMB_ITEM=!0;const j=g;var b=a(47864),A=a(45343),_=a(31900),k=a(77261);const S=(0,_.OF)("Breadcrumb",e=>(e=>{const{componentCls:t,iconCls:a,calc:n}=e;return{[t]:Object.assign(Object.assign({},(0,A.dF)(e)),{color:e.itemColor,fontSize:e.fontSize,[a]:{fontSize:e.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:e.linkColor,transition:"color ".concat(e.motionDurationMid),padding:"0 ".concat((0,b.zA)(e.paddingXXS)),borderRadius:e.borderRadiusSM,height:e.fontHeight,display:"inline-block",marginInline:n(e.marginXXS).mul(-1).equal(),"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover}},(0,A.K8)(e)),"li:last-child":{color:e.lastItemColor},["".concat(t,"-separator")]:{marginInline:e.separatorMargin,color:e.separatorColor},["".concat(t,"-link")]:{["\n > ".concat(a," + span,\n > ").concat(a," + a\n ")]:{marginInlineStart:e.marginXXS}},["".concat(t,"-overlay-link")]:{borderRadius:e.borderRadiusSM,height:e.fontHeight,display:"inline-block",padding:"0 ".concat((0,b.zA)(e.paddingXXS)),marginInline:n(e.marginXXS).mul(-1).equal(),["> ".concat(a)]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},["&".concat(e.componentCls,"-rtl")]:{direction:"rtl"}})}})((0,k.oX)(e,{})),e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS}));var w=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(a[n[l]]=e[n[l]])}return a};function C(e){const{breadcrumbName:t,children:a}=e,n=w(e,["breadcrumbName","children"]),l=Object.assign({title:t},n);return a&&(l.menu={items:a.map(e=>{var{breadcrumbName:t}=e,a=w(e,["breadcrumbName"]);return Object.assign(Object.assign({},a),{title:t})})}),l}var z=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(a[n[l]]=e[n[l]])}return a};const E=e=>{const{prefixCls:t,separator:a="/",style:l,className:d,rootClassName:u,routes:m,items:p,children:h,itemRender:f,params:g={}}=e,j=z(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:b,direction:A,breadcrumb:_}=n.useContext(c.QO);let k;const w=b("breadcrumb",t),[E,O,I]=S(w),D=function(e,t){return(0,n.useMemo)(()=>e||(t?t.map(C):null),[e,t])}(p,m);const F=x(w,f);
1if(D&&D.length>0){const e=[],t=p||m;k=D.map((l,r)=>{const{path:o,key:i,type:c,menu:d,overlay:u,onClick:m,className:p,separator:h,dropdownProps:x}=l,f=((e,t)=>{if(void 0===t)return t;let a=(t||"").replace(/^\//,"");return Object.keys(e).forEach(t=>{a=a.replace(":".concat(t),e[t])}),a})(g,o);void 0!==f&&e.push(f);const j=null!==i&&void 0!==i?i:r;if("separator"===c)return n.createElement(y,{key:j},h);const b={},A=r===D.length-1;d?b.menu=d:u&&(b.overlay=u);let{href:_}=l;return e.length&&void 0!==f&&(_="#/".concat(e.join("/"))),n.createElement(v,Object.assign({key:j},b,(0,s.A)(l,{data:!0,aria:!0}),{className:p,dropdownProps:x,href:_,separator:A?"":a,onClick:m,prefixCls:w}),F(l,g,t,e,_))})}else if(h){const e=(0,o.A)(h).length;k=(0,o.A)(h).map((t,n)=>{if(!t)return t;const l=n===e-1;return(0,i.Ob)(t,{separator:l?"":a,key:n})})}const N=r()(w,null===_||void 0===_?void 0:_.className,{["".concat(w,"-rtl")]:"rtl"===A},d,u,O,I),T=Object.assign(Object.assign({},null===_||void 0===_?void 0:_.style),l);return E(n.createElement("nav",Object.assign({className:N,style:T},j),n.createElement("ol",null,k)))};E.Item=j,E.Separator=y;const O=E}}]);
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.