@zeniai/web-app-ui 5.1.75-dev → 5.1.76-dev

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 (155) hide show
  1. package/dist/assets/AddressRoutes-BwsHnOH8.js +1 -0
  2. package/dist/assets/AddressScreen-CAtyAvAs.js +9 -0
  3. package/dist/assets/AiCfoScreen-D-u3zZeh.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-C9pR0_l1.js +1 -0
  5. package/dist/assets/BillPayRoutes-CmZHJWuj.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-CBwqYBjF.js +9 -0
  7. package/dist/assets/ChargeCardRoutes-BapvAll0.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-DavSJynu.js → CompanyPassportScreen-Bc_61P8x.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-ChtPjyOS.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-DIF1UKGf.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-CHcuZpK3.js +23 -0
  12. package/dist/assets/{DashboardRoutes-Brg8B8gk.js → DashboardRoutes-KKfELT68.js} +4 -4
  13. package/dist/assets/DefaultTenantHome-jBJso_C6.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-BpuUIzPP.js +18 -0
  15. package/dist/assets/DrawerScreen-iltW1aDR.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-BKjoJvHi.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-DyYkiLeH.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-BZoG5bFs.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-BaRTPuiA.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-CqR6QAtm.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-DLVoUEmm.js +12 -0
  22. package/dist/assets/MobileAppDrawer-9x3MntXc.js +1 -0
  23. package/dist/assets/NotFoundScreen-_z9DP-yZ.js +1 -0
  24. package/dist/assets/NotificationRoutes-Djfnd3nr.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-BwhWE0vr.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-CVL93nhx.js +1 -0
  27. package/dist/assets/PeopleRoutes-D3dMO3Oa.js +22 -0
  28. package/dist/assets/PerformanceRoutes-OkJlvpcW.js +1 -0
  29. package/dist/assets/{Preview-DIWTyMQY.js → Preview-C1-82nYG.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DXq_HXCX.js → QBOConnectionScreen-BcBoTeUC.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-DNdLnut4.js → ReferralListScreen-CAfKHWlD.js} +2 -2
  32. package/dist/assets/ReimbursementApprovalRoutes-GMPo499D.js +1 -0
  33. package/dist/assets/ReimbursementApprovalRuleDetailScreen-ilSdM3T_.js +1 -0
  34. package/dist/assets/{ReimbursementRoutes-Bb9JPi0m.js → ReimbursementRoutes-BCzqaCd0.js} +12 -12
  35. package/dist/assets/ReportsRoutes-sECeRqYD.js +1 -0
  36. package/dist/assets/RewardsRoutes-DccykIgv.js +1 -0
  37. package/dist/assets/ScreenRoutes-CX9dtujm.js +2 -0
  38. package/dist/assets/SettingsRoutes-DkiGjvE8.js +57 -0
  39. package/dist/assets/SetupPagesScreen-D5qsyJcA.js +29 -0
  40. package/dist/assets/SignInScreen-BoIMwzOO.js +1 -0
  41. package/dist/assets/SignOutScreen-Paf7hNrb.js +9 -0
  42. package/dist/assets/TaskListScreen-4INm3wUC.js +9 -0
  43. package/dist/assets/TaskRoutes-BqUtiKFz.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-Cbya-6yV.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-DB5lxQrk.js → TransactionDetailScreen-DSbk67SD.js} +2 -2
  46. package/dist/assets/TransactionListRoutes-18Xdo-CX.js +1 -0
  47. package/dist/assets/TreasuryRoutes-BLFuB0DM.js +37 -0
  48. package/dist/assets/{VendorsRoutes-CwYVQ8VQ.js → VendorsRoutes-C7cLMHN4.js} +19 -19
  49. package/dist/assets/WiseConfirmationScreen-CnHMJMAk.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-DEFgshzq.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-CahtqojG.js +9 -0
  52. package/dist/assets/{accountMappingHelper-s2xO6MjH.js → accountMappingHelper-DB6fTWzq.js} +1 -1
  53. package/dist/assets/{analytics-Ba6zmRos.js → analytics-CGnNJ1B3.js} +1 -1
  54. package/dist/assets/{analyticsHelper-Cq2pq-lr.js → analyticsHelper-B3wwzf_V.js} +1 -1
  55. package/dist/assets/{core-D6ttr5iw.js → core-BQch-SEa.js} +2 -2
  56. package/dist/assets/{decodeURIComponentSafe-D0vQ4d1Q.js → decodeURIComponentSafe-BlZKyc9K.js} +1 -1
  57. package/dist/assets/dnd-DtFKtvlf.js +6 -0
  58. package/dist/assets/{empty-B81gHGCB.js → empty-CnUVdn1j.js} +1 -1
  59. package/dist/assets/empty-DBOryUxv.js +1 -0
  60. package/dist/assets/{emptyVideoElement-DNxKi3mL.js → emptyVideoElement-CMOPMd9b.js} +1 -1
  61. package/dist/assets/epic-Cn810zkq.js +2 -0
  62. package/dist/assets/{getLocaleForTenant-O3Y2pcaQ.js → getLocaleForTenant-CQkHA1My.js} +1 -1
  63. package/dist/assets/{index-DL-oj321.js → index-BDydFdLA.js} +1 -1
  64. package/dist/assets/{index-pFVjg2n3.js → index-BJcfizgW.js} +1 -1
  65. package/dist/assets/{index-DK3W-xXd.js → index-BKzmRWFJ.js} +2 -2
  66. package/dist/assets/{index-ilZtTEZn.js → index-C6_U0a3I.js} +40263 -45717
  67. package/dist/assets/{index-CETE-7wR.js → index-C75IsDSW.js} +1 -1
  68. package/dist/assets/{index-DyaqeLYa.js → index-CdbMVgUL.js} +1 -1
  69. package/dist/assets/{empty-0_eSm854.js → index-CjwtZFvv.js} +1 -1
  70. package/dist/assets/index-DZkdTIsz.js +1 -0
  71. package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
  72. package/dist/assets/{lexical-T2nlwAPk.js → lexical-BBRytn_R.js} +1 -1
  73. package/dist/assets/{liveblocks-CS0rfBBF.js → liveblocks-Bi6jUyhM.js} +1 -1
  74. package/dist/assets/{lottie-CZmubsAo.js → lottie-CB8QpQmy.js} +1 -1
  75. package/dist/assets/{mui-vLo47rlo.js → mui-D4v6d6vq.js} +1 -1
  76. package/dist/assets/{pathToGoBack-CkJN8BOO.js → pathToGoBack-iBZHU0oy.js} +1 -1
  77. package/dist/assets/{pdf-CdoB_huE.js → pdf-BNQvW5mJ.js} +3 -3
  78. package/dist/assets/{pdf-lib-RRzqb1kw.js → pdf-lib-BkMwujYN.js} +1 -1
  79. package/dist/assets/{plaid-IKw4XOsd.js → plaid-DWupRB-M.js} +1 -1
  80. package/dist/assets/{pusher-Cj6_igRe.js → pusher-Dkp2Jrxx.js} +1 -1
  81. package/dist/assets/{react-D95yXzXQ.js → react-4loJCMRC.js} +1 -1
  82. package/dist/assets/{react-BkKsXl-3.js → react-BnoWjI1_.js} +1 -1
  83. package/dist/assets/{react-CCfELnN3.js → react-CZ9x9aZs.js} +1 -1
  84. package/dist/assets/{react-BDJBiih3.js → react-CtfVTLhb.js} +1 -1
  85. package/dist/assets/{react-BbjDrfEs.js → react-D6_PfBEK.js} +1 -1
  86. package/dist/assets/{react-CppN-oCz.js → react-DZeesIBx.js} +1 -1
  87. package/dist/assets/{recharts-BDyAk4nR.js → recharts-6oV2OwTy.js} +3 -3
  88. package/dist/assets/{routePaths-C1rKvS5o.js → routePaths-CGRC3p-8.js} +1 -1
  89. package/dist/assets/{sentry-CEfOando.js → sentry-DwScFzsh.js} +1 -1
  90. package/dist/assets/{url-BQNo9gT5.js → url-CA34r-nZ.js} +1 -1
  91. package/dist/assets/{url-C9_bAZjF.js → url-uJs8N0Ig.js} +1 -1
  92. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Btwm3vJo.js +1 -0
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-0ztMF6vl.js +1 -0
  94. package/dist/assets/{useDeviceId-DISstVTH.js → useDeviceId-B2Yksaa2.js} +1 -1
  95. package/dist/assets/useInitialThreadRequest-B5cDCn22.js +1 -0
  96. package/dist/assets/{utils-DKj7mVPA.js → utils-Dwr2wQrV.js} +2 -2
  97. package/dist/assets/{withTransactionSidePanel-DeW-W6do.js → withTransactionSidePanel-D1jVzWuM.js} +4 -4
  98. package/dist/assets/zeni-epic-state-DxVQhBoO.js +13 -0
  99. package/dist/index.html +1 -1
  100. package/package.json +4 -4
  101. package/dist/assets/AddressRoutes-BqX5wkCR.js +0 -1
  102. package/dist/assets/AddressScreen-ScWWmTbP.js +0 -9
  103. package/dist/assets/AiCfoScreen-quWQqhzX.js +0 -22
  104. package/dist/assets/BillPayApprovalRoutes-CQmYX8YN.js +0 -1
  105. package/dist/assets/BillPayRoutes-jZS0wJcj.js +0 -119
  106. package/dist/assets/BusinessVerificationPageScreen-DFgVqXvI.js +0 -9
  107. package/dist/assets/CardsAiCfoScreen-BbBCL2AM.js +0 -14
  108. package/dist/assets/ChargeCardRoutes-BPGek5pB.js +0 -71
  109. package/dist/assets/ConnectionAuthScreen-BbANlW5J.js +0 -11
  110. package/dist/assets/CustomerOnboardingAuthScreen-kiJ2IeW7.js +0 -1
  111. package/dist/assets/CustomerOnboardingRoutes-6ipmFo_1.js +0 -30
  112. package/dist/assets/DefaultTenantHome-B6se2qjz.js +0 -1
  113. package/dist/assets/DomesticWireDetailScreen-jS6brB2p.js +0 -18
  114. package/dist/assets/DrawerScreen-D0g6PABS.js +0 -1
  115. package/dist/assets/EntityDetailRoutes-qim0q068.js +0 -1
  116. package/dist/assets/ExpenseAutomationRoutes-D3rXxAM_.js +0 -25
  117. package/dist/assets/FeaturePreviewScreen-Y7t6ABdh.js +0 -1
  118. package/dist/assets/HubSpotOAuthCallbackScreen-BUpxwCNc.js +0 -1
  119. package/dist/assets/MagicLinkRoutes-5wgvqx65.js +0 -72
  120. package/dist/assets/MagicLinkSignInScreen-CelaLjKf.js +0 -12
  121. package/dist/assets/MobileAppDrawer-Sx7ydj7A.js +0 -1
  122. package/dist/assets/NotFoundScreen-BDl5tn8o.js +0 -1
  123. package/dist/assets/NotificationRoutes-Cdcu8PTz.js +0 -1
  124. package/dist/assets/OAuthConsentScreen-C5pyboC-.js +0 -1
  125. package/dist/assets/PandLWithForecastRoutes-DjwWiUAb.js +0 -1
  126. package/dist/assets/PeopleRoutes-x62_g_WP.js +0 -22
  127. package/dist/assets/PerformanceRoutes-DQciMsYC.js +0 -1
  128. package/dist/assets/ReimbursementApprovalRoutes-BazeprVG.js +0 -1
  129. package/dist/assets/ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js +0 -1
  130. package/dist/assets/ReportsRoutes-DB2v4EPm.js +0 -1
  131. package/dist/assets/RewardsRoutes-ChJyJSHY.js +0 -1
  132. package/dist/assets/ScreenRoutes-8R8Dd2d9.js +0 -2
  133. package/dist/assets/SettingsRoutes-oK_kou4I.js +0 -57
  134. package/dist/assets/SetupPagesScreen-CVKPKeC9.js +0 -29
  135. package/dist/assets/SignInScreen-C7vB3Bra.js +0 -1
  136. package/dist/assets/SignOutScreen-CQYa9Dvp.js +0 -9
  137. package/dist/assets/TaskListScreen-WRcn05lO.js +0 -9
  138. package/dist/assets/TaskRoutes-DoWinBID.js +0 -9
  139. package/dist/assets/TransactionDetailRoutes-B4ryZwp2.js +0 -1
  140. package/dist/assets/TransactionListRoutes-6SM8gNlu.js +0 -1
  141. package/dist/assets/TreasuryRoutes-DHuVCY9q.js +0 -37
  142. package/dist/assets/WiseConfirmationScreen-DLnf9dkP.js +0 -12
  143. package/dist/assets/ZeniAccountRoutes-u96OM2YN.js +0 -73
  144. package/dist/assets/ZeniAccountStatementScreen-D9UEHLLF.js +0 -9
  145. package/dist/assets/dnd-C751Xq24.js +0 -6
  146. package/dist/assets/epic-BpVO28im.js +0 -2
  147. package/dist/assets/index-lXh6fiHl.js +0 -1
  148. package/dist/assets/index-xNwL9wH4.js +0 -1
  149. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js +0 -1
  150. package/dist/assets/useAskAiCfoHostNavButtonProps-33WX5dhg.js +0 -1
  151. package/dist/assets/useCashManagementBanner-CBJfpbK7.js +0 -1
  152. package/dist/assets/useChargeCardPusherEvents-Cvnaf2Z-.js +0 -1
  153. package/dist/assets/useEmailConnectResultRefresh-BzWsu8a4.js +0 -1
  154. package/dist/assets/useInitialThreadRequest-Bx57kb_d.js +0 -1
  155. package/dist/assets/zeni-epic-state-Cl3jFj7z.js +0 -13
@@ -1,25 +0,0 @@
1
- import{j as h}from"./liveblocks-CS0rfBBF.js";import oa from"./NotFoundScreen-BDl5tn8o.js";import{a as o,b as Jt}from"./sentry-CEfOando.js";import{n as Ue,S as sa}from"./mui-vLo47rlo.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-D6ttr5iw.js";import{eX as Re,T0 as la,ok as ke,fZ as ra,s5 as da,oC as Kt,oX as Zt,T1 as Qt,p5 as ua,T2 as Ht,ov as ma,rD as pa,fJ as Ie,T3 as De,uc as Wt,Ev as Xt,T4 as en,T5 as ha,rb as Ze,Oi as Pt,Ok as ga,kB as Ca,Ol as Sa,kI as fa,c_ as Ia,vp as Qe,oI as tn,pa as Fe,oA as de,T6 as ka,Na as Rt,N9 as we,T7 as Dt,kZ as Ea,T8 as Ta,T9 as ya,Ta as ba,Tb as va,oP as Aa,pd as xe,Tc as wa,Td as xa,Te as Pa,pk as Ra,kM as Da,kD as Fa,Tf as Ua,kL as Ft,Os as Ba,Tg as Oa,Th as _a,r7 as Va,qL as za,pb as me,qK as Ne,Ti as Ma,Tj as La,Tk as ja,mg as $a,bo as qa,mb as Ut,lZ as Ga,Tl as Na,fz as Bt,gy as Ja,m8 as Ya,xi as Ka,Tm as Za,pL as Qa,pG as Ha,pK as Wa,pv as Xa,Tn as eo,fM as nn,o_ as to,oL as no,f_ as Ot,pf as ao,To as oo,Tp as so,pc as an,Tq as co,Tr as io,Ts as lo,Tt as ro,Tu as _t,rj as uo,qC as mo,N8 as po,Tv as ho,Tw as go,kK as Co,Tx as So,Jb as fo,kJ as Io,ky as ko,fL as Eo,q8 as on,qu as To,p9 as Vt,pe as yo,bE as bo,m5 as vo,m2 as Ao,Ty as wo,pu as zt,qq as Mt,qo as xo,Tz as Po,qd as Ro,pV as Do,qr as Fo,TA as Uo,TB as Bo,pZ as Oo,TC as _o,pQ as Vo,pY as zo,pW as Mo,qx as Lo}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as sn,d as X,e as q,s as ae,Y as cn,$ as ln,cZ as jo,z as Be,c_ as $o,at as Pe,c$ as qo,aY as Lt,w as rn,d0 as Go,aq as Je,a as No,a8 as Jo,d1 as Yo,a3 as Ko,d2 as Zo,X as Qo,d3 as Ho,d4 as Wo,S as Xo,I as es,aR as ts,d5 as ns,d6 as as,bd as os,A as ss,aU as cs}from"./index-ilZtTEZn.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{f as jt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-DB5lxQrk.js";import{w as us}from"./withTransactionSidePanel-DeW-W6do.js";import{h as ms,v as ps}from"./routePaths-C1rKvS5o.js";import{g as Ye}from"./accountMappingHelper-s2xO6MjH.js";import{D as hs}from"./DrawerScreen-D0g6PABS.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./decodeURIComponentSafe-D0vQ4d1Q.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]="2dc82eea-decd-4034-a2e3-59b9ebe8846d",t._sentryDebugIdIdentifier="sentry-dbid-2dc82eea-decd-4034-a2e3-59b9ebe8846d")}catch{}})();const gs=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:b}=sn(),{isFeatureEnabled:S}=b(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=b(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,G,ee=!1)=>{t(ke({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(g,f.tenantId,!0)},[E,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),k=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:T}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&T&&E(g,f.tenantId)},[E,g,s.fetchState,f.tenantId,T]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(da(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(Cs,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:k,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},Cs=Ue.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- background-color: ${t=>t.theme.colors.grey4};
8
- `,Ss=Jt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:b})=>{const S=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:E,statementUploadChosen:v}=t,g=u[l],m=g?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{S(pa(e,n.split(".")[0]))},k=e=>{m!=null&&S(ma({accountId:l,selectedPeriod:E,fileId:e,statementUploadId:m}))},T=()=>{S(Qt({statementUploadChosen:!1}))},d=e=>{S(ua({accountId:l,selectedPeriod:E,payload:e}))},G=e=>{S(Ht({accountId:l,selectedPeriod:E,localData:{accountSource:e}}))},ee=o.useCallback(()=>{S(Kt({accountId:l}))},[S,l]),z=o.useCallback(()=>{S(Zt({accountId:l}))},[S,l]),_=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return g!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:g,monthYearPeriod:E,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onEditFileName:P,onDeleteFile:k,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:T,onExcludeFromReconciliation:ee})})}):_!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,qt=Ue.div`
13
- flex: 1;
14
- min-height: 0;
15
- display: flex;
16
- flex-direction: column;
17
- box-sizing: border-box;
18
- min-width: 0;
19
- overflow-x: hidden;
20
- overflow-y: auto;
21
- `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const b=Be.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const S=x(r=>ha(r,t,b));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:ks,comma:Gt,space:Es}},dateFormat:pn}=No.getLocalizedStrings(),Nt=Lo,Ts=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,E={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:g}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:E,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:g,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:b,isUncategorizedExpenseCategoryEnabled:S,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:E,navigate:v,onClickCustomerRequest:g,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:k,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(k),z=Fe(ee.start),_=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(k.month,k.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,y,C)=>{t(_t(e,n,{fetchState:"In-Progress"}));const A=()=>t(_t(e,n,{fetchState:"Error"}));Zo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,C,n,c,i,y).then(O=>{O!=null?t(uo(e,O)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(ke({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?Es+ks+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{_!=null&&z!=null&&t(an({start:z,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Vo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(_o(e))},onConfirmBulkUploadMatch:(e,n,c,i,y)=>{t(Oo(e,n,c,i,y))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),_!=null&&z!=null&&t(me(c,{start:z,end:_},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(S))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:y}=n,C=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),O=Ye(G.accruedExpensesAccountList,y.selectedOptions),R={selectedPrepaidExpensesAccountIds:C.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:O.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:y,scheduleExpenseCategory:C,vendor:A}=n,{allAccountList:O,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,L=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(J=>J.id===A?.selectedOption):void 0,oe={id:L?.zeniId??A?.selectedOption??"",name:L?.name??A?.defaultOptions.find(J=>J.value===A?.selectedOption)?.label??"",logo:L?.logo},se=C?.selectedOption!=null?O.find(J=>J.qboId===C.selectedOption):void 0,Oe=y?.selectedOption!=null?R.find(J=>J.classId===y.selectedOption):void 0,_e=i?.selectedOption!=null?D.find(J=>J.qboId===i.selectedOption):void 0;t(Wa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Oe?.classId,updatedAccumulatedDepreciationCategoryID:_e?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ha(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Qa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Za())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ja())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,y,C,A,O,R,D,L,oe,se)=>{t(ja(e,n,c,i,E,y,C,A,O,R,D,L,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(me(e,{start:z,end:_},!1,!1)),t(La(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:_},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),_!=null&&z!=null&&t(me(e,{start:z,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,y,C,A)=>{_!=null&&z!=null&&t(me(e,{start:z,end:_},!0,c,n,i,y,C,A))},resetTransactionCategorizationLocalData:(e,n,c,i,y,C,A,O)=>{t(za(e,n,c,i,O??null,y,C,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,y)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:E,updatedVendor:y,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(k.month,k.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(k.month,k.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Va(e,n,c,S))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(_a({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&t(Ba({transactionId:O,customerUpdates:C})),t(Oa({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:E,updatedCustomer:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Qe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&(t(Da({transactionId:O,vendorUpdates:{name:C.name,id:C.id?C.id:void 0}})),t(Fa({vendorId:C.id?C.id:void 0,localData:{vendorName:C.name,vendorId:C.id?C.id:void 0}}))),C?.id?(t(Ft({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:E,updatedVendor:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Qe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:O.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(k,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(k,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ht({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Qt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(ba({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ya({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(Ea(i)),t(Ta({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ze("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(ka({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Zt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||T!=="reconciliation"||t(de(k,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...b}=B;return function(S,r,I){return{...S,...r,...I,onUploadTransactionReceipt:(s,p,u,E,v)=>{r.onUploadTransactionReceipt(s,p,u,E,v,S.authParams)}}}(t,l,b)})(Jo(Yo)),ys=us(function(t){const l=t.displayName??t.name??"Component",B=Jt.memo(t),f=b=>{const S=pe(),r=function(){const P=pe(),k=x(T=>Ie(T).reconciliation.selectedDrawerAccountId);return{isOpen:k!=null,selectedAccountId:k,openPanel:o.useCallback(T=>{P(De({selectedDrawerAccountId:T}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,k)=>{S(Wt("expense_automation_reconcile",P,k))},[S]),u=o.useCallback((P,k)=>{const T=s?.companyId;T!=null&&(S(Xt(P,T,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",k)),S(en({accountId:k,connectionInProgress:!0})))},[S,s?.companyId]),E=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Ss,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:E,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[E,r.isOpen,r.closePanel]),g=o.useContext(Lt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:g,[r.isOpen,r.closePanel,r.selectedAccountId,g]);return h.jsx(Lt.Provider,{value:m,children:h.jsx(B,{...b,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:b,reconPanelContent:S,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Qo(),u=Ho(),{isOpen:E}=Wo(),v=Yt(),g=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:k}=dn({mobileExploreReferrer:"Transaction categorization"}),T=o.useCallback(()=>{b===!0&&f!==!0&&t?.()},[t,b,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(N=>Ie(N)),U=Ke(),{currentSelectedViewFetchState:j,currentSelectedView:$,selectedPeriod:w}=a,H=Je($),Y=Je(j.fetchState),Q=o.useCallback(N=>{const W=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,W??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,W??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,W??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,W??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),W??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,W??null)},[w,a]);return o.useEffect(()=>{Y===j.fetchState&&$===H||j.fetchState!=="Completed"||Q(!1)},[$,j.fetchState,H]),Q})(),ee=Xo(),[z,_]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[y,C]=o.useState(!1),[A,O]=o.useState([]),[R,D]=o.useState(null),L=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),T(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[T,s,u,p]),Oe=o.useCallback(a=>{s&&p(!1),u(),T(),D({contentType:"transfer",detail:a})},[T,s,u,p]),_e=o.useCallback(()=>{u(),L(),T(),k()},[T,L,k,u]),J=o.useRef(s);o.useEffect(()=>{s===!0&&J.current===!1&&(u(),L(),T()),J.current=s},[T,L,s,u]);const He=o.useRef(E);o.useEffect(()=>{E===!0&&He.current===!1&&(s&&p(!1),L(),b===!0&&f!==!0&&t?.()),He.current=E},[L,t,E,s,p,f,b]);const Ee=b===!0&&f!==!0,We=o.useRef(Ee);o.useEffect(()=>{Ee&&!We.current&&(s&&p(!1),u(),L()),We.current=Ee},[L,s,Ee,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:gn}=xt(),[Ve,nt]=o.useState(g.state?.message==="comingFromTransactionDetail"),at=g.state?.message==="comingFromOverview",Cn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Sn,useFeatureGate:ce}=sn(),{configValue:fn}=Sn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:kn}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:En}=ce(X.isJEScheduleCOTEnabled),Tn=o.useCallback(a=>{const U=Ze(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),yn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:bn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>go(a.classState)),{monthEndCloseChecksView:Z,currentSelectedView:F,selectedPeriod:V,selectedTransactionCategorizationTab:Le,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:je,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,()=>{const a=[],U=ut.current,j=dt.current,$=j!=null&&U!=null?j[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const Y=H?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const Q of Object.values(Y)){const N=Q?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const H of w)for(const Y of H.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&b!==!0||se(void 0)},[F,se,b]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,Te=`${Le}|${Rn}`,ye=o.useRef(null);o.useEffect(()=>{ye.current!==null?ye.current!==Te&&(ye.current=Te,F==="transaction_categorization"&&L()):ye.current=Te},[L,F,Te]);const Dn=x(a=>oe==null?void 0:Co(a.transactionState,oe)),le=Dn?.qboId,mt=x(a=>le==null?void 0:So(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:gt}=M.transactionView,Ct=o.useCallback(a=>rs(m,a),[m]),St=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:gt,onClose:()=>D(null),onCreateTransfer:Ct,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,gt,Ct]),Fn=St!=null,{selectedAccountId:ge}=xn,ft=Je(je.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>ko(a)),Ce=tt!=null?Eo(tt):F,On=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(V),Se=Fe(It.start),fe=Fe(It.end);if(Se==null||fe==null)throw Error(`Invalid start - ${Se} and end - ${fe} period from given ${V}`);const _n=o.useCallback(()=>{i(!1)},[]),Vn=o.useCallback(()=>{C(!0)},[]),zn=o.useCallback(a=>{O(a),C(!1)},[]),Mn=o.useCallback(()=>{O([])},[]),be=M.missingReceipts.bulkUpload.phase,kt=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&be==="matching"&&kt!=null&&m(on({cacheOverride:!0}))},[he,F,be,kt,m]);const Et=ze?.userId,Ln=V.month,jn=V.year,Tt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&be==="idle"&&Et!=null&&Tt!=null&&m(To())},[F,he,be,Et,Tt,Ln,jn,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{Ce!=null&&F!==Ce&&m(nn(Ce))},[Ce]),o.useEffect(()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Vt(!1,!1,te)))},[Xe,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(Vt(!1,!1,te)),m(de(V,ge,!1,!1)))},[V.month,V.year,d,te]);const yt=o.useCallback((a=!1,U=!1)=>{const j={start:Se,end:fe};switch(F){case"transaction_categorization":m(me(Le,j,a,!Ve,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(V,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(V.year,V.month,0),w=bo($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(yo(j,U));break;case"missing_receipts":m(an(j,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(V,ge,a,U))}},[F,Se,fe,n.companyId,n.tenantId,Le,V,ge,Ve,nt,te]);o.useEffect(()=>{F===Ce&&ie.fetchState==="Not-Started"&&d&&yt(!0)},[ie,Se,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Ve||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,yt(!0,!0))},[]),o.useEffect(()=>{Z.fetchState!=="In-Progress"&&Z.fetchState!=="Completed"&&m(ke({tenantId:n.tenantId,period:V,refreshViewInBackground:!1}))},[Z.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(ke({tenantId:n.tenantId,period:V,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,V,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Z.fetchState!=="In-Progress"&&Z.fetchState==="Completed"&&m(ke({tenantId:n.tenantId,period:V,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Z.fetchState,n.tenantId,V,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&ge==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(V,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,ge,V]);const $n=jt();o.useEffect(()=>{const a=(Z.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Z.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Z.monthEndCloseChecks]);const qn=r===!0?S:B,Gn=r===!0||b===!0,Nn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&je.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,je.accountSettingsView.saveState.fetchState,zt]);const{transactionId:bt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:j,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let H,Y,Q;const N=jt(),W=a.transactionView;let vt=()=>{};const{transactions:Hn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Wn}=W;if(j==="transaction_categorization"){const $e=Wn.find(re=>re.transactionId===ue),K=Hn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(Q={id:ue,type:Ze(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=W.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(Qe({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x($e=>Pt($e,void 0,H,Y));return{transactionId:Q,onSaveVendor:()=>{w(fa(Q,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{Q!=null&&w(ga({transactionId:Q})),w(Ca()),w(Sa()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{_(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Qn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,j)=>{j.onReconciliationPusherEventReceived(a)}};return Cn?.loggedInUserRoleMap==null?Z.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:y,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{C(!1)},children:h.jsx(bs,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>C(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),bt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:bt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}),h.jsx(Ts,{...Qn,navigate:v,location:g,themeState:ee,categoryOptions:bn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:On,entityAutoCompleteView:yn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:kn,isCOTEnabled:$n,isJEScheduleCOTEnabled:En,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:St,onOpenTransferRightPanel:st===!0?Oe:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:Vn,handleEditClick:_n,tenantEmailDomain:gn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:_e,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:Tn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),bs=Ue(sa)`
22
- display: flex;
23
- min-height: 100%;
24
- flex-direction: column;
25
- `;function Ks(){return h.jsxs(ia,{children:[h.jsx(Ge,{path:"*",element:h.jsx(gs,{})}),h.jsx(Ge,{path:"/:selectedTab/:selectedPeriod/*",element:h.jsx(ys,{})}),h.jsx(Ge,{path:"*",element:h.jsx(oa,{})})]})}export{Ks as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as r}from"./sentry-CEfOando.js";import{a4 as f,a5 as c,a6 as l,r as p}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import m from"./NotFoundScreen-BDl5tn8o.js";import{h as b,g as u}from"./core-D6ttr5iw.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="0a21eb7e-92fc-4aae-b32a-082a8d04cb1f",a._sentryDebugIdIdentifier="sentry-dbid-0a21eb7e-92fc-4aae-b32a-082a8d04cb1f")}catch{}})();const _=()=>{const a=b(),e=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=p(e.state?.pathnameStackToGoBack),d=n.poppedPathname??k();a(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(e.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{_ as F};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-CEfOando.js";import{u as f,h as l,g as m}from"./core-D6ttr5iw.js";import{hu as p,Mg as b,Mh as g}from"./zeni-epic-state-Cl3jFj7z.js";import{u as _,L as h,z as y}from"./index-ilZtTEZn.js";import"./liveblocks-CS0rfBBF.js";import"./recharts-BDyAk4nR.js";import"./mui-vLo47rlo.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="439a9e01-1be9-4040-b4fd-6323bf2b5bd7",e._sentryDebugIdIdentifier="sentry-dbid-439a9e01-1be9-4040-b4fd-6323bf2b5bd7")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:c}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,b("revenue"),g("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
@@ -1,72 +0,0 @@
1
- import{j as a}from"./liveblocks-CS0rfBBF.js";import{i as S,n as x,h as C,g as y,u as ee,t as ae,j as E,N as te,o as ne,p}from"./core-D6ttr5iw.js";import{M9 as k,Ma as v,Mb as M,Bd as B,A$ as T,Mc as A,Md as oe,Me as se,B3 as ie,fA as $,Ba as le,B7 as re}from"./zeni-epic-state-Cl3jFj7z.js";import{Z as g,o as r,q as de,e as j,k as G,O as ce,r as me,B as pe,s as K,Q as ue,d as he,E as xe,S as ge,m as fe,v as be,w as we,K as Se,F as ye,x as ke,y as ve,A as je,C as $e}from"./index-ilZtTEZn.js";import{n as m}from"./mui-vLo47rlo.js";import f from"./NotFoundScreen-BDl5tn8o.js";import{a as I}from"./sentry-CEfOando.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="8c1e6b5d-b10a-46fb-a669-fa4e2c08c5a0",e._sentryDebugIdIdentifier="sentry-dbid-8c1e6b5d-b10a-46fb-a669-fa4e2c08c5a0")}catch{}})();const Ie=m.div`
2
- display: flex;
3
- height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,Ce=x(function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(M({data:l}))}}})(de);function F(){const e=g(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const Be=m.div`
11
- display: flex;
12
- height: 100vh;
13
- width: 100%;
14
- flex: 1 1 auto;
15
- flex-direction: column;
16
- align-items: center;
17
- background-color: ${e=>e.theme.colors.grey4};
18
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,Ae=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:A(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function De({isSubPage:e}){const t=C(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx(Be,{windowSize:o,children:a.jsx(Ae,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},ze=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`
20
- display: flex;
21
- height: 100%;
22
- width: 100%;
23
- flex: 1 1 auto;
24
- flex-direction: column;
25
- align-items: center;
26
- background-color: ${e=>e.theme.colors.grey4};
27
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=x(function(e){const t=k(e),n=v(e),o=A(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(M({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=K(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Le,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
29
- display: flex;
30
- height: 100%;
31
- width: 100%;
32
- flex: 1 1 auto;
33
- flex-direction: column;
34
- align-items: center;
35
- background-color: ${e=>e.theme.colors.grey4};
36
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Me=x(function(e){const t=k(e),n=v(e),o=A(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=K(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Te(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(f,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Me,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Ge={containerWidth:new je(100,58)},Ke=m(ke)`
38
- width: ${r.sp4};
39
- height: ${r.sp4};
40
- margin-bottom: ${r.sp3};
41
- margin-top: ${r.sp3};
42
- margin-left: ${r.sp8};
43
- cursor: pointer;
44
- position: absolute;
45
- color: ${e=>e.theme.colors.brandColorJade};
46
- `,Ve=m.div`
47
- display: flex;
48
- height: 100vh;
49
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
- width: 100vw;
51
- overflow-y: scroll;
52
- background-color: ${e=>e.theme.colors.grey4};
53
- `,_e=m.div`
54
- display: flex;
55
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
- flex-direction: column;
57
- width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
58
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
- padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,He=m.div`
62
- display: flex;
63
- flex-direction: column;
64
- align-items: center;
65
- justify-content: center;
66
- padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
- height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
- overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
- width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
- background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
- margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,We=x(function(e,t){return{file:t.file,type:t.type}})(ve);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=ae(),d=i.get("token"),V=n.pathname.includes("address"),b=g(),_=ge(),D=fe(),w=be(),H=()=>{_.toggle()},W=E(u=>k(u)),U=E(u=>v(u)),{authParams:O,fetchState:c,billAttachment:Q,billFetchState:P,companyName:q,currencySymbol:J,amount:R}=W,{tenantId:z,userId:L,sessionId:N}=O,{fetchState:Z,internationalBankAccountCreateStatus:X}=U;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{w&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&t(le(s,o,d))},[w,c,s,o,d,t]),I.useEffect(()=>{w&&c==="Completed"&&($(L,N,z),l!=null&&t(re(l)))},[c,w,L,N,z,l,t]),c==="Error"?a.jsx(f,{}):Z==="Completed"||X.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(we,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${D.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&P==="Completed"&&a.jsx(Se,{analytics:j,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",s??"",q,l??"",Ue(n.pathname),J,R))(u)}),a.jsxs(Ve,{windowSize:b,children:[b!=="small"?a.jsx(Ke,{onClick:H}):null,a.jsx(He,{windowSize:b,isAddressPage:V,children:P==="In-Progress"?a.jsx(ye,{size:"ExtraLarge",start:!0}):a.jsx(We,{file:Q,type:"bill"})}),a.jsx(_e,{windowSize:b,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Oe(){return a.jsx($e,{})}function da(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Oe,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(De,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Te,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{da as default};
@@ -1,12 +0,0 @@
1
- import{j as u}from"./liveblocks-CS0rfBBF.js";import{a as g}from"./sentry-CEfOando.js";import{u as U,g as O,h as _,t as w,j as l,N as T}from"./core-D6ttr5iw.js";import{z as r,m as A,a as P,f as V,e as N,g as W,n as X,F as R,j as Y}from"./index-ilZtTEZn.js";import{eX as $,LW as q,M4 as B,LX as G,fA as H,g1 as J,M0 as K,gp as Q,cY as Z,M5 as ee,M6 as te}from"./zeni-epic-state-Cl3jFj7z.js";import{n as ne}from"./mui-vLo47rlo.js";import{u as se}from"./useDeviceId-DISstVTH.js";import{f as ae}from"./analyticsHelper-Cq2pq-lr.js";import{t as ie}from"./getLocaleForTenant-O3Y2pcaQ.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="6c254972-d90e-494e-9ca3-ca5d500479c3",t._sentryDebugIdIdentifier="sentry-dbid-6c254972-d90e-494e-9ca3-ca5d500479c3")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=U(),a=O(),f=_(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:z,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>$(e)),k=l(e=>q(e)),E=r.getSignedInUser(),v=A().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(G(k.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(J(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Q().then(()=>{const e=Y();e!=null&&V(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,b,s,o,k,v,a.state,t]);const j=g.useCallback(()=>{f("/signin/auth")},[f]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),M=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(X,{phoneNumber:z,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:F,onVerifyOtp:M,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||m==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(R,{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{xe as default};
@@ -1 +0,0 @@
1
- import{j as N}from"./liveblocks-CS0rfBBF.js";import{a as c}from"./sentry-CEfOando.js";import{u as me,j as n,i as Ze,g as qe,h as Ke,l as M}from"./core-D6ttr5iw.js";import{eX as be,fF as Xe,fG as pe,fr as Je,bn as ea,eW as aa,fH as ta,fI as na,fK as sa,fN as oa,fW as ia,fO as g,fQ as ra,fR as le,fU as da,fS as la,fT as ca,fV as ua,cN as fa,fY as ma,cT as ba,fq as pa,g1 as ha,g2 as Sa,g0 as ga}from"./zeni-epic-state-Cl3jFj7z.js";import{a8 as Ea,a9 as ka,S as Ca,Q as ya,z as k,v as Ia,u as Ta,d as r,i as wa,T as Aa,aa as Fa,I as _a,c as Da,ab as va,a4 as $a,ac as Ba,ad as xa,ae as ce,af as ue,L as Ma,ag as Pa,ah as fe,e as P,a0 as Ra,s as A,ai as R,aj as Na}from"./index-ilZtTEZn.js";import{D as Ua}from"./mui-vLo47rlo.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="462687dd-944b-44e3-96e7-1b8a0a6d73c4",f._sentryDebugIdIdentifier="sentry-dbid-462687dd-944b-44e3-96e7-1b8a0a6d73c4")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ze(),a=qe(),C=Ca(),o=Ke(),U=Je(),m=me(),{useFeatureGate:i}=ya(),V=k.getSignedInUser(),G=ea(V),s=n(e=>be(e)),he=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ia(),{setLoading:Se}=Ta(),[F,L]=c.useState(void 0),_=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ee=wa(s,ge,H),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),W=n(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n(e=>na(e));c.useEffect(()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(sa(!0))},[y,T,D.fetchState,I]);const h=k.getSignedInUser(),v=n(e=>e.tenantState),Ce=n(e=>v.fetchState==="Completed"?oa(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),Q=Aa(),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=G||!G&&$e,xe=s.company!=null&&ia(s.company),w=ve&&xe,Me=n(e=>g(e).totalUnreadCount),Pe=n(e=>g(e).reducedFetchCountState),Z=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:X,isFetchingMore:J,hasFetchedAll:ee,fetchMore:Ne}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(X===!1&&J===!1&&ee===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[X,J,ee]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&$.fetchState==="In-Progress"&&(m(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:F},"comments")))},[F,$.fetchState]);const Ue={fetchStatus:Pe,count:Me},ae=t!=null?k.getSignedInUserTenant(t):null,te=n(e=>ae?.tenantId!=null?da(e,ae.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!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 Ve=_a(),ne=n(e=>la(e,S,h,we,Te,w).fetchState),se=n(e=>ca(e).fetchState),Ge=_&&(ne==="Completed"||ne==="Error")||z&&(se==="Completed"||se==="Error")||!_&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(s.userRole),[s.userRole]),je=fa(Oe),Le=s?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&W.fetchState==="Completed"&&ma(W.notificationSettings,h.userEmail,H,s),oe=Da(),Ye=oe&&va(a),ie=ba(Ve?.loggedInUserRoleMap),re=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,B=c.useCallback(()=>w&&ie&&!k.getTreasuryPopupSeen(t??"")&&re===!1&&$a(a.pathname)!=="treasury",[w,ie,re,a.pathname,t]),[He,de]=c.useState(B);c.useEffect(()=>{de(B())},[B]);const We=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Qe=Ba(We);return N.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:N.jsx(xa,{signedInUser:V,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ce:te!=null?[te]:[],currentTenant:s,isTenantDropdownDisabled:Ge,isSettings:ue(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ee,isTreasuryEnabled:w,treasuryYieldPercentage:Qe,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:Q,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:oe,onNotificationIconClick:()=>{d(!1);let e=Z===0&&q>0?"notifications/comments":"notifications/tasks";ue(a)&&(e=Z===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(P.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!he)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&P.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);fe(e.type)?(j!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Se(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=ce(a);let b=`/${encodeURIComponent(u)}/`;const x=R(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":fe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;P.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),de(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:O,isOnDashboard:_,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:_e,newYearAnimationEnabled:De})})}),Ha=f=>{const d=me(),t=n(C=>be(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Xe(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...a})};export{Ha as M};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-CS0rfBBF.js";import{h as r,n}from"./core-D6ttr5iw.js";import{N as i}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import"./sentry-CEfOando.js";import"./zeni-epic-state-Cl3jFj7z.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="0d8bbeee-ef94-478e-b36a-0f30a9be8cda",e._sentryDebugIdIdentifier="sentry-dbid-0d8bbeee-ef94-478e-b36a-0f30a9be8cda")}catch{}})();const a=n(null,function(e,o){return{onGoBack:()=>{o.navigate(-1)},onGoHome:()=>{o.navigate("/")}}})(i);function _(){const e=r();return t.jsx(a,{navigate:e})}export{_ as default};
@@ -1 +0,0 @@
1
- import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-CS0rfBBF.js";import lt from"./NotFoundScreen-BDl5tn8o.js";import{a as k}from"./sentry-CEfOando.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as O}from"./core-D6ttr5iw.js";import{cu as St,fH as q,eX as H,fV as bt,fO as b,SX as Z,fR as d,fG as y,sp as M,xV as It,SY as Ct,fF as Tt,fY as yt,su as _t,SZ as F,bo as $,fz as w,sy as Q,S_ as At,cG as Et,cz as Nt}from"./zeni-epic-state-Cl3jFj7z.js";import{Y as xt,z as Bt,Q as wt,d as Rt,$ as Gt,cW as Dt,s as N,a8 as vt,cX as Ut,a9 as Pt,r as Ft}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="00663832-b3e9-4b2a-be9f-86c6029c2dc3",t._sentryDebugIdIdentifier="sentry-dbid-00663832-b3e9-4b2a-be9f-86c6029c2dc3")}catch{}})();const Mt=(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:x,fetchMoreCommentsNotifications:R}=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(Q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(x(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(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(Z(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Q("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(x(r),t(F([r],$())))})).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(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t(F(s,$())),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=Ft(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}})}}})(vt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,R]=k.useState(!1),a=S(e=>q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Gt({isDataReady:!0});const J=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),G=S(e=>b(e).currentSubTab),K=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=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=Dt().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:z,isLoading:W,fetchMore:Y,isFetchingMore:L,hasFetchedAll:X}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Z(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{K.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=_||v===!0||C!==!0||_||v===!0||C!==!0;k.useEffect(()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&B!=null&&z!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=z.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||X===!0||Y==null||Y(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,v,L,C,X,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];G==="all"?A.push("read","unread"):G!=="mentions"&&A.push(G),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:J,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(O,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(O,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-CS0rfBBF.js";import{a as r}from"./sentry-CEfOando.js";import{u as T,g as j,j as o,N as A}from"./core-D6ttr5iw.js";import{Mj as C,eX as P,fN as x,Mk as z,Ml as D,Mm as L,Mn as N,oa as R,Lg as k}from"./zeni-epic-state-Cl3jFj7z.js";import{z as h,H as I}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="6e11cd88-9e81-4872-9d88-d2356ab615cb",n._sentryDebugIdIdentifier="sentry-dbid-6e11cd88-9e81-4872-9d88-d2356ab615cb")}catch{}})();function ee(){const n=T(),s=j(),{params:t,error:i}=r.useMemo(()=>C(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(),m=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),c=o(L),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(N())},[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(R(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const M=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(U=>U.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),u=v??M;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(k(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.")}}}):f.jsx(A,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-CS0rfBBF.js";import{h as z,u as K,g as Q,i as J,j as d,n as X,o as Z,p as I}from"./core-D6ttr5iw.js";import{eX as O,sd as M,rN as H,MQ as U,rI as S,bs as ee,bn as ae,bY as te,rJ as se,MR as oe,MD as C,dK as re,vS as ne,MS as ce,wd as ie,fE as le,fC as de}from"./zeni-epic-state-Cl3jFj7z.js";import{z as me,Y as fe,$ as pe,I as ue,Q as v,d as $,K as he,e as w,ao as be,s as ge}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import Fe from"./NotFoundScreen-BDl5tn8o.js";import{F as Ie}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as b}from"./sentry-CEfOando.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{u as Se}from"./useInitialThreadRequest-Bx57kb_d.js";import{t as Te}from"./routePaths-C1rKvS5o.js";import{M as ye}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52",s._sentryDebugIdIdentifier="sentry-dbid-0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52")}catch{}})();const T=(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=X(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:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(U(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({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,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(be);function P(){const s=z(),e=K(),a=Q(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),N=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>M(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:W}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(H());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex(F=>F.id===L):R!=null?f.forecasts.findIndex(F=>F.id===R):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(U(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&g&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,m,u,M,S,g]);const x=ue(),Y=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=v(),{isFeatureEnabled:E}=_($.isReportsCommentingEnabled),q=Se(E?y?.companyId:void 0,{clearParams:l&&m}),[G,V]=b.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:B,onAskAiCfoClick:W,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:q,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>O(c)),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Z,{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};
@@ -1,22 +0,0 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import{MM as te,eX as Y,ky as z,fE as q,fC as ne,Ke as Q,Mq as oe,uP as Ee,MN as N,uE as ke,uZ as Ie,uT as ie,uI as re,uX as Pe,uU as je,MO as le,wE as Le,fo as Te,gf as ve,MP as M,uM as de,uL as ce,v0 as Fe,c6 as Ae}from"./zeni-epic-state-Cl3jFj7z.js";import{Z as pe,Q as J,d as E,z as G,i as ue,D as me,ak as ge,al as Oe,A as he,o as O,G as fe,a as Ce,am as Re,Y as Ve,$ as Ue,K as Ze,e as be,g as Be,s as $e,an as Me,I as Ke}from"./index-ilZtTEZn.js";import{D as ye,n as H,S as we}from"./mui-vLo47rlo.js";import ae from"./NotFoundScreen-BDl5tn8o.js";import{a as r}from"./sentry-CEfOando.js";import{u as ee,i as _e,j as m,h as ze,g as Ge,n as He,o as se,p as $}from"./core-D6ttr5iw.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as Xe}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="d618ae18-9dec-4b80-8081-905200718551",a._sentryDebugIdIdentifier="sentry-dbid-d618ae18-9dec-4b80-8081-905200718551")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},K=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,w]=r.useState(!1),{userId:S}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>z(e)),{useFeatureGate:f}=J(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=Q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{R===!0?w(!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:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.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:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=H(we)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,Se=H(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=H(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
- `,Qe={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({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,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>Y(i)),u=m(i=>z(i)),{useFeatureGate:D}=J(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=q(f,d),P=ne(d),T=Q(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,Z=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{R===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!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:S,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(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Qe.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(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:F}):null,s.jsx(Re,{...b})]})})},ea=H(we)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,aa=He(function(a,t){const l=le(a),n=G.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:z(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(M({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(M({searchText:o}))}}}})(Me);function X({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=Ge(),{areTenantIdsInSync:o}=Ve(),y=G.getSignedInUser(),h=m(e=>Y(e)),{useFeatureGate:p}=J(),{isFeatureEnabled:R}=p(E.isDebitCardFeatureEnabled),V=m(e=>z(e)),I=!q(R,h)&&V,w=Q(h),S=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));Ue({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(M({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,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(M({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),T(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Ze,{analytics:be,onLoad:e=>e.trackPageLoaded(Be.Event.members)}):null,f===!0?s.jsx(Je,{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(Xe,{isAppContentDrawerOpen:Z,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:L,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(M({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:B})]})}function wa(){const a=Ke();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(X,{})}),s.jsx($,{path:"new",element:s.jsx(X,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(X,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import E from"./NotFoundScreen-BDl5tn8o.js";import{a as r}from"./sentry-CEfOando.js";import{h as _,g as v,j as p,i as M,u as U,N as z,n as P,o as $,p as h}from"./core-D6ttr5iw.js";import{eX as B,S$ as b,bq as F,bn as N,ig as O,fz as V}from"./zeni-epic-state-Cl3jFj7z.js";import{S as q,z as I,$ as X,cY as Y}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as H}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="fe2800c8-046d-4d7e-9bcb-fe976171a445",e._sentryDebugIdIdentifier="sentry-dbid-fe2800c8-046d-4d7e-9bcb-fe976171a445")}catch{}})();const J=P(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)}}})(Y),K=()=>{const e=_(),t=v(),c=q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback((a,i,T)=>{u(O({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(V({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return X({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs($,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-CS0rfBBF.js";import _ from"./NotFoundScreen-BDl5tn8o.js";import{a as p}from"./sentry-CEfOando.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as O,p as b}from"./core-D6ttr5iw.js";import{eX as I,Qg as g,Qw as S,FD as V,EM as U,FC as d,Ft as $,QK as B,FF as W}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,a8 as L,b_ as Q,af as T,bD as K,b$ as z}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as M,R as A}from"./ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="f2e90a39-cb30-4858-8382-0bbe66f676d6",e._sentryDebugIdIdentifier="sentry-dbid-f2e90a39-cb30-4858-8382-0bbe66f676d6")}catch{}})();const y="reimbursement-approval-rule-update",X=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(L(Q)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,F,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=k(function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}})(L(z)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a));M();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,F,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
@@ -1 +0,0 @@
1
- import{j as h}from"./liveblocks-CS0rfBBF.js";import{a as f}from"./sentry-CEfOando.js";import{u as T,j as y,h as _,g as O,i as k,n as F}from"./core-D6ttr5iw.js";import{k_ as L,Qw as E,Qg as x,Fw as V,FI as B,FD as A,FE as w,Qx as j,eX as z,FC as K}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,m as P,w as Q,bQ as W,af as $,bD as X,bR as G}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="7769a24f-1b33-4b45-a314-f08c889a339a",e._sentryDebugIdIdentifier="sentry-dbid-7769a24f-1b33-4b45-a314-f08c889a339a")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=y(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=y(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const J=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const b=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const g=(S=m.value,j(S)==null);var S;return{type:g?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),c=I.concat(R);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),b},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(W);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(g=>{const S=g.actorKind?.selectedOption,C=g.selectedRole?.selectedOption;let D=[];S==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const U=g.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=b?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=y(t=>z(t)),{isApprovalRulesV3Enabled:s}=X(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(M,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1 +0,0 @@
1
- import{j as p}from"./liveblocks-CS0rfBBF.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as H}from"./core-D6ttr5iw.js";import{eX as v,fT as w,Mp as Te,ky as Z,qS as X,rH as A,km as Re,jq as Me,vc as J,rM as Oe,bs as Ae,Mq as Fe,bn as ke,wl as De,Mr as Ee,Ms as je,v4 as Pe,Mt as Y,Mu as ve,Mv as Le,Mw as Be,Mx as Ve,My as I,Mz as F,MA as k,MB as q,MC as D,MD as E,dK as Ue,w1 as xe,vR as N,vS as $,w7 as ze,vW as K,wd as Ge,ME as He,MF as Ye,MG as qe,MH as Ne,MI as $e,fE as Ke,fC as Qe}from"./zeni-epic-state-Cl3jFj7z.js";import{R as We,V as Ze,W as Xe,X as Je,Z as ea,Q as ee,d as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,K as ra,e as P,g as ia,a0 as la,s as se,a1 as ca,a2 as da,a3 as pa}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import fa from"./NotFoundScreen-BDl5tn8o.js";import{F as ma}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as _}from"./sentry-CEfOando.js";import{u as ua}from"./useInitialThreadRequest-Bx57kb_d.js";import{t as Q,a as W,b as _a}from"./routePaths-C1rKvS5o.js";import{M as ha}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="06403b31-f3c5-49d7-8d66-1419e33f2214",e._sentryDebugIdIdentifier="sentry-dbid-06403b31-f3c5-49d7-8d66-1419e33f2214")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(qe()),e(Ne()),e($e())},ga=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Z(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(K(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Z(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Ze(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-CS0rfBBF.js";import{Q as j,z as w,aR as y,K as E,e as p,g as F,d7 as P,d as T}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import m from"./NotFoundScreen-BDl5tn8o.js";import{a as f}from"./sentry-CEfOando.js";import{u as L,j as b,h as R,g as V,n as A,o as U,p as u}from"./core-D6ttr5iw.js";import{eX as z,TD as C,PX as G,TE as v,vI as K,fK as X,TF as Y,vG as O}from"./zeni-epic-state-Cl3jFj7z.js";import{R as x}from"./ReferralListScreen-DNdLnut4.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./MobileAppDrawer-Sx7ydj7A.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]="6192166c-9a62-4d32-b2f1-8af86b346738",a._sentryDebugIdIdentifier="sentry-dbid-6192166c-9a62-4d32-b2f1-8af86b346738")}catch{}})();const Q=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(O())},onUpdateInviteFormLocalData:s=>{a(Y({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const a=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=R(),D=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),I=G(k);f.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(K()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(X(!0)))},[l.fetchState,a]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(Q,{navigate:c,location:D,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(u,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(q,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Brg8B8gk.js","assets/sentry-CEfOando.js","assets/core-D6ttr5iw.js","assets/zeni-epic-state-Cl3jFj7z.js","assets/index-ilZtTEZn.js","assets/mui-vLo47rlo.js","assets/analytics-Ba6zmRos.js","assets/utils-DKj7mVPA.js","assets/withTransactionSidePanel-DeW-W6do.js","assets/useAskAiCfoHostNavButtonProps-33WX5dhg.js","assets/TransactionDetailScreen-DB5lxQrk.js","assets/decodeURIComponentSafe-D0vQ4d1Q.js","assets/routePaths-C1rKvS5o.js","assets/NotFoundScreen-BDl5tn8o.js","assets/useInitialThreadRequest-Bx57kb_d.js","assets/analyticsHelper-Cq2pq-lr.js","assets/CompanyPassportScreen-DavSJynu.js","assets/MobileAppDrawer-Sx7ydj7A.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js","assets/FeaturePreviewScreen-Y7t6ABdh.js","assets/ReferralListScreen-DNdLnut4.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-jZS0wJcj.js","assets/AddressScreen-ScWWmTbP.js","assets/DomesticWireDetailScreen-jS6brB2p.js","assets/DrawerScreen-D0g6PABS.js","assets/SetupPagesScreen-CVKPKeC9.js","assets/BusinessVerificationPageScreen-DFgVqXvI.js","assets/BillPayApprovalRoutes-CQmYX8YN.js","assets/ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js","assets/getLocaleForTenant-O3Y2pcaQ.js","assets/ReimbursementRoutes-Bb9JPi0m.js","assets/ReimbursementApprovalRoutes-BazeprVG.js","assets/TransactionListRoutes-6SM8gNlu.js","assets/ZeniAccountStatementScreen-D9UEHLLF.js","assets/SettingsRoutes-oK_kou4I.js","assets/accountMappingHelper-s2xO6MjH.js","assets/useEmailConnectResultRefresh-BzWsu8a4.js","assets/QBOConnectionScreen-DXq_HXCX.js","assets/empty-B81gHGCB.js","assets/index-pFVjg2n3.js","assets/url-BQNo9gT5.js","assets/index-lXh6fiHl.js","assets/ReportsRoutes-DB2v4EPm.js","assets/ChargeCardRoutes-BPGek5pB.js","assets/useChargeCardPusherEvents-Cvnaf2Z-.js","assets/PeopleRoutes-x62_g_WP.js","assets/ExpenseAutomationRoutes-D3rXxAM_.js","assets/TreasuryRoutes-DHuVCY9q.js","assets/useCashManagementBanner-CBJfpbK7.js","assets/VendorsRoutes-CwYVQ8VQ.js","assets/pathToGoBack-CkJN8BOO.js","assets/ZeniAccountRoutes-u96OM2YN.js","assets/AddressRoutes-BqX5wkCR.js","assets/PandLWithForecastRoutes-DjwWiUAb.js","assets/CustomerOnboardingRoutes-6ipmFo_1.js","assets/TransactionDetailRoutes-B4ryZwp2.js","assets/EntityDetailRoutes-qim0q068.js","assets/NotificationRoutes-Cdcu8PTz.js","assets/PerformanceRoutes-DQciMsYC.js","assets/RewardsRoutes-ChJyJSHY.js","assets/TaskRoutes-DoWinBID.js","assets/TaskListScreen-WRcn05lO.js","assets/AiCfoScreen-quWQqhzX.js","assets/CardsAiCfoScreen-BbBCL2AM.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as as,eX as rs,fE as is,fC as os,gl as ls,fr as cs,cU as Ae,cA as ds,fU as us,cs as ms,bE as _s,bo as Es,fZ as ps,v as As,LX as hs,bs as gs,LY as xs,bK as Is,fW as Ts,bJ as js,bt as Rs,co as Us,LZ as Ds,L_ as bs,cQ as ys,cT as fs,cS as Cs,cz as Hs,cG as vs,oa as he,fA as ge,gv as Os,g1 as xe,gs as Ie,gt as Te,g2 as Ps}from"./zeni-epic-state-Cl3jFj7z.js";import{j as e}from"./liveblocks-CS0rfBBF.js";import{a as v}from"./sentry-CEfOando.js";import{u as Fs,h as Ls,i as ks,g as Bs,j as G,l as je,N as c,o as Vs,p as a}from"./core-D6ttr5iw.js";import{m as Ss,u as Ns,z as D,Q as ws,c as Zs,T as Ms,d as B,i as zs,I as Gs,L as F,a as Re,t as _,P as $s,e as K,l}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{f as Ue}from"./analyticsHelper-Cq2pq-lr.js";import{t as Ys}from"./getLocaleForTenant-O3Y2pcaQ.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new r.Error().stack;j&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[j]="f82ecb94-1a4f-4a10-a990-a5703ddf5add",r._sentryDebugIdIdentifier="sentry-dbid-f82ecb94-1a4f-4a10-a990-a5703ddf5add")}catch{}})();const Ws={dashboard:()=>n(()=>import("./DashboardRoutes-Brg8B8gk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-jZS0wJcj.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-Bb9JPi0m.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-6SM8gNlu.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-oK_kou4I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-DB2v4EPm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-BPGek5pB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>n(()=>import("./PeopleRoutes-x62_g_WP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-D3rXxAM_.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-DHuVCY9q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-CwYVQ8VQ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-u96OM2YN.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=r=>{"requestIdleCallback"in window?requestIdleCallback(r):setTimeout(r,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-DB2v4EPm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Xs=l(()=>n(()=>import("./AddressRoutes-BqX5wkCR.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Js=l(()=>n(()=>import("./PeopleRoutes-x62_g_WP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),Ks=l(()=>n(()=>import("./PandLWithForecastRoutes-DjwWiUAb.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-6ipmFo_1.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-CwYVQ8VQ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-B4ryZwp2.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>n(()=>import("./EntityDetailRoutes-qim0q068.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),tn=l(()=>n(()=>import("./DashboardRoutes-Brg8B8gk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),be=l(()=>n(()=>import("./BillPayRoutes-jZS0wJcj.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),an=l(()=>n(()=>import("./SettingsRoutes-oK_kou4I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>n(()=>import("./ReimbursementRoutes-Bb9JPi0m.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-u96OM2YN.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-DHuVCY9q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-6SM8gNlu.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-BPGek5pB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-Cdcu8PTz.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),un=l(()=>n(()=>import("./PerformanceRoutes-DQciMsYC.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mn=l(()=>n(()=>import("./ExpenseAutomationRoutes-D3rXxAM_.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-ChJyJSHY.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),En=l(()=>n(()=>import("./TaskRoutes-DoWinBID.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-quWQqhzX.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>n(()=>import("./CardsAiCfoScreen-BbBCL2AM.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>n(()=>import("./NotFoundScreen-BDl5tn8o.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),An=l(()=>n(()=>import("./TaskListScreen-WRcn05lO.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:r}){const j=Fs(),V=Ls(),{tenantEmailDomain:o}=ks(),S=Ss().mode,{setLoading:C,clearAllLoading:O,clearLoading:N}=Ns(),f=D.getSignedInUserTenant(o)?.tenantId,I=D.getSignedInUser(),se=as(I),$=Bs(),[w,He]=v.useState(!1),i=G(t=>rs(t)),{useFeatureGate:L}=ws(),M=Zs(),ne=Ms(),{isFeatureEnabled:ve}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Oe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Pe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),R=G(t=>t.tenantState.fetchState),T=G(t=>t.tenantState.activeTenantFetchState.fetchState),E=T==="Completed"||R==="Completed"?is(te,i):void 0,Q=T==="Completed"||R==="Completed"?os(i):void 0,Fe=zs(i,Pe,te),{isFeatureEnabled:Le}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=L(B.isAiCfoFileUploadEnabled),Y=G(t=>ls(t));if(o!=null){const t=D.getSignedInUserTenant(o);I!=null&&t!=null&&Ue(I,i,S)}const z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ae=cs(),p=Gs(),ke=i.company==null||p?.loggedInUserRoleMap!=null&&Ae(p.loggedInUserRole),Be=ds(p?.loggedInUserRoleMap),re=v.useRef(!0),ie=je("/:tenantEmailDomain/onboarding/*")!==null,J=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(t=>z.tenantId!=null?us(t,z.tenantId):void 0);v.useEffect(()=>{C(F.TENANT_FETCHING),r(o)},[o]),v.useEffect(()=>{if(J!=null&&f!=null){const t=J.params.selectedPeriod;if(t!=null){const U=t.split("-");if(U.length===2){const d=ms(Number(U[0])),s=Number(U[1]),u=_s(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();u.isAfter(Z,"month")===!1?j(ps(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,f]),v.useEffect(()=>{w||(He(!0),C(F.TENANT_FETCHING)),re.current?re.current=!1:!As(ae,z)&&D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s){if(ge(U?.userId,U?.zeniSessionId,t.tenantId),d(Os(!0)),d(xe(t.tenantId)),t.tenantId!=null&&_.clearTenant(t.tenantId),t.tenantId!=null){const u=D.getSignedInUserTenantWithId(t.tenantId);s&&Re.updateAppLocaleID(Ys(s)),u?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(u?.tenantEmailDomain)}t.userId!=null?K.identify(t.userId,{tenant_id:t.tenantId}):K.resetUserIdentity()}(z,I,j,Ve))},[z,ae,I,j,D]),v.useEffect(()=>{D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s,u,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&u?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(W&&ss){k(xe(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(u?.userId,u?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)))}else W&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),W&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)));if(W){K.identify(u.userId,{tenant_id:s});const q=s==null||s!=null&&(U==="Completed"||U==="Error");t==="Completed"||U!=="Not-Started"&&U!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ps(u.userId,s,u.zeniSessionId))),q&&(t==="Not-Started"||t==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(he(u.userId,u.zeniSessionId)))}}(R,T,i,f,I,C,j))},[f,T]),v.useEffect(()=>{D.isSignedIn()&&R==="Completed"&&Y.tenantsBaseInOrder.length>0&&(N(F.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),I!=null&&Ue(I,i,S,void 0,Y.tenantsBaseInOrder))},[Y,R,i,I]),v.useEffect(()=>{T==="In-Progress"&&C(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):T==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),N(F.TENANT_FETCHING),N(F.TENANT_SWITCHING))),R!=="Completed"&&R!=="Error"||(R==="Completed"?_.markAllTenantsFetchCompleted():R==="Error"&&_.markAllTenantsFetchFailed())},[T,R,f,w]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&T==="Completed"&&w&&(oe.current=!0,function(t=qs,U=3e3){setTimeout(()=>{const d=s=>{if(s>=t.length)return;const u=t[s],Z=Ws[u];Z!=null?Z().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},U)}())},[T,w]);const H=i?.userRole!=null&&gs(i?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ne=i?.userRole!=null&&i.userRole.includes("charge_card_user"),we=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&Ae(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!H,ce=Fe&&!H,Ze=xs(p?.loggedInUserRoleMap),Me=i.externalConnections?.accounting[0]?.isValid,de=i.company?.companyOnboardingInfo.isOnboardingCompleted,ue=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!H,me=ue&&Is(p?.loggedInUserRoleMap),_e=ve&&!H,ze=i.company!=null&&Ts(i.company),Ge=Oe&&ze===!0&&!H,$e=le&&js(p?.loggedInUserRoleMap),Ye=ce&&Rs(p?.loggedInUserRoleMap),We=_e&&Us(p?.loggedInUserRoleMap),qe=Ds(p?.loggedInUserRoleMap),Qe=bs(p?.loggedInUserRoleMap),A=ys(p?.loggedInUserRoleMap),h=fs(p?.loggedInUserRoleMap),Xe=Cs(p?.loggedInUserRoleMap),g=Hs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),Ee=le&&g,pe=ue&&x,Je=_e&&A,Ke=Ge&&h,m=ce&&Xe,es=i.excludedResources?.resources?.find(t=>t.resource==="/invites")!=null||Be===!0||Ze===!0||qe===!0||Qe===!0;return D.isSignedIn()?f==null?R==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&R!=="In-Progress"&&j(he(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||R==="Completed"?(de===!0||se&&!ie)&&Me===!1&&E===!1&&Q===!1?(r(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!w||de!==!1||ie||se?w&&i?.userRole&&E!=null&&Q!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx($s,{}),children:[e.jsx(a,{path:"/",element:e.jsx(hn,{isDashboardAccess:P,isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(tn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Qs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"people/*",element:es||P?e.jsx(Js,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(a,{path:"transaction/*",element:P&&H===!1||Ne||we?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"transactions/*",element:P&&H===!1?e.jsx(ln,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"customer/*",element:P&&H===!1?e.jsx(De,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,isUserHasTreasuryAccess:h,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"vendor/*",element:P&&H===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"tasks",element:e.jsx(An,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(En,{})}),e.jsx(a,{path:"address/*",element:$e||me||We||Ye?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"checking/*",element:Je?e.jsx(rn,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:Ke?e.jsx(on,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:ne===!0?e.jsx(un,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:ne===!0&&H===!1?e.jsx(mn,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(a,{path:"vendors/*",element:ke?e.jsx(sn,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"settings/*",element:Le?e.jsx(an,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(pn,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(r(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),r(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const hn=({isDashboardAccess:r,isUserHasZeniAccountsAccess:j,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:C,isTenantCardsOnly:O,showChargeCardRoute:N})=>C===!0&&j?e.jsx(c,{to:"checking"}):O===!0&&N?e.jsx(c,{to:"cards"}):r?e.jsx(c,{to:"dashboard"}):j?e.jsx(c,{to:"checking"}):S?e.jsx(c,{to:"treasury"}):N?e.jsx(c,{to:"cards"}):V?e.jsx(c,{to:"bills"}):o?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:r,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:o,isTenantBankingOnly:S,showChargeCardRoute:C,tenantEmailDomain:O})=>S===!0||r?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(In,{tenantEmailDomain:O}):C?e.jsx(jn,{tenantEmailDomain:O}):j?e.jsx(xn,{tenantEmailDomain:O}):V?e.jsx(gn,{tenantEmailDomain:O}):e.jsx(y,{}),gn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/reimbursements`}),xn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/bills`}),In=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/treasury`}),Tn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/checking`}),jn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/cards`}),Ce=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/dashboard`});export{b as FallBackRoute,Nn as default};