@accounter/client 0.0.9-alpha-20251209135403-8ff0c644655c764ce404779933f0dbf26a6a54e9 → 0.0.9-alpha-20251209170231-980cc730914111644c9194dac5ac995a09e28c74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/assets/{Checkbox-BHVKlxRj.js → Checkbox-CoEj3QSE.js} +1 -1
  3. package/dist/assets/{MultiSelect-DY08OexD.js → MultiSelect-DRJD_QDr.js} +1 -1
  4. package/dist/assets/{Progress-CkBW27DM.js → Progress-CU1fWOjF.js} +1 -1
  5. package/dist/assets/{Table-bhKB4PFK.js → Table-C5b9rbOB.js} +1 -1
  6. package/dist/assets/{Typography-DclIL89E.js → Typography-CJ6IUHKs.js} +1 -1
  7. package/dist/assets/{YearPickerInput-DgK0Ih6X.js → YearPickerInput-DD-O605S.js} +1 -1
  8. package/dist/assets/{accordion-CAxRDsFz.js → accordion-Csw2mWiO.js} +1 -1
  9. package/dist/assets/{accountant-approvals-Dgsw0WDb.js → accountant-approvals-BeUBLtnd.js} +1 -1
  10. package/dist/assets/{accounter-table-DIm6Wedu.js → accounter-table-CLNNqdXm.js} +1 -1
  11. package/dist/assets/{addDays-CpwSVE6j.js → addDays-oqtNz11p.js} +1 -1
  12. package/dist/assets/{all-charges-CS_0zCEZ.js → all-charges-BK_c2XcZ.js} +1 -1
  13. package/dist/assets/{arrow-up-down-BCKzoFzo.js → arrow-up-down-BepSQkkk.js} +1 -1
  14. package/dist/assets/{building-2-Cp2Es1mt.js → building-2-DoYjr9zp.js} +1 -1
  15. package/dist/assets/{business-B1WVYc0i.js → business-C49SW3ik.js} +2 -2
  16. package/dist/assets/{business-extended-info-NwMS1Rj6.js → business-extended-info-CaoOYPT8.js} +1 -1
  17. package/dist/assets/{business-header-D7w2Xzis.js → business-header-gf-FUFaN.js} +1 -1
  18. package/dist/assets/{business-ledger-filters-BBCKjVgu.js → business-ledger-filters-Clr_J6Pb.js} +1 -1
  19. package/dist/assets/{business-ledger-single-CjmguyFq.js → business-ledger-single-CeMmKYhH.js} +1 -1
  20. package/dist/assets/{business-trip-BljjobKa.js → business-trip-DNDWlM8w.js} +1 -1
  21. package/dist/assets/charge-NQDW3QqJ.js +1 -0
  22. package/dist/assets/{charges-filters-D_ruML4x.js → charges-filters-nFUpOOgf.js} +1 -1
  23. package/dist/assets/{charges-ledger-validation-RNuvPfFo.js → charges-ledger-validation-zMQsg1pC.js} +1 -1
  24. package/dist/assets/{charges-table-Dmz1Fxim.js → charges-table-CTMLwet4.js} +1 -1
  25. package/dist/assets/{chart-MqLuc9m0.js → chart-CcwcQbqJ.js} +1 -1
  26. package/dist/assets/{contracts-DCmvv-5I.js → contracts-CAZC6d8B.js} +1 -1
  27. package/dist/assets/{data-table-column-header-CT7O7uRT.js → data-table-column-header-BxsKrjBX.js} +1 -1
  28. package/dist/assets/{data-table-pagination-Bn6-S7wX.js → data-table-pagination-wIOuSOqc.js} +1 -1
  29. package/dist/assets/{deposits-transactions-table-BAObjoYX.js → deposits-transactions-table-jhVmfuNs.js} +1 -1
  30. package/dist/assets/{download-csv-button-BsXK9P76.js → download-csv-button-CxFM5ZN1.js} +1 -1
  31. package/dist/assets/{edit-issue-document-modal-CG9FH4t_.js → edit-issue-document-modal-CI2VPVkB.js} +1 -1
  32. package/dist/assets/{editable-business-trip-CH61WHL7.js → editable-business-trip-B388mlUw.js} +1 -1
  33. package/dist/assets/{eye-off-Cc-ssiRk.js → eye-off-CfHy9jRk.js} +1 -1
  34. package/dist/assets/{funnel-4UXATjU3.js → funnel-Cn1E8rCW.js} +1 -1
  35. package/dist/assets/{index-JJZ0k_k8.js → index-2Ym7mPTf.js} +1 -1
  36. package/dist/assets/{index-CPuaqVQw.js → index-BM4xRMf6.js} +1 -1
  37. package/dist/assets/{index-D8HuUMKu.js → index-BWtxBLCR.js} +1 -1
  38. package/dist/assets/{index-CFrclniY.js → index-BYgtjSMY.js} +1 -1
  39. package/dist/assets/{index-BHTel4x6.js → index-BbVwSP6k.js} +1 -1
  40. package/dist/assets/{index-DYUcGCvp.js → index-Bcc1EVhw.js} +1 -1
  41. package/dist/assets/{index-Cz49agDK.js → index-BcxhLoO7.js} +1 -1
  42. package/dist/assets/{index-lpyXbMDd.js → index-Bq4ew9mE.js} +1 -1
  43. package/dist/assets/{index-De4VpPkV.js → index-BvTcJJXh.js} +1 -1
  44. package/dist/assets/{index-DQsGXPYg.js → index-CM5jGkPB.js} +1 -1
  45. package/dist/assets/{index-DVU7w2C4.js → index-D0scMlrm.js} +1 -1
  46. package/dist/assets/{index-Cw81Wg3b.js → index-DAjmDqPJ.js} +1 -1
  47. package/dist/assets/{index-CFOw7tWS.js → index-DBLC9vCJ.js} +1 -1
  48. package/dist/assets/{index-D42PKeAo.js → index-DHYVY3Bq.js} +1 -1
  49. package/dist/assets/{index-YQXRLoVL.js → index-DrY2LoBX.js} +1 -1
  50. package/dist/assets/{index-CjcufnQY.js → index-DuJJkBba.js} +1 -1
  51. package/dist/assets/{index-BNMU0DUr.js → index-ITLfbYgx.js} +1 -1
  52. package/dist/assets/{index-qyF0HH0t.js → index-MvqJWvoO.js} +1 -1
  53. package/dist/assets/{index-BNGi9a78.js → index-U9BN8IFT.js} +1 -1
  54. package/dist/assets/{index-C3pJ0CeY.js → index-W0j_QNs_.js} +1 -1
  55. package/dist/assets/{index-DPzHTlTo.js → index-bfQMiA8o.js} +1 -1
  56. package/dist/assets/{index-BWtniMl1.js → index-lzDrXIqE.js} +1 -1
  57. package/dist/assets/{index-xOkwbA9z.js → index-oJIMvEL1.js} +1 -1
  58. package/dist/assets/{index-CHtpNrAW.js → index-qAF5sGRO.js} +4 -4
  59. package/dist/assets/{index-C9bDcLJk.js → index-ultzcMfl.js} +1 -1
  60. package/dist/assets/{index-SV9JUpu6.js → index-vQiKHr5F.js} +1 -1
  61. package/dist/assets/{index.es-DnF4r6Dk.js → index.es-Cbmre-3y.js} +1 -1
  62. package/dist/assets/{insert-business-trip-modal-CQv_ZpxL.js → insert-business-trip-modal-_imZNOPq.js} +1 -1
  63. package/dist/assets/issue-document-BbxmF4sT.js +1 -0
  64. package/dist/assets/{list-plus-DsfXaxO5.js → list-plus-DEqGGtBU.js} +1 -1
  65. package/dist/assets/{login-page-DKeixPVN.js → login-page-CUSymIR_.js} +1 -1
  66. package/dist/assets/{match-document-modal-LhAEyv1y.js → match-document-modal-CQ8I-zEU.js} +1 -1
  67. package/dist/assets/{missing-info-charges-DCVKrfEr.js → missing-info-charges-CFt2F-LA.js} +1 -1
  68. package/dist/assets/{modal-YTgF-R03.js → modal-D_KAAYCr.js} +1 -1
  69. package/dist/assets/{modify-contract-dialog-D7Z8bOws.js → modify-contract-dialog-DSwRl9du.js} +1 -1
  70. package/dist/assets/{page-layout-Cs7LzhPs.js → page-layout-7iCtDTzs.js} +1 -1
  71. package/dist/assets/{page-not-found-Cs086tZP.js → page-not-found-CsSbBsPd.js} +1 -1
  72. package/dist/assets/{panel-top-open-DfXV4xoB.js → panel-top-open-CVvVnpDH.js} +1 -1
  73. package/dist/assets/{pencil-3H1z0dQ2.js → pencil-CpYjq1NY.js} +1 -1
  74. package/dist/assets/{report-commentary-row-DNTsFgf_.js → report-commentary-row-CgmMnDJu.js} +1 -1
  75. package/dist/assets/{save-D2KnX2aJ.js → save-C6S-RD-9.js} +1 -1
  76. package/dist/assets/{similar-transactions-modal-DN6pAqBR.js → similar-transactions-modal-Dn4dMAAO.js} +1 -1
  77. package/dist/assets/{sub-UiWBdxTZ.js → sub-DgacWlyb.js} +1 -1
  78. package/dist/assets/subMonths-oKYDpkY2.js +1 -0
  79. package/dist/assets/{summary-DLRjO19t.js → summary-ZTGFg2Jz.js} +1 -1
  80. package/dist/assets/{toggle-expansion-button-ByfnT_sn.js → toggle-expansion-button-DYABrNZG.js} +1 -1
  81. package/dist/assets/tooltip-Br1wJ5zm.js +1 -0
  82. package/dist/assets/{use-url-query-DMunwqS4.js → use-url-query-CYeryni6.js} +1 -1
  83. package/dist/index.html +1 -1
  84. package/package.json +1 -1
  85. package/src/components/business/admin/financial-account-section.tsx +2 -0
  86. package/src/components/financial-accounts/financial-account-card.tsx +4 -0
  87. package/src/components/financial-accounts/modify-financial-account-dialog.tsx +19 -0
  88. package/src/components/financial-accounts/types.ts +1 -0
  89. package/src/gql/gql.ts +3 -3
  90. package/src/gql/graphql.ts +5 -2
  91. package/dist/assets/charge-ChPubJah.js +0 -1
  92. package/dist/assets/issue-document-DJMGPj2s.js +0 -1
  93. package/dist/assets/subMonths-DZvdAXT7.js +0 -1
  94. package/dist/assets/tooltip-0-bix6mQ.js +0 -1
@@ -1 +1 @@
1
- import{bt as I,r as f,bu as O,aF as P,bv as F,bw as y,j as s,bx as N,B,y as E,by as k,aC as M,bz as x,bA as h,bB as j,w as D,bC as R,bD as L}from"./index-CHtpNrAW.js";import{u as A}from"./use-url-query-DMunwqS4.js";import{P as T}from"./modal-YTgF-R03.js";import{F as U}from"./funnel-4UXATjU3.js";import{M as C}from"./MultiSelect-DY08OexD.js";var V=I((e,{color:t})=>({root:{backgroundColor:e.fn.themeColor(t,e.colorScheme==="dark"?5:2),color:e.colorScheme==="dark"?e.colors.dark[9]:"inherit"}})),z=Object.defineProperty,v=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,G=(e,t)=>{for(var a in t||(t={}))_.call(t,a)&&S(e,a,t[a]);if(v)for(var a of v(t))w.call(t,a)&&S(e,a,t[a]);return e},H=(e,t)=>{var a={};for(var o in e)_.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&v)for(var o of v(e))t.indexOf(o)<0&&w.call(e,o)&&(a[o]=e[o]);return a};const X={color:"yellow"},q=f.forwardRef((e,t)=>{const a=O("Mark",X,e),{color:o,className:u,unstyled:p,variant:c}=a,d=H(a,["color","className","unstyled","variant"]),{classes:m,cx:b}=V({color:o},{unstyled:p,name:"Mark",variant:c});return P.createElement(F,G({component:"mark",ref:t,className:b(m.root,u)},d))});q.displayName="@mantine/core/Mark";function J({filter:e,setFilter:t,closeModal:a,single:o=!1}){const{control:u,handleSubmit:p}=E({defaultValues:{...e}}),{selectableBusinesses:c,fetching:d}=k(),{userContext:m}=f.useContext(M),b=r=>{t(r),a()};function l(){t({businessIDs:o?e.businessIDs:void 0}),a()}return s.jsxs(s.Fragment,{children:[d?s.jsx("div",{children:"Loading..."}):s.jsx("div",{}),s.jsxs("form",{onSubmit:p(b),children:[!o&&s.jsxs(s.Fragment,{children:[s.jsx(x,{name:"ownerIds",control:u,defaultValue:e.ownerIds,render:({field:r,fieldState:i})=>s.jsx(C,{...r,data:c,value:r.value??(m?.context.adminBusinessId?[m.context.adminBusinessId]:void 0),disabled:d,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:i.error?.message})}),s.jsx(x,{name:"businessIDs",control:u,defaultValue:e.businessIDs,render:({field:r,fieldState:i})=>s.jsx(C,{...r,data:c,value:r.value??void 0,disabled:d,label:"Businesses",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:i.error?.message})})]}),s.jsx(x,{name:"fromDate",control:u,defaultValue:e.fromDate,rules:{pattern:{value:h,message:"Date must be im format yyyy-mm-dd"}},render:({field:r,fieldState:i})=>s.jsx(j,{...r,onChange:n=>{const g=n?typeof n=="string"?n:D(n,"yyyy-MM-dd"):void 0;g!==r.value&&r.onChange(g)},value:r.value?new Date(r.value):void 0,error:i.error?.message,label:"From Date",popoverProps:{withinPortal:!0}})}),s.jsx(x,{name:"toDate",control:u,defaultValue:e.toDate,rules:{pattern:{value:h,message:"Date must be im format yyyy-mm-dd"}},render:({field:r,fieldState:i})=>s.jsx(j,{...r,onChange:n=>{const g=n?typeof n=="string"?n:D(n,"yyyy-MM-dd"):void 0;g!==r.value&&r.onChange(g)},value:r.value?new Date(r.value):void 0,error:i.error?.message,label:"To Date",popoverProps:{withinPortal:!0}})}),!o&&s.jsx(x,{name:"type",control:u,defaultValue:null,render:({field:r,fieldState:i})=>s.jsx(R,{...r,onChange:n=>r.onChange(n==="NULL"?null:n),data:[{value:"NULL",label:"All"},{value:"BUSINESS",label:"Business"},{value:"TAX_CATEGORY",label:"Tax Category"}],error:i.error?.message,label:"Type"})}),s.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[s.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),s.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:l,children:"Clear"}),s.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:a,children:"Cancel"})]})]})]})}function $({filter:e,setFilter:t}){const[a,o]=f.useState(!1),[u,p]=f.useState(!y(e)),{get:c,set:d}=A();function m(l){return Object.entries(l??{}).filter(([i,n])=>n!==void 0&&Array.isArray(n)&&n.length>0).length>0}function b(l){l.fromDate?.trim()===""&&(l.fromDate=void 0),l.toDate?.trim()===""&&(l.toDate=void 0),L(l,e)||(t(l),p(m(l)))}return f.useEffect(()=>{const l=y(e)?null:encodeURIComponent(JSON.stringify(e)),r=c("ledgerRecordsFilters");l!==r&&d("ledgerRecordsFilters",l)},[e,c,d]),s.jsxs(s.Fragment,{children:[s.jsx(T,{opened:a,onClose:()=>o(!1),content:s.jsx(J,{single:!0,filter:e,setFilter:b,closeModal:()=>o(!1)})}),s.jsx(N,{inline:!0,size:16,disabled:!u,children:s.jsx(B,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>o(!0),children:s.jsx(U,{className:"size-5"})})})]})}export{$ as B,q as M};
1
+ import{bt as I,r as f,bu as O,aF as P,bv as F,bw as y,j as s,bx as N,B,y as E,by as k,aC as M,bz as x,bA as h,bB as j,w as D,bC as R,bD as L}from"./index-qAF5sGRO.js";import{u as A}from"./use-url-query-CYeryni6.js";import{P as T}from"./modal-D_KAAYCr.js";import{F as U}from"./funnel-Cn1E8rCW.js";import{M as C}from"./MultiSelect-DRJD_QDr.js";var V=I((e,{color:t})=>({root:{backgroundColor:e.fn.themeColor(t,e.colorScheme==="dark"?5:2),color:e.colorScheme==="dark"?e.colors.dark[9]:"inherit"}})),z=Object.defineProperty,v=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,G=(e,t)=>{for(var a in t||(t={}))_.call(t,a)&&S(e,a,t[a]);if(v)for(var a of v(t))w.call(t,a)&&S(e,a,t[a]);return e},H=(e,t)=>{var a={};for(var o in e)_.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&v)for(var o of v(e))t.indexOf(o)<0&&w.call(e,o)&&(a[o]=e[o]);return a};const X={color:"yellow"},q=f.forwardRef((e,t)=>{const a=O("Mark",X,e),{color:o,className:u,unstyled:p,variant:c}=a,d=H(a,["color","className","unstyled","variant"]),{classes:m,cx:b}=V({color:o},{unstyled:p,name:"Mark",variant:c});return P.createElement(F,G({component:"mark",ref:t,className:b(m.root,u)},d))});q.displayName="@mantine/core/Mark";function J({filter:e,setFilter:t,closeModal:a,single:o=!1}){const{control:u,handleSubmit:p}=E({defaultValues:{...e}}),{selectableBusinesses:c,fetching:d}=k(),{userContext:m}=f.useContext(M),b=r=>{t(r),a()};function l(){t({businessIDs:o?e.businessIDs:void 0}),a()}return s.jsxs(s.Fragment,{children:[d?s.jsx("div",{children:"Loading..."}):s.jsx("div",{}),s.jsxs("form",{onSubmit:p(b),children:[!o&&s.jsxs(s.Fragment,{children:[s.jsx(x,{name:"ownerIds",control:u,defaultValue:e.ownerIds,render:({field:r,fieldState:i})=>s.jsx(C,{...r,data:c,value:r.value??(m?.context.adminBusinessId?[m.context.adminBusinessId]:void 0),disabled:d,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:i.error?.message})}),s.jsx(x,{name:"businessIDs",control:u,defaultValue:e.businessIDs,render:({field:r,fieldState:i})=>s.jsx(C,{...r,data:c,value:r.value??void 0,disabled:d,label:"Businesses",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:i.error?.message})})]}),s.jsx(x,{name:"fromDate",control:u,defaultValue:e.fromDate,rules:{pattern:{value:h,message:"Date must be im format yyyy-mm-dd"}},render:({field:r,fieldState:i})=>s.jsx(j,{...r,onChange:n=>{const g=n?typeof n=="string"?n:D(n,"yyyy-MM-dd"):void 0;g!==r.value&&r.onChange(g)},value:r.value?new Date(r.value):void 0,error:i.error?.message,label:"From Date",popoverProps:{withinPortal:!0}})}),s.jsx(x,{name:"toDate",control:u,defaultValue:e.toDate,rules:{pattern:{value:h,message:"Date must be im format yyyy-mm-dd"}},render:({field:r,fieldState:i})=>s.jsx(j,{...r,onChange:n=>{const g=n?typeof n=="string"?n:D(n,"yyyy-MM-dd"):void 0;g!==r.value&&r.onChange(g)},value:r.value?new Date(r.value):void 0,error:i.error?.message,label:"To Date",popoverProps:{withinPortal:!0}})}),!o&&s.jsx(x,{name:"type",control:u,defaultValue:null,render:({field:r,fieldState:i})=>s.jsx(R,{...r,onChange:n=>r.onChange(n==="NULL"?null:n),data:[{value:"NULL",label:"All"},{value:"BUSINESS",label:"Business"},{value:"TAX_CATEGORY",label:"Tax Category"}],error:i.error?.message,label:"Type"})}),s.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[s.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),s.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:l,children:"Clear"}),s.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:a,children:"Cancel"})]})]})]})}function $({filter:e,setFilter:t}){const[a,o]=f.useState(!1),[u,p]=f.useState(!y(e)),{get:c,set:d}=A();function m(l){return Object.entries(l??{}).filter(([i,n])=>n!==void 0&&Array.isArray(n)&&n.length>0).length>0}function b(l){l.fromDate?.trim()===""&&(l.fromDate=void 0),l.toDate?.trim()===""&&(l.toDate=void 0),L(l,e)||(t(l),p(m(l)))}return f.useEffect(()=>{const l=y(e)?null:encodeURIComponent(JSON.stringify(e)),r=c("ledgerRecordsFilters");l!==r&&d("ledgerRecordsFilters",l)},[e,c,d]),s.jsxs(s.Fragment,{children:[s.jsx(T,{opened:a,onClose:()=>o(!1),content:s.jsx(J,{single:!0,filter:e,setFilter:b,closeModal:()=>o(!1)})}),s.jsx(N,{inline:!0,size:16,disabled:!u,children:s.jsx(B,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>o(!0),children:s.jsx(U,{className:"size-5"})})})]})}export{$ as B,q as M};
@@ -1 +1 @@
1
- import{a as S,r as c,F as w,u as y,j as n,c as C,ay as o,br as x}from"./index-CHtpNrAW.js";import{u as h}from"./use-url-query-DMunwqS4.js";import{a as F}from"./accounter-table-DIm6Wedu.js";import{B as R}from"./business-extended-info-NwMS1Rj6.js";import{B as v,M as p}from"./business-ledger-filters-BBCKjVgu.js";import"./Table-bhKB4PFK.js";import"./data-table-column-header-CT7O7uRT.js";import"./eye-off-Cc-ssiRk.js";import"./download-csv-button-BsXK9P76.js";import"./modal-YTgF-R03.js";import"./funnel-4UXATjU3.js";import"./MultiSelect-DY08OexD.js";const H=({businessId:t})=>{const{businessId:r}=S(),{get:s}=h(),{setFiltersContext:u}=c.useContext(w),l=t||r,[m,d]=c.useState(s("ledgerRecordsFilters")?{...JSON.parse(decodeURIComponent(s("ledgerRecordsFilters"))),businessIDs:l?[l]:[]}:{businessIDs:l?[l]:[]}),[{data:a,fetching:f}]=y({query:x,variables:{filters:m}});c.useEffect(()=>{u(n.jsx(v,{filter:m,setFilter:d}))},[a,m,u,d]);const b=c.useMemo(()=>a?.businessTransactionsSumFromLedgerRecords.__typename==="CommonError"?[]:a?.businessTransactionsSumFromLedgerRecords.businessTransactionsSum?a.businessTransactionsSumFromLedgerRecords.businessTransactionsSum.sort((e,g)=>e.business.name.localeCompare(g.business.name)):[],[a?.businessTransactionsSumFromLedgerRecords]);return f?n.jsx(C,{}):n.jsx(F,{moreInfo:e=>n.jsx(R,{businessID:e.business.id,filter:m}),striped:!0,highlightOnHover:!0,stickyHeader:!0,items:b,columns:[{title:"Business Name",value:e=>e.business.name},{title:"Debit",value:e=>e.debit.formatted,style:{whiteSpace:"nowrap"}},{title:"Credit",value:e=>e.credit.formatted,style:{whiteSpace:"nowrap"}},{title:"Total",value:e=>e.total.raw&&(e.total.raw<-1e-4||e.total.raw>1e-4)?n.jsx(p,{color:e.total.raw>0?"green":"red",children:e.total.formatted}):e.total.formatted,style:{whiteSpace:"nowrap"}},...i(o.Eur),...i(o.Usd),...i(o.Gbp),...i(o.Cad),...i(o.Jpy),...i(o.Aud),...i(o.Sek)]})};function i(t){return[{title:`${t} Debit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.debit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Credit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.credit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Total`,value:r=>{const s=r.foreignCurrenciesSum.find(u=>u.currency===t);return s?.total?.raw&&(s.total.raw<-1e-4||s.total.raw>1e-4)?n.jsx(p,{color:s.total.raw>0?"green":"red",children:s.total.formatted}):s?.total?.formatted},style:{whiteSpace:"nowrap"}}]}export{H as BusinessLedgerRecordsSingle};
1
+ import{a as S,r as c,F as w,u as y,j as n,c as C,ay as o,br as x}from"./index-qAF5sGRO.js";import{u as h}from"./use-url-query-CYeryni6.js";import{a as F}from"./accounter-table-CLNNqdXm.js";import{B as R}from"./business-extended-info-CaoOYPT8.js";import{B as v,M as p}from"./business-ledger-filters-Clr_J6Pb.js";import"./Table-C5b9rbOB.js";import"./data-table-column-header-BxsKrjBX.js";import"./eye-off-CfHy9jRk.js";import"./download-csv-button-CxFM5ZN1.js";import"./modal-D_KAAYCr.js";import"./funnel-Cn1E8rCW.js";import"./MultiSelect-DRJD_QDr.js";const H=({businessId:t})=>{const{businessId:r}=S(),{get:s}=h(),{setFiltersContext:u}=c.useContext(w),l=t||r,[m,d]=c.useState(s("ledgerRecordsFilters")?{...JSON.parse(decodeURIComponent(s("ledgerRecordsFilters"))),businessIDs:l?[l]:[]}:{businessIDs:l?[l]:[]}),[{data:a,fetching:f}]=y({query:x,variables:{filters:m}});c.useEffect(()=>{u(n.jsx(v,{filter:m,setFilter:d}))},[a,m,u,d]);const b=c.useMemo(()=>a?.businessTransactionsSumFromLedgerRecords.__typename==="CommonError"?[]:a?.businessTransactionsSumFromLedgerRecords.businessTransactionsSum?a.businessTransactionsSumFromLedgerRecords.businessTransactionsSum.sort((e,g)=>e.business.name.localeCompare(g.business.name)):[],[a?.businessTransactionsSumFromLedgerRecords]);return f?n.jsx(C,{}):n.jsx(F,{moreInfo:e=>n.jsx(R,{businessID:e.business.id,filter:m}),striped:!0,highlightOnHover:!0,stickyHeader:!0,items:b,columns:[{title:"Business Name",value:e=>e.business.name},{title:"Debit",value:e=>e.debit.formatted,style:{whiteSpace:"nowrap"}},{title:"Credit",value:e=>e.credit.formatted,style:{whiteSpace:"nowrap"}},{title:"Total",value:e=>e.total.raw&&(e.total.raw<-1e-4||e.total.raw>1e-4)?n.jsx(p,{color:e.total.raw>0?"green":"red",children:e.total.formatted}):e.total.formatted,style:{whiteSpace:"nowrap"}},...i(o.Eur),...i(o.Usd),...i(o.Gbp),...i(o.Cad),...i(o.Jpy),...i(o.Aud),...i(o.Sek)]})};function i(t){return[{title:`${t} Debit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.debit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Credit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.credit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Total`,value:r=>{const s=r.foreignCurrenciesSum.find(u=>u.currency===t);return s?.total?.raw&&(s.total.raw<-1e-4||s.total.raw>1e-4)?n.jsx(p,{color:s.total.raw>0?"green":"red",children:s.total.formatted}):s?.total?.formatted},style:{whiteSpace:"nowrap"}}]}export{H as BusinessLedgerRecordsSingle};
@@ -1 +1 @@
1
- import{a as p,r as n,F as u,u as m,j as s,c,cd as d}from"./index-CHtpNrAW.js";import{P as x,C as l,E as f}from"./editable-business-trip-CH61WHL7.js";import{P as T}from"./page-layout-Cs7LzhPs.js";import"./list-plus-DsfXaxO5.js";import"./summary-DLRjO19t.js";import"./Table-bhKB4PFK.js";import"./toggle-expansion-button-ByfnT_sn.js";import"./panel-top-open-DfXV4xoB.js";import"./MultiSelect-DY08OexD.js";import"./similar-transactions-modal-DN6pAqBR.js";import"./tooltip-0-bix6mQ.js";const v=({businessTripId:o})=>{const{businessTripId:a}=p(),{setFiltersContext:i}=n.useContext(u),e=o??a??"",[{data:r,fetching:t}]=m({query:d,variables:{businessTripId:e}});return n.useEffect(()=>{i(s.jsx("div",{className:"flex flex-row gap-x-5",children:s.jsx(x,{filename:"business_trip_report"})}))},[r,t,i]),t||!r?.businessTrip?s.jsx(c,{}):s.jsx(T,{title:`Business Trip: ${r.businessTrip.name}`,description:"Manage business trip",children:s.jsx(l,{className:"mt-5",children:e&&s.jsx(f,{tripId:e,isExtended:!0})})})};export{v as BusinessTrip};
1
+ import{a as p,r as n,F as u,u as m,j as s,c,cd as d}from"./index-qAF5sGRO.js";import{P as x,C as l,E as f}from"./editable-business-trip-B388mlUw.js";import{P as T}from"./page-layout-7iCtDTzs.js";import"./list-plus-DEqGGtBU.js";import"./summary-ZTGFg2Jz.js";import"./Table-C5b9rbOB.js";import"./toggle-expansion-button-DYABrNZG.js";import"./panel-top-open-CVvVnpDH.js";import"./MultiSelect-DRJD_QDr.js";import"./similar-transactions-modal-Dn4dMAAO.js";import"./tooltip-Br1wJ5zm.js";const v=({businessTripId:o})=>{const{businessTripId:a}=p(),{setFiltersContext:i}=n.useContext(u),e=o??a??"",[{data:r,fetching:t}]=m({query:d,variables:{businessTripId:e}});return n.useEffect(()=>{i(s.jsx("div",{className:"flex flex-row gap-x-5",children:s.jsx(x,{filename:"business_trip_report"})}))},[r,t,i]),t||!r?.businessTrip?s.jsx(c,{}):s.jsx(T,{title:`Business Trip: ${r.businessTrip.name}`,description:"Manage business trip",children:s.jsx(l,{className:"mt-5",children:e&&s.jsx(f,{tripId:e,isExtended:!0})})})};export{v as BusinessTrip};
@@ -0,0 +1 @@
1
+ import{a as I,b as x,r as o,u as D,j as t,c as f,C as j}from"./index-qAF5sGRO.js";import{C as v}from"./charges-table-CTMLwet4.js";import{E as M,I as E,M as S}from"./match-document-modal-CQ8I-zEU.js";import"./toggle-expansion-button-DYABrNZG.js";import"./panel-top-open-CVvVnpDH.js";import"./index-DrY2LoBX.js";import"./similar-transactions-modal-Dn4dMAAO.js";import"./addDays-oqtNz11p.js";import"./list-plus-DEqGGtBU.js";import"./tooltip-Br1wJ5zm.js";import"./Table-C5b9rbOB.js";import"./summary-ZTGFg2Jz.js";import"./deposits-transactions-table-jhVmfuNs.js";import"./Checkbox-CoEj3QSE.js";import"./accordion-Csw2mWiO.js";import"./data-table-column-header-BxsKrjBX.js";import"./eye-off-CfHy9jRk.js";import"./YearPickerInput-DD-O605S.js";import"./insert-business-trip-modal-_imZNOPq.js";import"./accounter-table-CLNNqdXm.js";import"./modal-D_KAAYCr.js";const V=({chargeId:p})=>{const{chargeId:u}=I(),r=p||u;let e;try{e=x()}catch{}const[a,c]=o.useState(void 0),[s,n]=o.useState(void 0),[i,d]=o.useState(void 0),[{data:g,fetching:l},m]=D({query:j,pause:!r||!!e,variables:{chargeId:r??""}});o.useEffect(()=>{r&&!e&&m()},[r,e,m]);const h=e||g,C=!e&&l;return r?t.jsxs(t.Fragment,{children:[C?t.jsx(f,{}):t.jsx(v,{setEditChargeId:c,setInsertDocument:n,setMatchDocuments:d,data:h?.charge?[h.charge]:[],isAllOpened:!0}),a&&t.jsx(M,{chargeId:a?.id,close:()=>c(void 0),onChange:a.onChange}),s&&t.jsx(E,{chargeId:s.id,onChange:s.onChange,close:()=>n(void 0)}),i&&t.jsx(S,{chargeId:i.id,ownerId:i.ownerId,setMatchDocuments:()=>d(void 0)})]}):t.jsx("div",{children:"Charge not found"})};export{V as Charge};
@@ -1 +1 @@
1
- import{r as i,bw as B,bD as z,j as e,P as H,bx as W,B as U,aC as G,y as _,w as N,aE as D,dm as Q,b0 as q,V as J,dn as X,bz as h,eo as Y,bA as M,bB as O,bC as L,eh as k,at as m,hs as Z,a2 as $,Y as x,Z as j,_ as p,$ as g,bQ as K,bR as ee,bS as se}from"./index-CHtpNrAW.js";import{u as ae}from"./use-url-query-DMunwqS4.js";import{P as te}from"./modal-YTgF-R03.js";import{F as ne}from"./funnel-4UXATjU3.js";import{s as oe}from"./sub-UiWBdxTZ.js";import{M as A}from"./MultiSelect-DY08OexD.js";function re(a){return!a||B(a)?null:encodeURIComponent(JSON.stringify(a))}const le=[{value:D.AbsAmount,label:"Abs Amount"},{value:D.Amount,label:"Amount"},{value:D.Date,label:"Date"}],ce=[{label:"All",value:k.All},{label:"Income",value:k.Income},{label:"Expense",value:k.Expense}];function ie({filter:a,setFilter:w,closeModal:d}){const{userContext:b}=i.useContext(G),o=_({defaultValues:{byOwners:b?.context.adminBusinessId?[b.context.adminBusinessId]:void 0,sortBy:{field:D.Date,asc:!1},toAnyDate:N(new Date,"yyyy-MM-dd"),fromAnyDate:N(oe(new Date,{years:1}),"yyyy-MM-dd"),...a}}),{control:l,handleSubmit:T,watch:C}=o,[y,F]=i.useState(a.sortBy?.asc??!1),[c,u]=i.useState(!!a.sortBy?.field),{selectableFinancialEntities:S,fetching:t}=Q(),{selectableTags:v,fetching:I}=q(),E=C("sortBy.field");i.useEffect(()=>{E&&!c?u(!0):!E&&c&&u(!1)},[E,c]);const V=s=>{y!=null&&s.sortBy?.field&&(s.sortBy.asc=y),w(s),d()};function R(){w({}),F(!1),d()}return e.jsxs(e.Fragment,{children:[t?e.jsx("div",{children:"Loading..."}):e.jsx("div",{}),e.jsx(J,{...o,children:e.jsxs("form",{onSubmit:T(V),children:[e.jsxs(X,{cols:2,children:[e.jsx(h,{name:"byOwners",control:l,defaultValue:a.byOwners,render:({field:s,fieldState:n})=>e.jsx(A,{...s,data:S,value:s.value??[],disabled:t,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"byBusinesses",control:l,defaultValue:a.byBusinesses,render:({field:s,fieldState:n})=>e.jsx(A,{...s,data:S,value:s.value??[],disabled:t,label:"Financial Entities",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"byTags",control:l,defaultValue:a.byTags,render:({field:s,fieldState:n})=>e.jsx(A,{...s,data:v,itemComponent:Y,value:s.value??[],disabled:I,label:"Tags",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0,filter:(r,f,P)=>P.label?.toLowerCase().includes(r.toLowerCase().trim())||P.description?.toLowerCase().includes(r.toLowerCase().trim())})}),e.jsx(h,{name:"fromAnyDate",control:l,defaultValue:a.fromAnyDate,rules:{pattern:{value:M,message:"Date must be im format yyyy-mm-dd"}},render:({field:s,fieldState:n})=>e.jsx(O,{...s,onChange:r=>{const f=r?typeof r=="string"?r:N(r,"yyyy-MM-dd"):void 0;f!==s.value&&s.onChange(f)},value:s.value?new Date(s.value):void 0,error:n.error?.message,label:"From Date",popoverProps:{withinPortal:!0}})}),e.jsx(h,{name:"toAnyDate",control:l,defaultValue:a.toAnyDate,rules:{pattern:{value:M,message:"Date must be im format yyyy-mm-dd"}},render:({field:s,fieldState:n})=>e.jsx(O,{...s,onChange:r=>{const f=r?typeof r=="string"?r:N(r,"yyyy-MM-dd"):void 0;f!==s.value&&s.onChange(f)},value:s.value?new Date(s.value):void 0,error:n.error?.message,label:"To Date",popoverProps:{withinPortal:!0}})}),e.jsx(h,{name:"chargesType",control:l,defaultValue:a.chargesType,render:({field:s,fieldState:n})=>e.jsx(L,{...s,data:ce,value:s.value??k.All,disabled:t,label:"Charge Type",placeholder:"Filter income/expense",maxDropdownHeight:160,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"sortBy.field",control:l,defaultValue:a.sortBy?.field??D.Date,render:({field:s,fieldState:n})=>e.jsx(L,{...s,data:le,label:"Field to sort by",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,rightSectionProps:{style:{width:"5rem"}},withinPortal:!0,rightSection:e.jsxs("div",{className:"flex flex-row items-center gap-1",children:[e.jsx(m,{defaultChecked:a.sortBy?.asc??!1,checked:y??!1,disabled:!c,onCheckedChange:F}),e.jsx("span",{className:"text-xs",children:y?"ASC":"DESC"})]})})}),e.jsx(h,{name:"accountantStatus",control:l,defaultValue:a.accountantStatus,render:({field:s,fieldState:n})=>e.jsx(A,{...s,value:s.value??[],data:Z,disabled:t,label:"Accountant Status",placeholder:"All",maxDropdownHeight:160,error:n.error?.message,withinPortal:!0})}),e.jsxs("div",{className:"flex flex-col gap-2 mt-4 rounded-lg border p-3 shadow-sm space-y-2",children:[e.jsx($,{children:"Missing Information:"}),e.jsx(x,{control:o.control,name:"withoutInvoice",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Invoice"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutInvoice??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withoutReceipt",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Receipts"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutReceipt??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withoutDocuments",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Documents"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutDocuments??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withOpenDocuments",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"With Open Documents"})}),e.jsx(g,{children:e.jsxs(K,{children:[e.jsx(ee,{children:e.jsx(m,{defaultChecked:a.withOpenDocuments??!1,onCheckedChange:s.onChange})}),e.jsx(se,{children:e.jsx("p",{children:"Show only charges with documents that are currently open"})})]})})]})}),e.jsx(x,{control:o.control,name:"withoutTransactions",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Transactions"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutTransactions??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"unbalanced",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Unbalanced businesses"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.unbalanced??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withoutLedger",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without ledger"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutLedger??!1,onCheckedChange:s.onChange})})]})})]})]}),e.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[e.jsx("button",{type:"submit",disabled:t||I,className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),e.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:R,children:"Clear"}),e.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:d,children:"Cancel"})]})]})})]})}function pe({filter:a={},setFilter:w,activePage:d,setPage:b,totalPages:o=1,initiallyOpened:l=!1}){const[T,C]=i.useState(l),[y,F]=i.useState(!B(a)),{get:c,set:u}=ae();i.useEffect(()=>{const t=d>0?d.toFixed(0):null,v=c("page");t!==v&&u("page",t)},[d,c,u]),i.useEffect(()=>{const t=re(a),v=c("chargesFilters");t!==v&&(u("chargesFilters",t),u("page"),b(0))},[a,c,u,b]);const S=i.useCallback(t=>{z(t,a)||(w(t),F(!B(t)))},[a,w]);return e.jsxs("div",{className:"flex flex-row gap-5 items-center",children:[e.jsx(te,{opened:T,onClose:()=>C(!1),content:e.jsx(ie,{filter:a,setFilter:S,closeModal:()=>C(!1)}),modalSize:"xl"}),o>1&&e.jsx(H,{className:"flex-fit w-fit mx-0",currentPageIndex:d,onChange:b,totalPages:o}),e.jsx(W,{inline:!0,size:16,disabled:!y,children:e.jsx(U,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>C(!0),children:e.jsx(ne,{className:"size-5"})})})]})}export{pe as C,ce as c};
1
+ import{r as i,bw as B,bD as z,j as e,P as H,bx as W,B as U,aC as G,y as _,w as N,aE as D,dm as Q,b0 as q,V as J,dn as X,bz as h,eo as Y,bA as M,bB as O,bC as L,eh as k,at as m,hs as Z,a2 as $,Y as x,Z as j,_ as p,$ as g,bQ as K,bR as ee,bS as se}from"./index-qAF5sGRO.js";import{u as ae}from"./use-url-query-CYeryni6.js";import{P as te}from"./modal-D_KAAYCr.js";import{F as ne}from"./funnel-Cn1E8rCW.js";import{s as oe}from"./sub-DgacWlyb.js";import{M as A}from"./MultiSelect-DRJD_QDr.js";function re(a){return!a||B(a)?null:encodeURIComponent(JSON.stringify(a))}const le=[{value:D.AbsAmount,label:"Abs Amount"},{value:D.Amount,label:"Amount"},{value:D.Date,label:"Date"}],ce=[{label:"All",value:k.All},{label:"Income",value:k.Income},{label:"Expense",value:k.Expense}];function ie({filter:a,setFilter:w,closeModal:d}){const{userContext:b}=i.useContext(G),o=_({defaultValues:{byOwners:b?.context.adminBusinessId?[b.context.adminBusinessId]:void 0,sortBy:{field:D.Date,asc:!1},toAnyDate:N(new Date,"yyyy-MM-dd"),fromAnyDate:N(oe(new Date,{years:1}),"yyyy-MM-dd"),...a}}),{control:l,handleSubmit:T,watch:C}=o,[y,F]=i.useState(a.sortBy?.asc??!1),[c,u]=i.useState(!!a.sortBy?.field),{selectableFinancialEntities:S,fetching:t}=Q(),{selectableTags:v,fetching:I}=q(),E=C("sortBy.field");i.useEffect(()=>{E&&!c?u(!0):!E&&c&&u(!1)},[E,c]);const V=s=>{y!=null&&s.sortBy?.field&&(s.sortBy.asc=y),w(s),d()};function R(){w({}),F(!1),d()}return e.jsxs(e.Fragment,{children:[t?e.jsx("div",{children:"Loading..."}):e.jsx("div",{}),e.jsx(J,{...o,children:e.jsxs("form",{onSubmit:T(V),children:[e.jsxs(X,{cols:2,children:[e.jsx(h,{name:"byOwners",control:l,defaultValue:a.byOwners,render:({field:s,fieldState:n})=>e.jsx(A,{...s,data:S,value:s.value??[],disabled:t,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"byBusinesses",control:l,defaultValue:a.byBusinesses,render:({field:s,fieldState:n})=>e.jsx(A,{...s,data:S,value:s.value??[],disabled:t,label:"Financial Entities",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"byTags",control:l,defaultValue:a.byTags,render:({field:s,fieldState:n})=>e.jsx(A,{...s,data:v,itemComponent:Y,value:s.value??[],disabled:I,label:"Tags",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0,filter:(r,f,P)=>P.label?.toLowerCase().includes(r.toLowerCase().trim())||P.description?.toLowerCase().includes(r.toLowerCase().trim())})}),e.jsx(h,{name:"fromAnyDate",control:l,defaultValue:a.fromAnyDate,rules:{pattern:{value:M,message:"Date must be im format yyyy-mm-dd"}},render:({field:s,fieldState:n})=>e.jsx(O,{...s,onChange:r=>{const f=r?typeof r=="string"?r:N(r,"yyyy-MM-dd"):void 0;f!==s.value&&s.onChange(f)},value:s.value?new Date(s.value):void 0,error:n.error?.message,label:"From Date",popoverProps:{withinPortal:!0}})}),e.jsx(h,{name:"toAnyDate",control:l,defaultValue:a.toAnyDate,rules:{pattern:{value:M,message:"Date must be im format yyyy-mm-dd"}},render:({field:s,fieldState:n})=>e.jsx(O,{...s,onChange:r=>{const f=r?typeof r=="string"?r:N(r,"yyyy-MM-dd"):void 0;f!==s.value&&s.onChange(f)},value:s.value?new Date(s.value):void 0,error:n.error?.message,label:"To Date",popoverProps:{withinPortal:!0}})}),e.jsx(h,{name:"chargesType",control:l,defaultValue:a.chargesType,render:({field:s,fieldState:n})=>e.jsx(L,{...s,data:ce,value:s.value??k.All,disabled:t,label:"Charge Type",placeholder:"Filter income/expense",maxDropdownHeight:160,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"sortBy.field",control:l,defaultValue:a.sortBy?.field??D.Date,render:({field:s,fieldState:n})=>e.jsx(L,{...s,data:le,label:"Field to sort by",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,rightSectionProps:{style:{width:"5rem"}},withinPortal:!0,rightSection:e.jsxs("div",{className:"flex flex-row items-center gap-1",children:[e.jsx(m,{defaultChecked:a.sortBy?.asc??!1,checked:y??!1,disabled:!c,onCheckedChange:F}),e.jsx("span",{className:"text-xs",children:y?"ASC":"DESC"})]})})}),e.jsx(h,{name:"accountantStatus",control:l,defaultValue:a.accountantStatus,render:({field:s,fieldState:n})=>e.jsx(A,{...s,value:s.value??[],data:Z,disabled:t,label:"Accountant Status",placeholder:"All",maxDropdownHeight:160,error:n.error?.message,withinPortal:!0})}),e.jsxs("div",{className:"flex flex-col gap-2 mt-4 rounded-lg border p-3 shadow-sm space-y-2",children:[e.jsx($,{children:"Missing Information:"}),e.jsx(x,{control:o.control,name:"withoutInvoice",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Invoice"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutInvoice??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withoutReceipt",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Receipts"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutReceipt??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withoutDocuments",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Documents"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutDocuments??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withOpenDocuments",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"With Open Documents"})}),e.jsx(g,{children:e.jsxs(K,{children:[e.jsx(ee,{children:e.jsx(m,{defaultChecked:a.withOpenDocuments??!1,onCheckedChange:s.onChange})}),e.jsx(se,{children:e.jsx("p",{children:"Show only charges with documents that are currently open"})})]})})]})}),e.jsx(x,{control:o.control,name:"withoutTransactions",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without Transactions"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutTransactions??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"unbalanced",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Unbalanced businesses"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.unbalanced??!1,onCheckedChange:s.onChange})})]})}),e.jsx(x,{control:o.control,name:"withoutLedger",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(p,{children:"Without ledger"})}),e.jsx(g,{children:e.jsx(m,{defaultChecked:a.withoutLedger??!1,onCheckedChange:s.onChange})})]})})]})]}),e.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[e.jsx("button",{type:"submit",disabled:t||I,className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),e.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:R,children:"Clear"}),e.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:d,children:"Cancel"})]})]})})]})}function pe({filter:a={},setFilter:w,activePage:d,setPage:b,totalPages:o=1,initiallyOpened:l=!1}){const[T,C]=i.useState(l),[y,F]=i.useState(!B(a)),{get:c,set:u}=ae();i.useEffect(()=>{const t=d>0?d.toFixed(0):null,v=c("page");t!==v&&u("page",t)},[d,c,u]),i.useEffect(()=>{const t=re(a),v=c("chargesFilters");t!==v&&(u("chargesFilters",t),u("page"),b(0))},[a,c,u,b]);const S=i.useCallback(t=>{z(t,a)||(w(t),F(!B(t)))},[a,w]);return e.jsxs("div",{className:"flex flex-row gap-5 items-center",children:[e.jsx(te,{opened:T,onClose:()=>C(!1),content:e.jsx(ie,{filter:a,setFilter:S,closeModal:()=>C(!1)}),modalSize:"xl"}),o>1&&e.jsx(H,{className:"flex-fit w-fit mx-0",currentPageIndex:d,onChange:b,totalPages:o}),e.jsx(W,{inline:!0,size:16,disabled:!y,children:e.jsx(U,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>C(!0),children:e.jsx(ne,{className:"size-5"})})})]})}export{pe as C,ce as c};
@@ -1 +1 @@
1
- import{r as t,F as D,u as E,j as e,T as N,B as w,L as T,d as b,e as z,f as W}from"./index-CHtpNrAW.js";import{u as O}from"./use-url-query-DMunwqS4.js";import{C as k}from"./charges-filters-D_ruML4x.js";import{M as B,C as R,T as V}from"./charges-table-Dmz1Fxim.js";import{E as A,I as Q,M as U}from"./match-document-modal-LhAEyv1y.js";import{P as q}from"./page-layout-Cs7LzhPs.js";import{P as J}from"./Progress-CkBW27DM.js";import{P as $,a as G}from"./panel-top-open-DfXV4xoB.js";import"./modal-YTgF-R03.js";import"./funnel-4UXATjU3.js";import"./sub-UiWBdxTZ.js";import"./addDays-CpwSVE6j.js";import"./subMonths-DZvdAXT7.js";import"./MultiSelect-DY08OexD.js";import"./toggle-expansion-button-ByfnT_sn.js";import"./index-YQXRLoVL.js";import"./similar-transactions-modal-DN6pAqBR.js";import"./list-plus-DsfXaxO5.js";import"./tooltip-0-bix6mQ.js";import"./Table-bhKB4PFK.js";import"./summary-DLRjO19t.js";import"./deposits-transactions-table-BAObjoYX.js";import"./Checkbox-BHVKlxRj.js";import"./accordion-CAxRDsFz.js";import"./data-table-column-header-CT7O7uRT.js";import"./eye-off-Cc-ssiRk.js";import"./YearPickerInput-DgK0Ih6X.js";import"./insert-business-trip-modal-CQv_ZpxL.js";import"./accounter-table-DIm6Wedu.js";const Fe=()=>{const{setFiltersContext:p}=t.useContext(D),[n,u]=t.useState(void 0),[l,x]=t.useState(void 0),[c,C]=t.useState(void 0),[g,f]=t.useState(!1),[r,m]=t.useState([]),{get:F}=O(),d=F("chargesFilters"),I=t.useMemo(()=>{if(d)try{return JSON.parse(decodeURIComponent(d))}catch{return}},[d]),[o,j]=t.useState(I),S=t.useCallback((s,y)=>{r.map(h=>h.id).includes(s)?m(r.filter(h=>h.id!==s)):m([...r,{id:s,onChange:y}])},[r]),[{data:a,fetching:M},v]=E({query:W,variables:{filters:o},pause:!0});function P(){m([])}const i=t.useMemo(()=>a?.chargesWithLedgerChanges?.length?a.chargesWithLedgerChanges[a.chargesWithLedgerChanges.length-1].progress:0,[a?.chargesWithLedgerChanges]),L=t.useCallback(s=>{j(s)},[j]);return t.useEffect(()=>{o&&v()},[o,v]),t.useEffect(()=>{p(e.jsxs("div",{className:"flex flex-row gap-x-5 items-center",children:[e.jsx(J,{value:i,label:`${i?.toFixed(2)}%`,size:"xl",animate:i<100,className:"min-w-52"}),e.jsx(k,{filter:o,setFilter:L,activePage:0,setPage:()=>{},initiallyOpened:!0}),e.jsx(N,{label:"Expand all accounts",children:e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>f(s=>!s),children:g?e.jsx($,{className:"size-5"}):e.jsx(G,{className:"size-5"})})}),e.jsx(B,{selected:r,resetMerge:P})]}))},[a,M,o,g,p,f,r,i,L]),e.jsxs(q,{title:"Charges Ledger Validation",description:"Manage charges",children:[M?e.jsx(T,{className:"h-10 w-10 animate-spin mr-2 self-center"}):e.jsxs(e.Fragment,{children:[e.jsx(R,{setEditChargeId:u,setInsertDocument:x,setMatchDocuments:C,toggleMergeCharge:S,mergeSelectedCharges:new Set(r.map(s=>s.id)),data:a?.chargesWithLedgerChanges.filter(s=>!!s.charge).map(s=>s.charge)??[],isAllOpened:g}),e.jsxs("div",{className:"flex flex-row justify-center my-2",children:[i>0&&i<100&&e.jsx(b,{}),i===100&&!a?.chargesWithLedgerChanges.filter(s=>!!s.charge).length&&e.jsx(V,{radius:"xl",size:"xl",color:"green",children:e.jsx(z,{})})]})]}),n&&e.jsx(A,{chargeId:n?.id,close:()=>u(void 0),onChange:n.onChange}),l&&e.jsx(Q,{chargeId:l.id,onChange:l.onChange,close:()=>x(void 0)}),c&&e.jsx(U,{chargeId:c.id,ownerId:c.ownerId,setMatchDocuments:()=>C(void 0)})]})};export{Fe as ChargesLedgerValidation};
1
+ import{r as t,F as D,u as E,j as e,T as N,B as w,L as T,d as b,e as z,f as W}from"./index-qAF5sGRO.js";import{u as O}from"./use-url-query-CYeryni6.js";import{C as k}from"./charges-filters-nFUpOOgf.js";import{M as B,C as R,T as V}from"./charges-table-CTMLwet4.js";import{E as A,I as Q,M as U}from"./match-document-modal-CQ8I-zEU.js";import{P as q}from"./page-layout-7iCtDTzs.js";import{P as J}from"./Progress-CU1fWOjF.js";import{P as $,a as G}from"./panel-top-open-CVvVnpDH.js";import"./modal-D_KAAYCr.js";import"./funnel-Cn1E8rCW.js";import"./sub-DgacWlyb.js";import"./addDays-oqtNz11p.js";import"./subMonths-oKYDpkY2.js";import"./MultiSelect-DRJD_QDr.js";import"./toggle-expansion-button-DYABrNZG.js";import"./index-DrY2LoBX.js";import"./similar-transactions-modal-Dn4dMAAO.js";import"./list-plus-DEqGGtBU.js";import"./tooltip-Br1wJ5zm.js";import"./Table-C5b9rbOB.js";import"./summary-ZTGFg2Jz.js";import"./deposits-transactions-table-jhVmfuNs.js";import"./Checkbox-CoEj3QSE.js";import"./accordion-Csw2mWiO.js";import"./data-table-column-header-BxsKrjBX.js";import"./eye-off-CfHy9jRk.js";import"./YearPickerInput-DD-O605S.js";import"./insert-business-trip-modal-_imZNOPq.js";import"./accounter-table-CLNNqdXm.js";const Fe=()=>{const{setFiltersContext:p}=t.useContext(D),[n,u]=t.useState(void 0),[l,x]=t.useState(void 0),[c,C]=t.useState(void 0),[g,f]=t.useState(!1),[r,m]=t.useState([]),{get:F}=O(),d=F("chargesFilters"),I=t.useMemo(()=>{if(d)try{return JSON.parse(decodeURIComponent(d))}catch{return}},[d]),[o,j]=t.useState(I),S=t.useCallback((s,y)=>{r.map(h=>h.id).includes(s)?m(r.filter(h=>h.id!==s)):m([...r,{id:s,onChange:y}])},[r]),[{data:a,fetching:M},v]=E({query:W,variables:{filters:o},pause:!0});function P(){m([])}const i=t.useMemo(()=>a?.chargesWithLedgerChanges?.length?a.chargesWithLedgerChanges[a.chargesWithLedgerChanges.length-1].progress:0,[a?.chargesWithLedgerChanges]),L=t.useCallback(s=>{j(s)},[j]);return t.useEffect(()=>{o&&v()},[o,v]),t.useEffect(()=>{p(e.jsxs("div",{className:"flex flex-row gap-x-5 items-center",children:[e.jsx(J,{value:i,label:`${i?.toFixed(2)}%`,size:"xl",animate:i<100,className:"min-w-52"}),e.jsx(k,{filter:o,setFilter:L,activePage:0,setPage:()=>{},initiallyOpened:!0}),e.jsx(N,{label:"Expand all accounts",children:e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>f(s=>!s),children:g?e.jsx($,{className:"size-5"}):e.jsx(G,{className:"size-5"})})}),e.jsx(B,{selected:r,resetMerge:P})]}))},[a,M,o,g,p,f,r,i,L]),e.jsxs(q,{title:"Charges Ledger Validation",description:"Manage charges",children:[M?e.jsx(T,{className:"h-10 w-10 animate-spin mr-2 self-center"}):e.jsxs(e.Fragment,{children:[e.jsx(R,{setEditChargeId:u,setInsertDocument:x,setMatchDocuments:C,toggleMergeCharge:S,mergeSelectedCharges:new Set(r.map(s=>s.id)),data:a?.chargesWithLedgerChanges.filter(s=>!!s.charge).map(s=>s.charge)??[],isAllOpened:g}),e.jsxs("div",{className:"flex flex-row justify-center my-2",children:[i>0&&i<100&&e.jsx(b,{}),i===100&&!a?.chargesWithLedgerChanges.filter(s=>!!s.charge).length&&e.jsx(V,{radius:"xl",size:"xl",color:"green",children:e.jsx(z,{})})]})]}),n&&e.jsx(A,{chargeId:n?.id,close:()=>u(void 0),onChange:n.onChange}),l&&e.jsx(Q,{chargeId:l.id,onChange:l.onChange,close:()=>x(void 0)}),c&&e.jsx(U,{chargeId:c.id,ownerId:c.ownerId,setMatchDocuments:()=>C(void 0)})]})};export{Fe as ChargesLedgerValidation};
@@ -1,4 +1,4 @@
1
- import{v as _e,j as n,ew as La,af as Ba,ex as Va,b8 as Ua,bt as Ge,cf as $,ce as Ie,ey as Ka,r as p,bu as qe,aF as k,bv as We,ez as us,eA as Ha,eB as Ga,eC as qa,eD as Wa,eE as cn,bq as Be,eF as fs,eG as Ya,d as Dt,cn as ps,G as B,eH as Qa,g as Ee,eI as Ja,t as F,i as Oe,eJ as Xa,bT as en,T as Ke,B as q,m as gs,eK as Za,eL as eo,y as An,V as to,eM as no,eN as ro,eO as at,eP as ot,eQ as Zn,eR as er,dL as so,eS as ms,eT as ao,l as xt,eU as oo,eV as io,aO as tr,eW as co,u as Pe,eX as lo,c as hs,D as St,aU as xs,bQ as uo,bR as fo,bS as po,x as wt,al as Pn,am as Nn,ah as ys,eY as go,eZ as mo,bU as Tn,c1 as kn,c2 as $n,J as vs,bK as tn,bL as nn,bM as Te,bN as Ae,b_ as rt,bO as rn,bP as xe,p as jn,w as He,e_ as ho,E as xo,e$ as yo,e7 as vo,f0 as jo,bx as Le,f1 as bo,ai as yt,R as st,f2 as js,f3 as bs,f4 as Ue,f5 as Co,f6 as Cs,f7 as Do,f8 as So,f9 as Ds,fa as zt,fb as Ss,fc as wo,fd as Io,ay as sn,fe as _o,a3 as ws,ff as Is,n as mt,bz as Fe,bA as _s,bB as Es,cm as Os,bC as Lt,fg as Eo,fh as Oo,cs as Fn,e as Ao,fi as Po,a9 as No,fj as To,L as Mn,fk as ko,e4 as $o,dp as Fo,fl as bn,fm as As,fn as Ps,fo as Mo,fp as ln,fq as nr,fr as Ns,dq as Ro,fs as zo,dE as we,bX as Ce,ag as Ts,ft as rr,ek as Lo,c0 as Bo,P as Vo,e8 as ks,fu as $s,fv as Fs,fw as Uo,fx as Ko,fy as Ho,fz as Go,ao as sr,ap as ar,aq as or,ar as ir,as as cr,a2 as qo,au as Wo,fA as Yo,fB as Ms,b$ as Qo,bV as Jo,bW as Xo,bY as Zo,bZ as ei,fC as ti,fD as ni,dk as nt,fE as Rs,fF as ri,fG as zs,W as si,O as ai,fH as Ls,fI as oi,fJ as Bs,fK as Vs,fL as Ne,fM as De,fN as lr,fO as Us,fP as ii,fQ as Je,fR as ci,fS as li,fT as di}from"./index-CHtpNrAW.js";import{T as Ks}from"./toggle-expansion-button-ByfnT_sn.js";import{M as ui,P as Y,I as fi,T as Hs,a as pi,D as gi,A as mi,b as hi,c as xi,S as yi,C as vi,d as ji}from"./index-YQXRLoVL.js";import{T as Gs}from"./Table-bhKB4PFK.js";import{R as bi,S as Ci,M as ie,B as Di,L as dr,A as z,G as dn,C as ur,a as Si}from"./summary-DLRjO19t.js";import{L as un}from"./list-plus-DsfXaxO5.js";import{u as wi,D as Ii}from"./deposits-transactions-table-BAObjoYX.js";import{C as _i,M as Ei}from"./Checkbox-BHVKlxRj.js";import{A as Oi,a as fr,c as pr,b as Ot}from"./accordion-CAxRDsFz.js";import{D as ze}from"./data-table-column-header-CT7O7uRT.js";const Ai=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],Pi=_e("arrow-down-wide-narrow",Ai);const Ni=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],Ti=_e("arrow-right-left",Ni);const ki=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],qs=_e("coins",ki);const $i=[["path",{d:"M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"1l7d7l"}],["path",{d:"M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"9955pe"}],["path",{d:"m7 15 3 3",key:"4hkfgk"}],["path",{d:"m7 21 3-3H5a2 2 0 0 1-2-2v-2",key:"1xljwe"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",key:"1cdgtw"}],["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",key:"zi3rio"}]],Fi=_e("combine",$i);const Mi=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],gr=_e("file-plus-corner",Mi);const Ri=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],zi=_e("gift",Ri);const Li=[["path",{d:"M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z",key:"1piglc"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M2 8v1a2 2 0 0 0 2 2h1",key:"1env43"}]],Bi=_e("piggy-bank",Li);const Vi=[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]],Ui=_e("plane",Vi);const Ki=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Hi=_e("refresh-ccw-dot",Ki);const Gi=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],At=_e("square-check-big",Gi);const qi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pt=_e("square-x",qi);const Wi=[["path",{d:"M14.828 14.828 21 21",key:"ar5fw7"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"m21 3-9 9-4-4-6 6",key:"1h02xo"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}]],Yi=_e("trending-up-down",Wi);const Qi=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Ji=_e("wallet",Qi),Xi={CommonCharge:"Common",BusinessTripCharge:"Business Trip",DividendCharge:"Dividend",ConversionCharge:"Conversion",SalaryCharge:"Salary",InternalTransferCharge:"Internal Transfer",MonthlyVatCharge:"Monthly VAT",BankDepositCharge:"Bank Deposit",ForeignSecuritiesCharge:"Foreign Securities",CreditcardBankCharge:"Credit Card Bank Charge",FinancialCharge:"Financial Charge"},Rn=e=>Xi[e]??"Unknown",Zi={CommonCharge:n.jsx(qs,{}),BusinessTripCharge:n.jsx(Ui,{}),DividendCharge:n.jsx(zi,{}),ConversionCharge:n.jsx(Ua,{}),SalaryCharge:n.jsx(Ji,{}),InternalTransferCharge:n.jsx(Ti,{}),MonthlyVatCharge:n.jsx(Va,{}),BankDepositCharge:n.jsx(Bi,{}),ForeignSecuritiesCharge:n.jsx(Yi,{}),CreditcardBankCharge:n.jsx(Ba,{}),FinancialCharge:n.jsx(La,{})},Ws=e=>Zi[e]??n.jsx(qs,{});function mr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var ec=Object.defineProperty,tc=Object.defineProperties,nc=Object.getOwnPropertyDescriptors,hr=Object.getOwnPropertySymbols,rc=Object.prototype.hasOwnProperty,sc=Object.prototype.propertyIsEnumerable,xr=(e,t,r)=>t in e?ec(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fn=(e,t)=>{for(var r in t||(t={}))rc.call(t,r)&&xr(e,r,t[r]);if(hr)for(var r of hr(t))sc.call(t,r)&&xr(e,r,t[r]);return e},ac=(e,t)=>tc(e,nc(t));const oc=["light","filled","outline","dot","gradient"],pn={xs:{fontSize:$(9),height:$(16)},sm:{fontSize:$(10),height:$(18)},md:{fontSize:$(11),height:$(20)},lg:{fontSize:$(13),height:$(26)},xl:{fontSize:$(16),height:$(32)}},ic={xs:$(4),sm:$(4),md:$(6),lg:$(8),xl:$(10)};function cc({theme:e,variant:t,color:r,size:s,gradient:a}){if(!oc.includes(t))return null;if(t==="dot"){const i=Ie({size:s,sizes:ic});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${$(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${Ie({size:s,sizes:e.spacing})} / 1.5 - ${i} / 2)`,"&::before":{content:'""',display:"block",width:i,height:i,borderRadius:i,backgroundColor:e.fn.themeColor(r,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:i}}}const o=e.fn.variant({color:r,variant:t,gradient:a});return{background:o.background,color:o.color,border:`${$(t==="gradient"?0:1)} solid ${o.border}`}}var lc=Ge((e,{color:t,radius:r,gradient:s,fullWidth:a},{variant:o,size:i})=>{const{fontSize:l,height:c}=i in pn?pn[i]:pn.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:fn(ac(fn(fn({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${$(2)})`,textDecoration:"none",padding:`0 calc(${Ie({size:i,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:a?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:a?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(r),fontWeight:700,letterSpacing:$(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),cc({theme:e,variant:o,color:t,size:i,gradient:s}))}}),dc=Object.defineProperty,Bt=Object.getOwnPropertySymbols,Ys=Object.prototype.hasOwnProperty,Qs=Object.prototype.propertyIsEnumerable,yr=(e,t,r)=>t in e?dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uc=(e,t)=>{for(var r in t||(t={}))Ys.call(t,r)&&yr(e,r,t[r]);if(Bt)for(var r of Bt(t))Qs.call(t,r)&&yr(e,r,t[r]);return e},fc=(e,t)=>{var r={};for(var s in e)Ys.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Bt)for(var s of Bt(e))t.indexOf(s)<0&&Qs.call(e,s)&&(r[s]=e[s]);return r};const pc={variant:"light",size:"md",radius:"xl"},Js=p.forwardRef((e,t)=>{const r=qe("Badge",pc,e),{className:s,color:a,variant:o,fullWidth:i,children:l,size:c,leftSection:d,rightSection:y,radius:g,gradient:m,classNames:x,styles:f,unstyled:u}=r,j=fc(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:v,cx:b}=lc({fullWidth:i,color:a,radius:g,gradient:m},{classNames:x,styles:f,name:"Badge",unstyled:u,variant:o,size:c});return k.createElement(We,uc({className:b(v.root,s),ref:t},j),d&&k.createElement("span",{className:v.leftSection},d),k.createElement("span",{className:v.inner},l),y&&k.createElement("span",{className:v.rightSection},y))});Js.displayName="@mantine/core/Badge";const Cn=Ka(Js);var gc=Object.defineProperty,Vt=Object.getOwnPropertySymbols,Xs=Object.prototype.hasOwnProperty,Zs=Object.prototype.propertyIsEnumerable,vr=(e,t,r)=>t in e?gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jr=(e,t)=>{for(var r in t||(t={}))Xs.call(t,r)&&vr(e,r,t[r]);if(Vt)for(var r of Vt(t))Zs.call(t,r)&&vr(e,r,t[r]);return e},mc=(e,t)=>{var r={};for(var s in e)Xs.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Vt)for(var s of Vt(e))t.indexOf(s)<0&&Zs.call(e,s)&&(r[s]=e[s]);return r};const hc={multiple:!1},ea=p.forwardRef((e,t)=>{const r=qe("FileButton",hc,e),{onChange:s,children:a,multiple:o,accept:i,name:l,form:c,resetRef:d,disabled:y,capture:g,inputProps:m}=r,x=mc(r,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),f=p.useRef(),u=()=>{!y&&f.current.click()},j=b=>{s(o?Array.from(b.currentTarget.files):b.currentTarget.files[0]||null)};return us(d,()=>{f.current.value=""}),k.createElement(k.Fragment,null,a(jr({onClick:u},x)),k.createElement("input",jr({style:{display:"none"},type:"file",accept:i,multiple:o,onChange:j,ref:Ha(t,f),name:l,form:c,capture:g},m)))});ea.displayName="@mantine/core/FileButton";var xc=Ge(()=>({placeholder:{},input:{cursor:"pointer"}})),yc=Object.defineProperty,vc=Object.defineProperties,jc=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,ta=Object.prototype.hasOwnProperty,na=Object.prototype.propertyIsEnumerable,br=(e,t,r)=>t in e?yc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tt=(e,t)=>{for(var r in t||(t={}))ta.call(t,r)&&br(e,r,t[r]);if(Ut)for(var r of Ut(t))na.call(t,r)&&br(e,r,t[r]);return e},Nt=(e,t)=>vc(e,jc(t)),bc=(e,t)=>{var r={};for(var s in e)ta.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Ut)for(var s of Ut(e))t.indexOf(s)<0&&na.call(e,s)&&(r[s]=e[s]);return r};const Cc=({value:e})=>k.createElement(Be,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},Array.isArray(e)?e.map(t=>t.name).join(", "):e?.name),Dc={size:"sm",valueComponent:Cc},ra=p.forwardRef((e,t)=>{const r=Ga("FileInput",Dc,e),{inputProps:s,wrapperProps:a,placeholder:o,value:i,defaultValue:l,onChange:c,multiple:d,accept:y,name:g,form:m,classNames:x,styles:f,unstyled:u,valueComponent:j,rightSection:v,clearable:b,clearButtonProps:D,readOnly:E,capture:A,fileInputProps:w}=r,C=bc(r,["inputProps","wrapperProps","placeholder","value","defaultValue","onChange","multiple","accept","name","form","classNames","styles","unstyled","valueComponent","rightSection","clearable","clearButtonProps","readOnly","capture","fileInputProps"]),_=p.useRef(),{classes:O,cx:M}=xc(null,{name:"FileInput",classNames:x,styles:f,unstyled:u}),[h,T]=qa({value:i,defaultValue:l,onChange:c,finalValue:d?[]:null}),Q=Array.isArray(h)?h.length!==0:h!==null,R=v||(b&&Q&&!E?k.createElement(Wa,Nt(tt({},D),{variant:"transparent",onClick:()=>T(d?[]:null),size:s.size,unstyled:u})):null);return p.useEffect(()=>{(Array.isArray(h)&&h.length===0||h===null)&&_.current()},[h]),k.createElement(cn.Wrapper,Nt(tt({},a),{__staticSelector:"FileInput"}),k.createElement(ea,{onChange:T,multiple:d,accept:y,name:g,form:m,resetRef:_,disabled:E,capture:A,inputProps:w},V=>k.createElement(cn,Nt(tt(tt(tt({multiline:!0},V),s),C),{component:"button",type:"button",ref:t,__staticSelector:"FileInput",rightSection:R,classNames:Nt(tt({},x),{input:M(O.input,x?.input)})}),Q?k.createElement(j,{value:h}):k.createElement(cn.Placeholder,{className:O.placeholder},o))))});ra.displayName="@mantine/core/FileInput";const Sc=ra;var wc=Object.defineProperty,Ic=Object.defineProperties,_c=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,Ec=Object.prototype.hasOwnProperty,Oc=Object.prototype.propertyIsEnumerable,Dr=(e,t,r)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ac=(e,t)=>{for(var r in t||(t={}))Ec.call(t,r)&&Dr(e,r,t[r]);if(Cr)for(var r of Cr(t))Oc.call(t,r)&&Dr(e,r,t[r]);return e},Pc=(e,t)=>Ic(e,_c(t)),Nc=Ge(e=>({root:Pc(Ac({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})})),Tc=Object.defineProperty,kc=Object.defineProperties,$c=Object.getOwnPropertyDescriptors,Kt=Object.getOwnPropertySymbols,sa=Object.prototype.hasOwnProperty,aa=Object.prototype.propertyIsEnumerable,Sr=(e,t,r)=>t in e?Tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tt=(e,t)=>{for(var r in t||(t={}))sa.call(t,r)&&Sr(e,r,t[r]);if(Kt)for(var r of Kt(t))aa.call(t,r)&&Sr(e,r,t[r]);return e},Fc=(e,t)=>kc(e,$c(t)),Mc=(e,t)=>{var r={};for(var s in e)sa.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Kt)for(var s of Kt(e))t.indexOf(s)<0&&aa.call(e,s)&&(r[s]=e[s]);return r};const Rc={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:fs("overlay")},oa=p.forwardRef((e,t)=>{const r=qe("LoadingOverlay",Rc,e),{className:s,visible:a,loaderProps:o,overlayOpacity:i,overlayColor:l,transitionDuration:c,exitTransitionDuration:d,zIndex:y,style:g,loader:m,radius:x,overlayBlur:f,unstyled:u,variant:j,keepMounted:v}=r,b=Mc(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:D,cx:E,theme:A}=Nc(null,{name:"LoadingOverlay",unstyled:u,variant:j}),w=`calc(${y} + 1)`;return k.createElement(Ya,{keepMounted:v,duration:c,exitDuration:d,mounted:a,transition:"fade"},C=>k.createElement(We,Tt({className:E(D.root,s),style:Fc(Tt(Tt({},C),g),{zIndex:y}),ref:t},b),m?k.createElement("div",{style:{zIndex:w}},m):k.createElement(Dt,Tt({style:{zIndex:w}},o)),k.createElement(ps,{opacity:i,zIndex:y,radius:x,blur:f,unstyled:u,color:l||(A.colorScheme==="dark"?A.colors.dark[5]:A.white)})))});oa.displayName="@mantine/core/LoadingOverlay";var zc=Object.defineProperty,Lc=Object.defineProperties,Bc=Object.getOwnPropertyDescriptors,wr=Object.getOwnPropertySymbols,Vc=Object.prototype.hasOwnProperty,Uc=Object.prototype.propertyIsEnumerable,Ir=(e,t,r)=>t in e?zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_r=(e,t)=>{for(var r in t||(t={}))Vc.call(t,r)&&Ir(e,r,t[r]);if(wr)for(var r of wr(t))Uc.call(t,r)&&Ir(e,r,t[r]);return e},Kc=(e,t)=>Lc(e,Bc(t));const Hc={xs:$(16),sm:$(20),md:$(26),lg:$(32),xl:$(40)},Gc=["filled","light","gradient","outline","default"];function qc({theme:e,variant:t,color:r,gradient:s}){if(!Gc.includes(t))return null;const a=e.fn.variant({variant:t,color:r||e.primaryColor,gradient:s,primaryFallback:!1});return{backgroundColor:a.background,color:a.color,backgroundImage:t==="gradient"?a.background:void 0,border:`${$(t==="gradient"?0:1)} solid ${a.border}`}}var Wc=Ge((e,{color:t,radius:r,gradient:s},{variant:a,size:o})=>{const i=Ie({size:o,sizes:Hc});return{root:_r(Kc(_r({},e.fn.fontStyles()),{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:i,height:i,minWidth:i,minHeight:i,borderRadius:e.fn.radius(r)}),qc({theme:e,variant:a,gradient:s,color:t}))}}),Yc=Object.defineProperty,Ht=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable,Er=(e,t,r)=>t in e?Yc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qc=(e,t)=>{for(var r in t||(t={}))ia.call(t,r)&&Er(e,r,t[r]);if(Ht)for(var r of Ht(t))ca.call(t,r)&&Er(e,r,t[r]);return e},Jc=(e,t)=>{var r={};for(var s in e)ia.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Ht)for(var s of Ht(e))t.indexOf(s)<0&&ca.call(e,s)&&(r[s]=e[s]);return r};const Xc={size:"md",variant:"filled"},zn=p.forwardRef((e,t)=>{const r=qe("ThemeIcon",Xc,e),{className:s,size:a,radius:o,variant:i,color:l,children:c,gradient:d,unstyled:y}=r,g=Jc(r,["className","size","radius","variant","color","children","gradient","unstyled"]),{classes:m,cx:x}=Wc({variant:i,radius:o,color:l,gradient:d},{name:"ThemeIcon",unstyled:y,variant:i,size:a});return k.createElement(We,Qc({className:x(m.root,s),ref:t},g),c)});zn.displayName="@mantine/core/ThemeIcon";const Zc=({data:e})=>{const t=B(Qa,e);return n.jsxs(n.Fragment,{children:[n.jsx(bi,{data:t,onChange:()=>{}}),n.jsx(Ci,{data:t})]})},el="deleteCharge",tl=()=>{const[{fetching:e},t]=Ee(Ja),r=p.useCallback(async s=>{const a=`Error deleting charge ID [${s.chargeId}]`,o=`${el}-${s.chargeId}`;F.loading("Deleting charge",{id:o});try{const i=await t(s),l=Oe(i,a,o);if(l){if(l.deleteCharge===!1)throw new Error("Unsuccessful deletion");return F.success("Success",{id:o,description:"Charge was deleted"}),l.deleteCharge}}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,deleteCharge:r}},nl="regenerateLedgerRecords",rl=()=>{const[{fetching:e},t]=Ee(Xa),r=p.useCallback(async s=>{const a="Error regenerating ledger",o=`${nl}-${s.chargeId}`;F.loading("Regenerating Ledger",{id:o});try{const i=await t(s),l=Oe(i,a,o,"regenerateLedgerRecords");if(l)return F.success("Success",{id:o,description:"Ledger records were regenerated"}),l.regenerateLedgerRecords}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,regenerateLedgerRecords:r}};function sl({chargeId:e,onChange:t,...r}){const{regenerateLedgerRecords:s}=rl();function a(){s({chargeId:e}).then(t)}return n.jsx(en,{onConfirm:a,title:"Are you sure you want to regenerate ledger records?",children:n.jsx(Ke,{label:"Regenerate Ledger",children:n.jsx(q,{variant:"outline",size:"icon",...r,className:gs("size-7.5",r.className),children:n.jsx(Hi,{className:"size-5"})})})})}function al(e){const{mergeSelected:t,toggleMergeSelected:r}=e,[s,a]=p.useState(t?"default":"ghost");return p.useEffect(()=>{a(t?"default":"ghost")},[t]),n.jsx(Ke,{label:"Select for merge",children:n.jsx(q,{onClick:o=>{o.stopPropagation(),r()},variant:s,className:gs("size-7.5",t?"bg-blue-500 hover:bg-blue-500/90":""),children:n.jsx(Fi,{className:"size-5"})})})}const ol="updateCharge",la=()=>{const[{fetching:e},t]=Ee(Za),r=p.useCallback(async s=>{const a=`Error updating charge ID [${s.chargeId}]`,o=`${ol}-${s.chargeId}`;F.loading("Updating charge",{id:o});try{const i=await t(s),l=Oe(i,a,o,"updateCharge");if(l)return F.success("Success",{id:o,description:"Charge updated"}),l.updateCharge.charge}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateCharge:r}},il="updateMiscExpense",cl=()=>{const[{fetching:e},t]=Ee(eo),r=p.useCallback(async s=>{const a=`Error updating misc expense ID [${s.id}]`,o=`${il}-${s.id}`;F.loading("Update Misc Expense",{id:o});try{const i=await t(s),l=Oe(i,a,o,"updateMiscExpense");if(l)return F.success("Success",{id:o,description:"Misc expense was updated"}),l.updateMiscExpense}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateMiscExpense:r}},ll=({onDone:e,data:t})=>{const[r,s]=p.useState(!1),a=B(no,t),o=An({defaultValues:{amount:a.amount.raw,currency:a.amount.currency,description:a.description,valueDate:new Date(a.valueDate),invoiceDate:a.invoiceDate,creditorId:a.creditor.id,debtorId:a.debtor.id}}),{handleSubmit:i,formState:{dirtyFields:l}}=o,{updateMiscExpense:c,fetching:d}=cl(),y=p.useCallback(async m=>{s(!0),await c({id:a.id,fields:m}),e(),s(!1)},[c,e,a.id]),g=m=>{m&&Object.keys(m).length>0&&y({...m})};return r?n.jsx(Dt,{className:"flex self-center my-5",color:"dark",size:"xl",variant:"dots"}):n.jsx(to,{...o,children:n.jsx("form",{onSubmit:i(g),noValidate:!0,children:n.jsxs("div",{className:"px-5 flex flex-col gap-5",children:[n.jsx(ui,{formManager:o,isInsert:!1}),n.jsx("div",{className:"flex justify-right gap-5 mt-5",children:n.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:d||Object.keys(l).length===0,children:"Accept"})})]})})})},dl="insertSalaryRecordsFromFile",ul=()=>{const[{fetching:e},t]=Ee(ro),r=p.useCallback(async s=>{const a=`Error uploading payroll file to charge ID [${s.chargeId}]`,o=`${dl}-${s.chargeId}`;F.loading("Uploading payroll file",{id:o});try{const i=await t(s),l=Oe(i,a,o,"insertSalaryRecordsFromFile");if(l)return F.success("Success",{id:o,description:"Payroll file added"}),l.insertSalaryRecordsFromFile}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,uploadPayrollFile:r}},fl=({chargeId:e,onDone:t})=>{const{fetching:r,uploadPayrollFile:s}=ul(),[a,o]=p.useState(null),i=p.useCallback(async()=>{a&&s({file:a,chargeId:e}).then(t)},[s,t,a,e]);return n.jsxs("div",{className:"px-5 w-max h-max justify-items-center",children:[n.jsx(Sc,{icon:r&&n.jsx(Dt,{}),value:a,onChange:o,clearable:!0,label:"File Upload"}),n.jsx("div",{className:"flex justify-center gap-5 mt-5",children:n.jsx("button",{type:"submit",className:" text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:r||!a,onClick:i,children:"Accept"})})]})};var pl=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function It(e,t){var r=gl(e);if(typeof r.path!="string"){var s=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof s=="string"&&s.length>0?s:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function gl(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var s=t.split(".").pop().toLowerCase(),a=pl.get(s);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}var ml=[".DS_Store","Thumbs.db"];function hl(e){return at(this,void 0,void 0,function(){return ot(this,function(t){return Gt(e)&&xl(e.dataTransfer)?[2,bl(e.dataTransfer,e.type)]:yl(e)?[2,vl(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,jl(e)]:[2,[]]})})}function xl(e){return Gt(e)}function yl(e){return Gt(e)&&Gt(e.target)}function Gt(e){return typeof e=="object"&&e!==null}function vl(e){return Dn(e.target.files).map(function(t){return It(t)})}function jl(e){return at(this,void 0,void 0,function(){var t;return ot(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(s){return s.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(s){return It(s)})]}})})}function bl(e,t){return at(this,void 0,void 0,function(){var r,s;return ot(this,function(a){switch(a.label){case 0:return e.items?(r=Dn(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(Cl))]):[3,2];case 1:return s=a.sent(),[2,Or(da(s))];case 2:return[2,Or(Dn(e.files).map(function(o){return It(o)}))]}})})}function Or(e){return e.filter(function(t){return ml.indexOf(t.name)===-1})}function Dn(e){if(e===null)return[];for(var t=[],r=0;r<e.length;r++){var s=e[r];t.push(s)}return t}function Cl(e){if(typeof e.webkitGetAsEntry!="function")return Ar(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?ua(t):Ar(e)}function da(e){return e.reduce(function(t,r){return Zn(Zn([],er(t),!1),er(Array.isArray(r)?da(r):[r]),!1)},[])}function Ar(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var r=It(t);return Promise.resolve(r)}function Dl(e){return at(this,void 0,void 0,function(){return ot(this,function(t){return[2,e.isDirectory?ua(e):Sl(e)]})})}function ua(e){var t=e.createReader();return new Promise(function(r,s){var a=[];function o(){var i=this;t.readEntries(function(l){return at(i,void 0,void 0,function(){var c,d,y;return ot(this,function(g){switch(g.label){case 0:if(l.length)return[3,5];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,Promise.all(a)];case 2:return c=g.sent(),r(c),[3,4];case 3:return d=g.sent(),s(d),[3,4];case 4:return[3,6];case 5:y=Promise.all(l.map(Dl)),a.push(y),o(),g.label=6;case 6:return[2]}})})},function(l){s(l)})}o()})}function Sl(e){return at(this,void 0,void 0,function(){return ot(this,function(t){return[2,new Promise(function(r,s){e.file(function(a){var o=It(a,e.fullPath);r(o)},function(a){s(a)})})]})})}var kt={},Pr;function wl(){return Pr||(Pr=1,kt.__esModule=!0,kt.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(",");if(r.length===0)return!0;var s=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return r.some(function(i){var l=i.trim().toLowerCase();return l.charAt(0)==="."?s.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):a===l})}return!0}),kt}var Il=wl();const _l=so(Il);function Nr(e){return Al(e)||Ol(e)||pa(e)||El()}function El(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{v as _e,j as n,ew as La,af as Ba,ex as Va,b8 as Ua,bt as Ge,cf as $,ce as Ie,ey as Ka,r as p,bu as qe,aF as k,bv as We,ez as us,eA as Ha,eB as Ga,eC as qa,eD as Wa,eE as cn,bq as Be,eF as fs,eG as Ya,d as Dt,cn as ps,G as B,eH as Qa,g as Ee,eI as Ja,t as F,i as Oe,eJ as Xa,bT as en,T as Ke,B as q,m as gs,eK as Za,eL as eo,y as An,V as to,eM as no,eN as ro,eO as at,eP as ot,eQ as Zn,eR as er,dL as so,eS as ms,eT as ao,l as xt,eU as oo,eV as io,aO as tr,eW as co,u as Pe,eX as lo,c as hs,D as St,aU as xs,bQ as uo,bR as fo,bS as po,x as wt,al as Pn,am as Nn,ah as ys,eY as go,eZ as mo,bU as Tn,c1 as kn,c2 as $n,J as vs,bK as tn,bL as nn,bM as Te,bN as Ae,b_ as rt,bO as rn,bP as xe,p as jn,w as He,e_ as ho,E as xo,e$ as yo,e7 as vo,f0 as jo,bx as Le,f1 as bo,ai as yt,R as st,f2 as js,f3 as bs,f4 as Ue,f5 as Co,f6 as Cs,f7 as Do,f8 as So,f9 as Ds,fa as zt,fb as Ss,fc as wo,fd as Io,ay as sn,fe as _o,a3 as ws,ff as Is,n as mt,bz as Fe,bA as _s,bB as Es,cm as Os,bC as Lt,fg as Eo,fh as Oo,cs as Fn,e as Ao,fi as Po,a9 as No,fj as To,L as Mn,fk as ko,e4 as $o,dp as Fo,fl as bn,fm as As,fn as Ps,fo as Mo,fp as ln,fq as nr,fr as Ns,dq as Ro,fs as zo,dE as we,bX as Ce,ag as Ts,ft as rr,ek as Lo,c0 as Bo,P as Vo,e8 as ks,fu as $s,fv as Fs,fw as Uo,fx as Ko,fy as Ho,fz as Go,ao as sr,ap as ar,aq as or,ar as ir,as as cr,a2 as qo,au as Wo,fA as Yo,fB as Ms,b$ as Qo,bV as Jo,bW as Xo,bY as Zo,bZ as ei,fC as ti,fD as ni,dk as nt,fE as Rs,fF as ri,fG as zs,W as si,O as ai,fH as Ls,fI as oi,fJ as Bs,fK as Vs,fL as Ne,fM as De,fN as lr,fO as Us,fP as ii,fQ as Je,fR as ci,fS as li,fT as di}from"./index-qAF5sGRO.js";import{T as Ks}from"./toggle-expansion-button-DYABrNZG.js";import{M as ui,P as Y,I as fi,T as Hs,a as pi,D as gi,A as mi,b as hi,c as xi,S as yi,C as vi,d as ji}from"./index-DrY2LoBX.js";import{T as Gs}from"./Table-C5b9rbOB.js";import{R as bi,S as Ci,M as ie,B as Di,L as dr,A as z,G as dn,C as ur,a as Si}from"./summary-ZTGFg2Jz.js";import{L as un}from"./list-plus-DEqGGtBU.js";import{u as wi,D as Ii}from"./deposits-transactions-table-jhVmfuNs.js";import{C as _i,M as Ei}from"./Checkbox-CoEj3QSE.js";import{A as Oi,a as fr,c as pr,b as Ot}from"./accordion-Csw2mWiO.js";import{D as ze}from"./data-table-column-header-BxsKrjBX.js";const Ai=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],Pi=_e("arrow-down-wide-narrow",Ai);const Ni=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],Ti=_e("arrow-right-left",Ni);const ki=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],qs=_e("coins",ki);const $i=[["path",{d:"M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"1l7d7l"}],["path",{d:"M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"9955pe"}],["path",{d:"m7 15 3 3",key:"4hkfgk"}],["path",{d:"m7 21 3-3H5a2 2 0 0 1-2-2v-2",key:"1xljwe"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",key:"1cdgtw"}],["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",key:"zi3rio"}]],Fi=_e("combine",$i);const Mi=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],gr=_e("file-plus-corner",Mi);const Ri=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],zi=_e("gift",Ri);const Li=[["path",{d:"M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z",key:"1piglc"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M2 8v1a2 2 0 0 0 2 2h1",key:"1env43"}]],Bi=_e("piggy-bank",Li);const Vi=[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]],Ui=_e("plane",Vi);const Ki=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Hi=_e("refresh-ccw-dot",Ki);const Gi=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],At=_e("square-check-big",Gi);const qi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pt=_e("square-x",qi);const Wi=[["path",{d:"M14.828 14.828 21 21",key:"ar5fw7"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"m21 3-9 9-4-4-6 6",key:"1h02xo"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}]],Yi=_e("trending-up-down",Wi);const Qi=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Ji=_e("wallet",Qi),Xi={CommonCharge:"Common",BusinessTripCharge:"Business Trip",DividendCharge:"Dividend",ConversionCharge:"Conversion",SalaryCharge:"Salary",InternalTransferCharge:"Internal Transfer",MonthlyVatCharge:"Monthly VAT",BankDepositCharge:"Bank Deposit",ForeignSecuritiesCharge:"Foreign Securities",CreditcardBankCharge:"Credit Card Bank Charge",FinancialCharge:"Financial Charge"},Rn=e=>Xi[e]??"Unknown",Zi={CommonCharge:n.jsx(qs,{}),BusinessTripCharge:n.jsx(Ui,{}),DividendCharge:n.jsx(zi,{}),ConversionCharge:n.jsx(Ua,{}),SalaryCharge:n.jsx(Ji,{}),InternalTransferCharge:n.jsx(Ti,{}),MonthlyVatCharge:n.jsx(Va,{}),BankDepositCharge:n.jsx(Bi,{}),ForeignSecuritiesCharge:n.jsx(Yi,{}),CreditcardBankCharge:n.jsx(Ba,{}),FinancialCharge:n.jsx(La,{})},Ws=e=>Zi[e]??n.jsx(qs,{});function mr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var ec=Object.defineProperty,tc=Object.defineProperties,nc=Object.getOwnPropertyDescriptors,hr=Object.getOwnPropertySymbols,rc=Object.prototype.hasOwnProperty,sc=Object.prototype.propertyIsEnumerable,xr=(e,t,r)=>t in e?ec(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fn=(e,t)=>{for(var r in t||(t={}))rc.call(t,r)&&xr(e,r,t[r]);if(hr)for(var r of hr(t))sc.call(t,r)&&xr(e,r,t[r]);return e},ac=(e,t)=>tc(e,nc(t));const oc=["light","filled","outline","dot","gradient"],pn={xs:{fontSize:$(9),height:$(16)},sm:{fontSize:$(10),height:$(18)},md:{fontSize:$(11),height:$(20)},lg:{fontSize:$(13),height:$(26)},xl:{fontSize:$(16),height:$(32)}},ic={xs:$(4),sm:$(4),md:$(6),lg:$(8),xl:$(10)};function cc({theme:e,variant:t,color:r,size:s,gradient:a}){if(!oc.includes(t))return null;if(t==="dot"){const i=Ie({size:s,sizes:ic});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${$(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${Ie({size:s,sizes:e.spacing})} / 1.5 - ${i} / 2)`,"&::before":{content:'""',display:"block",width:i,height:i,borderRadius:i,backgroundColor:e.fn.themeColor(r,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:i}}}const o=e.fn.variant({color:r,variant:t,gradient:a});return{background:o.background,color:o.color,border:`${$(t==="gradient"?0:1)} solid ${o.border}`}}var lc=Ge((e,{color:t,radius:r,gradient:s,fullWidth:a},{variant:o,size:i})=>{const{fontSize:l,height:c}=i in pn?pn[i]:pn.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:fn(ac(fn(fn({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${$(2)})`,textDecoration:"none",padding:`0 calc(${Ie({size:i,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:a?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:a?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(r),fontWeight:700,letterSpacing:$(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),cc({theme:e,variant:o,color:t,size:i,gradient:s}))}}),dc=Object.defineProperty,Bt=Object.getOwnPropertySymbols,Ys=Object.prototype.hasOwnProperty,Qs=Object.prototype.propertyIsEnumerable,yr=(e,t,r)=>t in e?dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uc=(e,t)=>{for(var r in t||(t={}))Ys.call(t,r)&&yr(e,r,t[r]);if(Bt)for(var r of Bt(t))Qs.call(t,r)&&yr(e,r,t[r]);return e},fc=(e,t)=>{var r={};for(var s in e)Ys.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Bt)for(var s of Bt(e))t.indexOf(s)<0&&Qs.call(e,s)&&(r[s]=e[s]);return r};const pc={variant:"light",size:"md",radius:"xl"},Js=p.forwardRef((e,t)=>{const r=qe("Badge",pc,e),{className:s,color:a,variant:o,fullWidth:i,children:l,size:c,leftSection:d,rightSection:y,radius:g,gradient:m,classNames:x,styles:f,unstyled:u}=r,j=fc(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:v,cx:b}=lc({fullWidth:i,color:a,radius:g,gradient:m},{classNames:x,styles:f,name:"Badge",unstyled:u,variant:o,size:c});return k.createElement(We,uc({className:b(v.root,s),ref:t},j),d&&k.createElement("span",{className:v.leftSection},d),k.createElement("span",{className:v.inner},l),y&&k.createElement("span",{className:v.rightSection},y))});Js.displayName="@mantine/core/Badge";const Cn=Ka(Js);var gc=Object.defineProperty,Vt=Object.getOwnPropertySymbols,Xs=Object.prototype.hasOwnProperty,Zs=Object.prototype.propertyIsEnumerable,vr=(e,t,r)=>t in e?gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jr=(e,t)=>{for(var r in t||(t={}))Xs.call(t,r)&&vr(e,r,t[r]);if(Vt)for(var r of Vt(t))Zs.call(t,r)&&vr(e,r,t[r]);return e},mc=(e,t)=>{var r={};for(var s in e)Xs.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Vt)for(var s of Vt(e))t.indexOf(s)<0&&Zs.call(e,s)&&(r[s]=e[s]);return r};const hc={multiple:!1},ea=p.forwardRef((e,t)=>{const r=qe("FileButton",hc,e),{onChange:s,children:a,multiple:o,accept:i,name:l,form:c,resetRef:d,disabled:y,capture:g,inputProps:m}=r,x=mc(r,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),f=p.useRef(),u=()=>{!y&&f.current.click()},j=b=>{s(o?Array.from(b.currentTarget.files):b.currentTarget.files[0]||null)};return us(d,()=>{f.current.value=""}),k.createElement(k.Fragment,null,a(jr({onClick:u},x)),k.createElement("input",jr({style:{display:"none"},type:"file",accept:i,multiple:o,onChange:j,ref:Ha(t,f),name:l,form:c,capture:g},m)))});ea.displayName="@mantine/core/FileButton";var xc=Ge(()=>({placeholder:{},input:{cursor:"pointer"}})),yc=Object.defineProperty,vc=Object.defineProperties,jc=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,ta=Object.prototype.hasOwnProperty,na=Object.prototype.propertyIsEnumerable,br=(e,t,r)=>t in e?yc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tt=(e,t)=>{for(var r in t||(t={}))ta.call(t,r)&&br(e,r,t[r]);if(Ut)for(var r of Ut(t))na.call(t,r)&&br(e,r,t[r]);return e},Nt=(e,t)=>vc(e,jc(t)),bc=(e,t)=>{var r={};for(var s in e)ta.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Ut)for(var s of Ut(e))t.indexOf(s)<0&&na.call(e,s)&&(r[s]=e[s]);return r};const Cc=({value:e})=>k.createElement(Be,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},Array.isArray(e)?e.map(t=>t.name).join(", "):e?.name),Dc={size:"sm",valueComponent:Cc},ra=p.forwardRef((e,t)=>{const r=Ga("FileInput",Dc,e),{inputProps:s,wrapperProps:a,placeholder:o,value:i,defaultValue:l,onChange:c,multiple:d,accept:y,name:g,form:m,classNames:x,styles:f,unstyled:u,valueComponent:j,rightSection:v,clearable:b,clearButtonProps:D,readOnly:E,capture:A,fileInputProps:w}=r,C=bc(r,["inputProps","wrapperProps","placeholder","value","defaultValue","onChange","multiple","accept","name","form","classNames","styles","unstyled","valueComponent","rightSection","clearable","clearButtonProps","readOnly","capture","fileInputProps"]),_=p.useRef(),{classes:O,cx:M}=xc(null,{name:"FileInput",classNames:x,styles:f,unstyled:u}),[h,T]=qa({value:i,defaultValue:l,onChange:c,finalValue:d?[]:null}),Q=Array.isArray(h)?h.length!==0:h!==null,R=v||(b&&Q&&!E?k.createElement(Wa,Nt(tt({},D),{variant:"transparent",onClick:()=>T(d?[]:null),size:s.size,unstyled:u})):null);return p.useEffect(()=>{(Array.isArray(h)&&h.length===0||h===null)&&_.current()},[h]),k.createElement(cn.Wrapper,Nt(tt({},a),{__staticSelector:"FileInput"}),k.createElement(ea,{onChange:T,multiple:d,accept:y,name:g,form:m,resetRef:_,disabled:E,capture:A,inputProps:w},V=>k.createElement(cn,Nt(tt(tt(tt({multiline:!0},V),s),C),{component:"button",type:"button",ref:t,__staticSelector:"FileInput",rightSection:R,classNames:Nt(tt({},x),{input:M(O.input,x?.input)})}),Q?k.createElement(j,{value:h}):k.createElement(cn.Placeholder,{className:O.placeholder},o))))});ra.displayName="@mantine/core/FileInput";const Sc=ra;var wc=Object.defineProperty,Ic=Object.defineProperties,_c=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,Ec=Object.prototype.hasOwnProperty,Oc=Object.prototype.propertyIsEnumerable,Dr=(e,t,r)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ac=(e,t)=>{for(var r in t||(t={}))Ec.call(t,r)&&Dr(e,r,t[r]);if(Cr)for(var r of Cr(t))Oc.call(t,r)&&Dr(e,r,t[r]);return e},Pc=(e,t)=>Ic(e,_c(t)),Nc=Ge(e=>({root:Pc(Ac({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})})),Tc=Object.defineProperty,kc=Object.defineProperties,$c=Object.getOwnPropertyDescriptors,Kt=Object.getOwnPropertySymbols,sa=Object.prototype.hasOwnProperty,aa=Object.prototype.propertyIsEnumerable,Sr=(e,t,r)=>t in e?Tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tt=(e,t)=>{for(var r in t||(t={}))sa.call(t,r)&&Sr(e,r,t[r]);if(Kt)for(var r of Kt(t))aa.call(t,r)&&Sr(e,r,t[r]);return e},Fc=(e,t)=>kc(e,$c(t)),Mc=(e,t)=>{var r={};for(var s in e)sa.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Kt)for(var s of Kt(e))t.indexOf(s)<0&&aa.call(e,s)&&(r[s]=e[s]);return r};const Rc={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:fs("overlay")},oa=p.forwardRef((e,t)=>{const r=qe("LoadingOverlay",Rc,e),{className:s,visible:a,loaderProps:o,overlayOpacity:i,overlayColor:l,transitionDuration:c,exitTransitionDuration:d,zIndex:y,style:g,loader:m,radius:x,overlayBlur:f,unstyled:u,variant:j,keepMounted:v}=r,b=Mc(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:D,cx:E,theme:A}=Nc(null,{name:"LoadingOverlay",unstyled:u,variant:j}),w=`calc(${y} + 1)`;return k.createElement(Ya,{keepMounted:v,duration:c,exitDuration:d,mounted:a,transition:"fade"},C=>k.createElement(We,Tt({className:E(D.root,s),style:Fc(Tt(Tt({},C),g),{zIndex:y}),ref:t},b),m?k.createElement("div",{style:{zIndex:w}},m):k.createElement(Dt,Tt({style:{zIndex:w}},o)),k.createElement(ps,{opacity:i,zIndex:y,radius:x,blur:f,unstyled:u,color:l||(A.colorScheme==="dark"?A.colors.dark[5]:A.white)})))});oa.displayName="@mantine/core/LoadingOverlay";var zc=Object.defineProperty,Lc=Object.defineProperties,Bc=Object.getOwnPropertyDescriptors,wr=Object.getOwnPropertySymbols,Vc=Object.prototype.hasOwnProperty,Uc=Object.prototype.propertyIsEnumerable,Ir=(e,t,r)=>t in e?zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_r=(e,t)=>{for(var r in t||(t={}))Vc.call(t,r)&&Ir(e,r,t[r]);if(wr)for(var r of wr(t))Uc.call(t,r)&&Ir(e,r,t[r]);return e},Kc=(e,t)=>Lc(e,Bc(t));const Hc={xs:$(16),sm:$(20),md:$(26),lg:$(32),xl:$(40)},Gc=["filled","light","gradient","outline","default"];function qc({theme:e,variant:t,color:r,gradient:s}){if(!Gc.includes(t))return null;const a=e.fn.variant({variant:t,color:r||e.primaryColor,gradient:s,primaryFallback:!1});return{backgroundColor:a.background,color:a.color,backgroundImage:t==="gradient"?a.background:void 0,border:`${$(t==="gradient"?0:1)} solid ${a.border}`}}var Wc=Ge((e,{color:t,radius:r,gradient:s},{variant:a,size:o})=>{const i=Ie({size:o,sizes:Hc});return{root:_r(Kc(_r({},e.fn.fontStyles()),{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:i,height:i,minWidth:i,minHeight:i,borderRadius:e.fn.radius(r)}),qc({theme:e,variant:a,gradient:s,color:t}))}}),Yc=Object.defineProperty,Ht=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable,Er=(e,t,r)=>t in e?Yc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qc=(e,t)=>{for(var r in t||(t={}))ia.call(t,r)&&Er(e,r,t[r]);if(Ht)for(var r of Ht(t))ca.call(t,r)&&Er(e,r,t[r]);return e},Jc=(e,t)=>{var r={};for(var s in e)ia.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&Ht)for(var s of Ht(e))t.indexOf(s)<0&&ca.call(e,s)&&(r[s]=e[s]);return r};const Xc={size:"md",variant:"filled"},zn=p.forwardRef((e,t)=>{const r=qe("ThemeIcon",Xc,e),{className:s,size:a,radius:o,variant:i,color:l,children:c,gradient:d,unstyled:y}=r,g=Jc(r,["className","size","radius","variant","color","children","gradient","unstyled"]),{classes:m,cx:x}=Wc({variant:i,radius:o,color:l,gradient:d},{name:"ThemeIcon",unstyled:y,variant:i,size:a});return k.createElement(We,Qc({className:x(m.root,s),ref:t},g),c)});zn.displayName="@mantine/core/ThemeIcon";const Zc=({data:e})=>{const t=B(Qa,e);return n.jsxs(n.Fragment,{children:[n.jsx(bi,{data:t,onChange:()=>{}}),n.jsx(Ci,{data:t})]})},el="deleteCharge",tl=()=>{const[{fetching:e},t]=Ee(Ja),r=p.useCallback(async s=>{const a=`Error deleting charge ID [${s.chargeId}]`,o=`${el}-${s.chargeId}`;F.loading("Deleting charge",{id:o});try{const i=await t(s),l=Oe(i,a,o);if(l){if(l.deleteCharge===!1)throw new Error("Unsuccessful deletion");return F.success("Success",{id:o,description:"Charge was deleted"}),l.deleteCharge}}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,deleteCharge:r}},nl="regenerateLedgerRecords",rl=()=>{const[{fetching:e},t]=Ee(Xa),r=p.useCallback(async s=>{const a="Error regenerating ledger",o=`${nl}-${s.chargeId}`;F.loading("Regenerating Ledger",{id:o});try{const i=await t(s),l=Oe(i,a,o,"regenerateLedgerRecords");if(l)return F.success("Success",{id:o,description:"Ledger records were regenerated"}),l.regenerateLedgerRecords}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,regenerateLedgerRecords:r}};function sl({chargeId:e,onChange:t,...r}){const{regenerateLedgerRecords:s}=rl();function a(){s({chargeId:e}).then(t)}return n.jsx(en,{onConfirm:a,title:"Are you sure you want to regenerate ledger records?",children:n.jsx(Ke,{label:"Regenerate Ledger",children:n.jsx(q,{variant:"outline",size:"icon",...r,className:gs("size-7.5",r.className),children:n.jsx(Hi,{className:"size-5"})})})})}function al(e){const{mergeSelected:t,toggleMergeSelected:r}=e,[s,a]=p.useState(t?"default":"ghost");return p.useEffect(()=>{a(t?"default":"ghost")},[t]),n.jsx(Ke,{label:"Select for merge",children:n.jsx(q,{onClick:o=>{o.stopPropagation(),r()},variant:s,className:gs("size-7.5",t?"bg-blue-500 hover:bg-blue-500/90":""),children:n.jsx(Fi,{className:"size-5"})})})}const ol="updateCharge",la=()=>{const[{fetching:e},t]=Ee(Za),r=p.useCallback(async s=>{const a=`Error updating charge ID [${s.chargeId}]`,o=`${ol}-${s.chargeId}`;F.loading("Updating charge",{id:o});try{const i=await t(s),l=Oe(i,a,o,"updateCharge");if(l)return F.success("Success",{id:o,description:"Charge updated"}),l.updateCharge.charge}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateCharge:r}},il="updateMiscExpense",cl=()=>{const[{fetching:e},t]=Ee(eo),r=p.useCallback(async s=>{const a=`Error updating misc expense ID [${s.id}]`,o=`${il}-${s.id}`;F.loading("Update Misc Expense",{id:o});try{const i=await t(s),l=Oe(i,a,o,"updateMiscExpense");if(l)return F.success("Success",{id:o,description:"Misc expense was updated"}),l.updateMiscExpense}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateMiscExpense:r}},ll=({onDone:e,data:t})=>{const[r,s]=p.useState(!1),a=B(no,t),o=An({defaultValues:{amount:a.amount.raw,currency:a.amount.currency,description:a.description,valueDate:new Date(a.valueDate),invoiceDate:a.invoiceDate,creditorId:a.creditor.id,debtorId:a.debtor.id}}),{handleSubmit:i,formState:{dirtyFields:l}}=o,{updateMiscExpense:c,fetching:d}=cl(),y=p.useCallback(async m=>{s(!0),await c({id:a.id,fields:m}),e(),s(!1)},[c,e,a.id]),g=m=>{m&&Object.keys(m).length>0&&y({...m})};return r?n.jsx(Dt,{className:"flex self-center my-5",color:"dark",size:"xl",variant:"dots"}):n.jsx(to,{...o,children:n.jsx("form",{onSubmit:i(g),noValidate:!0,children:n.jsxs("div",{className:"px-5 flex flex-col gap-5",children:[n.jsx(ui,{formManager:o,isInsert:!1}),n.jsx("div",{className:"flex justify-right gap-5 mt-5",children:n.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:d||Object.keys(l).length===0,children:"Accept"})})]})})})},dl="insertSalaryRecordsFromFile",ul=()=>{const[{fetching:e},t]=Ee(ro),r=p.useCallback(async s=>{const a=`Error uploading payroll file to charge ID [${s.chargeId}]`,o=`${dl}-${s.chargeId}`;F.loading("Uploading payroll file",{id:o});try{const i=await t(s),l=Oe(i,a,o,"insertSalaryRecordsFromFile");if(l)return F.success("Success",{id:o,description:"Payroll file added"}),l.insertSalaryRecordsFromFile}catch(i){console.error(`${a}: ${i}`),F.error("Error",{id:o,description:a,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,uploadPayrollFile:r}},fl=({chargeId:e,onDone:t})=>{const{fetching:r,uploadPayrollFile:s}=ul(),[a,o]=p.useState(null),i=p.useCallback(async()=>{a&&s({file:a,chargeId:e}).then(t)},[s,t,a,e]);return n.jsxs("div",{className:"px-5 w-max h-max justify-items-center",children:[n.jsx(Sc,{icon:r&&n.jsx(Dt,{}),value:a,onChange:o,clearable:!0,label:"File Upload"}),n.jsx("div",{className:"flex justify-center gap-5 mt-5",children:n.jsx("button",{type:"submit",className:" text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:r||!a,onClick:i,children:"Accept"})})]})};var pl=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function It(e,t){var r=gl(e);if(typeof r.path!="string"){var s=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof s=="string"&&s.length>0?s:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function gl(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var s=t.split(".").pop().toLowerCase(),a=pl.get(s);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}var ml=[".DS_Store","Thumbs.db"];function hl(e){return at(this,void 0,void 0,function(){return ot(this,function(t){return Gt(e)&&xl(e.dataTransfer)?[2,bl(e.dataTransfer,e.type)]:yl(e)?[2,vl(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,jl(e)]:[2,[]]})})}function xl(e){return Gt(e)}function yl(e){return Gt(e)&&Gt(e.target)}function Gt(e){return typeof e=="object"&&e!==null}function vl(e){return Dn(e.target.files).map(function(t){return It(t)})}function jl(e){return at(this,void 0,void 0,function(){var t;return ot(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(s){return s.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(s){return It(s)})]}})})}function bl(e,t){return at(this,void 0,void 0,function(){var r,s;return ot(this,function(a){switch(a.label){case 0:return e.items?(r=Dn(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(Cl))]):[3,2];case 1:return s=a.sent(),[2,Or(da(s))];case 2:return[2,Or(Dn(e.files).map(function(o){return It(o)}))]}})})}function Or(e){return e.filter(function(t){return ml.indexOf(t.name)===-1})}function Dn(e){if(e===null)return[];for(var t=[],r=0;r<e.length;r++){var s=e[r];t.push(s)}return t}function Cl(e){if(typeof e.webkitGetAsEntry!="function")return Ar(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?ua(t):Ar(e)}function da(e){return e.reduce(function(t,r){return Zn(Zn([],er(t),!1),er(Array.isArray(r)?da(r):[r]),!1)},[])}function Ar(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var r=It(t);return Promise.resolve(r)}function Dl(e){return at(this,void 0,void 0,function(){return ot(this,function(t){return[2,e.isDirectory?ua(e):Sl(e)]})})}function ua(e){var t=e.createReader();return new Promise(function(r,s){var a=[];function o(){var i=this;t.readEntries(function(l){return at(i,void 0,void 0,function(){var c,d,y;return ot(this,function(g){switch(g.label){case 0:if(l.length)return[3,5];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,Promise.all(a)];case 2:return c=g.sent(),r(c),[3,4];case 3:return d=g.sent(),s(d),[3,4];case 4:return[3,6];case 5:y=Promise.all(l.map(Dl)),a.push(y),o(),g.label=6;case 6:return[2]}})})},function(l){s(l)})}o()})}function Sl(e){return at(this,void 0,void 0,function(){return ot(this,function(t){return[2,new Promise(function(r,s){e.file(function(a){var o=It(a,e.fullPath);r(o)},function(a){s(a)})})]})})}var kt={},Pr;function wl(){return Pr||(Pr=1,kt.__esModule=!0,kt.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(",");if(r.length===0)return!0;var s=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return r.some(function(i){var l=i.trim().toLowerCase();return l.charAt(0)==="."?s.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):a===l})}return!0}),kt}var Il=wl();const _l=so(Il);function Nr(e){return Al(e)||Ol(e)||pa(e)||El()}function El(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ol(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Al(e){if(Array.isArray(e))return Sn(e)}function Tr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,s)}return r}function kr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tr(Object(r),!0).forEach(function(s){fa(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tr(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function fa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vt(e,t){return Tl(e)||Nl(e,t)||pa(e,t)||Pl()}function Pl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pa(e,t){if(e){if(typeof e=="string")return Sn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Sn(e,t)}}function Sn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function Nl(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var s=[],a=!0,o=!1,i,l;try{for(r=r.call(e);!(a=(i=r.next()).done)&&(s.push(i.value),!(t&&s.length===t));a=!0);}catch(c){o=!0,l=c}finally{try{!a&&r.return!=null&&r.return()}finally{if(o)throw l}}return s}}function Tl(e){if(Array.isArray(e))return e}var kl="file-invalid-type",$l="file-too-large",Fl="file-too-small",Ml="too-many-files",Rl=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var r=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:kl,message:"File type must be ".concat(r)}},$r=function(t){return{code:$l,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Fr=function(t){return{code:Fl,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},zl={code:Ml,message:"Too many files"};function ga(e,t){var r=e.type==="application/x-moz-file"||_l(e,t);return[r,r?null:Rl(t)]}function ma(e,t,r){if(Xe(e.size))if(Xe(t)&&Xe(r)){if(e.size>r)return[!1,$r(r)];if(e.size<t)return[!1,Fr(t)]}else{if(Xe(t)&&e.size<t)return[!1,Fr(t)];if(Xe(r)&&e.size>r)return[!1,$r(r)]}return[!0,null]}function Xe(e){return e!=null}function Ll(e){var t=e.files,r=e.accept,s=e.minSize,a=e.maxSize,o=e.multiple,i=e.maxFiles,l=e.validator;return!o&&t.length>1||o&&i>=1&&t.length>i?!1:t.every(function(c){var d=ga(c,r),y=vt(d,1),g=y[0],m=ma(c,s,a),x=vt(m,1),f=x[0],u=l?l(c):null;return g&&f&&!u})}function qt(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function $t(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Mr(e){e.preventDefault()}function Bl(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Vl(e){return e.indexOf("Edge/")!==-1}function Ul(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Bl(e)||Vl(e)}function $e(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(s){for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];return t.some(function(l){return!qt(s)&&l&&l.apply(void 0,[s].concat(o)),qt(s)})}}function Kl(){return"showOpenFilePicker"in window}function Hl(e){if(Xe(e)){var t=Object.entries(e).filter(function(r){var s=vt(r,2),a=s[0],o=s[1],i=!0;return ha(a)||(console.warn('Skipped "'.concat(a,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(o)||!o.every(xa))&&(console.warn('Skipped "'.concat(a,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(r,s){var a=vt(s,2),o=a[0],i=a[1];return kr(kr({},r),{},fa({},o,i))},{});return[{description:"Files",accept:t}]}return e}function Gl(e){if(Xe(e))return Object.entries(e).reduce(function(t,r){var s=vt(r,2),a=s[0],o=s[1];return[].concat(Nr(t),[a],Nr(o))},[]).filter(function(t){return ha(t)||xa(t)}).join(",")}function ql(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Wl(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ha(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function xa(e){return/^.*\.[\w]+$/.test(e)}var Yl=["children"],Ql=["open"],Jl=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Xl=["refKey","onChange","onClick"];function Zl(e){return nd(e)||td(e)||ya(e)||ed()}function ed(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function td(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nd(e){if(Array.isArray(e))return wn(e)}function gn(e,t){return ad(e)||sd(e,t)||ya(e,t)||rd()}function rd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.