@zeniai/web-app-ui 5.0.77-qa → 5.0.78-next

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 (133) hide show
  1. package/dist/assets/AddressRoutes-Bs0ffT2X.js +1 -0
  2. package/dist/assets/AddressScreen-DLY0B5X2.js +9 -0
  3. package/dist/assets/{AiCfoScreen-9dFOdDvS.js → AiCfoScreen-BrFGp0Rw.js} +5 -5
  4. package/dist/assets/BillPayApprovalRoutes-DGTEW0Ts.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DRXDrSZP.js → BillPayRoutes-B4DyZg9q.js} +28 -28
  6. package/dist/assets/BusinessVerificationPageScreen-CJhDGXDa.js +9 -0
  7. package/dist/assets/{ChargeCardRoutes-C9NA04uL.js → ChargeCardRoutes-ouivBCgA.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-BWjh-1tt.js → CompanyPassportScreen-Cv1RmmZ2.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-BGLgRykg.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-xT3UtszS.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-CCJ8rzxG.js +23 -0
  12. package/dist/assets/{DashboardRoutes-BR-AxyQo.js → DashboardRoutes-DpMwQkOO.js} +4 -4
  13. package/dist/assets/{DefaultTenantHome-C74gAQVt.js → DefaultTenantHome-BjKn1NRZ.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-Da3AjbNa.js +18 -0
  15. package/dist/assets/{DrawerScreen-DzkaoOWL.js → DrawerScreen-BtlXa6K0.js} +1 -1
  16. package/dist/assets/EntityDetailRoutes-DwRVDUuS.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-But3rf3J.js → ExpenseAutomationRoutes-UwZsuZMU.js} +5 -5
  18. package/dist/assets/FeaturePreviewScreen-CUAIKz1i.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-vr1PQzA9.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-Chwo-qkP.js → MagicLinkRoutes-pq1cqXvR.js} +7 -7
  21. package/dist/assets/MagicLinkSignInScreen-CJZyHulf.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-B3x5wY10.js → MobileAppDrawer-DSdJwfd5.js} +1 -1
  23. package/dist/assets/NotFoundScreen-Du1hgJnA.js +1 -0
  24. package/dist/assets/NotificationRoutes-BpqbcrT3.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-Cr5NZApw.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-CrHHjUmh.js +1 -0
  27. package/dist/assets/PeopleRoutes-DjAv-Cbm.js +22 -0
  28. package/dist/assets/PerformanceRoutes-ap8B_-S5.js +1 -0
  29. package/dist/assets/{Preview-B7yw63qf.js → Preview-BlbTJX4y.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-CzbbjqA7.js → QBOConnectionScreen-gihlHabK.js} +1 -1
  31. package/dist/assets/ReferralListScreen-DiGYqmEw.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-Dkrm7ab1.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cf6fN3gm.js → ReimbursementApprovalRuleDetailScreen-B-jeaK-0.js} +1 -1
  34. package/dist/assets/ReimbursementRoutes-Df1rene3.js +68 -0
  35. package/dist/assets/ReportsRoutes-01ZBxNzi.js +1 -0
  36. package/dist/assets/RewardsRoutes-C_RjM3wM.js +1 -0
  37. package/dist/assets/ScreenRoutes-XUGVTlJU.js +2 -0
  38. package/dist/assets/{SettingsRoutes-B6i5o_xZ.js → SettingsRoutes-DgDaKTnp.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-D9wDjvOC.js → SetupPagesScreen-DFNkJSDZ.js} +5 -5
  40. package/dist/assets/SignInScreen-4QpxmPGm.js +1 -0
  41. package/dist/assets/SignOutScreen-B8MdXYvN.js +9 -0
  42. package/dist/assets/{TaskListScreen-BXp_P6Ec.js → TaskListScreen-BDFYRBL0.js} +2 -2
  43. package/dist/assets/TaskRoutes-DT2WLVpc.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-Buw31_AN.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-DRZw6o-C.js → TransactionDetailScreen-Ci4ZELq0.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-BOekcd9c.js → TransactionListRoutes-BvA_L1Bn.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-CCwpqIb0.js +37 -0
  48. package/dist/assets/{VendorsRoutes-ZfxM-ykJ.js → VendorsRoutes-CEucFn4v.js} +28 -28
  49. package/dist/assets/WiseConfirmationScreen-74LRyISH.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-CpvkXgX6.js → ZeniAccountRoutes-C_yIwLbb.js} +12 -12
  51. package/dist/assets/ZeniAccountStatementScreen-C7x2WOwU.js +9 -0
  52. package/dist/assets/{accountMappingHelper-D6x0RpVY.js → accountMappingHelper-dm9IDhd5.js} +1 -1
  53. package/dist/assets/{analytics-CgRNtlDm.js → analytics-LRXDxB9U.js} +1 -1
  54. package/dist/assets/{analyticsHelper-BunVJ4K_.js → analyticsHelper-CM7-DzIH.js} +1 -1
  55. package/dist/assets/{core-uYqCzel8.js → core-DrFqYlht.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-DCnYf30M.js → decodeURIComponentSafe-BIE62qI8.js} +1 -1
  57. package/dist/assets/{dnd-BSWou54V.js → dnd-DjCTgA16.js} +1 -1
  58. package/dist/assets/{empty-BFCAZWzA.js → empty-B_1j7UZd.js} +1 -1
  59. package/dist/assets/{empty-CKinwWZY.js → empty-Btqpa3Dn.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-E29-Nor3.js → emptyVideoElement-DUjVh48Y.js} +1 -1
  61. package/dist/assets/epic-DUdYUOqK.js +2 -0
  62. package/dist/assets/getLocaleForTenant-CtOQ1QSt.js +1 -0
  63. package/dist/assets/{index-8d_FSGLw.js → index-B7-w4njp.js} +1 -1
  64. package/dist/assets/{index-CxWCBC6O.js → index-BIdZz-Lu.js} +1 -1
  65. package/dist/assets/{index-F3uqdkEv.js → index-BUJjaTE7.js} +2 -2
  66. package/dist/assets/{index-DWPRup5s.js → index-BxB1wE84.js} +1 -1
  67. package/dist/assets/{index-DeBaxB_L.js → index-CuGjO8q5.js} +1 -1
  68. package/dist/assets/{index-Dl7Wgss6.js → index-g9hTOOdd.js} +1 -1
  69. package/dist/assets/{index-DojfCsv7.js → index-gIHwUZJz.js} +12640 -12668
  70. package/dist/assets/{index-BsLHs9Ab.js → index-vvusuUAb.js} +1 -1
  71. package/dist/assets/{lexical-DbCoEckm.js → lexical-BvSd63VE.js} +1 -1
  72. package/dist/assets/{liveblocks-CfCKAQeM.js → liveblocks-C6NDyiJv.js} +1 -1
  73. package/dist/assets/{lottie-Dc_IH0fS.js → lottie-CRrBZj94.js} +1 -1
  74. package/dist/assets/{mui-CTbUXhla.js → mui-BfKuxuES.js} +1 -1
  75. package/dist/assets/{pathToGoBack-Y7yporNq.js → pathToGoBack-CUljzXbA.js} +1 -1
  76. package/dist/assets/{pdf-O9N1jd2N.js → pdf-WyHfBZP8.js} +3 -3
  77. package/dist/assets/{pdf-lib-CNgiyR2K.js → pdf-lib-Ni58cQtF.js} +1 -1
  78. package/dist/assets/{plaid-Bio3MiLm.js → plaid-BfLcb-Mu.js} +1 -1
  79. package/dist/assets/{pusher--jGYOMJ8.js → pusher-BetHGDvL.js} +1 -1
  80. package/dist/assets/{react-BYbqG6ZW.js → react-BWdafFx3.js} +1 -1
  81. package/dist/assets/{react-BaqpebX1.js → react-CKFyZHqR.js} +1 -1
  82. package/dist/assets/{react-kWXzqyUF.js → react-CZxiptYj.js} +1 -1
  83. package/dist/assets/{react-D9RjhqSo.js → react-CdUYyNlS.js} +1 -1
  84. package/dist/assets/{react-DqfAPb7w.js → react-D7NpAKPT.js} +1 -1
  85. package/dist/assets/{react-KPWjcD7D.js → react-DPXh3mWt.js} +1 -1
  86. package/dist/assets/{recharts-BUFoogHS.js → recharts-DzFRpM3n.js} +1 -1
  87. package/dist/assets/{routePaths-DoAvT9jx.js → routePaths-DwqXZ9IC.js} +1 -1
  88. package/dist/assets/{sentry-131ydzJg.js → sentry-DorFMwQU.js} +1 -1
  89. package/dist/assets/{url-DlWfObPw.js → url-CkJQeQOD.js} +1 -1
  90. package/dist/assets/{url-BRm_J7V6.js → url-yU2RR5Y5.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-SdJdV09H.js +1 -0
  92. package/dist/assets/{useDeviceId-CBU-vDdN.js → useDeviceId-B51M4N2b.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js → useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-Dbj0dyeX.js → useInitialThreadRequest-C8hN7EcF.js} +1 -1
  95. package/dist/assets/{utils-BkkIzijx.js → utils-BiDInqYy.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-DN0z2FuE.js → withTransactionSidePanel-51Ock1rJ.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-BmAPZlsC.js → zeni-epic-state-vpQnS6PI.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -4
  100. package/dist/assets/AddressRoutes-O04th73J.js +0 -1
  101. package/dist/assets/AddressScreen-Bk_munT3.js +0 -9
  102. package/dist/assets/BillPayApprovalRoutes-COiJeUFT.js +0 -1
  103. package/dist/assets/BusinessVerificationPageScreen-CnAB8eUQ.js +0 -9
  104. package/dist/assets/ConnectionAuthScreen-D6DaHf5c.js +0 -11
  105. package/dist/assets/CustomerOnboardingAuthScreen-3eEcB707.js +0 -1
  106. package/dist/assets/CustomerOnboardingRoutes-l7rM0eut.js +0 -23
  107. package/dist/assets/DomesticWireDetailScreen-CWWX1EFM.js +0 -18
  108. package/dist/assets/EntityDetailRoutes-B7e2LtGS.js +0 -1
  109. package/dist/assets/FeaturePreviewScreen-B2O-98_e.js +0 -1
  110. package/dist/assets/HubSpotOAuthCallbackScreen-DexCFc1l.js +0 -1
  111. package/dist/assets/MagicLinkSignInScreen-DWsNyqtg.js +0 -12
  112. package/dist/assets/NotFoundScreen-t1ueGvDG.js +0 -1
  113. package/dist/assets/NotificationRoutes-CIdj2V-n.js +0 -1
  114. package/dist/assets/OAuthConsentScreen-CP2RFaGU.js +0 -1
  115. package/dist/assets/PandLWithForecastRoutes-BXYFz1ZW.js +0 -1
  116. package/dist/assets/PeopleRoutes-MqrPexG5.js +0 -22
  117. package/dist/assets/PerformanceRoutes-B1RTm-Zq.js +0 -1
  118. package/dist/assets/ReferralListScreen-DTQFACuG.js +0 -5
  119. package/dist/assets/ReimbursementApprovalRoutes-Dclz8XkB.js +0 -1
  120. package/dist/assets/ReimbursementRoutes-Dd9IEYb-.js +0 -68
  121. package/dist/assets/ReportsRoutes-B9O7T9pm.js +0 -1
  122. package/dist/assets/RewardsRoutes-DN2HacCh.js +0 -1
  123. package/dist/assets/ScreenRoutes-BsLKoqEt.js +0 -2
  124. package/dist/assets/SignInScreen-D68DdO0g.js +0 -1
  125. package/dist/assets/SignOutScreen-CiC1xhyM.js +0 -9
  126. package/dist/assets/TaskRoutes-Dne-2qND.js +0 -9
  127. package/dist/assets/TransactionDetailRoutes-C1ih2pnm.js +0 -1
  128. package/dist/assets/TreasuryRoutes-BMXt9CZJ.js +0 -37
  129. package/dist/assets/WiseConfirmationScreen-D5IG7vtp.js +0 -12
  130. package/dist/assets/ZeniAccountStatementScreen-C_K9i07r.js +0 -9
  131. package/dist/assets/epic-dPIWYPli.js +0 -2
  132. package/dist/assets/getLocaleForTenant-BVZe9vGW.js +0 -1
  133. package/dist/assets/useAskAiCfoHostNavButtonProps-It-lF7wN.js +0 -1
@@ -1,15 +1,15 @@
1
- import{j as C}from"./liveblocks-CfCKAQeM.js";import xn from"./NotFoundScreen-t1ueGvDG.js";import{a,b as Pt}from"./sentry-131ydzJg.js";import{n as Fe,S as Rn}from"./mui-CTbUXhla.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-uYqCzel8.js";import{eQ as Re,PL as Fn,n0 as Se,fg as Bn,qD as _n,ni as xt,nD as Rt,PM as Dt,nN as Mn,PN as Ut,nb as Vn,q9 as On,e$ as pe,PO as De,sJ as Ft,BU as Bt,PP as _t,PQ as jn,pQ as Qe,Ls as dt,Lu as Ln,jF as zn,Lv as $n,jM as qn,cW as Gn,tM as Ne,no as Mt,nS as Ue,PR as Qn,Kl as ut,Kk as Pe,PS as mt,k1 as Nn,PT as Yn,PU as Jn,PV as Kn,PW as Wn,nv as Hn,ng as ie,nV as we,PX as Zn,PY as Xn,PZ as ea,o0 as ta,jQ as na,jH as aa,P_ as oa,jP as ht,LC as sa,P$ as ca,Q0 as ia,pM as la,pr as ra,nT as ge,pq as ze,Q1 as da,Q2 as ua,lk as ma,bq as ha,lf as pt,l1 as pa,Q3 as ga,gO as gt,fS as Ca,lc as Sa,vF as fa,Q4 as Ia,or as ka,om as Ea,oq as va,ob as ya,Q5 as ba,f2 as Vt,nG as Aa,nr as Ta,fh as Ct,nX as Pa,Q6 as wa,nU as Ot,Q7 as xa,Q8 as Ra,Q9 as Da,Qa as Ua,Qb as St,pY as Fa,ph as Ba,Kj as _a,jO as Ma,Qc as Va,Gq as Oa,jN as ja,jC as La,f1 as za,oS as jt,p9 as $a,nR as ft,nW as qa,bE as Ga,l9 as Qa,l6 as Na,Qd as Ya,oa as It,p7 as kt,p5 as Ja,oX as Ka,oC as Wa,p8 as Ha,Qe as Za,Qf as Xa,oG as eo,Qg as to,ow as no,oF as ao,oD as oo,pc as so}from"./zeni-epic-state-BmAPZlsC.js";import{y as Lt,S as Ce,d as L,q as W,U as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,x as $t,cz as ro,an as $e,D as uo,cA as mo,Y as ho,cB as po,T as go,cC as Co,cD as So,s as fo,c as Io,aK as ko,b1 as Eo,G as vo,cE as yo}from"./index-DojfCsv7.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-It-lF7wN.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js";import{c as vt,C as bo}from"./TransactionDetailScreen-DRZw6o-C.js";import{w as Ao}from"./withTransactionSidePanel-DN0z2FuE.js";import{h as To,v as Po}from"./routePaths-DoAvT9jx.js";import{g as qe}from"./accountMappingHelper-D6x0RpVY.js";import{D as wo}from"./DrawerScreen-DzkaoOWL.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./decodeURIComponentSafe-DCnYf30M.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="1fcd27ef-ceb0-4731-a89e-e2f5b540fadb",t._sentryDebugIdIdentifier="sentry-dbid-1fcd27ef-ceb0-4731-a89e-e2f5b540fadb")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),I=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,I.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,J=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:J}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(I.tenantId,d))},[I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[I.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,I.tenantId,!0)},[m,r,I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=W(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&f&&m(r,I.tenantId)},[m,r,o.fetchState,I.tenantId,f]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
1
+ import{j as C}from"./liveblocks-C6NDyiJv.js";import xn from"./NotFoundScreen-Du1hgJnA.js";import{a,b as Tt}from"./sentry-DorFMwQU.js";import{n as Fe,S as Rn}from"./mui-BfKuxuES.js";import{h as ce,j as wt,u as qe,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-DrFqYlht.js";import{eO as Re,Po as Fn,mF as Se,fe as Bn,qg as _n,mX as xt,ng as Rt,Pp as Dt,nq as Vn,Pq as Ut,mQ as Mn,pO as On,eZ as pe,Pr as De,sm as Ft,Bx as Bt,Ps as _t,Pt as jn,pt as Je,L5 as dt,L7 as Ln,jD as zn,L8 as $n,jK as Gn,cV as qn,tp as Ne,n1 as Vt,nv as Ue,Pu as Jn,J_ as ut,JZ as Te,Pv as mt,j$ as Nn,Pw as Yn,Px as Kn,Py as Qn,Pz as Zn,n8 as Hn,mV as ie,ny as we,PA as Wn,PB as Xn,PC as ea,nF as ta,jO as na,jF as aa,PD as oa,jN as ht,Lf as sa,PE as ca,PF as ia,pp as la,p4 as ra,nw as ge,p3 as ze,PG as da,PH as ua,li as ma,bq as ha,ld as pt,k$ as pa,PI as ga,gM as gt,fQ as Ca,la as Sa,vi as fa,PJ as Ia,o4 as ka,n$ as Ea,o3 as va,nQ as ya,PK as Pa,f0 as Mt,nj as ba,n4 as Aa,ff as Ct,nA as Ta,PL as wa,nx as Ot,PM as xa,PN as Ra,PO as Da,PP as Ua,PQ as St,pB as Fa,oW as Ba,JY as _a,jM as Va,PR as Ma,G3 as Oa,jL as ja,jA as La,e$ as za,ov as jt,oO as $a,nu as ft,nz as Ga,bD as qa,l7 as Ja,l4 as Na,PS as Ya,nP as It,oM as kt,oK as Ka,oA as Qa,of as Za,oN as Ha,PT as Wa,PU as Xa,oj as eo,PV as to,o9 as no,oi as ao,og as oo,oR as so}from"./zeni-epic-state-vpQnS6PI.js";import{y as Lt,S as Ce,c as L,r as Z,V as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,B as $t,cz as ro,an as $e,D as uo,cA as mo,Y as ho,cB as po,U as go,cC as Co,cD as So,w as fo,k as Io,aK as ko,b1 as Eo,G as vo,cE as yo}from"./index-gIHwUZJz.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as qt}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{c as vt,C as Po}from"./TransactionDetailScreen-Ci4ZELq0.js";import{w as bo}from"./withTransactionSidePanel-51Ock1rJ.js";import{h as Ao,v as To}from"./routePaths-DwqXZ9IC.js";import{g as Ge}from"./accountMappingHelper-dm9IDhd5.js";import{D as wo}from"./DrawerScreen-BtlXa6K0.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";import"./decodeURIComponentSafe-BIE62qI8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="4417dc45-f699-40ff-9924-08e3a72e6cfb",t._sentryDebugIdIdentifier="sentry-dbid-4417dc45-f699-40ff-9924-08e3a72e6cfb")}catch{}})();const xo=()=>{const t=ce(),i=wt(),b=qe(),I=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,I.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(I.tenantId,d))},[I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[I.tenantId],B=a.useCallback(()=>{const d=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,I.tenantId,!0)},[m,r,I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=Z(b.state?.pathnameStackToGoBack,b.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=zt();return qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&f&&m(r,I.tenantId)},[m,r,o.fetchState,I.tenantId,f]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=b.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,Do=Pt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:I,onEstablishConnectionClick:E})=>{const g=ce(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,T=(e,n)=>{g(On(e,n.split(".")[0]))},f=e=>{h!=null&&g(Vn({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Mn({accountId:i,selectedPeriod:y,payload:e}))},J=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),O=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(io,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:y,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:I,onEstablishConnectionClick:E,onEditFileName:T,onDeleteFile:f,onSelectSourceType:J,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(lo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:O})})}):null}),yt=Fe.div`
8
+ `,Do=Tt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:b,onFetchLinkTokenClick:I,onEstablishConnectionClick:E})=>{const g=ce(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,A=(e,n)=>{g(On(e,n.split(".")[0]))},f=e=>{h!=null&&g(Mn({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Vn({accountId:i,selectedPeriod:y,payload:e}))},K=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),O=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(io,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:y,onDismissClick:b,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:I,onEstablishConnectionClick:E,onEditFileName:A,onDeleteFile:f,onSelectSourceType:K,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(lo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:O})})}):null}),yt=Fe.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
12
- `,bt=Fe.div`
12
+ `,Pt=Fe.div`
13
13
  flex: 1;
14
14
  min-height: 0;
15
15
  display: flex;
@@ -18,8 +18,8 @@ import{j as C}from"./liveblocks-CfCKAQeM.js";import xn from"./NotFoundScreen-t1u
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function Uo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:I}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>jn(u,t,E));return a.useEffect(()=>{I()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(ro,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Bo,comma:At,space:_o}},dateFormat:Qt}=uo.getLocalizedStrings(),Tt=so,Mo=Dn(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:I,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=pe(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:I,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:I,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:f,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:J}=S.jeSchedules,te=Mt(f),O=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(f.month,f.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));po(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(P=>{P!=null?t(Fa(e,P)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=W(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Se({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Da(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?_o+Bo+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&O!=null&&t(Ot({start:O,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(eo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Xa())},onSetBulkUploadResultsTab:e=>{t(Za(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ha(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Wa())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ka(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ja())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&O!=null&&t(ge(s,{start:O,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Pa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ta(e))},onSaveReconciliationReview:e=>{t(Aa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=W(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Vt(e))},handleLogOutClick:()=>{const e=W(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=qe(J.prepaidExpensesAccountList,s.selectedOptions),b=qe(J.fixedAssetsAccountList,l.selectedOptions),P=qe(J.accruedExpensesAccountList,k.selectedOptions),M={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:P.map(w=>w.accountId)};t(ba({data:M}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:P,allClassList:M,allDepreciationAccountList:w}=S.jeSchedules,$=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find(q=>q.id===b?.selectedOption):void 0,fe={id:$?.zeniId??b?.selectedOption??"",name:$?.name??b?.defaultOptions.find(q=>q.value===b?.selectedOption)?.label??"",logo:$?.logo},Ie=p?.selectedOption!=null?P.find(q=>q.qboId===p.selectedOption):void 0,ke=k?.selectedOption!=null?M.find(q=>q.classId===k.selectedOption):void 0,ne=l?.selectedOption!=null?w.find(q=>q.qboId===l.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:Ie?.accountId,updatedClassId:ke?.classId,updatedAccumulatedDepreciationCategoryID:ne?.accountId,updatedVendor:{id:fe.id,name:fe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onCancelAutoComplete:()=>{t(Pe("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Ia())},handleJeScheduleClick:(e,n,s)=>{t(fa({selectedJEScheduleKey:n}));const l=W(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ha().format(Qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=W(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,P,M,w,$)=>{t(ua(e,n,s,l,y,k,p,b,P,M,w,$,I))},onCancelAutoComplete:()=>{t(Pe("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&O!=null&&(t(ge(e,{start:O,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&O!=null&&t(ge(e,{start:O,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{_!=null&&O!=null&&t(ge(e,{start:O,end:_},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,P)=>{t(ra(e,n,s,l,P??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:I}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(f.month,f.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(f.month,f.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(la(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:M,lineIds:w}=n;p!=null&&t(sa({transactionId:P,customerUpdates:p})),t(ca({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:M,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ne(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:M,lineIds:w}=n;p!=null&&(t(na({transactionId:P,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(aa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:M,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ne(k,e,n,s,!0,E,b))):t(oa({selectedTab:l,transactionId:P.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(f,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(ta(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:f}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=Po(e.id,e.qboId,i.tenantEmailDomain),s=W(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Zn({sectionId:e,selectedPeriod:f}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ie(f,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:f,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ie(f,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Hn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Wn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Kn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Jn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Nn(l)),t(Yn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,Qe("bill"));const n=W(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Qn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:I,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(mo),Vo=Ao(function(t){const i=t.displayName??t.name??"Component",A=Pt.memo(t),I=E=>{const g=ce(),u=function(){const T=ce(),f=U(d=>pe(d).reconciliation.selectedDrawerAccountId);return{isOpen:f!=null,selectedAccountId:f,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=U(T=>pe(T).reconciliation),v=U(T=>Re(T)),S=a.useCallback((T,f)=>{g(Ft("expense_automation_reconcile",T,f))},[g]),m=a.useCallback((T,f)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",f)),g(_t({accountId:f,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Do,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return I.displayName=`withReconSidePanel(${i})`,I}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:I,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=go(),m=Co(),{isOpen:y}=So(),r=wt(),B=Ge(),h=ce(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:f}=qt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&I!==!0&&t?.()},[t,E,I]),{areTenantIdsInSync:R}=zt(),J=(()=>{const c=U(G=>pe(G)),j=Ge(),{currentSelectedViewFetchState:Y,currentSelectedView:V,selectedPeriod:F}=c,he=$e(V),X=$e(Y.fetchState),be=a.useCallback(G=>{const K=j.state?.referrer;V==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,G,K??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,G,K??null)),V==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,G,c.missingReceipts.transactions.length,K??null),V==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,K??null),V==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,G,Fo(c.fluxAnalysis),K??null),V==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,G,"draft",c.auditSummary.auditScorePercentage,null,K??null)},[F,c]);return a.useEffect(()=>{X===Y.fetchState&&V===he||Y.fetchState!=="Completed"||be(!1)},[V,Y.fetchState,he]),be})(),te=fo(),[O,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,P]=a.useState([]),[M,w]=a.useState(void 0),$=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),fe=a.useCallback(()=>{m(),w(void 0),d(),f()},[d,f,m]),Ie=a.useRef(v);a.useEffect(()=>{v===!0&&Ie.current===!1&&(m(),w(void 0),d()),Ie.current=v},[d,v,m]);const ke=a.useRef(y);a.useEffect(()=>{y===!0&&ke.current===!1&&(v&&S(!1),w(void 0),E===!0&&I!==!0&&t?.()),ke.current=y},[t,y,v,S,I,E]);const ne=E===!0&&I!==!0,q=a.useRef(ne);a.useEffect(()=>{ne&&!q.current&&(v&&S(!1),m(),w(void 0)),q.current=ne},[v,ne,m,S]);const[Ye,Nt]=a.useState(!1),Je=a.useRef(!1),{selectedTab:Ke}=rt(),{tenantEmailDomain:Yt}=rt(),[_e,We]=a.useState(B.state?.message==="comingFromTransactionDetail"),He=B.state?.message==="comingFromOverview",Jt=Io(),Me=Be.getSignedInUser(),{useDynamicConfig:Kt,useFeatureGate:Ee}=Lt(),{configValue:Wt}=Kt(ko.enableUncategorizedExpenseCategory),H=Wt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ze}=Ee(Ce.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:le}=Ee(Ce.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=Ee(Ce.isTransactionActivityEnabled),{isFeatureEnabled:Ht}=Ee(Ce.isExpenseAutomationCommentingEnabled),Zt=a.useCallback(c=>{const j=Qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),Xt=U(c=>_a(c,"common")),z=U(c=>pe(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ae,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:Z,jeSchedules:Ve,reconciliation:tn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||$(void 0)},[x,$,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==ae&&(ve.current=ae,x==="transaction_categorization"&&$(void 0)):ve.current=ae},[x,ae,$]);const nn=U(c=>M==null?void 0:Ma(c.transactionState,M)),oe=nn?.qboId,an=U(c=>oe==null?void 0:Va(c,oe));a.useEffect(()=>{oe!=null&&h(Oa(oe))},[h,oe]);const{selectedAccountId:re}=tn,et=$e(Ve.accountSettingsView.saveState.fetchState),on=U(c=>ja(c.accountState,c.accountListState,"accountList")),sn=U(c=>La(c)),de=Ke!=null?za(Ke):x,cn=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:Z.fetchState==="Completed"}),Me==null)throw Error("Can't access expense automation screen without signing in...");const tt=Mt(D),ue=Ue(tt.start),me=Ue(tt.end);if(ue==null||me==null)throw Error(`Invalid start - ${ue} and end - ${me} period from given ${D}`);const ln=a.useCallback(()=>{l(!1)},[]),rn=a.useCallback(()=>{p(!0)},[]),dn=a.useCallback(c=>{P(c),p(!1)},[]),un=a.useCallback(()=>{P([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{le===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[le,x,ye,nt,h]);const at=Me?.userId,mn=D.month,hn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&le!==!1&&ye==="idle"&&at!=null&&ot!=null&&h($a())},[x,le,ye,at,ot,mn,hn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{de!=null&&x!==de&&h(Vt(de))},[de]),a.useEffect(()=>{Ye!==!1||Z.fetchState!=="Completed"&&Z.fetchState!=="Error"||!R||(Nt(!0),h(ft(!1,!1,H)))},[Ye,Z,R,H]),a.useEffect(()=>{!He&&R&&(h(ft(!1,!1,H)),h(ie(D,re,!1,!1)))},[D.month,D.year,R,H]);const st=a.useCallback((c=!1,j=!1)=>{const Y={start:ue,end:me};switch(x){case"transaction_categorization":h(ge(ae,Y,c,!_e,void 0,void 0,j,void 0,H)),We(!1);break;case"flux_analysis":h(we(D,c,j,null));break;case"month_end_insights":if(j===!1){const V=new Date(D.year,D.month,0),F=Ga(V.toDateString()).format(Qt.analytics.YYYYDashMMDashDDFormat);h(Qa(!0,n.companyId,n.tenantId,F)),h(Na(n.companyId,n.tenantId))}break;case"je_schedules":h(qa(Y,j));break;case"missing_receipts":h(Ot(Y,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ie(D,re,c,j))}},[x,ue,me,n.companyId,n.tenantId,ae,D,re,_e,We,H]);a.useEffect(()=>{x===de&&Z.fetchState==="Not-Started"&&R&&st(!0)},[Z,ue,me,n.companyId,n.tenantId,R]),a.useEffect(()=>{He||_e||Je.current||en.fetchState==="In-Progress"||Z.fetchState!=="Completed"||(Je.current=!0,st(!0,!0))},[]),a.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Ya({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&re==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ie(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,ie,re,D]);const pn=vt();a.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!Ze;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,N.monthEndCloseChecks]);const gn=u===!0?g:A,Cn=u===!0||E===!0,Sn=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Ve.accountSettingsView.saveState.fetchState==="Completed"&&h(It())},[et,Ve.accountSettingsView.saveState.fetchState,It]);const{transactionId:ct,onSaveVendor:fn,onSaveSuccess:In,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:Y})=>{const V=ce();let F,he,X;const be=vt(),G=c.transactionView;let K=()=>{};const{transactions:vn,selectedTransactionId:se,selectedTransactionLineId:Ae,transactionLocalData:yn}=G;if(Y==="transaction_categorization"){const Oe=yn.find(ee=>ee.transactionId===se),Q=vn.find(ee=>ee.id===se),it=Ae!=null?Oe?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;he=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const An=To(se,Q?.typeOfTransaction);Q!=null&&An&&(X={id:se,type:Qe(Q.typeOfTransaction)}),K=()=>{if(se!=null&&Ae!=null&&Q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===se)?.transactionReviewLocalData;if(ee!=null&&Q.lines!=null&&Q.lines.length>0){const Te=ee.lineItemById[Ae];let je=ee.selectedEntity;if(Gn(Q)||(je=Te.selectedEntityLine),je!=null){const Tn=je,Pn={transactionId:{id:Q.id,type:Q.type},transaction:Q,lineIds:Q.lines.map(wn=>wn.id)??[]};V(Ne(Tn,Te.amount.amount,Pn,!1,!0,be))}}}}}const bn=U(Oe=>dt(Oe,void 0,F,he));return{transactionId:X,onSaveVendor:()=>{V(qn(X,void 0,!1,!0))},onSaveSuccess:K,onCancel:()=>{X!=null&&V(Ln({transactionId:X})),V(zn()),V($n()),j()},vendorViewDetails:bn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Jt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(Eo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(wo,{isOpen:k,drawerLeftMargin:new vo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Oo,{onClick:c=>c.stopPropagation(),children:C.jsx(Uo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&O&&C.jsx(bo,{isOpen:O,transactionId:ct,onSaveVendor:fn,onSaveSuccess:In,onCancel:kn,vendorViewDetails:En}),C.jsx(Mo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:le,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:Ze,isUncategorizedExpenseCategoryEnabled:H,isAccountingClassesEnabled:sn,isCOTEnabled:pn,currentTenant:n,companyId:n.companyId,signedInUser:Me,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?M:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&M!=null?C.jsx(yo,{activityLogView:an,qboId:oe,onClose:()=>$(void 0),selectedTransactionId:M},String(M)):null,uncategorizedAccounts:on,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Yt,trackExpenseAutomationTabAnalytics:J,setActivityLogTransactionId:$,closeSidePanel:Sn,openTransactionPanel:i,sidePanelIsOpen:Cn,sidePanelIsFullView:u!==!0&&I,panelContent:gn,isAiCfoAccessEnabled:T,onAskAiCfoClick:fe,isExpenseAutomationCommentingEnabled:Ht,onExpenseAutomationCommentingThreadClick:Zt,sidePanelListPercent:u===!0?66:void 0})]})})),Oo=Fe(Rn)`
21
+ `;function Uo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:b,resetCustomerRequest:I}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>jn(u,t,E));return a.useEffect(()=>{I()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(ro,{onCloseClick:i,addCustomerRequest:b,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Bo,comma:bt,space:_o}},dateFormat:Jt}=uo.getLocalizedStrings(),At=so,Vo=Dn(function(t,i){const{uncategorizedAccounts:b,vendorSearchAutoCompleteData:I,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=pe(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:I,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:b,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:b,isAccountingClassesEnabled:I,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:A}=i,{selectedPeriod:f,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:K}=S.jeSchedules,te=Vt(f),O=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{b.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(f.month,f.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const P=()=>t(St(e,n,{fetchState:"Error"}));po(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(T=>{T!=null?t(Fa(e,T)):P()}).catch(P)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Se({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Da(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?_o+Bo+l+bt:bt}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&O!=null&&t(Ot({start:O,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(eo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Xa())},onSetBulkUploadResultsTab:e=>{t(Wa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ha(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(At(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(At(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Qa(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&O!=null&&t(ge(s,{start:O,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Ta(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Aa(e))},onSaveReconciliationReview:e=>{t(ba(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=Z(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=Ge(K.prepaidExpensesAccountList,s.selectedOptions),P=Ge(K.fixedAssetsAccountList,l.selectedOptions),T=Ge(K.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:P.map(w=>w.accountId),selectedAccruedExpensesAccountIds:T.map(w=>w.accountId)};t(Pa({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:P}=n,{allAccountList:T,allClassList:V,allDepreciationAccountList:w}=S.jeSchedules,$=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find(G=>G.id===P?.selectedOption):void 0,fe={id:$?.zeniId??P?.selectedOption??"",name:$?.name??P?.defaultOptions.find(G=>G.value===P?.selectedOption)?.label??"",logo:$?.logo},Ie=p?.selectedOption!=null?T.find(G=>G.qboId===p.selectedOption):void 0,ke=k?.selectedOption!=null?V.find(G=>G.classId===k.selectedOption):void 0,ne=l?.selectedOption!=null?w.find(G=>G.qboId===l.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:Ie?.accountId,updatedClassId:ke?.classId,updatedAccumulatedDepreciationCategoryID:ne?.accountId,updatedVendor:{id:fe.id,name:fe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Te("common"))},onCancelAutoComplete:()=>{t(Te("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Ia())},handleJeScheduleClick:(e,n,s)=>{t(fa({selectedJEScheduleKey:n}));const l=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:A,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,P,T,V,w,$)=>{t(ua(e,n,s,l,y,k,p,P,T,V,w,$,I))},onCancelAutoComplete:()=>{t(Te("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&O!=null&&(t(ge(e,{start:O,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&O!=null&&t(ge(e,{start:O,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,P)=>{_!=null&&O!=null&&t(ge(e,{start:O,end:_},!0,s,n,l,k,p,P))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,P,T)=>{t(ra(e,n,s,l,T??null,k,p,!1,P))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:I}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(f.month,f.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(f.month,f.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(la(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,P)=>{const{transactionId:T,transaction:V,lineIds:w}=n;p!=null&&t(sa({transactionId:T,customerUpdates:p})),t(ca({selectedTab:l,transactionId:T.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:P})),k!=null&&t(Ne(k,e,n,s,!0,E,P))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,P)=>{const{transactionId:T,transaction:V,lineIds:w}=n;p!=null&&(t(na({transactionId:T,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(aa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:T.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:P})),k!=null&&t(Ne(k,e,n,s,!0,E,P))):t(oa({selectedTab:l,transactionId:T.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(f,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(ta(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:f}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=To(e.id,e.qboId,i.tenantEmailDomain),s=Z(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Wn({sectionId:e,selectedPeriod:f}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ie(f,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:f,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ie(f,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Hn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Kn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Nn(l)),t(Yn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,Je("bill"));const n=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Te("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,b)=>{const{isMissingReceiptsBulkUploadEnabled:I,...E}=b;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(mo),Mo=bo(function(t){const i=t.displayName??t.name??"Component",b=Tt.memo(t),I=E=>{const g=ce(),u=function(){const A=ce(),f=U(d=>pe(d).reconciliation.selectedDrawerAccountId);return{isOpen:f!=null,selectedAccountId:f,openPanel:a.useCallback(d=>{A(De({selectedDrawerAccountId:d}))},[A]),closePanel:a.useCallback(()=>{A(De({selectedDrawerAccountId:void 0}))},[A])}}(),o=U(A=>pe(A).reconciliation),v=U(A=>Re(A)),S=a.useCallback((A,f)=>{g(Ft("expense_automation_reconcile",A,f))},[g]),m=a.useCallback((A,f)=>{const d=v?.companyId;d!=null&&(g(Bt(A,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",f)),g(_t({accountId:f,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Do,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(b,{...E,...r})})};return I.displayName=`withReconSidePanel(${i})`,I}(({closeSidePanel:t,openTransactionPanel:i,panelContent:b,sidePanelIsFullView:I,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=go(),m=Co(),{isOpen:y}=So(),r=wt(),B=qe(),h=ce(),{isAiCfoAccessEnabled:A,onAskAiCfoClick:f}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&I!==!0&&t?.()},[t,E,I]),{areTenantIdsInSync:R}=zt(),K=(()=>{const c=U(q=>pe(q)),j=qe(),{currentSelectedViewFetchState:Y,currentSelectedView:M,selectedPeriod:F}=c,he=$e(M),X=$e(Y.fetchState),Pe=a.useCallback(q=>{const Q=j.state?.referrer;M==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,q,Q??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,q,Q??null)),M==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,q,c.missingReceipts.transactions.length,Q??null),M==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,q,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,Q??null),M==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,q,Fo(c.fluxAnalysis),Q??null),M==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,q,"draft",c.auditSummary.auditScorePercentage,null,Q??null)},[F,c]);return a.useEffect(()=>{X===Y.fetchState&&M===he||Y.fetchState!=="Completed"||Pe(!1)},[M,Y.fetchState,he]),Pe})(),te=fo(),[O,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[P,T]=a.useState([]),[V,w]=a.useState(void 0),$=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),fe=a.useCallback(()=>{m(),w(void 0),d(),f()},[d,f,m]),Ie=a.useRef(v);a.useEffect(()=>{v===!0&&Ie.current===!1&&(m(),w(void 0),d()),Ie.current=v},[d,v,m]);const ke=a.useRef(y);a.useEffect(()=>{y===!0&&ke.current===!1&&(v&&S(!1),w(void 0),E===!0&&I!==!0&&t?.()),ke.current=y},[t,y,v,S,I,E]);const ne=E===!0&&I!==!0,G=a.useRef(ne);a.useEffect(()=>{ne&&!G.current&&(v&&S(!1),m(),w(void 0)),G.current=ne},[v,ne,m,S]);const[Ye,Nt]=a.useState(!1),Ke=a.useRef(!1),{selectedTab:Qe}=rt(),{tenantEmailDomain:Yt}=rt(),[_e,Ze]=a.useState(B.state?.message==="comingFromTransactionDetail"),He=B.state?.message==="comingFromOverview",Kt=Io(),Ve=Be.getSignedInUser(),{useDynamicConfig:Qt,useFeatureGate:Ee}=Lt(),{configValue:Zt}=Qt(ko.enableUncategorizedExpenseCategory),H=Zt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=Ee(Ce.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:le}=Ee(Ce.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=Ee(Ce.isTransactionActivityEnabled),{isFeatureEnabled:Ht}=Ee(Ce.isExpenseAutomationCommentingEnabled),Wt=a.useCallback(c=>{const j=Je(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),Xt=U(c=>_a(c,"common")),z=U(c=>pe(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ae,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:W,jeSchedules:Me,reconciliation:tn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||$(void 0)},[x,$,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==ae&&(ve.current=ae,x==="transaction_categorization"&&$(void 0)):ve.current=ae},[x,ae,$]);const nn=U(c=>V==null?void 0:Va(c.transactionState,V)),oe=nn?.qboId,an=U(c=>oe==null?void 0:Ma(c,oe));a.useEffect(()=>{oe!=null&&h(Oa(oe))},[h,oe]);const{selectedAccountId:re}=tn,et=$e(Me.accountSettingsView.saveState.fetchState),on=U(c=>ja(c.accountState,c.accountListState,"accountList")),sn=U(c=>La(c)),de=Qe!=null?za(Qe):x,cn=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(qt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ue=Ue(tt.start),me=Ue(tt.end);if(ue==null||me==null)throw Error(`Invalid start - ${ue} and end - ${me} period from given ${D}`);const ln=a.useCallback(()=>{l(!1)},[]),rn=a.useCallback(()=>{p(!0)},[]),dn=a.useCallback(c=>{T(c),p(!1)},[]),un=a.useCallback(()=>{T([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{le===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[le,x,ye,nt,h]);const at=Ve?.userId,mn=D.month,hn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&le!==!1&&ye==="idle"&&at!=null&&ot!=null&&h($a())},[x,le,ye,at,ot,mn,hn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{de!=null&&x!==de&&h(Mt(de))},[de]),a.useEffect(()=>{Ye!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!R||(Nt(!0),h(ft(!1,!1,H)))},[Ye,W,R,H]),a.useEffect(()=>{!He&&R&&(h(ft(!1,!1,H)),h(ie(D,re,!1,!1)))},[D.month,D.year,R,H]);const st=a.useCallback((c=!1,j=!1)=>{const Y={start:ue,end:me};switch(x){case"transaction_categorization":h(ge(ae,Y,c,!_e,void 0,void 0,j,void 0,H)),Ze(!1);break;case"flux_analysis":h(we(D,c,j,null));break;case"month_end_insights":if(j===!1){const M=new Date(D.year,D.month,0),F=qa(M.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);h(Ja(!0,n.companyId,n.tenantId,F)),h(Na(n.companyId,n.tenantId))}break;case"je_schedules":h(Ga(Y,j));break;case"missing_receipts":h(Ot(Y,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ie(D,re,c,j))}},[x,ue,me,n.companyId,n.tenantId,ae,D,re,_e,Ze,H]);a.useEffect(()=>{x===de&&W.fetchState==="Not-Started"&&R&&st(!0)},[W,ue,me,n.companyId,n.tenantId,R]),a.useEffect(()=>{He||_e||Ke.current||en.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),a.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Ya({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&re==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ie(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,ie,re,D]);const pn=vt();a.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,N.monthEndCloseChecks]);const gn=u===!0?g:b,Cn=u===!0||E===!0,Sn=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Me.accountSettingsView.saveState.fetchState==="Completed"&&h(It())},[et,Me.accountSettingsView.saveState.fetchState,It]);const{transactionId:ct,onSaveVendor:fn,onSaveSuccess:In,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:Y})=>{const M=ce();let F,he,X;const Pe=vt(),q=c.transactionView;let Q=()=>{};const{transactions:vn,selectedTransactionId:se,selectedTransactionLineId:be,transactionLocalData:yn}=q;if(Y==="transaction_categorization"){const Oe=yn.find(ee=>ee.transactionId===se),J=vn.find(ee=>ee.id===se),it=be!=null?Oe?.transactionReviewLocalData?.lineItemById[be]:void 0,lt=it?.account;he=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const bn=Ao(se,J?.typeOfTransaction);J!=null&&bn&&(X={id:se,type:Je(J.typeOfTransaction)}),Q=()=>{if(se!=null&&be!=null&&J!=null){const ee=q.transactionLocalData.find(Ae=>Ae.transactionId===se)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const Ae=ee.lineItemById[be];let je=ee.selectedEntity;if(qn(J)||(je=Ae.selectedEntityLine),je!=null){const An=je,Tn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(wn=>wn.id)??[]};M(Ne(An,Ae.amount.amount,Tn,!1,!0,Pe))}}}}}const Pn=U(Oe=>dt(Oe,void 0,F,he));return{transactionId:X,onSaveVendor:()=>{M(Gn(X,void 0,!1,!0))},onSaveSuccess:Q,onCancel:()=>{X!=null&&M(Ln({transactionId:X})),M(zn()),M($n()),j()},vendorViewDetails:Pn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Kt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(Eo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(wo,{isOpen:k,drawerLeftMargin:new vo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Oo,{onClick:c=>c.stopPropagation(),children:C.jsx(Uo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&O&&C.jsx(Po,{isOpen:O,transactionId:ct,onSaveVendor:fn,onSaveSuccess:In,onCancel:kn,vendorViewDetails:En}),C.jsx(Vo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:le,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:P,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:H,isAccountingClassesEnabled:sn,isCOTEnabled:pn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&V!=null?C.jsx(yo,{activityLogView:an,qboId:oe,onClose:()=>$(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:on,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Yt,trackExpenseAutomationTabAnalytics:K,setActivityLogTransactionId:$,closeSidePanel:Sn,openTransactionPanel:i,sidePanelIsOpen:Cn,sidePanelIsFullView:u!==!0&&I,panelContent:gn,isAiCfoAccessEnabled:A,onAskAiCfoClick:fe,isExpenseAutomationCommentingEnabled:Ht,onExpenseAutomationCommentingThreadClick:Wt,sidePanelListPercent:u===!0?66:void 0})]})})),Oo=Fe(Rn)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
25
- `;function rs(){return C.jsxs(Un,{children:[C.jsx(Le,{path:"*",element:C.jsx(xo,{})}),C.jsx(Le,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Vo,{})}),C.jsx(Le,{path:"*",element:C.jsx(xn,{})})]})}export{rs as default};
25
+ `;function rs(){return C.jsxs(Un,{children:[C.jsx(Le,{path:"*",element:C.jsx(xo,{})}),C.jsx(Le,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Mo,{})}),C.jsx(Le,{path:"*",element:C.jsx(xn,{})})]})}export{rs as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-C6NDyiJv.js";import{a as r}from"./sentry-DorFMwQU.js";import{_ as i,$ as f,a0 as l,q as p}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import m from"./NotFoundScreen-Du1hgJnA.js";import{j as u,u as b}from"./core-DrFqYlht.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="96d23c27-0578-4d73-aa34-ffc8c19889b7",e._sentryDebugIdIdentifier="sentry-dbid-96d23c27-0578-4d73-aa34-ffc8c19889b7")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(f,{menuItem:l(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
@@ -0,0 +1 @@
1
+ import{a as r}from"./sentry-DorFMwQU.js";import{h as l,j as f,u as m}from"./core-DrFqYlht.js";import{gt as p,Ja as g,Jb as b}from"./zeni-epic-state-vpQnS6PI.js";import{u as _,L as h,z as y}from"./index-gIHwUZJz.js";import"./liveblocks-C6NDyiJv.js";import"./recharts-DzFRpM3n.js";import"./mui-BfKuxuES.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="768ad7e3-0477-4b5f-8592-ca18cc93b2ab",e._sentryDebugIdIdentifier="sentry-dbid-768ad7e3-0477-4b5f-8592-ca18cc93b2ab")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=_(),a=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(a.current)return;a.current=!0;const s=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),s!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:s,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-uYqCzel8.js";import{Jq as k,Jr as v,Js as T,zv as z,zh as G,Jt as B,Ju as oe,Jv as se,zl as ie,eR as $,zs as le,zp as re}from"./zeni-epic-state-BmAPZlsC.js";import{Z as g,o as r,j as de,d as j,h as J,k as ce,p as me,n as pe,q as M,y as ue,S as he,r as xe,s as ge,m as fe,w as we,x as be,A as Se,B as ye,C as ke,E as ve,G as je,H as $e}from"./index-DojfCsv7.js";import{n as m}from"./mui-CTbUXhla.js";import f from"./NotFoundScreen-t1ueGvDG.js";import{a as I}from"./sentry-131ydzJg.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="a505e988-bc42-426b-8e37-2cb14433fdf0",e._sentryDebugIdIdentifier="sentry-dbid-a505e988-bc42-426b-8e37-2cb14433fdf0")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-C6NDyiJv.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-DrFqYlht.js";import{J3 as k,J4 as v,J5 as T,z8 as B,yW as G,J6 as D,J7 as oe,J8 as ie,y_ as se,eP as $,z5 as le,z2 as re}from"./zeni-epic-state-vpQnS6PI.js";import{Z as g,o as r,n as de,c as j,f as J,p as ce,q as me,F as pe,r as M,y as ue,S as he,N as xe,w as ge,m as fe,x as we,B as be,A as Se,i as ye,C as ke,E as ve,G as je,H as $e}from"./index-gIHwUZJz.js";import{n as m}from"./mui-BfKuxuES.js";import f from"./NotFoundScreen-Du1hgJnA.js";import{a as I}from"./sentry-DorFMwQU.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="51c37753-935c-457b-8d2b-c795df1940a9",e._sentryDebugIdIdentifier="sentry-dbid-51c37753-935c-457b-8d2b-c795df1940a9")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -7,7 +7,7 @@ import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
9
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(z(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(de);function F(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const ze=m.div`
10
+ `,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(T({data:l}))}}})(de);function F(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
11
11
  display: flex;
12
12
  height: 100vh;
13
13
  width: 100%;
@@ -16,7 +16,7 @@ import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,
16
16
  align-items: center;
17
17
  background-color: ${e=>e.theme.colors.grey4};
18
18
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,Be=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:B(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Ae();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=Pe(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function De({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(ze,{windowSize:o,children:t.jsx(Be,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const Ae=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
19
+ `,De=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:D(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,i=()=>{const l=me(o.state?.pathnameStackToGoBack),s=l.poppedPathname??ze();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Pe(l);e(oe({addressToCreate:s})),i()},onCancel:()=>{i()}}})(ce);function Ae({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(De,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const ze=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Ne=m.div`
20
20
  display: flex;
21
21
  height: 100%;
22
22
  width: 100%;
@@ -25,7 +25,7 @@ import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
27
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(z(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(T({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
28
+ `,Le=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=g(),{vendorId:o,billId:i}=S();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ne,{windowSize:n,children:t.jsx(Le,{location:a,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -34,7 +34,7 @@ import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
36
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Te=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(z(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},Me=m(ke)`
37
+ `,Te=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(ie({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),a=y(),n=g(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Je={containerWidth:new je(100,58)},Me=m(ke)`
38
38
  width: ${r.sp4};
39
39
  height: ${r.sp4};
40
40
  margin-bottom: ${r.sp3};
@@ -58,7 +58,7 @@ import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,
58
58
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
59
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
60
  padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,_e=m.div`
61
+ `,We=m.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
@@ -69,4 +69,4 @@ import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,Ke=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),d=i.get("token"),H=n.pathname.includes("address"),w=g(),V=ge(),D=fe(),b=we(),_=()=>{V.toggle()},K=E(u=>k(u)),W=E(u=>v(u)),{authParams:q,fetchState:c,billAttachment:U,billFetchState:A,companyName:R,currencySymbol:O,amount:Q}=K,{tenantId:P,userId:L,sessionId:N}=q,{fetchState:Z,internationalBankAccountCreateStatus:X}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&a(le(s,o,d))},[b,c,s,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(L,N,P),l!=null&&a(re(l)))},[c,b,L,N,P,l,a]),c==="Error"?t.jsx(f,{}):Z==="Completed"||X.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${D.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&A==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",s??"",R,l??"",We(n.pathname),O,Q))(u)}),t.jsxs(He,{windowSize:w,children:[w!=="small"?t.jsx(Me,{onClick:_}):null,t.jsx(_e,{windowSize:w,isAddressPage:H,children:A==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(Ke,{file:U,type:"bill"})}),t.jsx(Ve,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function qe(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(qe,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(De,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
72
+ `,_e=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),d=s.get("token"),H=n.pathname.includes("address"),w=g(),V=ge(),A=fe(),b=we(),W=()=>{V.toggle()},_=E(u=>k(u)),K=E(u=>v(u)),{authParams:U,fetchState:c,billAttachment:q,billFetchState:z,companyName:O,currencySymbol:Q,amount:R}=_,{tenantId:P,userId:N,sessionId:L}=U,{fetchState:Z,internationalBankAccountCreateStatus:X}=K;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(le(i,o,d))},[b,c,i,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(N,L,P),l!=null&&a(re(l)))},[c,b,N,L,P,l,a]),c==="Error"?t.jsx(f,{}):Z==="Completed"||X.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&z==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",i??"",O,l??"",Ke(n.pathname),Q,R))(u)}),t.jsxs(He,{windowSize:w,children:[w!=="small"?t.jsx(Me,{onClick:W}):null,t.jsx(We,{windowSize:w,isAddressPage:H,children:z==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(_e,{file:q,type:"bill"})}),t.jsx(Ve,{windowSize:w,children:e})]})]})}const Ke=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Ue,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Ae,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-C6NDyiJv.js";import{a as g}from"./sentry-DorFMwQU.js";import{h as O,u as _,j as w,q as P,g as l,N as T}from"./core-DrFqYlht.js";import{z as r,m as M,D as V,d as A,c as N,e as R,h as W,i as $,g as q}from"./index-gIHwUZJz.js";import{eO as H,IQ as J,I_ as Q,IR as B,eP as G,fi as K,IW as X,fH as Y,cT as Z,I$ as ee,J0 as te}from"./zeni-epic-state-vpQnS6PI.js";import{n as ne}from"./mui-BfKuxuES.js";import{u as se}from"./useDeviceId-B51M4N2b.js";import{f as ae}from"./analyticsHelper-CM7-DzIH.js";import{t as ie}from"./getLocaleForTenant-CtOQ1QSt.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="b2a57564-5a74-475b-b65f-64b43d24c73f",t._sentryDebugIdIdentifier="sentry-dbid-b2a57564-5a74-475b-b65f-64b43d24c73f")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=P(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>H(e)),b=l(e=>J(e)),E=r.getSignedInUser(),v=M().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Q(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(b.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=q();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx($,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{De as default};
@@ -1 +1 @@
1
- import{j as P}from"./liveblocks-CfCKAQeM.js";import{a as c}from"./sentry-131ydzJg.js";import{h as be,g as s,l as We,u as Ke,j as ea,i as M}from"./core-uYqCzel8.js";import{eQ as he,eX as aa,eY as Se,eS as ta,bn as na,f5 as sa,eZ as oa,e_ as ia,f0 as ra,f3 as da,fd as la,f4 as g,f7 as ca,f8 as ue,fb as ua,f9 as fa,fa as ma,fc as pa,cJ as ba,ff as ha,cP as Sa,bv as ga,eP as Ea,fk as ka,fl as Ca,fj as ya}from"./zeni-epic-state-BmAPZlsC.js";import{a3 as Ia,a4 as Ta,s as _a,y as wa,z as k,Z as Aa,a5 as Fa,T as Da,w as va,u as $a,S as r,a6 as Ba,a7 as Ga,c as xa,a as Ma,a8 as Ra,_ as Na,a9 as Pa,aa as Ua,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,d as R,q as w,X as ja,af as N,ag as La}from"./index-DojfCsv7.js";import{D as za}from"./mui-CTbUXhla.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="65ad767b-4464-4f77-a3c2-140ea5ad2664",m._sentryDebugIdIdentifier="sentry-dbid-65ad767b-4464-4f77-a3c2-140ea5ad2664")}catch{}})();const Ya=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=We(),t=Ke(),C=_a(),o=ea(),U=ta(),p=be(),{useFeatureGate:i}=wa(),V=k.getSignedInUser(),A=na(V),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),O=s(e=>sa(e)),j=O.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:_e}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:q}=i(r.isExpenseAutomationEnabledV2),J=q||X&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ge}=i(r.isTreasuryEnabled),{isFeatureEnabled:xe}=i(r.isTaskManagerCustomerUserAccessEnabled),Me=A||!A&&xe,Re=n.company!=null&&la(n.company),_=Ge&&Re,Ne=s(e=>g(e).totalUnreadCount),Pe=s(e=>g(e).reducedFetchCountState),Q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),W=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=Ga();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&U.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Pe,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),J===!1&&S.push("expense_automation_card");const je=xa(),oe=s(e=>fa(e,S,h,q,X,_).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",ze=c.useMemo(()=>pa(n.userRole),[n.userRole]),Ye=ba(ze),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Ma(),Xe=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>_&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[_,de,le,t.pathname,a]),[qe,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Je=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Qe=Pa(Je);return P.jsx(za,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:P.jsx(Ua,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:_e,isVendorsTabVisible:Ye,isZeniAccountEnabled:Y,isChargeCardEnabled:Te,isTreasuryEnabled:_,treasuryYieldPercentage:Qe,isTreasuryPopupVisible:qe,isNotificationsTabVisible:He,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:J&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=Q===0&&W>0?"notifications/comments":"notifications/tasks";me(t)&&(e=Q===0&&W>0?"../../notifications/comments":"../../notifications/tasks");const u=w(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=w(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=w(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Xe,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Me,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),Wa=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return P.jsx(Ya,{...m,...t})};export{Wa as M};
1
+ import{j as G}from"./liveblocks-C6NDyiJv.js";import{a as c}from"./sentry-DorFMwQU.js";import{h as be,g as s,l as Je,u as Ke,j as ea,i as P}from"./core-DrFqYlht.js";import{eO as he,eV as aa,eW as Se,eQ as ta,bn as na,f3 as sa,eX as oa,eY as ia,e_ as ra,f1 as da,fb as la,f2 as g,f5 as ca,f6 as ue,f9 as ua,f7 as fa,f8 as ma,fa as pa,cI as ba,fd as ha,cO as Sa,bv as ga,eN as Ea,fi as ka,fj as Ca,fh as ya}from"./zeni-epic-state-vpQnS6PI.js";import{a3 as Ia,a4 as Ta,w as _a,y as wa,z as k,Z as Aa,a5 as Fa,U as Da,x as va,u as $a,S as r,a6 as Ba,a7 as xa,k as Ma,a as Pa,a8 as Ra,_ as Na,a9 as Ga,aa as Ua,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,c as R,r as w,X as ja,af as N,ag as La}from"./index-gIHwUZJz.js";import{D as za}from"./mui-BfKuxuES.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="1001afa4-8e93-4a79-94c8-202fc6d34790",m._sentryDebugIdIdentifier="sentry-dbid-1001afa4-8e93-4a79-94c8-202fc6d34790")}catch{}})();const Ya=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Je(),t=Ke(),C=_a(),o=ea(),U=ta(),p=be(),{useFeatureGate:i}=wa(),V=k.getSignedInUser(),A=na(V),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),O=s(e=>sa(e)),j=O.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:_e}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),Q=X||W&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:xe}=i(r.isTreasuryEnabled),{isFeatureEnabled:Me}=i(r.isTaskManagerCustomerUserAccessEnabled),Pe=A||!A&&Me,Re=n.company!=null&&la(n.company),_=xe&&Re,Ne=s(e=>g(e).totalUnreadCount),Ge=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=xa();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&U.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Ge,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const je=Ma(),oe=s(e=>fa(e,S,h,X,W,_).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",ze=c.useMemo(()=>pa(n.userRole),[n.userRole]),Ye=ba(ze),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Pa(),We=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=c.useCallback(()=>_&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[_,de,le,t.pathname,a]),[Xe,ce]=c.useState(x);c.useEffect(()=>{ce(x())},[x]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Ga(Qe);return G.jsx(za,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:G.jsx(Ua,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:_e,isVendorsTabVisible:Ye,isZeniAccountEnabled:Y,isChargeCardEnabled:Te,isTreasuryEnabled:_,treasuryYieldPercentage:qe,isTreasuryPopupVisible:Xe,isNotificationsTabVisible:He,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:Q&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=w(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=w(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=w(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const M=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Pe,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),Ja=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return G.jsx(Ya,{...m,...t})};export{Ja as M};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-C6NDyiJv.js";import{j as i,k as n}from"./core-DrFqYlht.js";import{Q as e}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import"./sentry-DorFMwQU.js";import"./zeni-epic-state-vpQnS6PI.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="38433470-5748-45c8-9d22-f3cba6aaf7d5",o._sentryDebugIdIdentifier="sentry-dbid-38433470-5748-45c8-9d22-f3cba6aaf7d5")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(e);function h(){const o=i();return r.jsx(a,{navigate:o})}export{h as default};
@@ -0,0 +1 @@
1
+ import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-C6NDyiJv.js";import lt from"./NotFoundScreen-Du1hgJnA.js";import{a as k}from"./sentry-DorFMwQU.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-DrFqYlht.js";import{cq as St,eX as Q,eO as H,fa as bt,f2 as b,Pj as K,f6 as d,eW as y,qA as $,vV as It,Pk as Ct,eV as Tt,fd as yt,qF as At,Pl as F,bq as M,gM as w,qJ as O,Pm as Et,cB as _t,cv as Nt}from"./zeni-epic-state-vpQnS6PI.js";import{V as Bt,z as xt,y as wt,S as Pt,ct as vt,r as N,a3 as Rt,cu as Dt,a4 as Ut,q as Gt}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as Mt}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="a6923adf-a87f-4136-824e-ee3d47ca64dc",t._sentryDebugIdIdentifier="sentry-dbid-a6923adf-a87f-4136-824e-ee3d47ca64dc")}catch{}})();const $t=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(O("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),$t(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Rt(Dt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Mt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),v=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:J,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{U&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&x!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(J||L===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,J,C,L,W,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];v==="all"?E.push("read","unread"):v!=="mentions"&&E.push(v),s($("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
@@ -0,0 +1 @@
1
+ import{j as m}from"./liveblocks-C6NDyiJv.js";import{a as r}from"./sentry-DorFMwQU.js";import{h as A,u as C,g as o,N as J}from"./core-DrFqYlht.js";import{Jd as P,eO as j,f1 as x,Je as z,Jf as D,Jg as M,Jh as R,mv as k,I9 as L}from"./zeni-epic-state-vpQnS6PI.js";import{z as h,K as I}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="93d9e189-d114-4351-a497-7cdbbe6cf3b0",n._sentryDebugIdIdentifier="sentry-dbid-93d9e189-d114-4351-a497-7cdbbe6cf3b0")}catch{}})();function ee(){const n=A(),s=C(),{params:t,error:i}=r.useMemo(()=>P(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o(e=>j(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),b=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(J,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-C6NDyiJv.js";import{j as V,h as z,u as Z,l as H,g as d,k as K,n as Q,o as I}from"./core-DrFqYlht.js";import{eO as R,qo as U,pY as X,JM as v,pT as C,bv as ee,bn as ae,bS as te,pU as se,JN as oe,Jy as S,dC as re,tS as ne,JO as ie,ud as ce,eU as le,eS as de}from"./zeni-epic-state-vpQnS6PI.js";import{z as me,V as fe,k as pe,y as M,S as w,A as ue,c as $,al as he,r as ge}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import Fe from"./NotFoundScreen-Du1hgJnA.js";import{F as be}from"./FeaturePreviewScreen-CUAIKz1i.js";import{a as g}from"./sentry-DorFMwQU.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{u as Ce}from"./useInitialThreadRequest-C8hN7EcF.js";import{t as ye}from"./routePaths-DwqXZ9IC.js";import{M as Te}from"./MobileAppDrawer-DSdJwfd5.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="938486c2-3e02-4aa4-8299-b9f418694158",s._sentryDebugIdIdentifier="sentry-dbid-938486c2-3e02-4aa4-8299-b9f418694158")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(C(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=ye(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function P(){const s=V(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),T=d(t=>R(t)),N=T.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Se({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,O)=>L!=null?f.forecasts.findIndex(b=>b.id===L):O!=null?f.forecasts.findIndex(b=>b.id===O):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(c.forecasts[t].id,t)),y(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&y(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&F&&e(C(c.forecasts[t].id))}},[i,p,e,l,c,m,u,U,C,F]);const D=pe(),W=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:Y}=M(),{isFeatureEnabled:j}=Y(w.isReportsCommentingEnabled),_=Ce(j?T?.companyId:void 0,{clearParams:l&&m}),[G,J]=g.useState(!1),E=t=>{J(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:G,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:q,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:_,onClickMenuIcon:()=>{E(!0)}})]})}function Ve(){const s=d(i=>R(i)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-C6NDyiJv.js";import{JH as te,eO as Y,jA as G,eU as q,eS as ne,H6 as N,Jl as oe,s_ as Ee,JI as X,sO as ke,t7 as Ie,t1 as ie,sS as re,t5 as Pe,t2 as je,JJ as le,uE as Le,JK as Te,fx as ve,JL as J,sX as de,sV as ce,ta as Fe,c1 as Ae}from"./zeni-epic-state-vpQnS6PI.js";import{Z as pe,y as Q,S as E,z as H,a6 as ue,I as me,ah as ge,ai as Oe,G as he,o as O,J as fe,D as Ce,aj as Re,V as Ve,A as Ue,c as be,e as Ze,r as Be,ak as $e,k as Je}from"./index-gIHwUZJz.js";import{D as ye,n as W,S as Se}from"./mui-BfKuxuES.js";import ae from"./NotFoundScreen-Du1hgJnA.js";import{a as r}from"./sentry-DorFMwQU.js";import{h as ee,l as _e,g as m,j as ze,u as Ge,k as He,n as se,o as $}from"./core-DrFqYlht.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{M as Me}from"./MobileAppDrawer-DSdJwfd5.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6fe53476-954b-41b6-92c6-0c2f3aeef133",a._sentryDebugIdIdentifier="sentry-dbid-6fe53476-954b-41b6-92c6-0c2f3aeef133")}catch{}})();const Xe={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>G(e)),{useFeatureGate:f}=Q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=N(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(X()),y()},F=()=>{R===!0?S(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=W(Se)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,we=W(fe.H6Regular)`
6
+ margin-top: ${O.sp7};
7
+ padding-left: ${O.sp8};
8
+ padding-right: ${O.sp8};
9
+ color: ${a=>a.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,De=W(fe.LargeRegularSp)`
12
+ color: ${a=>a.theme.colors.hero};
13
+ padding-left: ${O.sp8};
14
+ padding-right: ${O.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${O.sp4};
17
+ white-space: pre-line;
18
+ `,Ne={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,S]=r.useState(!1),w=m(i=>te(i)),d=m(i=>Y(i)),u=m(i=>G(i)),{useFeatureGate:D}=Q(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=q(f,d),P=ne(d),T=N(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,Z=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(X())},C=()=>{R===!0?S(!0):x()},F={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},B=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),L=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:T,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:Z};return r.useEffect(()=>{w.invitePersonState.fetchState==="Completed"&&(y(),p(X()))},[w.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:z.discardTitle}),descriptionComponent:s.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:F}):null,s.jsx(Re,{...b})]})})},ea=W(Se)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,aa=He(function(a,t){const l=le(a),n=H.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(J({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(J({searchText:o}))}}}})($e);function M({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=Ge(),{areTenantIdsInSync:o}=Ve(),y=H.getSignedInUser(),h=m(e=>Y(e)),{useFeatureGate:p}=Q(),{isFeatureEnabled:R}=p(E.isDebitCardFeatureEnabled),V=m(e=>G(e)),I=!q(R,h)&&V,S=N(h),w=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,T]=r.useState(!1),[v,U]=r.useState("off"),[Z,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:B}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ke({isDataReady:c.fetchState==="Completed"});const j=m(e=>Le(e.classState,e.classListState)),L=m(e=>Te(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(J({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,w,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),T(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(J({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),T(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Ue,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Qe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Ye,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Me,{isAppContentDrawerOpen:Z,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:L,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,K)=>{n(J({sortKey:e,sortOrder:K}))},onRowClick:e=>{const K=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=Be(g.state?.pathnameStackToGoBack,g.pathname);l(K,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:B})]})}function wa(){const a=Je();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(M,{})}),s.jsx($,{path:"new",element:s.jsx(M,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(M,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-C6NDyiJv.js";import E from"./NotFoundScreen-Du1hgJnA.js";import{a as r}from"./sentry-DorFMwQU.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-DrFqYlht.js";import{eO as B,Pn as b,bo as F,bn as N,hg as V,gM as $}from"./zeni-epic-state-vpQnS6PI.js";import{w as q,z as I,cv as G}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as J}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{M as K}from"./MobileAppDrawer-DSdJwfd5.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9124148e-a571-47bf-9507-5c1b791e80bd",e._sentryDebugIdIdentifier="sentry-dbid-9124148e-a571-47bf-9507-5c1b791e80bd")}catch{}})();const L=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),Q=()=>{const e=_(),t=v(),c=q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:u}=M(),f=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{f(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:u,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${u}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-131ydzJg.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-DorFMwQU.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-CfCKAQeM.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-131ydzJg.js";import{L as dt,bT as Tc,eQ as Ac,Jb as Rc,JF as kl,c2 as Tl,fk as Al,fl as Rl}from"./zeni-epic-state-BmAPZlsC.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-BkkIzijx.js";import{r as un}from"./empty-CKinwWZY.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-CNgiyR2K.js";import{r as Gl}from"./index-DeBaxB_L.js";import{r as zl}from"./index-CxWCBC6O.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-uYqCzel8.js";import{u as Kl,z as Pc,L as Wl,O as Jl,Q as Xl,h as Ql,d as tf}from"./index-DojfCsv7.js";import"./mui-CTbUXhla.js";import{d as Pe}from"./decodeURIComponentSafe-DCnYf30M.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="95d33637-4aa8-4244-a205-1ae7d541edd8",t._sentryDebugIdIdentifier="sentry-dbid-95d33637-4aa8-4244-a205-1ae7d541edd8")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-C6NDyiJv.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DorFMwQU.js";import{L as dt,bS as Tc,eO as Ac,IQ as Rc,Ji as kl,c1 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-vpQnS6PI.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-BiDInqYy.js";import{r as un}from"./empty-Btqpa3Dn.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Ni58cQtF.js";import{r as Gl}from"./index-CuGjO8q5.js";import{r as zl}from"./index-BIdZz-Lu.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DrFqYlht.js";import{u as Kl,z as Pc,L as Wl,M as Jl,O as Xl,f as Ql,c as tf}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import{d as Pe}from"./decodeURIComponentSafe-BIE62qI8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="fadc171b-6792-4f49-86ab-6741f3ac973e",t._sentryDebugIdIdentifier="sentry-dbid-fadc171b-6792-4f49-86ab-6741f3ac973e")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4