PageSourceSearch

https://agasty.ai/_next/static/chunks/19102-build-2026_9_5_5_39-c46615a2c04eee29.js

js agasty.ai collected 2026-10-05 14:40:09 UTC 76,129 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19102],{33742:function(e,t,a){var n=a(57437),s=a(2265),r=a(33063),l=a(33968),i=a(51817),o=a(15136),c=a(76865),d=a(6949),u=a(65526),m=a(35022),x=a(45609),p=a(66070),f=a(90522),h=a(14027);t.Z=e=>{let{invoiceId:t,invoiceNumber:a,open:b,onOpenChange:g,onCancelled:y}=e,{toast:v}=(0,m.pm)(),{centerId:j,boardId:N}=(0,x.P)(),[w,{isLoading:S}]=(0,p.yR)(),C=(0,r.cI)({resolver:(0,l.F)(f.IB),defaultValues:{reason:""}});(0,s.useEffect)(()=>{b&&C.reset({reason:""})},[b,C]);let I=async e=>{if(t)try{await w({centerId:j,boardId:N,invoiceId:t,reason:e.reason}).unwrap(),v({title:"Invoice cancelled",description:a?"Invoice ".concat(a," has been cancelled."):void 0}),g(!1),null==y||y()}catch(e){v({title:"Failed to cancel invoice",description:409===(0,h.nH)(e)?"Only issued invoices can be cancelled.":(0,h.dc)(e),variant:"destructive"})}};return(0,n.jsx)(o.Vq,{open:b,onOpenChange:g,children:(0,n.jsxs)(o.cZ,{className:"sm:max-w-md",children:[(0,n.jsxs)(o.fK,{children:[(0,n.jsx)(o.$N,{children:"Cancel Invoice"}),(0,n.jsxs)(o.Be,{children:[a?"Cancel invoice ".concat(a,". "):"Cancel this invoice. ","This cannot be undone; the underlying fee statements remain payable and can be re-invoiced."]})]}),(0,n.jsx)(c.l0,{...C,children:(0,n.jsxs)("form",{onSubmit:C.handleSubmit(I),className:"space-y-4",children:[(0,n.jsx)(c.Wi,{control:C.control,name:"reason",render:e=>{let{field:t}=e;return(0,n.jsxs)(c.xJ,{children:[(0,n.jsx)(c.lX,{children:"Reason"}),(0,n.jsx)(c.NI,{children:(0,n.jsx)(u.g,{placeholder:"Why is this invoice being cancelled?",rows:3,...t})}),(0,n.jsx)(c.zG,{})]})}}),(0,n.jsxs)(o.cN,{children:[(0,n.jsx)(d.z,{type:"button",variant:"outline",onClick:()=>g(!1),disabled:S,children:"Keep Invoice"}),(0,n.jsx)(d.z,{type:"submit",variant:"destructive",disabled:S,children:S?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling…"]}):"Cancel Invoice"})]})]})})]})})}},79691:function(e,t,a){a.d(t,{Z:function(){return en}});var n=a(57437),s=a(2265),r=a(71621),l=a(51817),i=a(92735),o=a(44743),c=a(67782),d=a(82431),u=a(99388),m=a(48736),x=a(94766),p=a(82119),f=a(73247),h=a(32489),b=a(89027),g=a(64635),y=a(16023),v=a(10333),j=a(78656),N=a(59374),w=a(39124),S=a(6949),C=a(35022),I=a(93448),A=a(48116),R=a(45609),k=a(66070),D=a(14027),E=a(33742),T=a(74672),F=a(40875),P=a(41414),q=a(91723),L=a(89345),Z=a(82718),U=a(11),z=a(13041);let O={EMAIL:{label:"Email",circle:"bg-blue-500",bar:"bg-blue-500",pct:"text-blue-600",icon:e=>(0,n.jsx)(L.Z,{...e})},WHATSAPP:{label:"WhatsApp",circle:"bg-green-500",bar:"bg-green-500",pct:"text-green-600",icon:e=>(0,n.jsx)(Z.Z,{...e})},SMS:{label:"SMS",circle:"bg-orange-400",bar:"bg-orange-400",pct:"text-orange-500",icon:e=>(0,n.jsx)(U.Z,{...e})},CALL:{label:"Call",circle:"bg-purple-500",bar:"bg-purple-500",pct:"text-purple-600",icon:e=>(0,n.jsx)(z.Z,{...e})}},M={label:"",circle:"bg-gray-400",bar:"bg-gray-400",pct:"text-gray-600",icon:e=>(0,n.jsx)(U.Z,{...e})};function _(e){return"WHATSAPP"===e.toUpperCase()}let B={DELIVERED:"bg-green-50 text-green-700 border-green-200",SENT:"bg-green-50 text-green-700 border-green-200",READ:"bg-blue-50 text-blue-700 border-blue-200",INITIATED:"bg-amber-50 text-amber-700 border-amber-200",QUEUED:"bg-gray-100 text-gray-700 border-gray-200",FAILED:"bg-red-50 text-red-700 border-red-200"},V={DELIVERED:"bg-green-500",SENT:"bg-green-500",READ:"bg-blue-500",INITIATED:"bg-amber-400",QUEUED:"bg-gray-400",FAILED:"bg-red-500"},H=["DELIVERED","SENT","READ","INITIATED","FAILED","QUEUED"];function W(e){let t=H.indexOf(e.toUpperCase());return -1===t?99:t}function K(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}function Q(e){var t,a;let{status:s}=e,r=(null!=s?s:"").toUpperCase();return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-1 text-xs font-medium ".concat(null!==(t=B[r])&&void 0!==t?t:"border-gray-200 bg-gray-50 text-gray-700"),children:[(0,n.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(null!==(a=V[r])&&void 0!==a?a:"bg-gray-400")}),K(s)]})}function Y(e){if(!e)return"—";let t=new Date(e);
1return Number.isNaN(t.getTime())?"—":t.toLocaleString(void 0,{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"})}var G=a(91524),J=e=>{var t;let{invoiceId:a,channel:r}=e,{toast:i}=(0,C.pm)(),{centerId:o,boardId:c}=(0,R.P)(),d=_(r),[u,m]=(0,s.useState)(0),[x,p]=(0,s.useState)(new Set),[f,h]=(0,s.useState)(null),{data:b,isFetching:g}=(0,k.VB)({centerId:o,boardId:c,invoiceId:a,channel:r,page:u,size:20}),[y]=(0,k.r$)(),v=(0,s.useMemo)(()=>{var e;return(null!==(e=null==b?void 0:b.content)&&void 0!==e?e:[]).map(e=>{var t;return d?function(e){var t,a,n,s,r,l,i;let[o,...c]=null!==(t=e.history)&&void 0!==t?t:[];return{recipient:e.recipient,status:null!==(n=null!==(a=e.latestStatus)&&void 0!==a?a:null==o?void 0:o.status)&&void 0!==n?n:"—",timestamp:null!==(s=null==o?void 0:o.timestamp)&&void 0!==s?s:null,failureReason:null!==(r=null==o?void 0:o.failureReason)&&void 0!==r?r:null,retryCount:null!==(l=e.retryCount)&&void 0!==l?l:0,latestId:null!==(i=null==o?void 0:o.id)&&void 0!==i?i:null,olderHistory:c.map(e=>({id:e.id,status:e.status,timestamp:e.timestamp}))}}(e):{recipient:e.recipient,status:e.status,timestamp:e.timestamp,failureReason:e.failureReason,retryCount:null!==(t=e.retryCount)&&void 0!==t?t:0,latestId:e.id,olderHistory:[]}})},[b,d]),N=e=>{p(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},w=e=>d&&"FAILED"===e.status.toUpperCase()&&e.retryCount<3&&null!=e.latestId,I=async e=>{if(null!=e.latestId){h(e.latestId);try{var t;let n=await y({centerId:o,boardId:c,historyId:e.latestId,invoiceId:a}).unwrap();i({title:n.canRetry?"Retry queued":"Cannot retry",description:null!==(t=n.message)&&void 0!==t?t:n.canRetry?"The message has been re-queued for delivery.":"This message can no longer be retried.",variant:n.canRetry?void 0:"destructive"})}catch(e){i({title:"Retry failed",description:(0,D.dc)(e),variant:"destructive"})}finally{h(null)}}},A=null!==(t=null==b?void 0:b.totalPages)&&void 0!==t?t:0;return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"shadow-2xs overflow-x-auto rounded-lg border border-slate-200 bg-white",children:(0,n.jsxs)(j.iA,{className:"w-full min-w-[640px]",children:[(0,n.jsx)(j.xD,{className:"border-b border-slate-200 bg-slate-100",children:(0,n.jsxs)(j.SC,{className:"border-b border-slate-200 bg-slate-100 hover:bg-slate-100",children:[(0,n.jsx)(j.ss,{className:"bg-slate-100 py-3 text-xs font-semibold text-slate-700",children:"Recipient"}),(0,n.jsx)(j.ss,{className:"bg-slate-100 py-3 text-xs font-semibold text-slate-700",children:d?"Latest status":"Status"}),(0,n.jsx)(j.ss,{className:"bg-slate-100 py-3 text-xs font-semibold text-slate-700",children:d?"Updated":"Sent at"}),d?(0,n.jsx)(j.ss,{className:"bg-slate-100 py-3 text-center text-xs font-semibold text-slate-700",children:"Retries"}):(0,n.jsx)(j.ss,{className:"bg-slate-100 py-3 text-xs font-semibold text-slate-700",children:"Failure reason"}),(0,n.jsx)(j.ss,{className:"bg-slate-100 py-3 text-right text-xs font-semibold text-slate-700",children:d?"Action":"Retries"})]})}),(0,n.jsx)(j.RM,{children:g?(0,n.jsx)(j.SC,{children:(0,n.jsx)(j.pj,{colSpan:5,className:"py-10 text-center text-sm text-gray-500",children:(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,n.jsx)(l.Z,{className:"h-4 w-4 animate-spin text-gray-400"}),"Loading recipients…"]})})}):0===v.length?(0,n.jsx)(j.SC,{children:(0,n.jsx)(j.pj,{colSpan:5,className:"py-10 text-center text-sm text-gray-500",children:"No recipients on this channel yet."})}):v.map(e=>{var t;let a=x.has(e.recipient),r=e.olderHistory.length>0;return(0,n.jsxs)(s.Fragment,{children:[(0,n.jsxs)(j.SC,{children:[(0,n.jsx)(j.pj,{className:"font-mono text-xs",children:(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[d&&r&&(0,n.jsx)("button",{type:"button",onClick:()=>N(e.recipient),className:"rounded p-0.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600",title:a?"Hide history":"Show history",children:(0,n.jsx)(F.Z,{className:"h-3.5 w-3.5 transition-transform ".concat(a?"rotate-180":"")})}),(0,n.jsx)("span",{className:"break-all",children:e.recipient})]})}),(0,n.jsx)(j.pj,{children:(0,n.jsx)(Q,{status:e.status})}),(0,n.jsx)(j.pj,{className:"whitespace-nowrap text-xs text-gray-600",children:Y(e.timestamp)}),d?(0,n.jsx)(j.pj,{className:"text-center text-sm text-gray-600",children:e.retryCount}):(0,n.jsx)(j.pj,{className:"text-xs text-red-600",children:null!==(t=e.failureReason)&&void 0!==t?t:"—"}),(0,n.jsx)(j.pj,{className:"text-right",children:d?w(e)?(0,n.jsx)(S.z,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs",disabled:f===e.latestId,onClick:()=>I(e),children:f===e.latestId?(0,n.jsx)(l.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.Z,{className:"mr-1 h-3.5 w-3.5"}),"Retry"]})}):e.retryCount>=3?(0,n.jsx)("span",{className:"text-xs text-gray-400",children:"Max attempts"}):(0,n.jsx)("span",{className:"text-xs text-gray-300",children:"—"}):(0,n.jsx)("span",{className:"text-sm text-gray-600",children:e.retryCount})})]}),d&&a&&e.olderHistory.map(t=>(0,n.jsxs)(j.SC,{className:"bg-gray-50/60",children:[(0,n.jsx)(j.pj,{className:"pl-8 font-mono text-xs text-gray-400",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)(q.Z,{className:"h-3 w-3"}),"earlier attempt"]})}),(0,n.jsx)(j.pj,{children:(0,n.jsx)(Q,{status:t.status})}),(0,n.jsx)(j.pj,{className:"whitespace-nowrap text-xs text-gray-500",children:Y(t.timestamp)}),(0,n.jsx)(j.pj,{colSpan:2})]},"".concat(e.recipient,"-").concat(t.id)))]},e.recipient)})})]})}),A>1&&(0,n.jsx)(G.Z,{page:u,totalPages:A,onPrevious:()=>m(e=>Math.max(0,e-1)),onNext:()=>m(e=>e+1),isFirst:0===u||g,isLast:(null==b?void 0:b.last)||g})]})};let $=new Set(["SENT","INITIATED","QUEUED"]);var X=e=>{var t;let{invoiceId:a,invoiceNumber:r,isIssued:i=!1,onSendClick:c,sendNonce:u}=e,{toast:m}=(0,C.pm)(),{centerId:x,boardId:p}
1=(0,R.P)(),[f,h]=(0,s.useState)(null),[b,g]=(0,s.useState)(0),[y,v]=(0,s.useState)(!1),{data:j,isFetching:N,isLoading:w,refetch:I}=(0,k.oj)({centerId:x,boardId:p,invoiceId:a},{pollingInterval:b,refetchOnMountOrArgChange:!0}),[A,{isLoading:E}]=(0,k.Ad)(),T=null!==(t=null==j?void 0:j.selectedChannels)&&void 0!==t?t:[];(0,s.useEffect)(()=>{if(!u)return;v(!0),I();let e=setTimeout(()=>v(!1),9e4);return()=>clearTimeout(e)},[u,I]),(0,s.useEffect)(()=>{y&&T.length>0&&v(!1)},[y,T.length]),(0,s.useEffect)(()=>{var e;g(Object.entries(null!==(e=null==j?void 0:j.channelStats)&&void 0!==e?e:{}).some(e=>{var t;let[a,n]=e;return"EMAIL"!==a.toUpperCase()&&Object.entries(null!==(t=n.counts)&&void 0!==t?t:{}).some(e=>{let[t,a]=e;return(null!=a?a:0)>0&&$.has(t.toUpperCase())})})?2e4:y?5e3:0)},[j,y]);let q=(0,s.useMemo)(()=>{var e,t;let a=Object.values(null!==(e=null==j?void 0:j.channelStats)&&void 0!==e?e:{}).map(e=>e.asOf).filter(Boolean);if(0===a.length)return null;let n=[...a].sort();return null!==(t=n[n.length-1])&&void 0!==t?t:null},[j]),L=async()=>{try{let e=await A({centerId:x,boardId:p,invoiceId:a}).unwrap();m({title:"Retry started",description:"".concat(e.initiated," re-queued \xb7 ").concat(e.skipped," skipped \xb7 ").concat(e.errors," error(s).")}),I()}catch(e){m({title:"Retry failed",description:(0,D.dc)(e),variant:"destructive"})}};return w?(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-gray-500",children:[(0,n.jsx)(l.Z,{className:"h-5 w-5 animate-spin text-gray-400"}),"Loading delivery status…"]}):0===T.length&&y?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed py-12 text-center",children:[(0,n.jsx)(l.Z,{className:"h-6 w-6 animate-spin text-[var(--primary-color)]"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-medium text-gray-700",children:"Sending…"}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"Delivery details will appear here in a few moments."})]}),(0,n.jsxs)(S.z,{variant:"outline",size:"sm",onClick:()=>I(),disabled:N,children:[(0,n.jsx)(d.Z,{className:"mr-2 h-4 w-4 ".concat(N?"animate-spin":"")}),"Refresh now"]})]}):0===T.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed py-12 text-center",children:[(0,n.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-gray-100",children:(0,n.jsx)(o.Z,{className:"h-5 w-5 text-gray-400"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-medium text-gray-700",children:"This invoice hasn't been sent yet."}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"Send it to the guardian to start tracking delivery."})]}),i&&c&&(0,n.jsxs)(S.z,{onClick:c,className:"bg-[var(--primary-color)] text-white hover:bg-[var(--primary-color)]",children:[(0,n.jsx)(o.Z,{className:"mr-2 h-4 w-4"}),"Send Invoice"]})]}):(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:"Delivery status"}),(0,n.jsxs)("p",{className:"text-xs text-gray-500",children:[r?"".concat(r," \xb7 "):"",q?"Updated ".concat(Y(q)):"Fetched ".concat(Y(new Date().toISOString()))]})]}),(0,n.jsxs)(S.z,{variant:"outline",size:"sm",onClick:()=>I(),disabled:N,children:[(0,n.jsx)(d.Z,{className:"mr-2 h-4 w-4 ".concat(N?"animate-spin":"")}),"Refresh"]})]}),(0,n.jsx)("div",{className:"space-y-3",children:T.map(e=>{var t,s;let r=null==j?void 0:null===(t=j.channelStats)||void 0===t?void 0:t[e];if(!r)return null;let i=O[(s=e).toUpperCase()]||{...M,label:K(s)},{failed:o,successRate:c,parts:d}=function(e){var t;let a=Object.entries(null!==(t=e.counts)&&void 0!==t?t:{}).filter(e=>{let[,t]=e;return"number"==typeof t&&t>0}),n=a.filter(e=>{let[t]=e;return"FAILED"===t.toUpperCase()}).reduce((e,t)=>{let[,a]=t;return e+a},0),s=a.filter(e=>{let[t]=e;return"QUEUED"===t.toUpperCase()}).reduce((e,t)=>{let[,a]=t;return e+a},0),r=Math.max(0,e.total-n-s);return{failed:n,successRate:e.total>0?Math.round(r/e.total*100):0,parts:a.sort((e,t)=>
1{let[a]=e,[n]=t;return W(a)-W(n)}).map(e=>{let[t,a]=e;return"".concat(a," ").concat(K(t))})}}(r),u=f===e,m=_(e),x=i.icon;return(0,n.jsxs)("div",{className:"overflow-hidden rounded-xl border bg-white shadow-sm transition-all ".concat(u?"border-blue-200 shadow-md":"border-gray-100 hover:border-gray-200"),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>h(u?null:e),className:"flex w-full items-center gap-3.5 px-4 py-3.5 text-left",children:[(0,n.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full ".concat(i.circle),children:(0,n.jsx)(x,{className:"h-5 w-5 text-white"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("span",{className:"truncate text-sm font-semibold text-gray-900",children:i.label||K(e)}),(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,n.jsx)("div",{className:"h-2 w-16 overflow-hidden rounded-full bg-gray-100 sm:w-28",children:(0,n.jsx)("div",{className:"h-full rounded-full ".concat(i.bar),style:{width:"".concat(c,"%")}})}),(0,n.jsxs)("span",{className:"text-xs font-semibold ".concat(i.pct),children:[c,"%"]}),(0,n.jsx)(F.Z,{className:"h-4 w-4 text-gray-400 transition-transform ".concat(u?"rotate-180":"")})]})]}),(0,n.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2",children:[(0,n.jsx)("p",{className:"truncate text-xs text-gray-500",children:d.join(" \xb7 ")||"".concat(r.total," total")}),(0,n.jsxs)("span",{className:"shrink-0 whitespace-nowrap text-xs text-gray-500",children:["Total"," ",(0,n.jsx)("span",{className:"font-bold text-gray-700",children:r.total})]})]})]})]}),m&&(r.asOf||o>0)&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t border-gray-100 bg-gray-50/60 px-4 py-2",children:[(0,n.jsx)("span",{className:"text-xs text-gray-500",children:r.asOf?"As of ".concat(Y(r.asOf)):""}),o>0&&(0,n.jsxs)(S.z,{variant:"outline",size:"sm",className:"h-7 border-red-200 px-2 text-xs text-red-600 hover:bg-red-50 hover:text-red-700",onClick:L,disabled:E,children:[E?(0,n.jsx)(l.Z,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(P.Z,{className:"mr-1 h-3.5 w-3.5"}),"Retry ",o," failed"]})]}),u&&(0,n.jsx)("div",{className:"border-t border-gray-100 p-3",children:(0,n.jsx)(J,{invoiceId:a,channel:e})})]},e)})})]})},ee=a(53759),et=a(56305);let ea=e=>{if(!e)return"—";try{return(0,I.p6)(e)}catch(e){return"—"}};var en=e=>{var t,a,I,F;let{invoiceId:P,open:q,onOpenChange:L}=e,{toast:Z}=(0,C.pm)(),{centerId:U,boardId:z}
1=(0,R.P)(),[O,M]=(0,s.useState)(P);(0,s.useEffect)(()=>{M(P)},[P,q]);let[_,B]=(0,s.useState)(!1),[V,H]=(0,s.useState)(!1),[W,K]=(0,s.useState)(!1),[Q,Y]=(0,s.useState)("details"),[G,J]=(0,s.useState)(0),[$,en]=(0,s.useState)("");(0,s.useEffect)(()=>{Y("details"),en("")},[O,q]);let{data:es,isFetching:er,error:el,isError:ei}=(0,k.Ro)({centerId:U,boardId:z,invoiceId:null!=O?O:0},{skip:!q||!O}),eo=(0,s.useMemo)(()=>{var e;let t=[...null!==(e=null==es?void 0:es.lines)&&void 0!==e?e:[]].sort((e,t)=>e.displayOrder-t.displayOrder);if(!$.trim())return t;let a=$.toLowerCase();return t.filter(e=>e.feeType.toLowerCase().includes(a)||e.periodLabel&&e.periodLabel.toLowerCase().includes(a)||e.discountName&&e.discountName.toLowerCase().includes(a))},[null==es?void 0:es.lines,$]),[ec,{isLoading:ed}]=(0,k.Xt)(),{previewOpen:eu,setPreviewOpen:em,previewData:ex,showPreview:ep}=(0,et.lI)(),{downloadPdf:ef,downloadingId:eh}=(0,ee.J)(ep),eb=null!==(t=null==es?void 0:es.currencyCode)&&void 0!==t?t:void 0,eg=e=>(0,A.l)(e,eb),ey=async()=>{if(es)try{let e=await ec({centerId:U,boardId:z,studentId:es.studentId,body:{feeStatementIds:es.lines.map(e=>e.feeStatementId),academicCalendarId:es.academicCalendarId,regenerate:!0}}).unwrap();Z({title:"Invoice regenerated",description:"Issued ".concat(e.invoiceNumber,"; ").concat(es.invoiceNumber," is now superseded.")}),M(e.id)}catch(e){Z({title:"Failed to regenerate invoice",description:(0,D.dc)(e),variant:"destructive"})}};return(0,n.jsx)(g.yo,{open:q,onOpenChange:L,children:(0,n.jsxs)(g.ue,{side:"right",className:"flex h-full w-full flex-col gap-0 overflow-hidden border-0 bg-white p-0 shadow-none sm:max-w-none",children:[(0,n.jsxs)("div",{className:"shrink-0 border-b border-slate-200 bg-white px-6 pt-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-3 pr-10",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,n.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-blue-100 bg-blue-50 text-[var(--primary-color)]",children:(0,n.jsx)(r.Z,{className:"h-5 w-5"})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)(g.bC,{className:"truncate text-base font-bold tracking-tight text-slate-900",children:es?"Invoice ".concat(es.invoiceNumber):"Invoice Details"}),es&&(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,D.j1)(es.status),(0,D.c4)(es.settlementStatus)]})]}),es?(0,n.jsxs)("p",{className:"mt-0.5 truncate text-xs text-slate-500",children:[(0,n.jsx)("span",{className:"font-medium text-slate-700",children:es.studentName})," \xb7 ",null!==(a=es.className)&&void 0!==a?a:"Class ".concat(es.classId),es.sectionName?"-".concat(es.sectionName):"",es.admissionNo&&" \xb7 Adm ".concat(es.admissionNo)]}):null,(0,n.jsx)(g.Ei,{className:"sr-only",children:es?"Amounts frozen at issue time (".concat(ea(es.issueDate),"); settlement state is live."):"Fee invoice snapshot and settlement status."})]})]}),es&&(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,n.jsxs)(S.z,{variant:"outline",size:"sm",className:"h-8 border-slate-200 px-3 text-xs font-medium",onClick:()=>
1ef(es.id,es.invoiceNumber),disabled:eh===es.id,children:[eh===es.id?(0,n.jsx)(l.Z,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(i.Z,{className:"mr-1.5 h-3.5 w-3.5"}),"Download PDF"]}),"ISSUED"===es.status&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(S.z,{size:"sm",onClick:()=>K(!0),className:"h-8 bg-[var(--primary-color)] px-3 text-xs font-semibold text-white hover:opacity-90",children:[(0,n.jsx)(o.Z,{className:"mr-1.5 h-3.5 w-3.5"}),"Send Invoice"]}),(0,n.jsxs)(w.h_,{children:[(0,n.jsx)(w.$F,{asChild:!0,children:(0,n.jsx)(S.z,{variant:"outline",size:"icon",className:"h-8 w-8 border-slate-200","aria-label":"More invoice actions",disabled:ed,children:ed?(0,n.jsx)(l.Z,{className:"h-4 w-4 animate-spin"}):(0,n.jsx)(c.Z,{className:"h-4 w-4"})})}),(0,n.jsxs)(w.AW,{align:"end",className:"w-48",children:[(0,n.jsxs)(w.Xi,{onClick:()=>H(!0),className:"cursor-pointer text-xs",children:[(0,n.jsx)(d.Z,{className:"mr-2 h-3.5 w-3.5"}),"Regenerate"]}),(0,n.jsx)(w.VD,{}),(0,n.jsxs)(w.Xi,{onClick:()=>B(!0),className:"cursor-pointer text-xs text-red-600 focus:bg-red-50 focus:text-red-700",children:[(0,n.jsx)(u.Z,{className:"mr-2 h-3.5 w-3.5"}),"Cancel invoice"]})]})]})]})]})]}),es&&(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap items-end justify-between gap-x-6 gap-y-2",children:[(0,n.jsx)(y.mQ,{value:Q,onValueChange:Y,children:(0,n.jsxs)(y.dr,{className:"h-auto gap-5 rounded-none bg-transparent p-0",children:[(0,n.jsxs)(y.SP,{value:"details",className:"flex items-center gap-1.5 rounded-none border-b-2 border-transparent bg-transparent px-0 pb-2.5 pt-0 text-xs font-medium text-slate-500 shadow-none hover:text-slate-800 data-[state=active]:border-[var(--primary-color)] data-[state=active]:bg-transparent data-[state=active]:text-slate-900 data-[state=active]:shadow-none",children:[(0,n.jsx)(m.Z,{className:"h-3.5 w-3.5"}),"Invoice Breakdown"]}),(0,n.jsxs)(y.SP,{value:"notifications",className:"flex items-center gap-1.5 rounded-none border-b-2 border-transparent bg-transparent px-0 pb-2.5 pt-0 text-xs font-medium text-slate-500 shadow-none hover:text-slate-800 data-[state=active]:border-[var(--primary-color)] data-[state=active]:bg-transparent data-[state=active]:text-slate-900 data-[state=active]:shadow-none",children:[(0,n.jsx)(x.Z,{className:"h-3.5 w-3.5"}),"Dispatch & Notifications"]})]})}),(0,n.jsxs)("dl",{className:"flex items-center divide-x divide-slate-200 pb-2.5 text-xs",children:[(0,n.jsxs)("div",{className:"pr-4",children:[(0,n.jsx)("dt",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:"Issued"}),(0,n.jsx)("dd",{className:"font-medium text-slate-800",children:ea(es.issueDate)})]}),es.dueDate&&(0,n.jsxs)("div",{className:"px-4",children:[(0,n.jsx)("dt",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:"Due"}),(0,n.jsx)("dd",{className:"font-medium text-slate-800",children:ea(es.dueDate)})]}),(0,n.jsxs)("div",{className:"pl-4",children:[(0,n.jsx)("dt",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:"Net payable"}),(0,n.jsx)("dd",{className:"font-bold tabular-nums text-slate-900",children:eg(es.totalNetPayable)})]})]})]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:ei?(0,n.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3 rounded-2xl border border-red-200/80 bg-red-50/40 p-8 text-center",children:[(0,n.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-red-100 text-red-600",children:(0,n.jsx)(b.gJy,{className:"h-6 w-6"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"text-sm font-semibold text-slate-900",children:"Failed to load invoice"}),(0,n.jsx)("p",{className:"mt-1 text-xs text-red-600",children:(0,D.dc)(el)})]})]}):er?(0,n.jsxs)("div",{className:"flex h-64 w-full flex-col items-center justify-center gap-3 text-center",children:[(0,n.jsx)(l.Z,{size:32,className:"animate-spin text-[var(--primary-color)]"}),(0,n.jsx)("p",{className:"text-xs font-medium text-slate-500",children:"Loading invoice details..."})]}):es?(0,n.jsxs)("div",{className:"space-y-4",children:["details"===Q&&(0,n.jsxs)(n.Fragment,{children:["SUPERSEDED"===es.status&&es.supersededByInvoiceId&&(0,n.jsxs)("div",{className:"shadow-2xs flex items-center justify-between gap-3 rounded-xl border border-amber-200 bg-amber-50/80 px-4 py-3 text-xs text-amber-900",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(p.Z,{className:"h-4 w-4 shrink-0 text-amber-600"}),(0,n.jsxs)("span",{children:["This invoice was ",(0,n.jsx)("strong",{children:"superseded"})," by a newer invoice (#",es.supersededByInvoiceId,")."]})]}),(0,n.jsx)(S.z,{variant:"ghost",size:"sm",className:"h-7 text-xs font-semibold text-amber-900 hover:bg-amber-100 hover:text-amber-950",onClick:()=>M(es.supersededByInvoiceId),children:"View current invoice →"})]}),"CANCELLED"===es.status&&(0,n.jsxs)("div",{className:"shadow-2xs flex items-center gap-2.5 rounded-xl border border-red-200 bg-red-50/80 px-4 py-3 text-xs text-red-800",children:[(0,n.jsx)(u.Z,{className:"h-4 w-4 shrink-0 text-red-600"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{className:"font-semibold",children:"Invoice Cancelled:"})," ",(0,n.jsx)("span",{children:es.cancellationReason||"No reason specified."})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h4",{className:"text-xs font-bold uppercase tracking-wider text-slate-600",children:"Fee Head Breakdown"}),(0,n.jsxs)("span",{className:"rounded-full bg-slate-200/80 px-2 py-0.5 text-[11px] font-semibold text-slate-700",children:[eo.length," ",1===eo.length?"item":"items"]}),(0,n.jsx)("span",{className:"hidden text-[11px] text-slate-400 sm:inline",children:"Amounts as on issue date \xb7 settlement status is live"})]}),(0,n.jsxs)("div",{className:"relative min-w-[200px] max-w-xs flex-1 sm:max-w-sm",children:[(0,n.jsx)(f.Z,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400"}),(0,n.jsx)(N.I,{type:"text",placeholder:"Filter fee heads or discounts...",value:$,onChange:e=>en(e.target.value),className:"shadow-2xs h-8 border-slate-200 bg-white pl-8 pr-8 text-xs focus-visible:ring-1"}),$&&(0,n.jsx)("button",{type:"button",onClick:()=>en(""),"aria-label":"Clear fee search",className:"absolute right-2 top-1/2 -translate-y-1/2 roun
1ded-full p-0.5 text-slate-400 hover:text-slate-600",children:(0,n.jsx)(h.Z,{className:"h-3 w-3"})})]})]}),(0,n.jsx)("div",{className:"shadow-2xs overflow-hidden rounded-xl border border-slate-200 bg-white",children:(0,n.jsxs)(j.iA,{className:"w-full text-xs",children:[(0,n.jsx)(j.xD,{className:"bg-slate-50/90",children:(0,n.jsxs)(j.SC,{className:"border-b border-slate-200/80 hover:bg-transparent",children:[(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-xs font-semibold text-slate-700",children:"Fee Head"}),(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-xs font-semibold text-slate-700",children:"Period"}),(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-xs font-semibold text-slate-700",children:"Due Date"}),(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-right text-xs font-semibold text-slate-700",children:"Gross"}),(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-right text-xs font-semibold text-slate-700",children:"Discount"}),(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-right text-xs font-semibold text-slate-700",children:"Late Fee"}),(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-right text-xs font-semibold text-slate-700",children:"Paid"}),(0,n.jsx)(j.ss,{className:"px-3.5 py-2.5 text-right text-xs font-bold text-slate-900",children:"Net Payable"})]})}),(0,n.jsx)(j.RM,{children:0===eo.length?(0,n.jsx)(j.SC,{children:(0,n.jsxs)(j.pj,{colSpan:8,className:"py-10 text-center text-xs text-slate-500",children:['No fee heads match "',$,'".',(0,n.jsx)(S.z,{variant:"link",size:"sm",className:"ml-1.5 h-auto p-0 text-xs font-semibold text-[var(--primary-color)]",onClick:()=>en(""),children:"Clear filter"})]})}):eo.map(e=>{var t;return(0,n.jsxs)(j.SC,{className:"border-b border-slate-100 transition-colors hover:bg-slate-50/70",children:[(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 font-semibold text-slate-800",children:e.feeType}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-slate-600",children:(0,n.jsx)("span",{className:"inline-flex rounded bg-slate-100 px-2 py-0.5 text-[11px] font-medium text-slate-700",children:null!==(t=e.periodLabel)&&void 0!==t?t:"—"})}),(0,n.jsx)(j.pj,{className:"whitespace-nowrap px-3.5 py-2.5 text-slate-600",children:ea(e.dueDate)}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right font-mono font-medium text-slate-700",children:eg(e.grossAmount)}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right",children:e.discountAmount>0?(0,n.jsxs)("div",{children:[(0,n.jsxs)("span",{className:"font-mono font-semibold text-emerald-600",children:["-",eg(e.discountAmount)]}),e.discountName&&(0,n.jsx)("p",{className:"ml-auto max-w-[130px] truncate text-[10px] text-slate-400",children:e.discountName})]}):(0,n.jsx)("span",{className:"font-mono text-slate-400",children:eg(0)})}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right",children:e.lateFeeAmount>0?(0,n.jsxs)("span",{className:"font-mono font-semibold text-amber-600",children:["+",eg(e.lateFeeAmount)]}):(0,n.jsx)("span",{className:"font-mono text-slate-400",children:eg(0)})}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right",children:e.paidAmountAtIssue>0?(0,n.jsx)("span",{className:"font-mono font-medium text-slate-700",children:eg(e.paidAmountAtIssue)}):(0,n.jsx)("span",{className:"font-mono text-slate-400",children:eg(0)})}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right font-mono font-bold text-slate-900",children:eg(e.netPayable)})]},e.id)})}),(0,n.jsx)(j.yt,{className:"border-t-2 border-slate-200 bg-slate-50/90 font-semibold",children:(0,n.jsxs)(j.SC,{className:"border-0 hover:bg-transparent",children:[(0,n.jsxs)(j.pj,{colSpan:3,className:"px-3.5 py-2.5 text-xs font-bold text-slate-800",children:["Total"," ",eo.length!==es.lines.length&&(0,n.jsx)("span",{className:"ml-1 text-[11px] font-normal text-slate-500",children:"(Invoice Total)"})]}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right font-mono text-xs font-bold text-slate-800",children:eg(es.totalGross)}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right font-mono text-xs font-bold text-emerald-700",children:es.totalDiscount>0?"-".concat(eg(es.totalDiscount)):eg(0)}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right font-mono text-xs font-bold text-amber-700",children:es.totalLateFee>0?"+".concat(eg(es.totalLateFee)):eg(0)}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right font-mono text-xs font-bold text-slate-800",children:eg(es.totalPaidAtIssue)}),(0,n.jsx)(j.pj,{className:"px-3.5 py-2.5 text-right font-mono text-xs font-extrabold text-slate-900",children:eg(es.totalNetPayable)})]})})]})})]}),"notifications"===Q&&(0,n.jsx)("div",{className:"shadow-2xs rounded-xl border border-slate-200 bg-white p-4",children:(0,n.jsx)(X,{invoiceId:es.id,invoiceNumber:es.invoiceNumber,isIssued:"ISSUED"===es.status,onSendClick:()=>K(!0),sendNonce:G})})]}):(0,n.jsxs)("div",{className:"flex h-64 w-full flex-col items-center justify-center gap-3 rounded-2xl border border-dashed border-slate-200 bg-white p-8 text-center",children:[(0,n.jsx)("img",{src:"/noData.jpg",alt:"No data",className:"h-36 opacity-80"}),(0,n.jsx)("p",{className:"text-xs font-medium text-slate-500",children:"No invoice found."})]})}),(0,n.jsx)(v.aR,{open:V,onOpenChange:H,children:(0,n.jsxs)(v._T,{children:[(0,n.jsxs)(v.fY,{children:[(0,n.jsx)(v.f$,{children:"Regenerate this invoice?"}),(0,n.jsxs)(v.yT,{children:["A new invoice with a new number will be issued for the same fee statements, and"," ",es?"invoice ".concat(es.invoiceNumber):"this invoice"," ","will be marked as superseded. The superseded invoice stays in history."]})]}),(0,n.jsxs)(v.xo,{children:[(0,n.jsx)(v.le,{children:"Keep as is"}),(0,n.jsx)(v.OL,{onClick:ey,className:"bg-[var(--primary-color)] text-white hover:bg-[var(--primary-color)]",children:"Supersede & Re-issue"})]})]})}),(0,n.jsx)(et._G,{open:eu,onOpenChange:em,previewData:ex}),(0,n.jsx)(E.Z,{invoiceId:null!==(I=null==es?void 0:es.id)&&void 0!==I?I:null,invoiceNumber:null==es?void 0:es.invoiceNumber,open:_,onOpenChange:B}),(0,n.jsx)(T.Z,{invoiceId:null!==(F=null==es?void 0:es.id)&&void 0!==F?F:null,invoiceNumber:null==es?void 0:es.invoiceNumber,studentName:null==es?void 0:es.studentName,isIssued:(null==es?void 0:es.status)==="ISSUED",open:W,onOpenChange:K,onSent:()=>{Y("notifications"),J(e=>e+1)}})]})})}}
1,74672:function(e,t,a){var n=a(57437),s=a(2265),r=a(33063),l=a(33968),i=a(89345),o=a(82718),c=a(11),d=a(82119),u=a(92934),m=a(51817),x=a(44743),p=a(15136),f=a(76865),h=a(6949),b=a(56908),g=a(35022),y=a(45609),v=a(66070),j=a(90522),N=a(14027);let w=[{value:"EMAIL",label:"Email",hint:"Includes the invoice PDF",icon:(0,n.jsx)(i.Z,{className:"h-4 w-4 text-blue-600"})},{value:"WHATSAPP",label:"WhatsApp",hint:"Text notice with a payment reminder",icon:(0,n.jsx)(o.Z,{className:"h-4 w-4 text-green-600"})},{value:"SMS",label:"SMS",hint:"Text notice with a payment reminder",icon:(0,n.jsx)(c.Z,{className:"h-4 w-4 text-orange-500"})}];t.Z=e=>{let{invoiceId:t,invoiceNumber:a,studentName:i,isIssued:o=!0,open:c,onOpenChange:S,onSent:C}=e,{toast:I}=(0,g.pm)(),{centerId:A,boardId:R}=(0,y.P)(),[k,{isLoading:D}]=(0,v.ZI)(),[E,T]=(0,s.useState)(null),F=(0,r.cI)({resolver:(0,l.F)(j.ne),defaultValues:{channels:["EMAIL"]}});(0,s.useEffect)(()=>{c&&(F.reset({channels:["EMAIL"]}),T(null))},[c,F]);let P=async e=>{if(t)try{let a=await k({centerId:A,boardId:R,invoiceId:t,body:{channels:e.channels}}).unwrap();T(a);let n=a.dispatchedChannels.length>0?a.dispatchedChannels.map(e=>e.charAt(0)+e.slice(1).toLowerCase()).join(", "):"the selected channels";I({title:"Invoice sent",description:"Invoice sent to ".concat(a.recipientCount," recipient(s) via ").concat(n,".")}),null==C||C(a)}catch(e){I({title:"Failed to send invoice",description:409===(0,N.nH)(e)?"Only ISSUED invoices can be sent.":(0,N.dc)(e),variant:"destructive"})}};return(0,n.jsx)(p.Vq,{open:c,onOpenChange:S,children:(0,n.jsxs)(p.cZ,{className:"max-h-[90vh] overflow-y-auto sm:max-w-md",children:[(0,n.jsxs)(p.fK,{children:[(0,n.jsx)(p.$N,{children:"Send Invoice"}),(0,n.jsxs)(p.Be,{children:[a?"Send invoice ".concat(a):"Send this invoice",i?" to ".concat(i,"'s guardian."):" to the guardian."]})]}),!o&&(0,n.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-700",children:[(0,n.jsx)(d.Z,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,n.jsx)("span",{children:"Only ISSUED invoices can be sent."})]}),E?(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-green-200 bg-green-50 px-3 py-2 text-sm text-green-700",children:[(0,n.jsx)(u.Z,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,n.jsxs)("span",{children:["Dispatched to ",(0,n.jsx)("strong",{children:E.recipientCount})," ","recipient(s)",E.dispatchedChannels.length>0&&(0,n.jsxs)(n.Fragment,{children:[" ","via"," ",E.dispatchedChannels.map(e=>e.charAt(0)+e.slice(1).toLowerCase()).join(", ")]}),"."]})]}),E.notes.length>0&&(0,n.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-800",children:[(0,n.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 font-medium",children:[(0,n.jsx)(d.Z,{className:"h-4 w-4"}),"Some channels were skipped"]}),(0,n.jsx)("ul",{className:"list-disc space-y-0.5 pl-5",children:E.notes.map((e,t)=>(0,n.jsx)("li",{children:e},t))})]}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:"Delivery status (delivered / read / failed) updates over the next few minutes — track it under Notifications."}),(0,n.jsxs)(p.cN,{children:[(0,n.jsx)(h.z,{type:"button",variant:"outline",onClick:()=>S(!1),children:"Done"}),(0,n.jsx)(h.z,{type:"button",className:"bg-[var(--primary-color)] text-white hover:bg-[var(--primary-color)]",onClick:()=>{F.reset({channels:["EMAIL"]}),T(null)},children:"Send again"})]})]}):(0,n.jsx)(f.l0,{...F,children:(0,n.jsxs)("form",{onSubmit:F.handleSubmit(P),className:"space-y-4",children:[(0,n.jsx)(f.Wi,{control:F.control,name:"channels",render:()=>(0,n.jsxs)(f.xJ,{className:"space-y-2",children:[w.map(e=>(0,n.jsx)(f.Wi,{control:F.control,name:"channels",render:t=>{var a;let{field:s}=t,r=null===(a=s.value)||void 0===a?void 0:a.includes(e.value);return(0,n.jsxs)(f.xJ,{className:"flex items-center gap-3 space-y-0 rounded-lg border border-gray-200 px-3 py-2.5",children:[(0,n.jsx)(f.NI,{children:(0,n.jsx)(b.X,{checked:r,onCheckedChange:t=>{var a,n;let r=t?[...null!==(a=s.value)&&void 0!==a?a:[],e.value]:(null!==(n=s.value)&&void 0!==n?n:[]).filter(t=>t!==e.value);s.onChange(r)}})}),(0,n.jsxs)("div",{className:"flex flex-1 items-center gap-2",children:[e.icon,(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-gray-900",children:e.label}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:e.hint})]})]})]})}},e.value)),(0,n.jsx)(f.zG,{})]})}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:"Email includes the invoice PDF. WhatsApp/SMS send a short text notice with a payment reminder."}),(0,n.jsxs)(p.cN,{children:[(0,n.jsx)(h.z,{type:"button",variant:"outline",onClick:()=>S(!1),disabled:D,children:"Cancel"}),(0,n.jsx)(h.z,{type:"submit",disabled:D||!o,className:"bg-[var(--primary-color)] text-white hover:bg-[var(--primary-color)]",children:D?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending…"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.Z,{className:"mr-2 h-4 w-4"}),"Send Invoice"]})})]})]})})]})})}},14027:function(e,t,a){a.d(t,{Np:function(){return u},bB:function(){return p},c4:function(){return d},dc:function(){return m},j1:function(){return c},nH:function(){return x}});var n=a(57437);let s="inline-flex items-center justify-center whitespace-nowrap rounded-full border px-2.5 py-0.5 text-[11px] font-medium leading-tight shadow-2xs",r={ISSUED:{classes:"border-blue-200 bg-blue-50/80 text-blue-700",label:"Issued"},CANCELLED:{classes:"border-red-200 bg-red-50/80 text-red-700",label:"Cancelled"},SUPERSEDED:{classes:"border-slate-200 bg-slate-50 text-slate-600",label:"Superseded"}},l={UNPAID:{classes:"border-amber-200 bg-amber-50/80 text-amber-700",label:"Unpaid"},PARTIALLY_PAID:{classes:"border-indigo-200 bg-indigo-50/80 text-indigo-700",label:"Partially Paid"},PAID:{classes:"border-emerald-200 bg-emerald-50/80 text-emerald-700",label:"Paid"}},i={CREATED:{classes:"border-emerald-200 bg-emerald-50/80 text-emerald-700",label:"Created"},SKIPPED_ALREADY_INVOICED:{classes:"border-slate-200 bg-slate-50 text-slate-600",label:"Already Invoiced"},SKIPPED_NOTHING_DUE:{classes:"border-amber-200 bg-amber-50/80 text-amber-700",label:"Nothing Due"},FAILED:{classes:"border-red-200 bg-red-50/80 text-red-700",label:"Failed"}},o={classes:"border-gray-300 bg-gray-50 text-gray-600"};function c(e){var t;let{classes:a,label:l}=null!==(t=r[e])&&void 0!==t?t:{...o,label:e};return(0,n.jsx)("span",{className:"".concat(s," ").concat(a),children:l})}function d(e){var t;let{classes:a,label:r}=null!==(t=l[e])&&void 0!==t?t:{...o,label:e};return(0,n.jsx)("span",{className:"".concat(s," ").concat(a),children:r})}function u(e){var t;let{classes:a,label:r}=null!==(t=i[e])&&void 0!==t?t:{...o,label:e};return(0,n.jsx)("span",{className:"".concat(s," ").concat(a),children:r})}function m(e){if(e instanceof Error)return e.message;if("object"==typeof e&&null!==e){var t,a;if("string"==typeof(null===(t=e.data)||void 0===t?void 0:t.message))return e.data.message;if("string"==typeof(null===(a=e.data)||void 0===a?void 0:a.error))return e.data.error;if("string"==typeof e.error)return e.error;if("string"==typeof e.message)return e.message;if("number"==typeof e.status)return"Request failed with status ".concat(e.status)}return"Something went wrong"}function x(e){let t=null==e?void 0:e.status;return"number"==typeof t?t:void 0}function p(e){return"".concat(e.replace(/[/\\\s]+/g,"-"),".pdf")}},53759:function(e,t,a){a.d(t,{J:function(){return o}});var n=a(2265),s=a(35022),r=a(45609),l=a(66070),i=a(14027);function o(e){let{toast:t}=(0,s.pm)(),{centerId:a,boardId:o}
1=(0,r.P)(),[c]=(0,l.cW)(),[d,u]=(0,n.useState)(null);return{downloadPdf:async(n,s)=>{u(n);try{let t=await c({centerId:a,boardId:o,invoiceId:n}).unwrap();e(t,(0,i.bB)(s),"application/pdf")}catch(e){t({title:"Download failed",description:(0,i.dc)(e),variant:"destructive"})}finally{u(null)}},downloadingId:d}}},91524:function(e,t,a){var n=a(57437);a(2265);var s=a(92451),r=a(10407);let l=e=>{let{onClick:t,disabled:a,ariaLabel:s,children:r}=e;return(0,n.jsx)("button",{type:"button",onClick:t,disabled:a,"aria-label":s,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 active:bg-gray-200 active:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:text-gray-300 disabled:hover:bg-transparent dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 dark:disabled:text-gray-600 dark:disabled:hover:bg-transparent",children:r})};t.Z=e=>{let{page:t,totalPages:a,onPrevious:i,onNext:o,isFirst:c,isLast:d}=e;if("number"==typeof a&&a<=1)return null;let u="number"==typeof a&&a>0?String(a):"string"==typeof a&&""!==a.trim()?a.trim():"?";return(0,n.jsxs)("div",{className:"flex w-full shrink-0 items-center justify-center gap-1 border-t border-gray-100 py-2 dark:border-gray-700",children:[(0,n.jsx)(l,{onClick:i,disabled:null!=c?c:0===t,ariaLabel:"Previous page",children:(0,n.jsx)(s.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),(0,n.jsxs)("span",{className:"min-w-[36px] select-none text-center text-xs font-medium tracking-tight text-gray-700 dark:text-gray-300",children:[t+1," / ",u]}),(0,n.jsx)(l,{onClick:o,disabled:null!=d?d:"number"==typeof a&&t>=a-1,ariaLabel:"Next page",children:(0,n.jsx)(r.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})}},10333:function(e,t,a){a.d(t,{OL:function(){return b},_T:function(){return m},aR:function(){return o},f$:function(){return f},fY:function(){return x},le:function(){return g},vW:function(){return c},xo:function(){return p},yT:function(){return h}});var n=a(57437),s=a(2265),r=a(35879),l=a(93448),i=a(6949);let o=r.fC,c=r.xz,d=r.h_,u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.aV,{className:(0,l.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});u.displayName=r.aV.displayName;let m=s.forwardRef((e,t)=>{let{className:a,container:s,...i}=e;return(0,n.jsxs)(d,{container:null!=s?s:void 0,children:[(0,n.jsx)(u,{}),(0,n.jsx)(r.VY,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...i})]})});m.displayName=r.VY.displayName;let x=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};x.displayName="AlertDialogHeader";let p=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};p.displayName="AlertDialogFooter";let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold",a),...s})});f.displayName=r.Dx.displayName;let h=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",a),...s})});h.displayName=r.dk.displayName;let b=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.aU,{ref:t,className:(0,l.cn)((0,i.d)(),a),...s})});b.displayName=r.aU.displayName;let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.$j,{ref:t,className:(0,l.cn)((0,i.d)({variant:"outline"}),"mt-2 sm:mt-0",a),...s})});g.displayName=r.$j.displayName},39124:function(e,t,a){a.d(t,{$F:function(){return u},AW:function(){return b},Ju:function(){return j},Ph:function(){return x},Qk:function(){return m},TG:function(){return h},VD:function(){return N},Xi:function(){return g},_x:function(){return p},bO:function(){return y},h_:function(){return d},kt:function(){return f},qB:function(){return v}});
1var n=a(57437),s=a(2265),r=a(79731),l=a(10407),i=a(30401),o=a(40519),c=a(93448);let d=r.fC,u=r.xz,m=r.ZA;r.Uv;let x=r.Tr,p=r.Ee,f=s.forwardRef((e,t)=>{let{className:a,inset:s,children:i,...o}=e;return(0,n.jsxs)(r.fF,{ref:t,className:(0,c.cn)("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",a),...o,children:[i,(0,n.jsx)(l.Z,{className:"ml-auto"})]})});f.displayName=r.fF.displayName;let h=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.tu,{ref:t,className:(0,c.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s})});h.displayName=r.tu.displayName;let b=s.forwardRef((e,t)=>{let{className:a,sideOffset:s=4,...l}=e;return(0,n.jsx)(r.Uv,{children:(0,n.jsx)(r.VY,{ref:t,sideOffset:s,className:(0,c.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...l})})});b.displayName=r.VY.displayName;let g=s.forwardRef((e,t)=>{let{className:a,inset:s,...l}=e;return(0,n.jsx)(r.ck,{ref:t,className:(0,c.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",s&&"pl-8",a),...l})});g.displayName=r.ck.displayName;let y=s.forwardRef((e,t)=>{let{className:a,children:s,checked:l,...o}=e;return(0,n.jsxs)(r.oC,{ref:t,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:l,...o,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(r.wU,{children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})}),s]})});y.displayName=r.oC.displayName;let v=s.forwardRef((e,t)=>{let{className:a,children:s,...l}=e;return(0,n.jsxs)(r.Rk,{ref:t,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(r.wU,{children:(0,n.jsx)(o.Z,{className:"h-2 w-2 fill-current"})})}),s]})});v.displayName=r.Rk.displayName;let j=s.forwardRef((e,t)=>{let{className:a,inset:s,...l}=e;return(0,n.jsx)(r.__,{ref:t,className:(0,c.cn)("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",a),...l})});j.displayName=r.__.displayName;let N=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...s})});N.displayName=r.Z0.displayName},76865:function(e,t,a){a.d(t,{NI:function(){return h},Wi:function(){return u},l0:function(){return c},lX:function(){return f},pf:function(){return b},xJ:function(){return p},zG:function(){return g}});var n=a(57437),s=a(2265),r=a(59763),l=a(33063),i=a(93448),o=a(4632);let c=l.RV,d=s.createContext({}),u=e=>{let{...t}=e;return(0,n.jsx)(d.Provider,{value:{name:t.name},children:(0,n.jsx)(l.Qr,{...t})})},m=()=>{let e=s.useContext(d),t=s.useContext(x),{getFieldState:a,formState:n}=(0,l.Gc)(),r=a(e.name,n);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...r}},x=s.createContext({}),p=s.forwardRef((e,t)=>
1{let{className:a,...r}=e,l=s.useId();return(0,n.jsx)(x.Provider,{value:{id:l},children:(0,n.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",a),...r})})});p.displayName="FormItem";let f=s.forwardRef((e,t)=>{let{className:a,...s}=e,{error:r,formItemId:l}=m();return(0,n.jsx)(o._,{ref:t,className:(0,i.cn)(r&&"text-destructive",a),htmlFor:l,...s})});f.displayName="FormLabel";let h=s.forwardRef((e,t)=>{let{...a}=e,{error:s,formItemId:l,formDescriptionId:i,formMessageId:o}=m();return(0,n.jsx)(r.g7,{ref:t,id:l,"aria-describedby":s?"".concat(i," ").concat(o):"".concat(i),"aria-invalid":!!s,...a})});h.displayName="FormControl";let b=s.forwardRef((e,t)=>{let{className:a,...s}=e,{formDescriptionId:r}=m();return(0,n.jsx)("p",{ref:t,id:r,className:(0,i.cn)("text-[0.8rem] text-muted-foreground",a),...s})});b.displayName="FormDescription";let g=s.forwardRef((e,t)=>{var a;let{className:s,children:r,...l}=e,{error:o,formMessageId:c}=m(),d=o?String(null!==(a=null==o?void 0:o.message)&&void 0!==a?a:""):r;return d?(0,n.jsx)("p",{ref:t,id:c,className:(0,i.cn)("text-[0.8rem] font-medium text-destructive",s),...l,children:d}):null});g.displayName="FormMessage"},59374:function(e,t,a){a.d(t,{I:function(){return l}});var n=a(57437),s=a(2265),r=a(93448);let l=s.forwardRef((e,t)=>{let{className:a,type:s,...l}=e;return(0,n.jsx)("input",{type:s,className:(0,r.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:t,...l})});l.displayName="Input"},4632:function(e,t,a){a.d(t,{_:function(){return c}});var n=a(57437),s=a(2265),r=a(9604),l=a(69804),i=a(93448);let o=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.f,{ref:t,className:(0,i.cn)(o(),a),...s})});c.displayName=r.f.displayName},47301:function(e,t,a){a.d(t,{J2:function(){return i},xo:function(){return o},xp:function(){return c},yk:function(){return d}});var n=a(57437),s=a(2265),r=a(85659),l=a(93448);let i=r.fC,o=r.xz;r.ee;let c=r.x8,d=s.forwardRef((e,t)=>{let{className:a,align:s="center",sideOffset:i=4,container:o,...c}=e;return(0,n.jsx)(r.h_,{container:null!=o?o:void 0,children:(0,n.jsx)(r.VY,{ref:t,align:s,sideOffset:i,className:(0,l.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...c})})});d.displayName=r.VY.displayName},64635:function(e,t,a){a.d(t,{Ei:function(){return y},FF:function(){return b},Tu:function(){return h},aM:function(){return d},bC:function(){return g},sw:function(){return u},ue:function(){return f},yo:function(){return c}});var n=a(57437),s=a(2265),r=a(51914),l=a(69804),i=a(32489),o=a(93448);let c=r.fC,d=r.xz,u=r.x8,m=r.h_,x=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});x.displayName=r.aV.displayName;let p=(0,l.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),f=s.forwardRef((e,t)=>
1{let{side:a="right",className:s,children:l,container:c,overlayClassName:d,hideCloseButton:u=!1,...f}=e;return(0,n.jsxs)(m,{container:null!=c?c:void 0,children:[(0,n.jsx)(x,{className:d}),(0,n.jsxs)(r.VY,{ref:t,className:(0,o.cn)(p({side:a}),s),...f,children:[!u&&(0,n.jsxs)(r.x8,{className:"absolute right-4 top-4 z-[60] rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,n.jsx)(i.Z,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}),l]})]})});f.displayName=r.VY.displayName;let h=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};h.displayName="SheetHeader";let b=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};b.displayName="SheetFooter";let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",a),...s})});g.displayName=r.Dx.displayName;let y=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...s})});y.displayName=r.dk.displayName},78656:function(e,t,a){a.d(t,{RM:function(){return o},SC:function(){return d},iA:function(){return l},pj:function(){return m},ss:function(){return u},xD:function(){return i},yt:function(){return c}});var n=a(57437),s=a(2265),r=a(93448);let l=s.forwardRef((e,t)=>{let{className:a,containerClassName:s,...l}=e;return(0,n.jsx)("div",{className:(0,r.cn)("custom-scrollbar relative w-full overflow-auto",s),children:(0,n.jsx)("table",{ref:t,className:(0,r.cn)("min-w-full caption-bottom text-sm",a),...l})})});l.displayName="Table";let i=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("thead",{ref:t,className:(0,r.cn)("[&_tr]:border-b",a),...s})});i.displayName="TableHeader";let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("tbody",{ref:t,className:(0,r.cn)("[&_tr:last-child]:border-0",a),...s})});o.displayName="TableBody";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("tfoot",{ref:t,className:(0,r.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...s})});c.displayName="TableFooter";let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("tr",{ref:t,className:(0,r.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...s})});d.displayName="TableRow";let u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("th",{ref:t,className:(0,r.cn)("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...s})});u.displayName="TableHead";let m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("td",{ref:t,className:(0,r.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...s})});m.displayName="TableCell",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("caption",{ref:t,className:(0,r.cn)("mt-4 text-sm text-muted-foreground",a),...s})}).displayName="TableCaption"},16023:function(e,t,a){a.d(t,{SP:function(){return c},dr:function(){return o},mQ:function(){return i},nU:function(){return d}});var n=a(57437),s=a(2265),r=a(65779),l=a(93448);let i=r.fC,o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.aV,{ref:t,className:(0,l.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...s})});o.displayName=r.aV.displayName;let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.xz,{ref:t,className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a),...s})});c.displayName=r.xz.displayName;let d=s.forwardRef((e,t)=>
1{let{className:a,...s}=e;return(0,n.jsx)(r.VY,{ref:t,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...s})});d.displayName=r.VY.displayName},65526:function(e,t,a){a.d(t,{g:function(){return l}});var n=a(57437),s=a(2265),r=a(93448);let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("textarea",{className:(0,r.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:t,...s})});l.displayName="Textarea"},83691:function(e,t,a){a.d(t,{l:function(){return x}});var n=a(57437),s=a(2265),r=a(58173),l=a(30401),i=a(82431),o=a(93448),c=a(6949),d=a(99559),u=a(80906);let m=e=>{let t=null==e?void 0:e[d.e_.reducerPath];return!!t&&Object.values({...t.queries,...t.mutations}).some(e=>(null==e?void 0:e.status)==="pending")},x=e=>{let{className:t,showLabel:a=!1}=e,x=(0,r.I0)(),p=(0,r.v9)(m),[f,h]=(0,s.useState)("idle"),b=(0,s.useRef)(0);(0,s.useEffect)(()=>{if("refreshing"===f&&!p){let e=setTimeout(()=>h("done"),Math.max(0,500-(Date.now()-b.current)));return()=>clearTimeout(e)}if("done"===f){let e=setTimeout(()=>h("idle"),1500);return()=>clearTimeout(e)}},[f,p]);let g="refreshing"===f?"Refreshing…":"done"===f?"Updated":"Refresh";return(0,n.jsxs)(c.z,{type:"button",variant:"outline",size:a?"sm":"icon",onClick:()=>{b.current=Date.now(),h("refreshing"),x(d.e_.util.invalidateTags([...u.auD]))},disabled:"refreshing"===f,title:"Reload the latest fee data","aria-label":g,className:(0,o.cn)("h-9 shrink-0 border-slate-200 bg-white text-slate-600 hover:text-slate-900",a?"gap-1.5 px-3 text-xs":"w-9","done"===f&&"text-emerald-600 hover:text-emerald-700",t),children:["done"===f?(0,n.jsx)(l.Z,{className:"h-4 w-4"}):(0,n.jsx)(i.Z,{className:(0,o.cn)("h-4 w-4","refreshing"===f&&"animate-spin")}),a&&(0,n.jsx)("span",{children:g}),(0,n.jsx)("span",{className:"sr-only","aria-live":"polite",children:"done"===f?"Fee data updated":""})]})}},5532:function(e,t,a){a.d(t,{FY:function(){return i},IC:function(){return r},N4:function(){return s},OH:function(){return n},Ss:function(){return l}});let n={Q1:[4,5,6],Q2:[7,8,9],Q3:[10,11,12],Q4:[1,2,3]},s=[{value:"Q1",label:"Q1 (Apr - Jun)"},{value:"Q2",label:"Q2 (Jul - Sep)"},{value:"Q3",label:"Q3 (Oct - Dec)"},{value:"Q4",label:"Q4 (Jan - Mar)"}],r={Q1:1,Q2:2,Q3:3,Q4:4},l=e=>{var t,a;return null!==(a=null===(t=s.find(t=>t.value===e))||void 0===t?void 0:t.label)&&void 0!==a?a:"All quarters"},i=e=>e?Number(e.slice(5,7)):null},20596:function(e,t,a){a.d(t,{Hw:function(){return r},Mf:function(){return n},RT:function(){return l},a7:function(){return s}});let n={INR:{code:"INR",symbol:"₹",name:"Indian Rupee",locale:"en-IN",decimals:2},USD:{code:"USD",symbol:"$",name:"US Dollar",locale:"en-US",decimals:2},EUR:{code:"EUR",symbol:"€",name:"Euro",locale:"en-IE",decimals:2},GBP:{code:"GBP",symbol:"\xa3",name:"British Pound",locale:"en-GB",decimals:2},JPY:{code:"JPY",symbol:"\xa5",name:"Japanese Yen",locale:"ja-JP",decimals:0},AUD:{code:"AUD",symbol:"A$",name:"Australian Dollar",locale:"en-AU",decimals:2},CAD:{code:"CAD",symbol:"C$",name:"Canadian Dollar",locale:"en-CA",decimals:2},CHF:{code:"CHF",symbol:"Fr",name:"Swiss Franc",locale:"de-CH",decimals:2},CNY:{code:"CNY",symbol:"\xa5",name:"Chinese Yuan",locale:"zh-CN",decimals:2},SGD:{code:"SGD",symbol:"S$",name:"Singapore Dollar",locale:"en-SG",decimals:2},AED:{code:"AED",symbol:"AED",name:"UAE Dirham",locale:"en-AE",decimals:2},SAR:{code:"SAR",symbol:"SAR",name:"Saudi Riyal",locale:"en-SA",decimals:2},ZAR:{code:"ZAR",symbol:"R",name:"South African Rand",locale:"en-ZA",decimals:2}},s="INR",r=Object.values(n),l=e=>{if(!e)return n[s];let t=e.toUpperCase();return t in n?n[t]:{code:t,symbol:t,name:t,locale:"en-US",decimals:2}}},66070:function(e,t,a){a.d(t,{Ad:function(){return v},P7:function(){return d},Q3:function(){return x},Ro:function(){return c},VB:function(){return y},X_:function(){return o},Xt:function(){return u},ZI:function(){return b},cW:function(){return h},nO:function(){return f},oj:function(){return g},r$:function(){return j},yR:function(){return p}});var n=a(24399),s=a(99559),r=a(80906);let l=(e,t)=>
1"v1/fee-invoices/center/".concat(e,"/board/").concat(t),i=(e,t)=>"v1/center/".concat(e,"/board/").concat(t,"/whatsapp"),{useGetFeeInvoicesQuery:o,useGetFeeInvoiceQuery:c,useGetStudentFeeInvoicesQuery:d,useGenerateStudentFeeInvoiceMutation:u,useBulkGenerateFeeInvoicesMutation:m,useBulkGenerateStudentInvoicesMutation:x,useCancelFeeInvoiceMutation:p,useBulkCancelFeeInvoicesMutation:f,useLazyDownloadFeeInvoicePdfQuery:h,useSendFeeInvoiceMutation:b,useGetFeeInvoiceNotificationStatsQuery:g,useGetFeeInvoiceNotificationDetailsQuery:y,useRetryFeeInvoiceWhatsappBatchMutation:v,useRetryFeeInvoiceWhatsappMessageMutation:j}=s.Y4.injectEndpoints({endpoints:e=>({getFeeInvoices:e.query({query:e=>{let{centerId:t,boardId:a,params:n}=e;return{url:"".concat(l(t,a),"/list"),params:n}},providesTags:e=>e?[...e.content.map(e=>{let{id:t}=e;return{type:r.KCA,id:t}}),{type:r.KCA,id:"LIST"}]:[{type:r.KCA,id:"LIST"}]}),getFeeInvoice:e.query({query:e=>{let{centerId:t,boardId:a,invoiceId:n}=e;return{url:"".concat(l(t,a),"/invoice/").concat(n)}},providesTags:(e,t,a)=>{let{invoiceId:n}=a;return[{type:r.KCA,id:n}]}}),getStudentFeeInvoices:e.query({query:e=>{let{centerId:t,boardId:a,studentId:n}=e;return{url:"".concat(l(t,a),"/student/").concat(n,"/list")}},providesTags:e=>e?[...e.map(e=>{let{id:t}=e;return{type:r.KCA,id:t}}),{type:r.KCA,id:"LIST"}]:[{type:r.KCA,id:"LIST"}]}),generateStudentFeeInvoice:e.mutation({query:e=>{let{centerId:t,boardId:a,studentId:s,body:r}=e;return{url:"".concat(l(t,a),"/student/").concat(s,"/generate"),method:n.WU.POST,body:r}},invalidatesTags:[r.KCA]}),bulkGenerateFeeInvoices:e.mutation({query:e=>{let{centerId:t,boardId:a,classId:s,body:r}=e;return{url:"".concat(l(t,a),"/class/").concat(s,"/bulk-generate"),method:n.WU.POST,body:r}},invalidatesTags:(e,t,a)=>{let{body:n}=a;return n.dryRun?[]:[r.KCA]}}),bulkGenerateStudentInvoices:e.mutation({query:e=>{let{centerId:t,boardId:a,body:s}=e;return{url:"".concat(l(t,a),"/students/bulk-generate"),method:n.WU.POST,body:s}},invalidatesTags:(e,t,a)=>{let{body:n}=a;return n.dryRun?[]:[r.KCA]}}),cancelFeeInvoice:e.mutation({query:e=>{let{centerId:t,boardId:a,invoiceId:s,reason:r}=e;return{url:"".concat(l(t,a),"/invoice/").concat(s,"/cancel"),method:n.WU.PUT,body:{reason:r}}},invalidatesTags:(e,t,a)=>{let{invoiceId:n}=a;return[{type:r.KCA,id:"LIST"},{type:r.KCA,id:n}]}}),bulkCancelFeeInvoices:e.mutation({query:e=>{let{centerId:t,boardId:a,body:s}=e;return{url:"".concat(l(t,a),"/invoice/bulk-cancel"),method:n.WU.POST,body:s}},invalidatesTags:e=>{var t;return[{type:r.KCA,id:"LIST"},...(null!==(t=null==e?void 0:e.results)&&void 0!==t?t:[]).map(e=>{let{invoiceId:t}=e;return{type:r.KCA,id:t}})]}}),sendFeeInvoice:e.mutation({query:e=>{let{centerId:t,boardId:a,invoiceId:s,body:r}=e;return{url:"".concat(l(t,a),"/invoice/").concat(s,"/send"),method:n.WU.POST,body:null!=r?r:{}}},invalidatesTags:(e,t,a)=>{let{invoiceId:n}=a;return[{type:r.lBw,id:n}]}}),getFeeInvoiceNotificationStats:e.query({query:e=>{let{centerId:t,boardId:a,invoiceId:n}=e;return{url:"".concat(l(t,a),"/invoice/").concat(n,"/notification-stats")}},providesTags:(e,t,a)=>{let{invoiceId:n}=a;return[{type:r.lBw,id:n}]}}),getFeeInvoiceNotificationDetails:e.query({query:e=>{let{centerId:t,boardId:a,invoiceId:n,channel:s,page:r=0,size:i=20}=e;return{url:"".concat(l(t,a),"/invoice/").concat(n,"/notification-details"),params:{channel:s,page:r,size:i}}},providesTags:(e,t,a)=>{let{invoiceId:n}=a;return[{type:r.lBw,id:n}]}}),retryFeeInvoiceWhatsappBatch:e.mutation({query:e=>{let{centerId:t,boardId:a,invoiceId:s,historyIds:r}=e;return{url:"".concat(i(t,a),"/retry-batch"),method:n.WU.POST,params:{source:"FEE_INVOICE",referenceId:s},body:(null==r?void 0:r.length)?{historyIds:r}:void 0}},invalidatesTags:(e,t,a)=>{let{invoiceId:n}=a;return[{type:r.lBw,id:n}]}}),retryFeeInvoiceWhatsappMessage:e.mutation({query:e=>{let{centerId:t,boardId:a,historyId:s}=e;return{url:"".concat(i(t,a),"/").concat(s,"/retry"),method:n.WU.POST}},invalidatesTags:(e,t,a)=>{let{invoiceId:n}=a;return[{type:r.lBw,id:n}]}}),downloadFeeInvoicePdf:e.query({query:e=>{let{centerId:t,boardId:a,invoiceId:n}=e;return{url:"".concat(l(t,a),"/invoice/").concat(n,"/download"),responseHandler:async e=>{if(!e.ok)throw Error("Failed to download invoice PDF");return e.blob()}}}
1,keepUnusedDataFor:0})})})},91395:function(e,t,a){a.d(t,{AJ:function(){return l},BK:function(){return f},Bh:function(){return i},GC:function(){return A},L5:function(){return p},LL:function(){return E},Mq:function(){return m},NT:function(){return C},Sw:function(){return d},_Z:function(){return T},_g:function(){return S},_y:function(){return j},aH:function(){return x},dL:function(){return R},f7:function(){return I},kC:function(){return v},kM:function(){return o},m:function(){return q},po:function(){return w},qc:function(){return h},r3:function(){return D},ri:function(){return c},rp:function(){return y},sL:function(){return N},vP:function(){return k},vk:function(){return u},xe:function(){return P},z7:function(){return F}});var n=a(24399),s=a(99559),r=a(80906);let{useGetStudentStatsQuery:l,useAddStudentMutation:i,useRemoveStudentMutation:o,useGetClassesQuery:c,useLazyGetClassesQuery:d,useGetSectionsQuery:u,useLazyGetSectionsQuery:m,useGetStudentsByClassSectionQuery:x,useLazyGetStudentsByClassSectionQuery:p,useGetStudentsByClassSectionByPaginationQuery:f,useLazyGetStudentsByClassSectionByPaginationQuery:h,useGetAllStudentsQuery:b,useLazyGetAllStudentsQuery:g,useGetAllStudentsByCenterBoardQuery:y,useLazyGetAllStudentsByCenterBoardQuery:v,useLazyDownloadStudentsQuery:j,useRollbackDeletedStudentsMutation:N,useGetStudentFilterMetadataQuery:w,useGetAllDeactivatedStudentsQuery:S,useGetStudentStatisticsQuery:C,useGetTransferCertificateFormQuery:I,useGenerateTransferCertificateMutation:A,useGetTransferCertificateHistoryQuery:R,useLazyDownloadTransferCertificateQuery:k,useLazyDownloadCharacterCertificateQuery:D,useGetAllEditableFieldsQuery:E,useGetAllStudentsForBulkEditQuery:T,useUpdateStudentsBulkMutation:F,useGetStudentSubjectMappingQuery:P,useSaveStudentSubjectMappingMutation:q}=s.e_.injectEndpoints({overrideExisting:!0,endpoints:e=>({getStudentStats:e.query({query:e=>{let{centerId:t,boardId:a,params:n}=e;return{url:"/admin/center/".concat(t,"/board/").concat(a,"/students"),params:n}}}),addStudent:e.mutation({query:e=>{let{centerId:t,boardId:a,data:n}=e;return{url:"/admin/center/".concat(t,"/board/").concat(a,"/students/add"),method:"POST",body:n}}}),removeStudent:e.mutation({query:e=>{let{centerId:t,boardId:a,studentId:n}=e;return{url:"/admin/center/".concat(t,"/board/").concat(a,"/students/").concat(n,"/remove"),method:"DELETE"}}}),getClasses:e.query({query:e=>{let{centerId:t,boardId:a}=e;return"/center/".concat(t,"/board/").concat(a,"/class")}}),getSections:e.query({query:e=>{let{centerId:t,boardId:a,classId:n}=e;return"/center/".concat(t,"/board/").concat(a,"/class/").concat(n,"/section")}}),getStudentsByClassSection:e.query({query:e=>{let{classId:t,sectionId:a,centerId:n,boardId:s,params:r={}}=e;return{url:"/center/".concat(n,"/board/").concat(s,"/student/class/").concat(t,"/section/").concat(a),params:r}}}),getStudentsByClassSectionByPagination:e.query({query:e=>{let{centerId:t,boardId:a,params:n,classId:s,sectionId:r}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student/class/").concat(s,"/section/").concat(r,"/paged"),params:n}}}),getAllStudents:e.query({query:e=>{let{centerId:t,boardId:a,params:n}=e;return{url:"/admin/center/".concat(t,"/board/").concat(a,"/students"),params:{page:0,size:1e3,...n}}}}),getAllStudentsByCenterBoard:e.query({query:e=>{let{centerId:t,boardId:a,params:n}=e;return{url:"/center/".concat(t,"/board/").concat(a,"/student"),params:n}}}),rollbackDeletedStudents:e.mutation({query:e=>{let{centerId:t,boardId:a,studentIds:s}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student/rollback-deleted"),method:n.WU.POST,body:s}}}),downloadStudents:e.query({query:e=>{let{centerId:t,boardId:a,payload:s}=e;return{url:"/center/".concat(t,"/board/").concat(a,"/student/download"),method:n.WU.POST,body:s,responseHandler:async e=>e.blob()}}}),getStudentFilterMetadata:e.query({query:e=>{let{centerId:t,boardId:a}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student/student_filter_metadata")}}}),getAllDeactivatedStudents:e.query({query:e=>{let{centerId:t,boardId:a,classId:n,sectionId:s,params:r}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student/class/").concat(n,"/section/").concat(s,"/paged"),params:r}}}),getStudentStatistics:e.query({query:e=>{let{centerId:t,boardId:a}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student/stats")}}}),getTransferCertificateForm:e.query({query:e=>{let{centerId:t,boardId:a,studentId:n}=e;return{url:"center/".concat(t,"/board/").concat(a,"/manageStudent/student/").concat(n,"/tc/form")}}}),generateTransferCertificate:e.mutation({query:e=>{let{centerId:t,boardId:a,studentId:s,payload:r}=e;return{url:"center/".concat(t,"/board/").concat(a,"/manageStudent/student/").concat(s,"/tc/generate"),method:n.WU.POST,body:r,responseHandler:async e=>e.blob()}}}),getTransferCertificateHistory:e.query({query:e=>{let{centerId:t,boardId:a,studentId:n}=e;return{url:"center/".concat(t,"/board/").concat(a,"/manageStudent/student/").concat(n,"/tc/history")}}}),downloadTransferCertificate:e.query({query:e=>{let{centerId:t,boardId:a,studentId:n,certificateId:s}=e;return{url:"center/".concat(t,"/board/").concat(a,"/manageStudent/student/").concat(n,"/tc/").concat(s,"/download"),responseHandler:async e=>e.blob()}}}),downloadCharacterCertificate:e.query({query:e=>{let{centerId:t,boardId:a,studentId:n}=e;return{url:"character/center/".concat(t,"/board/").concat(a,"/entity/").concat(n,"/download"),params:{type:"character"},responseHandler:async e=>e.blob()}}}),getAllEditableFields:e.query({query:e=>{let{centerId:t,boardId:a}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student-bulk-edit/editable-fields")}}}),getAllStudentsForBulkEdit:e.query({query:e=>{let{centerId:t,boardId:a,params:n}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student-bulk-edit/bulk-edit"),params:n,paramsSerializer:e=>{let t=new URLSearchParams;return void 0!==e.classId&&t.append("classId",e.classId.toString()),void 0!==e.sectionId&&t.append("sectionId",e.
1sectionId.toString()),Array.isArray(e.fields)&&e.fields.forEach(e=>{t.append("fields",e)}),t.toString()}}}}),updateStudentsBulk:e.mutation({query:e=>{let{centerId:t,boardId:a,payload:s}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student-bulk-edit/bulk-update"),method:n.WU.PUT,body:s,responseHandler:"text"}}}),getStudentSubjectMapping:e.query({query:e=>{let{centerId:t,boardId:a,classId:n,sectionId:s,academicCalendarId:r}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student-subject-mapping"),params:{classId:n,sectionId:s,...void 0!==r&&{academicCalendarId:r}}}},providesTags:(e,t,a)=>{let{classId:n,sectionId:s}=a;return[{type:r.LS4,id:"MAPPING-".concat(n,"-").concat(s)}]}}),saveStudentSubjectMapping:e.mutation({query:e=>{let{centerId:t,boardId:a,payload:s}=e;return{url:"center/".concat(t,"/board/").concat(a,"/student-subject-mapping/bulk"),method:n.WU.POST,body:s}},invalidatesTags:(e,t,a)=>{let{payload:n}=a;return[{type:r.LS4,id:"LIST"},r.LS4]}})})})},48116:function(e,t,a){a.d(t,{d:function(){return r},l:function(){return s}});var n=a(20596);let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.a7,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=(0,n.RT)(t),r="string"==typeof e?parseFloat(e):null!=e?e:0,l=Number.isFinite(r)?r:0,{showSymbol:i=!0,showCode:o=!1,minimumFractionDigits:c=s.decimals,maximumFractionDigits:d=s.decimals}=a,u=new Intl.NumberFormat(s.locale,{minimumFractionDigits:Math.min(c,d),maximumFractionDigits:d}).format(l);return o?"".concat(s.code," ").concat(u):i?"".concat(s.symbol).concat(u):u},r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.a7,a=(0,n.RT)(t).symbol,s="string"==typeof e?i(e):Number(e);if(!isFinite(s))return s>0?"∞":"-∞";if(isNaN(s))return"NaN";if(0===s)return"".concat(a,"0.00");let r=Math.abs(s),o="";if(r>=1e12){let e=l(r,1e12);o="".concat(a).concat(e.toFixed(1)," L Cr")}else if(r>=1e10){let e=l(r,1e10);o="".concat(a).concat(e.toFixed(1)," K Cr")}else if(r>=1e7){let e=l(r,1e7);o="".concat(a).concat(e.toFixed(1)," Cr")}else if(r>=1e5){let e=l(r,1e5);o="".concat(a).concat(e.toFixed(1)," L")}else if(r>=1e3){let e=l(r,1e3);o="".concat(a).concat(e.toFixed(1),"K")}else o="".concat(a).concat(r.toFixed(1));return s<0?"-".concat(o):o},l=(e,t)=>{let a=e/t;return a<10?a:a/Math.pow(10,Math.floor(Math.log10(a))+1-2)},i=e=>{let t=e.includes("-"),a=e.replace(/[^\d.]/g,""),n=1;e.includes("L Cr")?n=1e12:e.includes("K Cr")?n=1e10:e.includes("Cr")?n=1e7:e.includes("L")?n=1e5:e.includes("K")&&(n=1e3);let s=parseFloat(a)*n;return t?-s:s}},90522:function(e,t,a){a.d(t,{IB:function(){return s},af:function(){return r},ne:function(){return l}});var n=a(91351);let s=n.Ry({reason:n.Z_({required_error:"Reason is required"}).trim().min(1,"Reason is required").max(500,"Reason must be 500 characters or fewer")}),r=n.Ry({reason:n.Z_().trim().max(500,"Reason must be 500 characters or fewer").optional()}),l=n.Ry({channels:n.IX(n.Km(["EMAIL","WHATSAPP","SMS"])).min(1,"Select at least one channel")})}}]);

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.