@zeniai/web-app-ui 5.3.65-dev → 5.3.66-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 (172) hide show
  1. package/dist/assets/AccountMappingScreen-qzaB7mmI.js +9 -0
  2. package/dist/assets/ActualMatchingMatchDetailScreen-DqHcloug.js +1 -0
  3. package/dist/assets/AddressRoutes-CSHbftqG.js +1 -0
  4. package/dist/assets/AddressScreen-C6LJsN0I.js +9 -0
  5. package/dist/assets/{AiCfoScreen-HIFRX9qy.js → AiCfoScreen-69iCdaWe.js} +5 -5
  6. package/dist/assets/AppDrawer-BetwU_4-.js +10 -0
  7. package/dist/assets/{BillPayApprovalRoutes-CJFVAxhN.js → BillPayApprovalRoutes-DzANWOc3.js} +1 -1
  8. package/dist/assets/BillPayRoutes-D2aY2x5B.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-ClHDLcIn.js → BusinessVerificationPageScreen-BgP8jWXu.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-B0vefglp.js +14 -0
  11. package/dist/assets/ChargeCardRoutes-giQdoPks.js +71 -0
  12. package/dist/assets/CompanyPassportScreen-B-V7cvQm.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-BXN_6nzp.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-DU6fAlNg.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-BxjXFm9y.js +30 -0
  16. package/dist/assets/DashboardRoutes-B8Is8VU8.js +20 -0
  17. package/dist/assets/DefaultTenantHome-DeP5rQNd.js +1 -0
  18. package/dist/assets/DomesticWireDetailScreen-BQJTKZiM.js +18 -0
  19. package/dist/assets/DrawerScreen-BUdO6BQE.js +1 -0
  20. package/dist/assets/EntityDetailRoutes-DUH9-vmY.js +1 -0
  21. package/dist/assets/ExpenseAutomationRoutes-CoKP5vlI.js +38 -0
  22. package/dist/assets/FeaturePreviewScreen-DLzs5A8g.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-Zi2fxuEj.js +1 -0
  24. package/dist/assets/InboxNotificationsProvider-C8gkRzEM.js +1 -0
  25. package/dist/assets/InvoicingRoutes-Bl5-2g9q.js +2 -0
  26. package/dist/assets/MagicLinkRoutes-BkB3vELP.js +72 -0
  27. package/dist/assets/MagicLinkSignInScreen-BQa7bOA3.js +12 -0
  28. package/dist/assets/MobileAppDrawer-BdOhYCo5.js +1 -0
  29. package/dist/assets/NotFoundScreen-D_hX2Dzv.js +1 -0
  30. package/dist/assets/NotificationRoutes-BlXrAcVL.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-DV9AMjuQ.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-DQr_dvG9.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-CAg7Uc1V.js → PaymentLinkScreen-BU0e_SRM.js} +5 -5
  34. package/dist/assets/PeopleRoutes-BGMNmycG.js +22 -0
  35. package/dist/assets/PerformanceRoutes-Bx4cQFIn.js +1 -0
  36. package/dist/assets/{Preview-DB5CbRio.js → Preview-CdZ2j2v9.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-CRdIfjOg.js → QBOConnectionScreen-DPCQAZIh.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-BNnc3IUS.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-ChXGgpkg.js → ReimbursementApprovalRuleDetailScreen-DZMnuINe.js} +1 -1
  40. package/dist/assets/ReimbursementRoutes-CzK-ajwk.js +68 -0
  41. package/dist/assets/ReportsRoutes-FipSeC9E.js +1 -0
  42. package/dist/assets/RewardsRoutes-BXICRfw-.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CuQHddsr.js → ScheduleDetailsPrepaidExpensesScreen-BF-khYnD.js} +5 -5
  44. package/dist/assets/ScreenRoutes-6gUtsuNq.js +2 -0
  45. package/dist/assets/{SettingsRoutes-B7gRIVJU.js → SettingsRoutes-ZSOCIcz1.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-CabDNVlS.js → SetupPagesScreen-DLgnlxEs.js} +5 -5
  47. package/dist/assets/SignInScreen-C1w5fnGW.js +1 -0
  48. package/dist/assets/SignOutScreen-DCUrMwdu.js +9 -0
  49. package/dist/assets/{TaskListScreen-d8rT1QCC.js → TaskListScreen-DJlJsvJO.js} +2 -2
  50. package/dist/assets/TaskRoutes-Bwnv9rhn.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-Dw-xx0H2.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-BH-OIB8S.js +5 -0
  53. package/dist/assets/TransactionListRoutes-DcrtQayK.js +1 -0
  54. package/dist/assets/TreasuryRoutes-BNsP_RFF.js +37 -0
  55. package/dist/assets/{VendorsRoutes-Dd9qfBZi.js → VendorsRoutes-Bzdw0VNh.js} +10 -10
  56. package/dist/assets/WiseConfirmationScreen-Cs6ZZr7W.js +12 -0
  57. package/dist/assets/ZeniAccountRoutes-CbW2U8iU.js +57 -0
  58. package/dist/assets/ZeniAccountStatementScreen-Dbn9Qd0C.js +9 -0
  59. package/dist/assets/{accountMappingHelper-mjWJVrZb.js → accountMappingHelper-BBlKWvqF.js} +1 -1
  60. package/dist/assets/analytics-Cd5J-GpX.js +68 -0
  61. package/dist/assets/{analyticsHelper-DoCIxX19.js → analyticsHelper-1gGrcOYN.js} +1 -1
  62. package/dist/assets/{core-BBG4mxvC.js → core-vR5k5yHJ.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-DgKmvHaP.js → decodeURIComponentSafe-dlx9EsSm.js} +1 -1
  64. package/dist/assets/{dnd-oIrpOltC.js → dnd-CNeE6eVY.js} +1 -1
  65. package/dist/assets/{empty-zUa_Ywzm.js → empty-BCyx7s6I.js} +1 -1
  66. package/dist/assets/{empty-BVUnugO_.js → empty-BaVMrwvd.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-WG4m8gNp.js → emptyVideoElement-BsSkwvra.js} +1 -1
  68. package/dist/assets/epic-BY4nSR9p.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-DhbRqzrb.js +1 -0
  70. package/dist/assets/getLocaleForTenant-DlNsSiyY.js +1 -0
  71. package/dist/assets/{index-De2R2YuA.js → index-1ujiYIu0.js} +29082 -29221
  72. package/dist/assets/{index-CD8RychW.js → index-B8gT7z4T.js} +1 -1
  73. package/dist/assets/{index-lbu92FYh.js → index-BNIWZiV_.js} +1 -1
  74. package/dist/assets/{index-BlZF-J3g.js → index-C-u59Z-A.js} +1 -1
  75. package/dist/assets/{index-DlbH0-p0.js → index-DC9buFXh.js} +1 -1
  76. package/dist/assets/{index-Bgwcwudg.js → index-DT7mcNKS.js} +1 -1
  77. package/dist/assets/{index-B9QH_oKn.js → index-DglCggLh.js} +2 -2
  78. package/dist/assets/{index-CyCQjJen.js → index-bBDyOWrB.js} +1 -1
  79. package/dist/assets/{lexical-BRrdO5Cu.js → lexical-DgMW3HzT.js} +1 -1
  80. package/dist/assets/{liveblocks-CzCs-qU3.js → liveblocks-DVkNRe2z.js} +1 -1
  81. package/dist/assets/{lottie-ULJlrwjP.js → lottie-w9LOAwHI.js} +1 -1
  82. package/dist/assets/{mui-B2F_PvWe.js → mui-Bf4yQzNc.js} +1 -1
  83. package/dist/assets/{pathToGoBack-e0pJACvC.js → pathToGoBack-C6FxxwA3.js} +1 -1
  84. package/dist/assets/{pdf-CeVn9A9c.js → pdf-HKvehc9b.js} +4 -4
  85. package/dist/assets/{pdf-lib-DiMa7ymi.js → pdf-lib-1kn73-Ho.js} +1 -1
  86. package/dist/assets/{plaid-BWZxX3Bn.js → plaid-TFLEc35h.js} +1 -1
  87. package/dist/assets/{pusher-wcP4-1ih.js → pusher-tJC8UB03.js} +1 -1
  88. package/dist/assets/{react-D7hd8riP.js → react-BKyIT5tt.js} +1 -1
  89. package/dist/assets/{react-CGMaXwI-.js → react-BtmyM_-m.js} +1 -1
  90. package/dist/assets/{react-Chuw6ptT.js → react-CiN9hWuS.js} +1 -1
  91. package/dist/assets/{react-3Jh1nOTX.js → react-DLVu_DIJ.js} +1 -1
  92. package/dist/assets/{react-Dv-IwMT5.js → react-DrY897mF.js} +1 -1
  93. package/dist/assets/{react-BrDYknqm.js → react-YQhQ1aSJ.js} +1 -1
  94. package/dist/assets/{recharts-CzGMTm3v.js → recharts-BajLe7QJ.js} +1 -1
  95. package/dist/assets/{routePaths-BRju88LA.js → routePaths-Du4I9ue1.js} +1 -1
  96. package/dist/assets/{sentry-CWp8Ph3h.js → sentry-BcU4ynZK.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-BWJSV6oD.js → stripSplatSuffix-CGuqfZ54.js} +1 -1
  98. package/dist/assets/{url-CnTmKJO0.js → url-ee1pOdF5.js} +1 -1
  99. package/dist/assets/{url-DV6CtKQ5.js → url-l4mUxam0.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-CNkjnN75.js +1 -0
  101. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CB15Xjw5.js +1 -0
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-Daw0Xdbp.js +1 -0
  103. package/dist/assets/useChargeCardPusherEvents-B1XaK23y.js +1 -0
  104. package/dist/assets/{useDeviceId-Bzw6IkAe.js → useDeviceId-D80AOehv.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-DxMN-FLO.js +1 -0
  106. package/dist/assets/useInitialThreadRequest-CujqTgMw.js +1 -0
  107. package/dist/assets/useTaskManagerAccess-DmtbEonm.js +1 -0
  108. package/dist/assets/useTaskManagerPusherEvents-Cieei3Tg.js +1 -0
  109. package/dist/assets/{utils-u0mlLj2I.js → utils-BJrHoU4M.js} +1 -1
  110. package/dist/assets/withTransactionSidePanel-D7CS7WiP.js +25 -0
  111. package/dist/assets/{zeni-epic-state-FRanwwFO.js → zeni-epic-state-BmF1nplD.js} +6 -6
  112. package/dist/index.html +1 -1
  113. package/package.json +4 -4
  114. package/dist/assets/AccountMappingScreen-6_GKC9vx.js +0 -9
  115. package/dist/assets/ActualMatchingMatchDetailScreen-BtJ1PRf_.js +0 -1
  116. package/dist/assets/AddressRoutes-BGo6E_l0.js +0 -1
  117. package/dist/assets/AddressScreen-BYfgTsTg.js +0 -9
  118. package/dist/assets/AppDrawer-HGV6a9mb.js +0 -10
  119. package/dist/assets/BillPayRoutes-9qxDDuw-.js +0 -119
  120. package/dist/assets/CardsAiCfoScreen-HQpPf571.js +0 -14
  121. package/dist/assets/ChargeCardRoutes-D5HxBR-m.js +0 -71
  122. package/dist/assets/CompanyPassportScreen-NKCcjvTx.js +0 -1
  123. package/dist/assets/ConnectionAuthScreen-5_efBSJK.js +0 -11
  124. package/dist/assets/CustomerOnboardingAuthScreen-LnGpx7c7.js +0 -1
  125. package/dist/assets/CustomerOnboardingRoutes-DvA4xflo.js +0 -30
  126. package/dist/assets/DashboardRoutes-BrD8wr4t.js +0 -20
  127. package/dist/assets/DefaultTenantHome-UgTfgsWU.js +0 -1
  128. package/dist/assets/DomesticWireDetailScreen-CnA3RoGS.js +0 -18
  129. package/dist/assets/DrawerScreen-Uxjfm6D_.js +0 -1
  130. package/dist/assets/EntityDetailRoutes-DtNSByJA.js +0 -1
  131. package/dist/assets/ExpenseAutomationRoutes-CyGyQy2q.js +0 -38
  132. package/dist/assets/FeaturePreviewScreen-C1hVuos1.js +0 -1
  133. package/dist/assets/HubSpotOAuthCallbackScreen-BZRaCcdu.js +0 -1
  134. package/dist/assets/InboxNotificationsProvider-J2K-16R3.js +0 -1
  135. package/dist/assets/InvoicingRoutes-BER5-vbp.js +0 -2
  136. package/dist/assets/MagicLinkRoutes-BGZcWo6O.js +0 -72
  137. package/dist/assets/MagicLinkSignInScreen-BclRPUfZ.js +0 -12
  138. package/dist/assets/MobileAppDrawer-B_zpLZqx.js +0 -1
  139. package/dist/assets/NotFoundScreen-BXryZNID.js +0 -1
  140. package/dist/assets/NotificationRoutes-CQasJ3IU.js +0 -1
  141. package/dist/assets/OAuthConsentScreen-Bo-ewMPc.js +0 -1
  142. package/dist/assets/PandLWithForecastRoutes-DdmupK5y.js +0 -1
  143. package/dist/assets/PeopleRoutes-CYUsZeQt.js +0 -22
  144. package/dist/assets/PerformanceRoutes-DqTbj0rB.js +0 -1
  145. package/dist/assets/ReimbursementApprovalRoutes-CgCsp1OP.js +0 -1
  146. package/dist/assets/ReimbursementRoutes-DKUCzczr.js +0 -68
  147. package/dist/assets/ReportsRoutes-CSUm6Emn.js +0 -1
  148. package/dist/assets/RewardsRoutes-DWpcmti-.js +0 -1
  149. package/dist/assets/ScreenRoutes-evald5rF.js +0 -2
  150. package/dist/assets/SignInScreen-DfTwbUKW.js +0 -1
  151. package/dist/assets/SignOutScreen-CH6sLo8r.js +0 -9
  152. package/dist/assets/TaskRoutes-DVZrk18e.js +0 -9
  153. package/dist/assets/TransactionDetailRoutes-CkeAEzHU.js +0 -1
  154. package/dist/assets/TransactionDetailScreen-hIkUAVjY.js +0 -5
  155. package/dist/assets/TransactionListRoutes-BVLahxTu.js +0 -1
  156. package/dist/assets/TreasuryRoutes-D4vqz1Fs.js +0 -37
  157. package/dist/assets/WiseConfirmationScreen-B9ReE25J.js +0 -12
  158. package/dist/assets/ZeniAccountRoutes-BtAMcoNj.js +0 -57
  159. package/dist/assets/ZeniAccountStatementScreen-B3egvFmp.js +0 -9
  160. package/dist/assets/analytics-cC2XJoxx.js +0 -68
  161. package/dist/assets/epic-Du6qCFYI.js +0 -2
  162. package/dist/assets/expenseAutomationHelper-BkZxz0F-.js +0 -1
  163. package/dist/assets/getLocaleForTenant-BYuz_wJa.js +0 -1
  164. package/dist/assets/useActualMatchingMatchDetail-lnPRleqr.js +0 -1
  165. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DuZAl-a1.js +0 -1
  166. package/dist/assets/useAskAiCfoHostNavButtonProps-Bq-fQXG8.js +0 -1
  167. package/dist/assets/useChargeCardPusherEvents-CrB7Excu.js +0 -1
  168. package/dist/assets/useEmailConnectResultRefresh-x1GFiNhw.js +0 -1
  169. package/dist/assets/useInitialThreadRequest-C1rKRZSH.js +0 -1
  170. package/dist/assets/useTaskManagerAccess-CoE1FF6T.js +0 -1
  171. package/dist/assets/useTaskManagerPusherEvents-CgOrop-a.js +0 -1
  172. package/dist/assets/withTransactionSidePanel-CbnU34fe.js +0 -25
@@ -1,20 +0,0 @@
1
- import{j as d}from"./liveblocks-CzCs-qU3.js";import{i as K,j as S,g as W,u as X,h as H,l as ne,k as oa,n as ht,o as P,N as vn}from"./core-BBG4mxvC.js";import{fI as B,V$ as He,bF as sa,br as Ee,Xn as En,kd as Tn,Xo as Vt,Xp as wn,kg as ft,Xq as Qe,Xr as xn,kl as Dn,Xs as Gt,Xt as Pn,kp as gt,Xu as Ze,Xv as On,Xw as Fn,Wj as jn,lr as Rn,Xx as Mn,bn as Je,Xy as ra,WZ as le,bc as ia,lF as ca,lo as la,W$ as de,W_ as ae,fH as da,gd as Bn,gt as bt,Xz as Yn,XA as Un,XB as ua,XC as Oe,E5 as Be,E6 as Ye,Eu as Te,Eo as ue,Ea as Ue,XD as Ln,c0 as Le,XE as Vn,XF as Gn,XG as ma,XH as Fe,XI as Nn,ek as et,Ag as pa,XJ as $n,XK as ha,XL as Xn,XM as zn,XN as Kn,XO as _t,UX as St,ug as we,m2 as xe,EE as kt,An as qn,Au as Qn,XP as Zn,XQ as Wn,E7 as Nt,XR as Hn,Aj as Ie,Ae as fa,XS as ge,XT as $t,XU as Jn,XV as yt,UW as At,Cr as ga,XW as eo,XX as ba,XY as to,XZ as ao,X_ as no,X$ as It,CG as oo,CN as so,Y0 as ro,Y1 as io,E9 as Xt,Y2 as co,Cp as Ca,Y3 as be,Y4 as zt,Y5 as lo,bq as _a,EJ as Sa,Y6 as uo,Y7 as ka,Y8 as mo,Y9 as po,Ya as ho,Yb as vt,EB as fo,ED as go,Yc as bo,Yd as Co,E8 as Kt,Ye as _o,EH as ya,Yf as Ce,Yg as qt,Yh as So,Yi as ko,Yj as Aa,lT as Ia,p_ as va,lY as Ea,pY as Ta,pX as wa,pW as xa,BO as yo,dd as Ao,pT as Io,Ui as vo,q8 as Eo,Yk as To,Yl as wo,Ym as xo,b5 as Et,q2 as Do,ig as Po,gL as Oo,q1 as Fo,lh as jo,p$ as Ro,pZ as Mo,e0 as Bo,d$ as Yo}from"./zeni-epic-state-FRanwwFO.js";import{z as Y,av as oe,p as O,j as w,G as q,bb as Uo,as as Ve,a8 as Ge,bc as Da,T as N,bd as Lo,be as Pa,E as Vo,bf as Go,bg as No,a as Oa,a1 as Fa,e as ja,ar as $o,bh as Xo,ao as zo,c as Tt,bi as Ra,C as re,bj as Ma,bk as Ba,au as Ya,bl as Ko,ai as Ne,_ as $e,bm as qo,P as Qo,bn as Zo,m as G,k as Wo,l as Ho,a4 as Jo,aq as es,bo as ts,bp as as,bq as ns,br as ve}from"./index-De2R2YuA.js";import{n as wt}from"./mui-B2F_PvWe.js";import{a as b}from"./sentry-CWp8Ph3h.js";import{w as Ua}from"./withTransactionSidePanel-CbnU34fe.js";import{c as La,t as De,f as me,b as xt,a as Dt,v as os}from"./routePaths-BRju88LA.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-Bq-fQXG8.js";import Me from"./NotFoundScreen-BXryZNID.js";import{u as Pt}from"./useInitialThreadRequest-C1rKRZSH.js";import{t as Va}from"./analyticsHelper-DoCIxX19.js";import{C as ss}from"./CompanyPassportScreen-NKCcjvTx.js";import{u as rs}from"./useAiCfoDashboardSuggestedQuestionsChips-DuZAl-a1.js";import{F as is}from"./FeaturePreviewScreen-C1hVuos1.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";import"./TransactionDetailScreen-hIkUAVjY.js";import"./decodeURIComponentSafe-DgKmvHaP.js";import"./expenseAutomationHelper-BkZxz0F-.js";import"./stripSplatSuffix-BWJSV6oD.js";import"./MobileAppDrawer-B_zpLZqx.js";import"./InboxNotificationsProvider-J2K-16R3.js";import"./useTaskManagerAccess-CoE1FF6T.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="d41865a2-4fd5-455b-99db-2b87d745c1e1",e._sentryDebugIdIdentifier="sentry-dbid-d41865a2-4fd5-455b-99db-2b87d745c1e1")}catch{}})();const cs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=Y.getSignedInUser(),i=S((_=>_.tenantState.currentTenantId)),l=S((_=>B(_))),{tenantEmailDomain:m}=K(),p=W(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=X(),g=H(),y=S((_=>En(_,u,o))),E=b.useCallback((()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&C(Tn(o,u))}),[u]),I=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),k=b.useCallback(((_,A)=>{C(Vt({sortKey:_,sortOrder:A}))}),[]),T=b.useCallback((_=>{C(Vt({downloadState:_}))}),[]),R=b.useCallback((_=>{if(e)e(_.transactionId,_.transactionType);else if(m!=null){const A=La({id:_.transactionId,type:_.transactionType},m);g(A);const U=O(p.state?.pathnameStackToGoBack,p.pathname);g(A,{state:{pathnameStackToGoBack:U}})}}),[m,e]),x=b.useCallback((()=>{y.vendor!=null&&w.trackApAgingDetail("AP Aging",u.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)}),[y.vendor,u]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{y.fetchState==="Completed"&&x()}),[x,y.fetchState]),d.jsx(Uo,{apAgingDetail:y,downloadParams:c,reportDate:u,analytics:w,onTransactionClick:R,onReload:E,onBackClick:I,onColumnSortConfigChanged:k,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=X(),a=H(),t=S((k=>wn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=Y.getSignedInUser(),s=S((k=>k.tenantState.currentTenantId)),i=S((k=>B(k))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ft(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((k=>{e(Qe({searchString:k}))}),[]),C=b.useCallback(((k,T)=>{e(Qe({sortKey:T,sortOrder:k}))}),[]),g=b.useCallback((k=>{a(`./${k}/${h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),y=b.useCallback((k=>{e(Qe({downloadState:k}))}),[]),E=b.useCallback(((k,T)=>{}),[]),I=b.useCallback(((k,T)=>{e(Qe({selectedDate:k,agingDateSelectionType:T})),e(ft(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Da,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:w,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:y,onSelectedDateChanged:I,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ds=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=Y.getSignedInUser(),i=S((x=>B(x))),{tenantEmailDomain:l}=K(),m=W(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=X(),C=H(),g=S((x=>xn(x,c,o))),y=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Dn(o,c))}),[c]),E=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),I=b.useCallback(((x,_)=>{u(Gt({sortKey:x,sortOrder:_}))}),[]),k=b.useCallback((x=>{u(Gt({downloadState:x}))}),[]),T=b.useCallback((x=>{if(e)e(x.transactionId,x.transactionType);else if(l!=null){const _=La({id:x.transactionId,type:x.transactionType},l);C(_);const A=O(m.state?.pathnameStackToGoBack,m.pathname);C(_,{state:{pathnameStackToGoBack:A}})}}),[l,e]),R=b.useCallback((()=>{g.customer!=null&&w.trackArAgingDetail("AR Aging",c.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{y()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&R()}),[g.fetchState,R]),d.jsx(Lo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:w,onTransactionClick:T,onReload:y,onBackClick:E,onColumnSortConfigChanged:I,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),us=()=>{const e=X(),a=H(),t=S((I=>Pn(I))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=Y.getSignedInUser(),s=S((I=>B(I))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((I=>{e(Ze({searchString:I}))}),[]),u=b.useCallback(((I,k)=>{e(Ze({sortKey:k,sortOrder:I}))}),[]),C=b.useCallback((I=>{a(`./${I}/${p.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((I=>{e(Ze({downloadState:I}))}),[]),y=b.useCallback(((I,k)=>{e(Ze({selectedDate:I,agingDateSelectionType:k})),e(gt(I))}),[]),E=b.useCallback(((I,k)=>{e(On({nodeId:I,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Da,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:w,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:y,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=jn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Rn(n,o))}}}const ms=ne((function(e){const a=Fn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:w}}),Na)(Pa),ps=ne((function(e){const a=Mn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=Y.getSignedInUser(),n=Je(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:w}}),Na)(Pa);function hs(){const e=H(),a=W(),{tenantEmailDomain:t}=K(),n=S((o=>B(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ms,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function fs(){const e=H(),a=W(),{tenantEmailDomain:t}=K(),n=S((o=>B(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ps,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const gs=wt.div`
2
- display: flex;
3
- flex: 1 1 auto;
4
- min-height: 100%;
5
- flex-direction: column;
6
- background-color: ${e=>e.theme.colors.grey4};
7
- `,bs=wt.div`
8
- display: flex;
9
- flex: 1 1 auto;
10
- flex-direction: column;
11
- align-items: center;
12
- background-color: ${e=>e.theme.colors.grey4};
13
- `;function Cs({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=H(),i=X(),l=W(),{tenantEmailDomain:m}=K(),p=Vo();return d.jsxs(gs,{children:[d.jsx(Go,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:p.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:h=>{h.trim().length>=2?i(de({searchString:h,searchOrigin:"navbar"})):h.trim().length===0&&i(ae("navbar"))},onAutoCompleteEntity:h=>{n!=null&&w?.trackSearch(N.Event.search,_s(a),h.type,h.name,n);const f=me(h,m),c=O(l.state?.pathnameStackToGoBack,l.pathname);s(f,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:d.jsx(No,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(bs,{children:a==="cash_balance"?d.jsx(hs,{}):d.jsx(fs,{})})]})}function Qt(){const e=W(),a=X(),t=S((c=>c.cashBalanceState.fetchState)),n=S((c=>c.cardBalanceState.fetchState)),o=Y.getSignedInUser();if(o==null)throw Error("Can't access dashboard detail without signing in...");const r=ra((c=>{const u=ia(c,"/").split("/");return u[u.length-1]})(e.pathname));let s="Not-Started",i="";const l=q.getLocalizedStrings();switch(r){case"cash_balance":s=t,i=l.common.texts.cashBalance;break;case"card_balance":s=n,i=l.reportTitleById.card_balance;break;default:console.error(`${r} is not supported!`)}const{isAiCfoAccessEnabled:m,onAskAiCfoClick:p}=se({mobileExploreReferrer:r==="card_balance"?"Card Balance":"Cash Balance"});Ve({isDataReady:s==="Completed"});const h=S((c=>c.entityAutoCompleteState.autoCompleteText.navbar)),f=S((c=>le(c,"navbar")));return b.useEffect((()=>{s==="Not-Started"&&(function(c,u){switch(u){case"card_balance":c(la());break;case"cash_balance":c(ca());break;default:throw new Error(`balance report type ${u} is not yet supported`)}})(a,r)}),[o,a,s]),d.jsxs(d.Fragment,{children:[s==="Completed"?d.jsx(Ge,{analytics:w,onLoad:c=>((u,C)=>{switch(C){case"card_balance":u.trackPageLoaded(N.Event.cardBalance);break;case"cash_balance":u.trackPageLoaded(N.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,r)}):null,d.jsx(Cs,{title:i,reportId:r,autoCompleteText:h,entityAutoCompleteView:f,isAiCfoAccessEnabled:m,onAskAiCfoClick:p})]})}const _s=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Ss=[],Zt="insights_section";function Xe(e){const{mobileExploreReferrer:a}=e,t=X(),n=H(),o=W(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Oa(),l=Fa(),m=Ya(l),p=oa(),h=S((F=>F.tenantState.fetchState==="Completed"||F.tenantState.activeTenantFetchState.fetchState==="Completed"?B(F):void 0)),f=h?.masterTOSInfo?.isMasterTOSAccepted??!1,c=S((F=>da(F))),u=c.uiState?.currentChatSessionId,C=c.allSessionsWithOrderedQuestionAnswers??Ss,g=Y.getSignedInUser()?.userId,y=ja(),E=$o()&&y&&r!=null,I=Xo(),k=zo(!0),T=S((F=>I!=null?Bn(F,I):void 0)),{useDynamicConfig:R}=Tt(),{configValue:x}=R(Ra.aiCfoMessageDynamicConfig),_=b.useMemo((()=>Array.isArray(x.default_message_list)?x.default_message_list:[]),[x.default_message_list]),A=b.useMemo((()=>_.slice(0,2)),[_]),U=I!=null&&T!=null&&T.fetchState!=="Completed"&&T.fetchState!=="Error"&&(k||T.fetchState==="In-Progress"),pe=b.useMemo((()=>{if(I==null||T?.fetchState==="Error")return A;if(U)return[];const F=(T?.suggestedQuestions??[]).map((J=>J.trim())).filter((J=>J.length>0)).slice(0,2);return F.length===0?A:F}),[A,U,I,T?.fetchState,T?.suggestedQuestions]),Pe=b.useCallback(((F,J)=>{if(g==null||F.trim()==="")return;if(!f)return void re({location:o,navigate:n,mergeState:{referrer:a,aiCfoInitialQuestion:F,aiCfoInitialSubmissionSource:Zt,aiCfoSuggestionIndex:J}});const Ke=Ma(p.getState());if(m){const qe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:qe,referrer:a,aiCfoInitialQuestion:F,aiCfoShouldSubmit:!Ke}})}else{if(Ke)return t(bt(F)),void s(!0);i(F),s(!0),Ba(t,F,Zt,u,C,g,J,void 0)}}),[C,u,t,f,m,o,a,n,s,i,p,r,g]),_e=b.useCallback((()=>{if(f)if(m){const F=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:F,referrer:a}})}else s(!0);else re({location:o,navigate:n,mergeState:{referrer:a}})}),[f,m,o,a,n,s,r]);return b.useMemo((()=>{if(E)return{isSuggestedQuestionsLoading:U,onAskSomethingElseClick:_e,onSuggestedQuestionClick:Pe,suggestedQuestions:pe}}),[E,U,_e,Pe,pe])}const ze=Ko,ks=ne((function(e){const a=Yn(e),t=Un(e),n=ua(e),{scrollPosition:o,...r}=n,s=q.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=Y.getSignedInUser(),l=e.tenantState.currentTenantId,m=B(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:w,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Te("month")),e(ue(a.firstMonthOfFY,t)),e(Oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Be(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ye(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onElementCollapseStateChanged:(t,n)=>{e(Oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(ze),ys=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ne(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashInCashOut"}),i=Xe({mobileExploreReferrer:"DashboardCashInCashOut"}),l=S((m=>ua(m))).mode==="compare_mode";return d.jsx(ks,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Le(o("dashboard_report_filters"))})},As=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Is=ne((function(e){const a=Vn(e),t=Gn(e),n=ma(e),{scrollPosition:o,...r}=n,s=q.getLocalizedStrings().reportTitleById.cash_position,i=Y.getSignedInUser(),l=e.tenantState.currentTenantId,m=B(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:w,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Nn(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Fe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Fe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Be(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ye(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=As(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Fe({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}}))(ze),vs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ne(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashPosition"}),i=Xe({mobileExploreReferrer:"DashboardCashPosition"}),l=S((m=>ma(m))).mode==="compare_mode";return d.jsx(Is,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Le(o("dashboard_report_filters"))})},$=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!==t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))},Es=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Ts=ne((function(e){const a=pa(e),t=$n(e),n=ha(e),o=Xn(e),r=zn(e),s=Kn(e),i=_t(e),{scrollPosition:l,...m}=i,p=t.reportTitle,h=Y.getSignedInUser(),f=e.tenantState.currentTenantId,c=B(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:w,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:xe(e),isAccountingProjectsEnabled:we(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Jn(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Be(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ye(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Es(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?xt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e($t({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(ge({scrollPosition:t})):e($t({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Nt({viewMode:"account_group"})),e(fa(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ge({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Burn Rate"),e(Nt({viewMode:t})),e(Hn({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Wn({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(Zn({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(qn()),a.isAccountingProjectsEnabled&&e(Qn())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"net_burn_or_income_by_projects":"net_burn_or_income_by_classes"))}}}))(ze),ws=e=>{const a=X(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=Xe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S((_=>_t(_))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((_=>yt(_.forecastState,c??""))),C=S((_=>pa(_))),g=S((_=>At(_))),y=S((_=>xe(_))),E=S((_=>we(_))),I=S((_=>ha(_).uiState.accountViewMode)),k=p.mode==="compare_mode",T=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const _=u?.forecastPeriod,A=T!=null&&_.endDate.isAfter(T?.endDate)===!0?T:_;a(ue(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}}),[c]);const R=$e(),x=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(Ts,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:y,isAccountingProjectsEnabled:E,accountViewMode:I,isCompareModeOn:k,navigate:o,analytics:w,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:x,meetingUrl:Le(s("dashboard_report_filters"))})},xs=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Ds=ne((function(e){const a=ga(e),t=eo(e),n=ba(e),o=to(e),r=ao(e),s=no(e),i=It(e),{scrollPosition:l,...m}=i,p=q.getLocalizedStrings().common.texts.operatingExpenses,h=Y.getSignedInUser(),f=e.tenantState.currentTenantId,c=B(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:w,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:xe(e),isAccountingProjectsEnabled:we(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(lo(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Be(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ye(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=xs(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?xt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(zt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(be({scrollPosition:t})):e(zt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t=="forecast_mode"?(e(Xt({viewMode:"account_group"})),e(Ca(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(be({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Operating Expenses"),e(Xt({viewMode:t})),e(co({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(io({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(ro({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(oo()),a.isAccountingProjectsEnabled&&e(so())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"operating_expenses_by_projects":"operating_expenses_by_classes"))}}}))(ze),Ps=e=>{const a=X(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardOpEx"}),m=Xe({mobileExploreReferrer:"DashboardOpEx"}),p=S((A=>It(A))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((A=>yt(A.forecastState,c??""))),C=S((A=>ga(A))),g=S((A=>At(A))),y=S((A=>xe(A))),E=S((A=>we(A))),I=S((A=>ba(A).uiState.accountViewMode)),k=p.mode==="compare_mode",T=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const A=u?.forecastPeriod,U=T!=null&&A.endDate.isAfter(T?.endDate)===!0?T:A;a(ue(e.firstMonthOfFY,{startDate:U.endDate.startOf(f),endDate:U?.endDate}))}}),[c]);const R=$e(),x=R?.loggedInUserRole!=null&&_a(R?.loggedInUserRole)!==!0,_=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(Ds,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:y,isAccountingProjectsEnabled:E,accountViewMode:I,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:w,hasTransactionAccess:x,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:_,meetingUrl:Le(s("dashboard_report_filters"))})},Os=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Fs=ne((function(e){const a=Sa(e),t=uo(e),n=ka(e),o=mo(e),r=po(e),s=ho(e),i=vt(e),{scrollPosition:l,...m}=i,p=q.getLocalizedStrings().common.texts.revenue,h=Y.getSignedInUser(),f=e.tenantState.currentTenantId,c=B(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:w,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:xe(e),isAccountingProjectsEnabled:we(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(So(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Be(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ye(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Os(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?xt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(Ce({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(qt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(Ce({scrollPosition:t})):e(qt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Kt({viewMode:"account_group"})),e(ya(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(Ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Revenues"),e(Kt({viewMode:t})),e(_o({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Co({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(bo({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(fo()),a.isAccountingProjectsEnabled&&e(go())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"revenue_by_projects":"revenue_by_classes"))}}}))(ze),js=e=>{const a=X(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardRevenue"}),m=Xe({mobileExploreReferrer:"DashboardRevenue"}),p=S((_=>vt(_))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((_=>yt(_.forecastState,c??""))),C=S((_=>Sa(_))),g=C.dataAvailable,y=p.mode==="compare_mode",E=S((_=>xe(_))),I=S((_=>we(_))),k=S((_=>ka(_).uiState.accountViewMode)),T=S((_=>At(_)));b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const _=u?.forecastPeriod,A=g!=null&&_.endDate.isAfter(g?.endDate)===!0?g:_;a(ue(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}}),[c]);const R=$e(),x=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(Fs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:E,isAccountingProjectsEnabled:I,accountViewMode:k,isCompareModeOn:y,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:w,reportsResyncFetchState:T.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:x,meetingUrl:Le(s("dashboard_report_filters"))})},Rs=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Ms=ne((function(e){const a=ko(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=le(e,"navbar");return{report:a,analytics:w,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}}),(function(e,a){return{onTimeframeSelectionChanged:t=>{w.trackTimeframeSwitch(Va(t),"Top Expenses"),e(Aa(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Rs(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(qo),Bs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Ms,{tenantEmailDomain:a,location:t,navigate:n})},Ys=wt.div`
14
- display: flex;
15
- flex: 1 1 auto;
16
- min-height: 100%;
17
- flex-direction: column;
18
- background-color: ${e=>e.theme.colors.grey5};
19
- align-items: center;
20
- `;function Us({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=H(),r=W(),{tenantEmailDomain:s}=K();let i;Ve({isDataReady:!0});const l={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(Ps,{...l});break;case"revenue":i=d.jsx(js,{...l});break;case"net_burn_or_income":i=d.jsx(ws,{...l});break;case"cash_position":i=d.jsx(vs,{...l});break;case"top_expenses":i=d.jsx(Bs,{...l});break;case"cash_in_cash_out":i=d.jsx(ys,{...l});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(Ys,{children:i}):null}function ie(){const e=W(),a=X(),{forecastId:t}=K();let n="Not-Started";const o=S((c=>It(c).fetchState)),r=S((c=>vt(c).fetchState)),s=S((c=>_t(c).fetchState)),i=S((c=>c.cashPositionState.fetchState)),l=S((c=>c.topExState.fetchState)),m=S((c=>c.cashInCashOutState.fetchState));if(Y.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const p=S((c=>B(c))),h=p?.company?.companyInfo?.firstMonthOfFY??1,f=ra((c=>{const u=ia(c,"/").split("/");return t!=null?u[u.length-3]:u[u.length-1]})(e.pathname));switch(f){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=l;break;case"cash_in_cash_out":n=m;break;default:console.error(`${f} is not supported!`)}return b.useEffect((()=>{n==="Not-Started"&&(function(c,u,C,g){switch(u){case"operating_expenses":c(xa(!0)),g!=null&&(c(Ie(C,!0,3,{id:g,index:0})),c(Ca(!1,g)));break;case"revenue":c(wa(!0)),g!=null&&(c(Ie(C,!0,3,{id:g,index:0})),c(ya(!1,g)));break;case"net_burn_or_income":c(Ta(!0)),g!=null&&(c(Ie(C,!0,3,{id:g,index:0})),c(fa(!1,g)));break;case"cash_position":c(Ea(!0));break;case"top_expenses":c(va());break;case"cash_in_cash_out":c(Ia());break;default:throw new Error(`report type ${u} is not yet supported`)}})(a,f,h,t)}),[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(Ge,{analytics:w,onLoad:c=>((u,C)=>{const g=e.state?.referrer;switch(C){case"operating_expenses":u.trackPageLoaded(N.Event.operatingExpenses,g);break;case"revenue":u.trackPageLoaded(N.Event.revenues,g);break;case"net_burn_or_income":u.trackPageLoaded(N.Event.burnRate,g);break;case"cash_position":u.trackPageLoaded(N.Event.cashPosition,g);break;case"top_expenses":u.trackPageLoaded(N.Event.topExpenses,g);break;case"cash_in_cash_out":u.trackPageLoaded(N.Event.cashInCashOut,g);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,f)}):null,d.jsx(Us,{firstMonthOfFY:h,fetchState:n,reportId:f,forecastId:t})]})}var it=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function ct(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),(function(){t(window.event)}))}function $a(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Xa(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Ot={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":it?173:189,"=":it?61:187,";":it?59:186,"'":222,"[":219,"]":221,"\\":220},ce={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ct={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},M={16:!1,18:!1,17:!1,91:!1},j={},We=1;We<20;We++)Ot["f".concat(We)]=111+We;var D=[],Wt=!1,za="all",Ht=[],tt=function(e){return Ot[e.toLowerCase()]||ce[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Jt(e){za=e||"all"}function Re(){return za||"all"}var lt=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Xa(a).forEach((function(s){var i=s.split(r),l=i.length,m=i[l-1],p=m==="*"?"*":tt(m);if(j[p]){t||(t=Re());var h=l>1?$a(ce,i):[];j[p]=j[p].filter((function(f){return!((!n||f.method===n)&&f.scope===t&&(function(c,u){for(var C=c.length>=u.length?c:u,g=c.length>=u.length?u:c,y=!0,E=0;E<C.length;E++)g.indexOf(C[E])===-1&&(y=!1);return y})(f.mods,h))}))}}))};function ea(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,M)Object.prototype.hasOwnProperty.call(M,r)&&(!M[r]&&a.mods.indexOf(+r)>-1||M[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||M[16]||M[18]||M[17]||M[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function ta(e,a){var t=j["*"],n=e.keyCode||e.which||e.charCode;if(V.filter.call(this,e)){if(n!==93&&n!==224||(n=91),D.indexOf(n)===-1&&n!==229&&D.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(u){var C=Ct[u];e[u]&&D.indexOf(C)===-1?D.push(C):!e[u]&&D.indexOf(C)>-1?D.splice(D.indexOf(C),1):u==="metaKey"&&e[u]&&D.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(D=D.slice(D.indexOf(C))))})),n in M){for(var o in M[n]=!0,ce)ce[o]===n&&(V[o]=!0);if(!t)return}for(var r in M)Object.prototype.hasOwnProperty.call(M,r)&&(M[r]=e[Ct[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(D.indexOf(17)===-1&&D.push(17),D.indexOf(18)===-1&&D.push(18),M[17]=!0,M[18]=!0);var s=Re();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&ea(e,t[i],s,a);if(n in j){for(var l=0;l<j[n].length;l++)if((e.type==="keydown"&&j[n][l].keydown||e.type==="keyup"&&j[n][l].keyup)&&j[n][l].key){for(var m=j[n][l],p=m.splitKey,h=m.key.split(p),f=[],c=0;c<h.length;c++)f.push(tt(h[c]));f.sort().join("")===D.sort().join("")&&ea(e,m,s,a)}}}}function V(e,a,t){D=[];var n=Xa(e),o=[],r="all",s=document,i=0,l=!1,m=!0,p="+",h=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(l=a.keyup),a.keydown!==void 0&&(m=a.keydown),a.capture!==void 0&&(h=a.capture),typeof a.splitKey=="string"&&(p=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(p)).length>1&&(o=$a(ce,e)),(e=(e=e[e.length-1])==="*"?"*":tt(e))in j||(j[e]=[]),j[e].push({keyup:l,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:p,element:s});s!==void 0&&!(function(f){return Ht.indexOf(f)>-1})(s)&&window&&(Ht.push(s),ct(s,"keydown",(function(f){ta(f,s)}),h),Wt||(Wt=!0,ct(window,"focus",(function(){D=[]}),h)),ct(s,"keyup",(function(f){ta(f,s),(function(c){var u=c.keyCode||c.which||c.charCode,C=D.indexOf(u);if(C>=0&&D.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&D.splice(0,D.length),u!==93&&u!==224||(u=91),u in M)for(var g in M[u]=!1,ce)ce[g]===u&&(V[g]=!1)})(f)}),h))}var dt={setScope:Jt,getScope:Re,deleteScope:function(e,a){var t,n;for(var o in e||(e=Re()),j)if(Object.prototype.hasOwnProperty.call(j,o))for(t=j[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Re()===e&&Jt(a||"all")},getPressedKeyCodes:function(){return D.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=tt(e)),D.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(j).forEach((function(t){var n=j[t].find((function(o){return o.scope===a&&o.shortcut===e}));n&&n.method&&n.method()}))},unbind:function(e){if(e===void 0)Object.keys(j).forEach((function(s){return delete j[s]}));else if(Array.isArray(e))e.forEach((function(s){s.key&&lt(s)}));else if(typeof e=="object")e.key&&lt(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),lt({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Ot,modifier:ce,modifierMap:Ct};for(var ut in dt)Object.prototype.hasOwnProperty.call(dt,ut)&&(V[ut]=dt[ut]);if(typeof window<"u"){var Ls=window.hotkeys;V.noConflict=function(e){return e&&window.hotkeys===V&&(window.hotkeys=Ls),V},window.hotkeys=V}V.filter=function(){return!0};var aa=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Vs(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,l=o.keydown,m=o.filterPreventDefault,p=m===void 0||m,h=o.enabled,f=h===void 0||h,c=o.enableOnContentEditable,u=c!==void 0&&c,C=b.useRef(null),g=b.useCallback((function(y,E){var I,k;return s&&!s(y)?!p:!!(aa(y,["INPUT","TEXTAREA","SELECT"])&&!aa(y,r)||(I=y.target)!=null&&I.isContentEditable&&!u)||!!(C.current===null||document.activeElement===C.current||(k=C.current)!=null&&k.contains(document.activeElement))&&(a(y,E),!0)}),n?[C,r,s].concat(n):[C,r,s]);return b.useEffect((function(){if(f)return i&&l!==!0&&(t.keydown=!1),V(e,t||{},g),function(){return V.unbind(e,g)};V.unbind(e,g)}),[g,e,f]),C}V.isPressed;const Gs=[],mt="dashboard_card",te="ai_cfo_dashboard_card";function na(e,a){return a?e.some((t=>String(t)===te))?e.slice():[te,...e]:e.filter((t=>String(t)!==te))}const Ns=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","rewards_card"],$s=(e,a,t,n,o)=>({card:{dimension:Et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),je=(e,a,t,n,o)=>({card:{dimension:Et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),Xs=(e,a,t,n)=>je(void 0,e,ve,a,t),zs=e=>{const a=Et(ve);return a.height=ve.height+10,{card:{dimension:a,cardType:te,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},Ks=ne((function(e,a){const t=Zs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i}=a;let l=n.map(((m,p)=>{if(m==="reimbursement_promo_card"||m==="bill_pay_promo_card")return Xs(t,m,p);if(m==="zeni_promo_card")return je({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ve,m,p);if(m==="information_card")return je(void 0,"Completed",ve,m,p);if(m===te)return zs(p);{const h=o.find((f=>f?.reportId===m));return h?(function(f,c,u,C){const g=f.reportId;switch(g){case"card_balance":case"cash_balance":return[$s(f,c,u,g,C)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"rewards_card":return[je(f,c,u,g,C)];case"net_burn_or_income_story_card":return[je(f,c,u,"net_burn_or_income_story_card",C)];default:return console.error(`card type ${g} not yet supported!`),[]}})(h,h.fetchState,ve,p):[]}})).flat();return a.isSummaryCardsFiltered===!0&&(l=l.filter((m=>Ns.includes(m.card.cardType)==0)).filter((m=>{const p=m.data?.availableNumberOfPeriods;return p!=null?p>0:m.card.cardType!="top_expenses"||m.data==null||(function(h){if(h==null||h.length===0)return!0;let f=!0;for(const c of h)if(c.balance.available.amount!==0){f=!1;break}return f})(m.data.topExpenses.accountsOrdered)===!1}))),{cardDataArray:l,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:le(e,"navbar")},analytics:w,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}}),(function(e,a){const t=a.tenantId,n=Y.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)w.trackDashboardCardClicked("cards promo",2),w.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&w.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(w.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),(function(i,l,m,p){if(l!==te)switch(l){case"card_balance":i(la());break;case"cash_balance":i(ca());break;case"operating_expenses":i(xa(!0));break;case"revenue":i(wa(!0));break;case"net_burn_or_income":i(Ta(!0));break;case"net_burn_or_income_story_card":i(Mo(!0));break;case"cash_position":i(Ea(!0));break;case"top_expenses":i(va());break;case"cash_in_cash_out":i(Ia());break;case"insights_dashboard":i(Ro());break;case"bill_pay_card":i(jo());break;case"reimbursement_card":i(Fo());break;case"company_details":i(Oo(m));break;case"task_card":i(Po());break;case"accounts_payable_aging":p.includes("accounts_payable_aging")===!1&&i(ft(Ee()));break;case"accounts_receivable_aging":i(gt(Ee()));break;case"rewards_card":p.includes("rewards_card")===!1&&i(Do(!0));break;default:throw new Error(`report type ${l} is not yet supported`)}})(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{w.trackTimeframeSwitch(Va(r),Qs(o),"Dashboard"),(function(s,i,l){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(Te(l));break;case"top_expenses":s(Aa(l));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}})(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(xo(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:o=>{if(o==="bill_pay_promo_card"){const r="../bills",s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}else if(o==="reimbursement_promo_card"){const r="../reimbursements",s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(w.trackUpdateBurnRateCalculatorSettings(r,s,To(s)),e(wo(t,r,s)))}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(de({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(ae("navbar"))},onCancelAutoComplete:()=>{e(ae("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?me(o,a.tenantEmailDomain):os(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}}))(ns);function qs(){const e=oa(),a=Fa(),t=Ya(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=Oa(),s=H(),i=X(),l=W(),m=Y.getSignedInUser(),{useFeatureGate:p,useDynamicConfig:h}=Tt(),[f,c]=b.useState(!1),[u,C]=b.useState(!1),g=ja(),{tenantEmailDomain:y}=K(),{isAiCfoAccessEnabled:E,onAskAiCfoClick:I}=se({mobileExploreReferrer:"Dashboard"}),k=S((v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?B(v):void 0)),T=k??Y.getSignedInUserTenant(y),{isCardsShuttingDown:R,shutdownContent:x}=Qo(T?.tenantId,k?.company?.managementInfo?.receiverEmails),_=b.useMemo((()=>R===!0&&x!=null?d.jsx(Zo,{shutdownContent:x}):null),[R,x]),A=k?.masterTOSInfo?.isMasterTOSAccepted??!1,U=T.tenantId,pe=T.companyId;b.useEffect((()=>{f===!1&&l.state?.message==="activation"&&(i(yo(pe)),c(!0))}),[l.state,f,pe,i]),b.useEffect((()=>{g&&!u&&l.state?.message==="open_ai_cfo_drawer"&&(C(!0),A?(o(!0),s({pathname:l.pathname,search:l.search,hash:l.hash},{replace:!0,state:{...l.state,message:void 0}})):re({location:l,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))}),[l,u,g,A,o,s]);const{isFeatureEnabled:Pe}=p(G.isApAgingFeatureEnabled),_e=Wo(),F=Ho(_e),{isFeatureEnabled:J}=p(G.isArAgingFeatureEnabled),{isFeatureEnabled:Ke}=p(G.isDepositAccountsFeatureEnabled),{isFeatureEnabled:qe}=p(G.isReferralFeatureEnabled),{isFeatureEnabled:Ka}=p(G.isChargeCardFeatureEnabled),{isFeatureEnabled:qa}=p(G.isAiCfoFileUploadEnabled),{isFeatureEnabled:Qa}=p(G.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Za}=p(G.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Wa}=p(G.aiAuditScorePercentage),{configValue:Ft}=h(Ra.zeniCardsConfig),Ha=Ft.charge_card_cashback_rate_per_transaction==null?.0175:Ft.charge_card_cashback_rate_per_transaction;if(l.state?.message==="activation"){const v=Jo(l.state?.pathnameStackToGoBack);s(l.pathname,{state:{...l.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[jt,Ja]=b.useState(!1),[at,en]=b.useState(!1);Vs("command+p, Control+p",(v=>{en(!at),v.preventDefault()}),{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[at]);const Rt=k?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const he=S((v=>B(v)?.excludedResources)),tn=S((v=>v.expenseAutomationViewState.selectedPeriodByTenantId)),an=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,nn=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,on=$e(),z=[],Mt=he?.resources?.find((v=>v.resource==="/reports/top_expenses"))==null,sn=he?.resources?.find((v=>v.resource==="/reports/task_card"))==null,Bt=k?.userRole!=null&&_a(k?.userRole),rn=he?.resources?.find((v=>v.resource==="/bills"))==null&&!Bt,cn=he?.resources?.find((v=>v.resource==="/reimbursements"))==null,ln=Ao(on?.loggedInUserRoleMap),dn=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,un=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1;Mt===!1&&z.push("top_expenses"),sn===!1&&z.push("task_card"),rn===!1&&z.push("bill_pay_card","bill_pay_promo_card"),Pe===!1&&z.push("accounts_payable_aging"),J===!1&&z.push("accounts_receivable_aging"),(_e===!1||Bt)&&z.push("expense_automation_card"),cn===!1&&z.push("reimbursement_card","reimbursement_promo_card"),z.push("zeni_accounts_promo_card","treasury_promo_card"),qe===!1&&z.push("rewards_card");const{areTenantIdsInSync:Yt}=es();b.useLayoutEffect((()=>{jt&&F===_e||Rt!==!0||!Yt||he?.fetchState!=="Completed"&&he?.fetchState!=="Error"||(Ja(!0),i(Io(m.userId,pe,U,!0,!1,z)))}),[jt,m,U,i,Mt,Rt,he?.fetchState,Yt]);const mn=S((v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn)),pn=S((v=>v.revenueState.uiState.selectedForecast?.id)),hn=S((v=>v.cardBalanceState.fetchState)),fe=S((v=>vo(v,z))),fn=fe.fetchState,gn=b.useMemo((()=>na(fe.cardsOrdered,E)),[fe.cardsOrdered,E]),bn=b.useMemo((()=>na(fe.cardsForDashboardUI,E)),[fe.cardsForDashboardUI,E]);Ve({isDataReady:!0});const{isSuggestedQuestionsLoading:Cn,suggestedPromptQuestions:_n}=rs(),Ut=S((v=>da(v))),Se=Ut.uiState?.currentChatSessionId,nt=Ut.allSessionsWithOrderedQuestionAnswers??Gs,{currentSessionQuestionAnswers:Sn}=ts(nt,Se),Lt=Sn.length===0,kn=b.useCallback(((v,Q,ee)=>{const ke=m?.userId;if(ke==null)return;const L=v.trim();if(L.length===0&&Q.length===0)return;if(!A)return void re({location:l,navigate:s,mergeState:{referrer:"Dashboard",...L.length>0?{aiCfoInitialQuestion:L,aiCfoInitialSubmissionSource:mt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}:{}}});const Z=Ma(e.getState()),ye=()=>{const Ae=O(l.state?.pathnameStackToGoBack,l.pathname);s(`/${y}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Ae,referrer:"Dashboard",aiCfoInitialQuestion:L,aiCfoShouldSubmit:!Z&&L.length>0,aiCfoInitialSubmissionSource:mt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}})};return t?Q.length>0?void o(!0):void ye():Q.length>0?Z?(i(bt(L)),void o(!0)):(r(L.length>0?L:null),o(!0),void(L.length>0&&Ba(i,L,mt,Se,nt,ke,ee,Q.length>0?Q:void 0))):(Z&&i(bt(L)),void ye())}),[nt,Se,i,A,t,l,s,r,o,m?.userId,e,y]),yn=b.useCallback((()=>{A?o(!0):re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[A,l,s,o]),An=b.useCallback((()=>{if(!A)return void re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});if(y==null)return;const v=O(l.state?.pathnameStackToGoBack,l.pathname);s(`/${y}/ai-cfo/explore`,{state:{pathnameStackToGoBack:v,referrer:"Dashboard"}})}),[A,l,s,y]),In=b.useCallback((()=>{if(A)if(t){if(y==null||k==null)return;const v=Se==null||Lt?`/${y}/ai-cfo/explore`:`/${y}/ai-cfo/${Se}`,Q=l.state?.pathnameStackToGoBack??[],ee=O(Q,l.pathname);s(v,{state:{...l.state,pathnameStackToGoBack:ee,[as]:!0}})}else re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});else re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[A,t,l,s,y,k,Se,Lt]);return d.jsxs(d.Fragment,{children:[fn==="Completed"?d.jsx(Ge,{analytics:w,onLoad:v=>{v.trackPageLoaded(N.Event.dashboard)}}):null,d.jsx(Ks,{cardsShutdownBanner:_,maxColumns:n?2:void 0,isAiCfoAccessEnabled:E,onAskAiCfoClick:I,onAiCfoDashboardOpenPanel:yn,onAiCfoDashboardOpenScopePage:In,isAiCfoFileUploadEnabled:qa===!0&&t===!1,onAiCfoDashboardPromptSubmit:kn,onAiCfoDashboardExpandToFullPage:An,aiCfoDashboardShouldClearPromptOnSubmit:A,aiCfoDashboardSuggestedPromptQuestions:_n,aiCfoDashboardSuggestedPromptQuestionsLoading:Cn,onDragAndDropCard:(v,Q)=>{if(v===te||Q===te)return;const ee=(function(Z,ye,Ae){const ot=Ae.indexOf(Z),st=Ae.indexOf(ye);if(ot===-1||st===-1||ot===st)return Ae;const rt=[...Ae];return rt.splice(ot,1),rt.splice(st,0,Z),rt})(v,Q,gn),ke=ee.filter((Z=>Z!==te)),L=fe.cardsOrdered;(ke.length!==L.length||ke.some(((Z,ye)=>Z!==L[ye])))&&i(Eo(ke))},dashboardReport:fe,passedCardsOrdered:bn,tenantId:U,companyId:pe,tenantEmailDomain:y,location:l,navigate:s,isApAgingFeatureEnabled:Pe,isArAgingFeatureEnabled:J,isBillPayEnabled:nn,isReimbursementEnabled:an,isSummaryCardsFiltered:at,isForecastOn:mn,selectedForecastOnDashboard:pn,isVisitingFirstTime:f,isZeniAccountEnabled:Ke,isRewardsFeatureEnabled:qe,selectedPeriod:tn[U],isChargeCardFeatureEnabled:Ka,isUserHasCardsAccess:ln,cardsCreditLimit:dn,cashbackRate:Ha,isInterestedInChargeCard:un,cardBalanceFetchState:hn,christmasAnimationEnabled:Qa,newYearAnimationEnabled:Za,aiAuditScorePercentageEnabled:Wa})]})}const Qs=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},Zs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map((a=>a.fetchState)).reduce(((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t));function pt(){return d.jsxs(ht,{children:[d.jsx(P,{path:"/",element:d.jsx(ie,{})}),d.jsx(P,{path:"/:forecastId",element:d.jsx(ie,{})}),d.jsx(P,{path:"/:forecastId/*",element:d.jsx(Me,{})})]})}function wr(){const e=$e(),a=e?.excludedResources?.find((m=>m.resource==="/reports/top_expenses"))==null,{useFeatureGate:t}=Tt(),{isFeatureEnabled:n}=t(G.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(G.isArAgingFeatureEnabled),r=S((m=>B(m))),{isFeatureEnabled:s}=t(G.isDebitCardFeatureEnabled),i=Bo(s,r),l=Yo(r);return i===!0||l===!0?d.jsx(ht,{children:d.jsx(P,{path:"/*",element:d.jsx(is,{})})}):d.jsxs(ht,{children:[d.jsx(P,{path:"/",element:d.jsx(qs,{})}),d.jsx(P,{path:"cash_balance/*",element:d.jsx(Qt,{})}),d.jsx(P,{path:"card_balance/*",element:d.jsx(Qt,{})}),d.jsx(P,{path:"operating_expenses/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"operating_expenses/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"revenue/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"revenue/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"net_burn_or_income/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"net_burn_or_income/*",element:d.jsx(ie,{})}),n===!0&&d.jsxs(d.Fragment,{children:[d.jsx(P,{path:"accounts_payable_aging/*",element:d.jsx(ls,{})}),d.jsx(P,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:d.jsx(cs,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(P,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(ds,{})}),d.jsx(P,{path:"accounts_receivable_aging/*",element:d.jsx(us,{})})]}),d.jsx(P,{path:"cash_position/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"top_expenses/*",element:a===!0?d.jsx(ie,{}):d.jsx(Me,{})}),d.jsx(P,{path:"cash_in_cash_out/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"company_details",element:d.jsx(ss,{})}),d.jsx(P,{path:"referrals/*",element:d.jsx(vn,{to:"../../rewards/refer",replace:!0})}),d.jsx(P,{path:"*",element:d.jsx(Me,{})})]})}export{wr as default};
@@ -1 +0,0 @@
1
- import{j as v}from"./liveblocks-CzCs-qU3.js";import{a as u}from"./sentry-CWp8Ph3h.js";import{u as y,j as b,l as U,g as w,N as A}from"./core-BBG4mxvC.js";import{U1 as N,fI as _,go as k,U2 as L,pV as R,U3 as z}from"./zeni-epic-state-FRanwwFO.js";import{u as j,z as f,L as T,t as I,G as O,b as $}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import{t as P}from"./getLocaleForTenant-BYuz_wJa.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="447ace2f-b847-415e-8589-13f2424a61c7",t._sentryDebugIdIdentifier="sentry-dbid-447ace2f-b847-415e-8589-13f2424a61c7")}catch{}})();const G=U((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(A,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>N(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(G,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],V={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return V[s]}export{oe as default};
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-CzCs-qU3.js";import{h as w,g as C,j as h,l as A,i as V}from"./core-BBG4mxvC.js";import{Z0 as k,Z7 as W,gJ as J,gI as M,gH as Q,kS as Y,W_ as q,uU as K,fI as B,Yz as D,kQ as T,Z1 as S,Za as F,kO as G,l9 as j}from"./zeni-epic-state-FRanwwFO.js";import{bN as L,a1 as N,c as R,z as Z,E as U,a4 as p,m as v,a7 as O,bO as X,M as _,bP as ee,p as te}from"./index-De2R2YuA.js";import{n as z}from"./mui-B2F_PvWe.js";import"./sentry-CWp8Ph3h.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]="dd6f1e5a-29af-4794-8d46-fc686198bee2",e._sentryDebugIdIdentifier="sentry-dbid-dd6f1e5a-29af-4794-8d46-fc686198bee2")}catch{}})();const ae=A(null,(function(e,t){return{onSaveVendor:a=>{e(Y(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(K(a))},onGetOtp:a=>{e(Q(a,"BillPayVendor"))},onResendOtp:a=>{e(M(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(J(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(W(a,n,o))}}}))(L);function H({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=z.div`
2
- display: flex;
3
- height: 100vh;
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
- `,oe=A((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:a,location:n,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(n.state?.pathnameStackToGoBack),r=s.poppedPathname??P();a(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(F({data:r}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(X);function fe({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,{useFeatureGate:d}=R(),c=Z.getSignedInUser(),b=h((u=>B(u))),g=U(),I=p(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ne,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:r}),l.jsx(oe,{location:n,navigate:a,billId:r,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t},me=(e,t,a)=>{let n=`/${e}/bill/${encodeURIComponent(t)}`;return a=="draft"&&(n+="/edit"),n},he=e=>`/${e}/bills`,ke=(e,t)=>{let a=`/${e}/bill`;return a=t!=null?a.concat(`/${t}/edit`):a.concat("/new"),a},E=(e,t,a,n)=>{let o=`/${e}/bill`;return o+=a!=null?`/${a}/edit/vendor`:"/new/vendor",o+=n!=null?`/${n}/edit/${t}`:`/create/${t}`,o};function Se(e,t,a){return E(e,"ach",t,a)}function ve(e,t,a){return E(e,"domestic",t,a)}function ge(e,t,a){return E(e,"international",t,a)}const se=(e,t,a)=>{let n=`/${e}/bill/`;return n=a!=null?n.concat(`${encodeURIComponent(a)}/${t}/`):n.concat(`new/${t}/`),n},de=z.div`
10
- display: flex;
11
- height: 100vh;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- box-shadow: ${e=>`0px 2px ${_.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,re=A((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:a,navigate:n,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:i}=r;return{onFetchBankName:d=>{e(j(d))},onSaveHandler:d=>{e(G(t.bankAccountContext,d,"us-domestic",s))},onWireDetailsUpdated:d=>{const{bankAccountSection:c}=d;e(F({data:c}))},onCancel:()=>{(()=>{const d=p(o.state?.pathnameStackToGoBack),c=d.poppedPathname??$();n(c,{state:{pathnameStackToGoBack:d.newStack}})})(),e(S())},onAddressClick:d=>{if(t.bankAccountContext==="express-pay")n("./add-address");else{const c=se(i,d,a),b=te(o.state?.pathnameStackToGoBack,o.pathname);n(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const d=p(t.location.state?.pathnameStackToGoBack),c=d.poppedPathname??$(0);t.navigate(c,{state:{pathnameStackToGoBack:d.newStack}})}e(S())}}}))(ee);function Ie({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,d=Z.getSignedInUser(),{useFeatureGate:c}=R(),b=U(),g=h((u=>B(u))),I=p(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${_.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(de,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:r}),l.jsx(re,{location:n,navigate:a,billId:r,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{fe as A,Ie as D,H as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-CzCs-qU3.js";import{a1 as c,ab as l,E as f}from"./index-De2R2YuA.js";import{D as p}from"./mui-B2F_PvWe.js";import"./sentry-CWp8Ph3h.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="c06e3c71-2cdd-4b4c-9d6d-3f270023e5b2",e._sentryDebugIdIdentifier="sentry-dbid-c06e3c71-2cdd-4b4c-9d6d-3f270023e5b2")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:d}=e,n=c(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),a=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:d,children:t})}export{h as D};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CzCs-qU3.js";import{a as d}from"./sentry-CWp8Ph3h.js";import{h as B,u as G,g as A,i as q,j as c,N as F,l as _,n as N,o as O}from"./core-BBG4mxvC.js";import{X3 as R,fI as $,Wk as M,n2 as X,Sl as k,X8 as Y,WZ as z,m2 as V,Sm as S,Wp as Z,Wq as H,W$ as J,W_ as K}from"./zeni-epic-state-FRanwwFO.js";import{b8 as L,j as Q,a4 as U,p as tt}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import{d as b}from"./decodeURIComponentSafe-DgKmvHaP.js";import{w as et}from"./withTransactionSidePanel-CbnU34fe.js";import{f as at,c as nt}from"./routePaths-BRju88LA.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";import"./useAskAiCfoHostNavButtonProps-Bq-fQXG8.js";import"./TransactionDetailScreen-hIkUAVjY.js";import"./useInitialThreadRequest-C1rKRZSH.js";import"./expenseAutomationHelper-BkZxz0F-.js";import"./stripSplatSuffix-BWJSV6oD.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]="ca3bb1e9-fa4c-4062-a411-b043bd85351c",a._sentryDebugIdIdentifier="sentry-dbid-ca3bb1e9-fa4c-4062-a411-b043bd85351c")}catch{}})();const ot=_((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:Q,isAccountingClassesEnabled:V(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(K("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Z()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=U(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(L),it=et((function({entityType:a,...t}){const e=B(),o=G(),l=A(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:W}=q(),r=b(x??""),p=b(W??""),u=rt(r,p),j=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c((n=>R(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),v=c((n=>$(n).company?.companyInfo.firstMonthOfFY??1)),f=c((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&u===!0&&(T(!0),o(X(i)))}),[m,u,i]);const E=c((n=>n.trendState.fetchState)),P=f?.selectedPeriod?.timePeriod??g,w=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(f?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function vt({entityType:a}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{vt as EntityDetailRoutes,vt as default};
@@ -1,38 +0,0 @@
1
- import{j as k}from"./liveblocks-CzCs-qU3.js";import{u as ge,h as nt,g as be,j as F,i as Be,t as Jn,l as Yn,n as Hn,o as We,N as Wn}from"./core-BBG4mxvC.js";import{fI as ke,a1a as Kn,q3 as Me,Uk as Qn,A9 as Xn,a1b as Zn,a1c as es,a1d as ts,a1e as Ct,a1f as Qe,gk as Tt,a1g as ia,eY as as,g3 as ns,a1h as la,a1i as Xe,qW as ss,uX as os,gV as cs,gT as is,a1j as ls,r7 as rs,rg as ds,qe as us,qs as Ra,gS as ue,gU as ms,a1k as ps,qO as Da,rh as hs,qp as Ss,qk as gs,v1 as Cs,gR as Oe,a1l as tt,Cj as Fa,MG as _a,a1m as Ma,FE as Oa,a1n as fs,f0 as Is,f2 as ks,sY as Pt,X4 as ra,X6 as bs,m5 as Ts,X7 as Ps,mc as ys,dm as vs,DC as yt,a1o as Es,a1p as As,a1q as xs,a1r as ws,fp as vt,sM as da,WZ as Rs,a1s as Ds,a1t as Fs,me as _s,a1u as Ms,Rm as Os,md as Us,m2 as Bs,qH as Ua,rm as at,tz as Ba,tV as Vs,Ua as Va,rl as ua,ro as ja,rq as js,bF as zs,nB as Ls,ny as $s,rp as Ze,rn as Se,a1v as Gs,rH as ma,a1w as Ns,a1x as qs,sQ as Js,sR as Ys,WV as Hs,V$ as Ws,a0E as Ks,a1y as Qs,W$ as pa,W_ as Ke,a1z as ha,mt as Xs,a1A as Zs,a1B as eo,a1C as to,a1D as ao,qC as no,a1E as so,a1F as oo,a1G as co,rx as io,mg as lo,m7 as ro,a1H as uo,mf as Sa,Xh as mo,a1I as po,a1J as ho,uy as So,u9 as go,u8 as ft,a1K as Co,a1L as fo,a1M as Io,a1N as ko,nM as bo,br as To,nH as ga,nt as Po,a1O as yo,h2 as vo,nE as Eo,s_ as Ao,t0 as xo,sJ as wo,W2 as Ro,W3 as Do,F6 as Fo,F5 as _o,Fm as Mo,a1P as Ca,sP as Oo,sk as Uo,a1Q as Bo,s0 as Vo,s5 as jo,sg as zo,s3 as Lo,a1R as $o,rY as Go,sf as No,sV as qo,a1S as Jo,t6 as Yo,sD as Ho,tc as Wo,sI as Ko,rI as Qo,a1T as Xo,q_ as Zo,qy as ec,qF as fa,rs as tc,a1U as ac,a1V as nc,a1W as sc,a1X as oc,a1Y as cc,a1Z as ic,a1_ as lc,tg as rc,a1$ as dc,a20 as uc,a21 as Ia,uJ as mc,u0 as pc,tR as ka,tP as hc,a22 as Sc,tE as gc,tj as Cc,tS as fc,a23 as Ic,a24 as kc,tp as bc,a25 as Tc,tk as Pc,to as yc,tm as vc,tY as Ec}from"./zeni-epic-state-FRanwwFO.js";import za from"./NotFoundScreen-BXryZNID.js";import{a as s,R as La}from"./sentry-CWp8Ph3h.js";import{n as Te,S as Ac}from"./mui-B2F_PvWe.js";import{c as Ve,m as H,j as W,p as ee,aq as $a,as as Ga,dO as xc,dP as wc,z as st,dQ as Rc,dR as Dc,dS as Fc,ae as Ue,dT as _c,dU as ba,ba as Ta,dV as Mc,a7 as Na,dW as Oc,l as et,a as Uc,dX as Bc,dY as Vc,Z as jc,_ as zc,dZ as Lc,d_ as $c,d$ as Gc,b4 as Nc,bs as qc,ab as Jc,b5 as Yc,b6 as Hc,G as Wc,w as Kc,e0 as Qc,av as Pa,e1 as Xc}from"./index-De2R2YuA.js";import{u as qa}from"./useAskAiCfoHostNavButtonProps-Bq-fQXG8.js";import{g as ya,b as Zc,c as ei,h as ti,a as ai,i as ni,r as si,C as oi}from"./TransactionDetailScreen-hIkUAVjY.js";import{u as ci,a as ii}from"./useActualMatchingMatchDetail-lnPRleqr.js";import{d as li}from"./decodeURIComponentSafe-DgKmvHaP.js";import{m as Ja,a as Ya}from"./expenseAutomationHelper-BkZxz0F-.js";import{u as Ha,a as Wa,w as ri}from"./withTransactionSidePanel-CbnU34fe.js";import{b as di,S as ui,a as mi,J as pi}from"./ScheduleDetailsPrepaidExpensesScreen-CuQHddsr.js";import{s as va,i as Ka,h as hi,v as Si,c as gi}from"./routePaths-BRju88LA.js";import{a as It}from"./accountMappingHelper-mjWJVrZb.js";import{D as Ci}from"./DrawerScreen-Uxjfm6D_.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";import"./useInitialThreadRequest-C1rKRZSH.js";import"./stripSplatSuffix-BWJSV6oD.js";import"./pathToGoBack-e0pJACvC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="bb7c6e7b-e52a-46a2-89c5-53658d2067c5",t._sentryDebugIdIdentifier="sentry-dbid-bb7c6e7b-e52a-46a2-89c5-53658d2067c5")}catch{}})();const fi=()=>{const t=ge(),n=nt(),S=be(),g=F((p=>ke(p))),{useFeatureGate:d}=Ve(),{isFeatureEnabled:i}=d(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=d(H.aiAuditScorePercentage),A=F((p=>p.expenseAutomationViewState.selectedPeriodByTenantId)),l=F((p=>Kn(p,g.tenantId))),{isAiCfoAccessEnabled:v,onAskAiCfoClick:x}=qa({mobileExploreReferrer:"Month-End Close Overview"}),T=s.useCallback(((p,P,_=!1)=>{t(Me({tenantId:P,period:{month:p.month,year:p.year},refreshViewInBackground:_}))}),[]),C=s.useCallback((p=>{const P=S.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&W.trackMonthCloseAuditPage(p.month,p.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,P??null),t(Qn(g.tenantId,p))}),[g.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),f=A[g.tenantId],m=s.useCallback((()=>{const p=S.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&W.trackMonthCloseAuditPage(f.month,f.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),T(f,g.tenantId,!0)}),[T,f,g.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),z=ee(S.state?.pathnameStackToGoBack,S.pathname),w=s.useCallback((()=>{if(l.monthEndCloseChecks!=null&&f!=null){const p=l.monthEndCloseChecks.monthEndCloseCheckList.find((P=>P.progress<100));if(p!=null)return void n(`./${p.id}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:z,message:"comingFromOverview"}});n(`./month_end_insights/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:z,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,f]),{areTenantIdsInSync:I}=$a();return Ga({isDataReady:l.fetchState==="Completed"}),s.useEffect((()=>{f!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&I&&T(f,g.tenantId)}),[T,f,l.fetchState,g.tenantId,I]),s.useEffect((()=>{f!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(Xn(f))}),[f,l.monthClosePerformanceTrendFetchStatus.fetchState,I]),s.useEffect((()=>{const p=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&m()}),3e5);return()=>clearInterval(p)}),[l.fetchState]),s.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const p=S.state?.referrer;W.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),k.jsx(Ii,{children:k.jsx(xc,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:p=>{n(`./${p}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:z,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:C,handleReviewButtonClick:w,onBackClick:()=>{n("../../dashboard")},onReload:m,isAiCfoAccessEnabled:v,onAskAiCfoClick:x,aiAuditScorePercentageEnabled:r})})},Ii=Te.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
- `;function ki({isFullView:t,matchId:n,onClose:S}){const{match:g,detailFetchState:d,handleOpenBill:i,handleApproveAndReverse:r,handleIgnoreMatchSuggestion:A,handleRefresh:l,handleUndoReversal:v,lastMatchResults:x,lastUndoResults:T,refreshStatus:C,ignoreStatus:f,matchAndReverseStatus:m,undoReversalStatus:z}=ci(n);return k.jsx(wc,{match:g,detailFetchState:d.fetchState,isRenderedInPanel:!t,isApproveInFlight:m.fetchState==="In-Progress",isIgnoreInFlight:f.fetchState==="In-Progress",isUndoInFlight:z.fetchState==="In-Progress",refreshStatus:C.fetchState,onNavigateBack:S,onOpenBill:i,onApproveAndReverse:r,onIgnoreMatchSuggestion:A,onRefresh:l,onUndoReversal:v,lastMatchResults:x,lastUndoResults:T})}const bi=/^match\/([^/?]+)$/,Ti=Wa({displayNamePrefix:"withActualMatchingSidePanel",usePanelSetup:function(t){const{useFeatureGate:n}=Ve(),{isFeatureEnabled:S}=n(H.isTransactionDetailSplitViewEnabled),{isFeatureEnabled:g}=n(H.isAccrualEnabled),d=(function(r=!0){const A=nt(),l=be(),v=Be(),x=Ja(v),T=Ha({childPathPattern:bi,enabled:r,listPath:x}),C=T.matchGroups[0]!=null&&T.matchGroups[0]!==""?li(T.matchGroups[0]):void 0,f=v.tenantEmailDomain??l.pathname.split("/").find(Boolean)??"",m=s.useRef({isOpen:T.isOpen,matchId:C});m.current={isOpen:T.isOpen,matchId:C};const z=s.useCallback((p=>{!T.isMobile&&r?m.current.isOpen&&m.current.matchId===p?T.closePanel():T.navigateToChild(`match/${encodeURIComponent(p)}`,{replace:m.current.isOpen}):A(`/${f}/expense-automation/actual-matching/${encodeURIComponent(p)}`)}),[A,T.isMobile,T.navigateToChild,T.closePanel,r,f]),w=s.useCallback((()=>{if(C==null)return;const p=ee(l.state?.pathnameStackToGoBack,`${l.pathname}${l.search}`);A(`/${f}/expense-automation/actual-matching/${encodeURIComponent(C)}`,{state:{pathnameStackToGoBack:p}})}),[l.pathname,l.search,l.state,C,A,f]),I=T.isOpen&&C!=null;return{closePanel:T.closePanel,isOpen:I,maximize:w,matchId:r&&I?C:void 0,openPanel:z}})(t&&g===!0&&S===!0),i=s.useMemo((()=>{if(d.isOpen&&d.matchId!=null)return k.jsx(ki,{isFullView:!1,matchId:d.matchId,onClose:d.closePanel},d.matchId)}),[d.closePanel,d.isOpen,d.matchId]);return{injectedProps:s.useMemo((()=>({closeMatchSidePanel:d.closePanel,isMatchPanelOpen:d.isOpen,matchPanelContent:i,matchPanelMatchId:d.matchId,openMatchPanel:d.openPanel})),[i,d.closePanel,d.isOpen,d.matchId,d.openPanel]),selectedItemId:d.matchId,sidePanel:{closePanel:d.closePanel,maximize:d.maximize}}}}),Pi=La.memo((({reconciliation:t,selectedDrawerAccountId:n,onClose:S,onFetchLinkTokenClick:g,onEstablishConnectionClick:d})=>{const i=ge(),{useFeatureGate:r}=Ve(),{isFeatureEnabled:A}=r(H.isReconV3Enabled),{isFeatureEnabled:l}=r(H.isReconciliationCombinedStatementEnabled),v=st.getSignedInUser(),x=F((y=>ke(y))),T=s.useMemo((()=>({userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:x?.tenantId??""})),[v?.userId,v?.zeniSessionId,x?.tenantId]),{accountReconciliationsByAccountID:C,excludedAccountIDs:f,monthYearPeriod:m,statementUploadChosen:z}=t,w=C[n],I=s.useMemo((()=>Zn(C,n)),[C,n]),p=s.useMemo((()=>es(C)),[C]),P=s.useMemo((()=>ts(C,n)),[C,n]),_=s.useRef(!1),G=s.useCallback((y=>{_.current=y,ba(n,y)}),[n]),N=s.useCallback((y=>{i(Ct({accountId:n,selectedPeriod:m,dismissedToBackground:!0,backgroundCompletedSteps:y.completedSteps,startedAtMs:y.startedAtMs,totalDurationSeconds:y.totalDurationSeconds})),y.accountMappings!=null&&i(Qe({accountId:n,selectedPeriod:m,localData:{combinedStatementAccountMappings:y.accountMappings}})),w!=null&&requestAnimationFrame((()=>{_.current||i(Tt({messageSection:"statement_parsing_in_progress",messageText:"success",type:"info",showStatusIcon:!0,variables:[{variableName:"_account_name_",variableValue:Rc(w)}]}))}))}),[i,m,w,n]),q=s.useCallback((()=>{i(Ct({accountId:n,selectedPeriod:m,dismissedToBackground:!1}))}),[i,n,m]),h=s.useCallback((y=>{i(ia({accountId:n,selectedPeriod:m,backgroundCompletedSteps:y}))}),[i,m,n]),$=s.useCallback((()=>{i(ia({accountId:n,selectedPeriod:m,backgroundCompletedSteps:0})),i(Ct({accountId:n,selectedPeriod:m,dismissedToBackground:!1}))}),[i,m,n]);s.useEffect((()=>()=>{ba(null,!1)}),[]);const e=w?.parsedStatementData?.statementUpload?.statementMeta?.statementUploadId??w?.accountReconEntity.statementMetaData?.statementUploadId,a=w?.statementDateConflict?.previousReconciliationInfo?.reconciledByUserId,c=F((y=>a!=null&&a!==""?as(ns(y.userState,a)):"")),u=s.useCallback((()=>{i(la({accountId:n,selectedPeriod:m}))}),[i,n,m]),b=s.useCallback((()=>{i(la({accountId:n,selectedPeriod:m})),i(Xe({statementUploadChosen:!0}))}),[i,n,m]),E=(y,Z)=>{i(Cs(y,Z.split(".")[0]))},D=(y,Z)=>{if(Z===!0){const ne=w?.combinedStatementGroupId??w?.parsedStatementData?.statementUpload?.statementMeta?.combinedStatementGroupId??w?.parsedStatementData?.statementUpload?.combinedStatementDetails?.combinedStatementGroupId;if(ne!=null&&ne!=="")return void i(Ss({accountId:n,selectedPeriod:m,combinedStatementGroupId:ne,fileId:y}))}e!=null&&i(gs({accountId:n,selectedPeriod:m,fileId:y,statementUploadId:e}))},M=()=>{i(Xe({statementUploadChosen:!1}))},J=y=>{i(hs({accountId:n,selectedPeriod:m,payload:y,statementAccountScope:l===!0?w?.localData?.statementAccountScope??"single_account":"single_account"}))},Y=s.useCallback(((y,Z,ne)=>{i(ss({accountId:y,selectedPeriod:Z,statementUploadId:ne}))}),[i]),oe=s.useCallback(((y,Z,ne,Q,ce)=>{ce!=null&&ce!==""&&i(os(ce)),i(Q==null||Q===""?is({accountId:y,selectedPeriod:Z,statementUploadId:ne}):cs({accountId:y,selectedPeriod:Z,statementUploadId:ne,combinedStatementGroupId:Q}))}),[i]),ae=s.useCallback(((y,Z)=>{Z!==""&&i(ls({accountId:n,selectedPeriod:m,statementUpdateLocalData:y,statementUploadId:Z}))}),[i,n,m]),Pe=s.useCallback((()=>{e!=null&&i(w?.localData?.statementAccountScope!=="multi_account"?ds({accountId:n,selectedPeriod:m,statementUploadId:e}):rs({accountId:n,selectedPeriod:m,statementUploadId:e}))}),[i,w?.localData?.statementAccountScope,n,m,e]),ye=s.useCallback((y=>{e!=null&&i(us({accountId:n,selectedPeriod:m,statementUploadId:e,accountMappings:y}))}),[i,m,n,e]),ve=s.useCallback((()=>{i(Xe({statementUploadChosen:!0}))}),[i]),K=y=>{i(Qe({accountId:n,selectedPeriod:m,localData:{accountSource:y}}))},ot=y=>{i(Qe({accountId:n,selectedPeriod:m,localData:{statementAccountScope:y}}))},Ee=s.useCallback((()=>{i(Ra({accountId:n}))}),[i,n]),B=s.useCallback((y=>{i(ue(m,y,!0)),S()}),[i,m,S]),ct=s.useCallback((()=>{i(ms({accountId:n,selectedPeriod:m,statementProcessingFailed:!1})),i(ps({accountId:n,selectedPeriod:m}))}),[i,n,m]),Ae=s.useCallback((()=>{i(Da({accountId:n}))}),[i,n]),je=f.includes(n)?t.excludedAccountReconciliationByAccountID[n]:void 0;if(je!=null)return k.jsx(Ea,{children:k.jsx(Aa,{$isV3:A===!0,children:k.jsx(Dc,{excludedAccountReconciliation:je,includeAccountFetch:t.includeAccountFetchState,isReconV3Enabled:A,onDismissClick:S,onIncludeIntoReconciliation:Ae})})});if(w!=null){const y=A===!0?k.jsx(Fc,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:w,monthYearPeriod:m,onDismissClick:S,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:g,onEstablishConnectionClick:d,onEditFileName:E,onDeleteFile:D,onSelectSourceType:K,onSelectStatementAccountScope:ot,isReconciliationCombinedStatementEnabled:l===!0,ledgerAccounts:I,statementOverrideWarningAccountIds:P,unavailableLedgerAccountIds:p,onConfirmStatementMapping:ye,filesEndPoint:Ue.fileMicroServiceBaseUrl,authParams:T,openFilePicker:z,onStatementUploadSuccess:J,onUploadWindowOpenedOnce:M,onExcludeFromReconciliation:Ee,onRetryParsing:Y,onFetchStatementParseInfo:oe,onReviewClicked:B,statementProcessingFailed:w.statementProcessingFailed,statementProcessingDismissedToBackground:w.statementProcessingDismissedToBackground,onDismissStatementProcessingFailed:ct,onContinueInBackground:N,onClearStatementProcessingDismissedToBackground:q,onResetStatementProcessingProgress:$,onStatementProcessingProgressChange:h,onStatementFlowVisibilityChange:G,onReuploadStatement:ve,onStatementFormDataChange:ae,onStatementConfirmSave:Pe,reconciledByName:c,onDismissDateConflict:u,onReuploadAfterDateConflict:b,isReconV3Enabled:A}):k.jsx(_c,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:w,monthYearPeriod:m,onDismissClick:S,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:g,onEstablishConnectionClick:d,onEditFileName:E,onDeleteFile:D,onSelectSourceType:K,filesEndPoint:Ue.fileMicroServiceBaseUrl,authParams:T,openFilePicker:z,onStatementUploadSuccess:J,onUploadWindowOpenedOnce:M,onExcludeFromReconciliation:Ee});return k.jsx(Ea,{children:k.jsx(Aa,{$isV3:A===!0,children:y})})}return null})),Ea=Te.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,Aa=Te.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: ${t=>t.$isV3===!0?"hidden":"auto"};
21
- `;function yi({panelType:t,scheduleId:n,onClose:S,onCloseAfterDecision:g}){return k.jsx(Ei,{children:k.jsx(Ai,{children:vi(t,n,S,g)})})}function vi(t,n,S,g){switch(t){case"one_time_accrual":return k.jsx(pi,{isRenderedInPanel:!0,accrualIdOverride:n,onPanelNavigateBack:S});case"accrued_expenses":return k.jsx(mi,{isRenderedInPanel:!0,scheduleDetailIdOverride:n,onPanelNavigateBack:S,onPanelCloseAfterDecision:g});case"fixed_assets":return k.jsx(ui,{isRenderedInPanel:!0,scheduleDetailIdOverride:n,onPanelNavigateBack:S,onPanelCloseAfterDecision:g});case"prepaid_expenses":return k.jsx(di,{isRenderedInPanel:!0,scheduleDetailIdOverride:n,scheduleTypeOverride:"prepaid_expenses",onPanelNavigateBack:S,onPanelCloseAfterDecision:g})}}const Ei=Te.div`
22
- display: flex;
23
- flex-direction: column;
24
- height: 100%;
25
- `,Ai=Te.div`
26
- flex: 1;
27
- min-height: 0;
28
- display: flex;
29
- flex-direction: column;
30
- box-sizing: border-box;
31
- min-width: 0;
32
- overflow-x: hidden;
33
- overflow-y: auto;
34
- `,xi=/^schedule\/(prepaid_expenses|fixed_assets|accrued_expenses|one_time_accrual)\/([^/?]+)$/,wi=Wa({displayNamePrefix:"withScheduleSidePanel",usePanelSetup:function(t){const n=(function(C=!0){const f=nt(),m=be(),z=ge(),w=Be(),I=Ha({childPathPattern:xi,enabled:C}),p=I.matchGroups[0],P=Ka(p)?p:void 0,_=I.matchGroups[1]!=null&&I.matchGroups[1]!==""?I.matchGroups[1]:void 0,G=I.isOpen&&P!=null&&_!=null,N=w.tenantEmailDomain??m.pathname.split("/").find(Boolean)??"",q=s.useRef({isOpen:G,scheduleId:_});q.current={isOpen:G,scheduleId:_};const h=s.useCallback(((e,a,c)=>{c!=null&&(a==="prepaid_expenses"||a==="fixed_assets")&&z(Oa({selectedJEScheduleKey:c})),!I.isMobile&&C?q.current.isOpen&&q.current.scheduleId===e?I.closePanel():I.navigateToChild(`schedule/${a}/${e}`,{replace:q.current.isOpen}):f(va(a,e,N),{state:{message:"expenseAutomation",origin:"je_schedules"}})}),[z,f,I.isMobile,I.navigateToChild,I.closePanel,C,N]),$=s.useCallback((()=>{if(P==null||_==null)return;const e=ee(m.state?.pathnameStackToGoBack,m.pathname);f(va(P,_,N),{state:{pathnameStackToGoBack:e,message:"expenseAutomation",origin:"je_schedules"}})}),[f,P,_,N,m.pathname,m.state]);return{closePanel:I.closePanel,isOpen:G,maximize:$,openPanel:h,panelType:G?P:void 0,scheduleId:G?_:void 0}})(t),S=s.useRef(null),[g,d]=s.useState(null),i=s.useMemo((()=>({registerPanelDirtyGuard:C=>{S.current=C}})),[]),r=s.useCallback((C=>{S.current?.isDirty()===!0?d((()=>C)):C()}),[]),A=s.useCallback((()=>{r(n.closePanel)}),[r,n.closePanel]),l=s.useCallback((()=>{r(n.maximize)}),[r,n.maximize]),v=s.useCallback(((C,f,m)=>{r((()=>n.openPanel(C,f,m)))}),[r,n.openPanel]),x=s.useMemo((()=>{if(g!=null)return{onCancel:()=>d(null),onDiscard:()=>{S.current=null,d(null),g()}}}),[g]),T=s.useMemo((()=>{if(n.isOpen&&n.panelType!=null&&n.scheduleId!=null)return k.jsx(Mc.Provider,{value:i,children:k.jsx(yi,{panelType:n.panelType,scheduleId:n.scheduleId,onClose:A,onCloseAfterDecision:()=>{S.current=null,n.closePanel()}},`${n.panelType}:${n.scheduleId}`)})}),[n.isOpen,n.panelType,n.scheduleId,n.closePanel,A,i]);return{injectedProps:s.useMemo((()=>({closeSchedulePanel:A,isSchedulePanelOpen:n.isOpen,openSchedulePanel:v,schedulePanelContent:T,schedulePendingDiscardConfirmation:x})),[A,v,T,x,n.isOpen]),selectedItemId:n.scheduleId,sidePanel:{closePanel:A,maximize:l}}}});function Ri({companyId:t,closeCustomerRequestDrawer:n,addCustomerRequest:S,resetCustomerRequest:g}){const d=st.getSignedInUser();if(d==null)throw Error("Can't access Customer Request page without signing in...");const i=F((r=>fs(r,t,d)));return s.useEffect((()=>{g()}),[]),k.jsx(k.Fragment,{children:i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?k.jsx(Na,{fetchState:"In-Progress"}):k.jsx(Oc,{onCloseClick:n,addCustomerRequest:S,snippets:i.companyMonthEndReportTemplatesData,bulletPoints:i.zeniRequestsData??[]})})}const Di={schedules:"Review Schedules",actual_matching:"Actual Matching",existing_schedules:"Existing Schedules"},Fi=()=>{const t=F((x=>Oe(x))),n=be(),{currentSelectedViewFetchState:S,currentSelectedView:g,selectedPeriod:d}=t,i=et(g),r=et(S.fetchState),A=t.jeSchedules.uiState.selectedPageTab??"schedules",l=et(A),v=s.useCallback((x=>{const T=n.state?.referrer;g==="transaction_categorization"&&(t.selectedTransactionCategorizationTab==="review"?W.trackTransactionsReviewPage(d.month,d.year,t.transactionView.totalCountByTab.review,0,x,T??null):W.trackTransactionsAutoCategorisedPage(d.month,d.year,t.transactionView.totalCountByTab.autoCategorized,0,x,T??null)),g==="missing_receipts"&&W.trackMissingReceiptsPage(d.month,d.year,x,t.missingReceipts.transactions.length,T??null),g==="je_schedules"&&W.trackMonthCloseScheduleListPage(d.month,d.year,x,t.jeSchedules.pendingReviewSchedules.length,t.jeSchedules.failedPostings.length,(C=>{const f={accruedCount:0,fixedAssetsCount:0,oneTimeAccrualCount:0,prepaidCount:0};return C.forEach((m=>{if(Is(m))f.oneTimeAccrualCount+=1;else switch(ks(m)){case"prepaid_expenses":f.prepaidCount+=1;break;case"fixed_assets":f.fixedAssetsCount+=1;break;case"accrued_expenses":f.accruedCount+=1}})),f})(t.jeSchedules.pendingReviewSchedules),Di[A],T??null),g==="flux_analysis"&&W.trackFluxAnalysisPage(d.month,d.year,x,_i(t.fluxAnalysis),T??null),g==="month_end_insights"&&t.auditSummary?.auditScorePercentage!=null&&W.trackInsightsEmailPage(d.month,d.year,x,"draft",t.auditSummary.auditScorePercentage,null,T??null)}),[d,t,A]);return s.useEffect((()=>{(r!==S.fetchState||g!==i||g==="je_schedules"&&l!=null&&A!==l)&&S.fetchState==="Completed"&&v(!1)}),[g,S.fetchState,i,A,l]),v},_i=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Mi,comma:xa,space:Oi}},dateFormat:Qa}=Wc.getLocalizedStrings(),wa=Ec,Ui=Yn((function(t,n){const{uncategorizedAccounts:S,vendorSearchAutoCompleteData:g,monthEndInsightsCustomerRequestData:d,monthEndInsightsPreviewMode:i,companyId:r,isMissingReceiptsBulkUploadEnabled:A,isTransactionActivityEnabled:l,newScheduleActiveType:v}=n,x=st.getSignedInUser(),T=t.tenantState.currentTenantId,C={userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:T??""},f=Oe(t),{selectedTransactionCategorizationTab:m}=f,{searchTransactionsResults:z,searchTransactionsFetchState:w}=Ns(t),I=v==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{accountListNestedAccountHierarchy:p,classListNestedAccountHierarchy:P,allDepreciationAccountListNestedAccountHierarchy:_,newScheduleLocalData:G,saveStatus:N}=qs(t,I);return{expenseAutomationViewSelector:f,accountListNestedAccountHierarchy:p,allDepreciationAccountListNestedAccountHierarchy:_,baseTransactionSearchFetchState:w,baseTransactionSearchResults:z,classListNestedAccountHierarchy:P,newScheduleLocalData:G,initialSelectedBaseTransaction:G.selectedBaseTransactionId!=null?Js(t.transactionState,Ys(G.selectedBaseTransactionId)):void 0,newAccrualAccountsView:Hs(t),newScheduleSaveStatus:N,bulkUploadSelector:A===!0?f.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:g,authParams:C,receiptUploadEndpoint:`${Ue.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Pa}/transaction_attachments`,bulkUploadEndpoint:A===!0?`${Ue.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:m,selectedTransactionGroup:f.transactionView.selectedTransactionGroup,monthEndInsightsCustomerRequestData:d,monthEndInsightsPreviewMode:i,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:x,uncategorizedAccounts:S,companyId:r,isTransactionActivityEnabled:l,receiptsEmail:Ks(t.tenantState,T),downloadParams:{authParams:C,jeScheduleEndPoint:`${Pa}/jeScheduleReports`,timezone:Ws(),companyName:ke(t).companyName}}}),(function(t,n){const{themeState:S,isAccountingClassesEnabled:g,isCOTEnabled:d,isMissingReceiptsBulkUploadEnabled:i,location:r,vendorSearchAutoCompleteData:A,expenseAutomationViewSelector:l,currentTenant:v,newScheduleActiveType:x,uncategorizedAccounts:T,navigate:C,onClickCustomerRequest:f,handleEditClick:m,closeSchedulePanel:z,isSchedulePanelOpen:w,openSchedulePanel:I,setActivityLogTransactionId:p}=n,{selectedPeriod:P,currentSelectedView:_,reconciliation:{selectedAccountId:G}}=l,{accountSettingsView:N}=l.jeSchedules,q=Ua(P),h=at(q.start),$=at(q.end);return{onZeniLogoClick:()=>{S.toggle()},onUploadReceiptAttachment:e=>{W.trackMissingReceiptAttached(P.month,P.year),t(pc(e))},onUploadTransactionReceipt:(e,a,c,u,b,E)=>{t(Ia(e,a,{fetchState:"In-Progress"}));const D=()=>t(Ia(e,a,{fetchState:"Error"}));Xc(`${Ue.accountMicroServiceBaseUrl}/1.0/transactions/${a}/attachments`,E,a,c,u,b).then((M=>{M!=null?t(mc(e,M)):D()})).catch(D)},onMissingReceiptsRowClick:(e,a)=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,a);const c=ee(r.state?.pathnameStackToGoBack,r.pathname);C(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,a)=>{t(uc(e,a)),v!=null&&t(Me({tenantId:v.tenantId,period:a,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,a,c,u)=>{t(dc(e,{fetchState:a,error:c})),c!=null&&t(Tt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:u!=null?Oi+Mi+u+xa:xa}]}))},onUpdateJESchedulesUIState:e=>{const a=l.jeSchedules.uiState,c=e.selectedPageTab!=null&&e.selectedPageTab!==a.selectedPageTab,u=e.selectedJETypeFilter!==void 0&&e.selectedJETypeFilter!==a.selectedJETypeFilter;c&&n.closeMatchSidePanel?.(),w===!0&&(c||u)&&z?.(),e.createdGroupCollapsed!=null?t(oc()):e.pendingGroupCollapsed!=null?t(cc()):e.failedGroupCollapsed!=null?t(ic()):e.selectedJETypeFilter!==void 0?t(lc(e.selectedJETypeFilter)):t(rc(e))},onUpdateMissingReceiptsUIState:e=>{t(sc(e))},onFetchMissingReceiptsList:()=>{$!=null&&h!=null&&t(ja({start:h,end:$},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...i===!0?{onBulkUploadFiles:e=>{t(vc(e))},onBulkUploadProgress:e=>{t(yc(e))},onBulkUploadSuccess:e=>{t(Pc({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Tc(e))},onConfirmBulkUploadMatch:(e,a,c,u,b)=>{t(bc(e,a,c,u,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(kc())},onSetBulkUploadResultsTab:e=>{t(Ic(e))},onSetBulkUploadCompletedSubTab:e=>{t(fc(e))},onSetBulkUploadSortConfig:(e,a)=>{t(ka({sortKey:e,sortOrder:a}))},onClearBulkUpload:()=>{t(Cc())},onSearchTransactionsForManualMatch:(e,a)=>{t(wa(e,a??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=l.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(wa(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,a)=>{t(gc(e,a))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Sc())},onFetchBulkUploadBatches:e=>{t(Ba(e))},onFetchMoreBatchDetails:()=>{t(hc())},onResetBulkUploadSort:()=>{t(ka({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(nc())},onSearchTextChanged:e=>{const a=l.currentSelectedView,c=l.selectedTransactionCategorizationTab;a==="transaction_categorization"&&(t(ft({selectedTab:c,uiState:{searchString:e}})),$!=null&&h!=null&&t(Se(c,{start:h,end:$},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const a=l.selectedTransactionCategorizationTab;t(ac({filters:e,selectedTab:a}))},onRefresh:()=>{n.trackExpenseAutomationTabAnalytics(!0),t(tc())},onClose:()=>{_==="reconciliation"&&G!=null&&t(fa({selectedAccountId:void 0})),C("../")},onBack:()=>{_==="reconciliation"&&G!=null&&t(fa({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(ec(e))},onSaveReconciliationReview:e=>{t(Zo(e))},onUpdateStep:e=>{const{selectedPeriod:a}=l,c=ee(r.state?.pathnameStackToGoBack,r.pathname);C(`../${e}/${a.month}-${a.year}`,{state:{pathnameStackToGoBack:c,referrer:l.currentSelectedView}}),t(Va(e))},handleLogOutClick:()=>{const e=ee(r.state?.pathnameStackToGoBack,r.pathname);C("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:a}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:u,accruedExpensesAccount:b}=a,E=It(N.prepaidExpensesAccountList,c.selectedOptions),D=It(N.fixedAssetsAccountList,u.selectedOptions),M=It(N.accruedExpensesAccountList,b.selectedOptions),J={selectedPrepaidExpensesAccountIds:E.map((Y=>Y.accountId)),selectedFixedAssetsAccountIds:D.map((Y=>Y.accountId)),selectedAccruedExpensesAccountIds:M.map((Y=>Y.accountId))};t(Xo({data:J}))},onSaveJeAccountSettingsClick:()=>{t(Qo())},onJESchedulesFormDataChange(e,a){const{jeScheduleID:c,accumulatedDepreciationCategory:u,scheduleClass:b,scheduleExpenseCategory:E,vendor:D}=a,{allAccountList:M,allClassList:J,allDepreciationAccountList:Y}=l.jeSchedules,oe=A.entityAutoCompleteView.vendor.length>0?A.entityAutoCompleteView.vendor.find((K=>K.id===D?.selectedOption)):void 0,ae={id:oe?.zeniId??D?.selectedOption??"",name:oe?.name??D?.defaultOptions.find((K=>K.value===D?.selectedOption))?.label??"",logo:oe?.logo},Pe=E?.selectedOption!=null?M.find((K=>K.qboId===E.selectedOption)):void 0,ye=b?.selectedOption!=null?J.find((K=>K.classId===b.selectedOption)):void 0,ve=u?.selectedOption!=null?Y.find((K=>K.qboId===u.selectedOption)):void 0;t(Ko({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:Pe?.accountId,updatedClassId:ye?.classId,updatedAccumulatedDepreciationCategoryID:ve?.accountId,updatedVendor:{id:ae.id,name:ae.name}}}))},onRevertJeSchedule(e,a,c,u,b){t(Wo(e,a,c,u,b))},ignoreRecommendedJeSchedule(e,a,c,u){t(Ho(e,a,c,u))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,a)=>{e.trim().length>=2?t(pa({searchString:e,entityType:a,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onCancelAutoComplete:()=>{t(Ke("common"))}},onPostJESchedule(e,a){t(Yo({scheduledJournalEntryID:e,jeScheduleTransactionKey:a}))},clearJeScheduleLocalData(){t(Jo())},onViewTransaction(e){if(n.tenantEmailDomain==null)return;const a=gi(e,n.tenantEmailDomain),c=ee(n.location.state?.pathnameStackToGoBack,`${n.location.pathname}${n.location.search}`);n.navigate(a,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"je_schedules"}})},onSearchBaseTransaction(e){t(qo({query:e,scheduleType:x==="prepaid_expenses"?"prepaid_expenses":"fixed_assets"}))},onNewScheduleFormChange(e,a){const c=vt(e)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets";t(Ca({scheduleType:c,localData:a}))},onOpenMatchNewModal(){t(No())},onIgnoreMatchSuggestion(e,a,c){t(Go(e,a,c))},onCloseMatchNewModal(){t($o())},onClearMatchNewModal(){t(Lo())},onSearchMatchTransactions(e,a){t(zo(e,a))},onSearchMatchAccruals(e,a){t(jo(e,a))},onMatchAndReverse(e){t(Vo(e.transactionId,e.transactionIntegrationId,e.transactionType,e.lineIds,e.transactionSyncToken,e.accrualIds,!0))},onUpdateActualMatchingUIState(e){t(Bo(e))},onUndoReversal(e,a){t(Uo(e,a))},onSaveSchedule(e,a){const c=e==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{allAccountList:u,allDepreciationAccountList:b}=l.jeSchedules,E=a.selectedAccount!=null?u.find((M=>M.qboId===a.selectedAccount)):void 0,D=a.selectedAccumulatedDepreciationCategory!=null?b.find((M=>M.qboId===a.selectedAccumulatedDepreciationCategory)):void 0;t(Ca({scheduleType:c,localData:{...a,selectedAccount:E?.accountId,selectedAccumulatedDepreciationCategory:D?.accountId}})),t(Oo({scheduleType:c}))},onCreateAccruedSchedule(e){const a="accrued_expenses";t(Ro()),t(Do()),t(Fo({scheduleType:a,localData:e,selectedJeScheduleDetailId:void 0})),t(_o({scheduleType:a})),t(Mo(a,void 0))},onCreateOneTimeAccrual(e){t(wo(e))},handleJeScheduleClick:(e,a,c)=>{if((function(b,E){return E!=="accrued_expenses"})(0,c)&&t(Oa({selectedJEScheduleKey:a})),I!=null&&Ka(c))return void I(e,c,a);const u=ee(r.state?.pathnameStackToGoBack,r.pathname);C(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:u,message:"expenseAutomation",origin:"je_schedules"}})},onOneTimeAccrualFeedback:(e,a,c,u)=>{t(a!=="revert"?xo(e,c,u):Ao(e,c,u))},onOneTimeAccrualClick:e=>{if(I!=null)return void I(e,"one_time_accrual");const a=ee(r.state?.pathnameStackToGoBack,r.pathname);C(`../../vendors/schedules/one_time_accrual/details/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"je_schedules"}})},onOpenMatch:e=>{n.openMatchPanel?.(e)},onOpenBill(e){if(n.tenantEmailDomain==null)return;const a=ii(e,n.tenantEmailDomain,n.location);n.navigate(a.pathname,{state:a.state})},improveMonthEndInsightsUsingZeniGPTClick:e=>{v!=null&&t(Eo(e,v.companyId,v.tenantId))},onClickCustomerRequest:f,setActivityLogTransactionId:p,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(vo())},onOpenFileAttachmentSnackBar:()=>{t(Tt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(yo(e))},onUpdateFileAttachment:e=>{t(Po({files:e}))},previewMonthEndReport:(e,a,c,u,b)=>{v!=null&&t(ga(e,v.companyId,a,!0,c,u,{agentInsightEdits:b,tenantId:v.tenantId}))},saveMonthEndReport:(e,a,c,u,b)=>{v!=null&&t(ga(e,v.companyId,a,!1,c,u,{agentInsightEdits:b,tenantId:v.tenantId}))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const a=r.state?.referrer,{selectedPeriod:c,auditSummary:u}=l;v!=null&&u?.auditScorePercentage!=null&&(t(bo(v.companyId,e,v.tenantId)),W.trackInsightsEmailPage(c.month,c.year,!1,"draft",u.auditScorePercentage,To().format(Qa.analytics.MMMDDCommaYYYYformat),a??null))},onTransactionCategorizationRowClick:(e,a)=>{const c=l.transactionView.uiState.searchString??"",u=l.transactionView.transactions,b=u.findIndex((M=>M.id===e)),E=c.length>0?{resultPosition:b>=0?b+1:void 0,resultsCount:u.length,searchTerm:c}:void 0;if(n.openTransactionPanel)return void n.openTransactionPanel(e,a,E);const D=ee(r.state?.pathnameStackToGoBack,r.pathname);C(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:D,message:"expenseAutomation",origin:"transaction_categorization",searchContext:E}})},setLocalDataForCategoryAndClass:(e,a,c,u,b,E,D,M,J,Y,oe,ae)=>{t(ko(e,a,c,u,T,b,E,D,M,J,Y,oe,ae))},onCancelAutoComplete:()=>{t(Ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(ha({scrollPosition:e}))},onUpdateTab:e=>{n.closeSidePanel?.(),$!=null&&h!=null&&(t(Se(e,{start:h,end:$},!1,!1)),t(Io(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{n.closeSidePanel?.(),$!=null&&h!=null&&(t(fo(e)),t(Se("autoCategorized",{start:h,end:$},!1,!1)))},onTransactionGroupChange:e=>{n.closeSidePanel?.(),$!=null&&h!=null&&(t(Co(e)),t(Se(n.expenseAutomationViewSelector.selectedTransactionCategorizationTab,{start:h,end:$},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,a)=>{t(ft({selectedTab:e,uiState:a})),$!=null&&h!=null&&t(Se(e,{start:h,end:$},!1,!1,a.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,a)=>{t(ft({selectedTab:e,uiState:a}))},onFetchTransactionCategorizationList:(e,a,c,u,b,E)=>{$!=null&&h!=null&&t(Se(e,{start:h,end:$},!0,c,a,u,b,E))},resetTransactionCategorizationLocalData:(e,a,c,u,b,E,D)=>{t(go(e,a,c,u,D??null,b,E,!1)),si(t,a.map(String))},updateSelectedVendorForTransaction:(e,a,c,u,b)=>{t(Sa({selectedTab:e,transactionId:a,lineId:c,selectedTransaction:u,uncategorizedAccounts:T,updatedVendor:b,isAccountingClassesEnabled:g}))},onSaveUpdateTransactionCategorization:(e,a,c)=>{const u=r.state?.referrer;e==="autoCategorized"?W.trackTransactionsAutoCategorisedPage(P.month,P.year,l.transactionView.totalCountByTab.autoCategorized,a.length,!1,u??null):W.trackTransactionsReviewPage(P.month,P.year,l.transactionView.totalCountByTab.review,a.length,!1,u??null),t(So(e,a,c)),ni(a.map(String))},onUpdateSelectedCheckboxTransactionIds:(e,a)=>{t(ho({selectedTab:e,transactionIds:a}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,a,c,u,b,E)=>{const{transactionId:D,transaction:M,lineIds:J}=a;E!=null&&t(mo({transactionId:D,customerUpdates:E})),t(po({selectedTab:u,transactionId:D.id,lineId:J[0],selectedTransaction:M,uncategorizedAccounts:T,updatedCustomer:E,selectedEntity:b,isAccountingClassesEnabled:g})),b!=null&&t(yt({entity:b,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:u,isFetchCOT:d}))},onFetchRecommendationsForEntityCategorization:(e,a,c,u,b,E)=>{const{transactionId:D,transaction:M,lineIds:J}=a;E!=null&&(t(lo({transactionId:D,vendorUpdates:{name:E.name,id:E.id?E.id:void 0}})),t(ro({vendorId:E.id?E.id:void 0,localData:{vendorName:E.name,vendorId:E.id?E.id:void 0}}))),E?.id?(t(Sa({selectedTab:u,transactionId:D.id,lineId:J[0],selectedTransaction:M,uncategorizedAccounts:T,updatedVendor:E,selectedEntity:b,isAccountingClassesEnabled:g})),b!=null&&t(yt({entity:b,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:u,isFetchCOT:d}))):t(uo({selectedTab:u,transactionId:D.id,lineId:J[0]}))},fetchFluxViewOnScroll:(e,a)=>{t(Ze(e,!0,!1,a,!1,!0))},onFetchFluxViewList:()=>{t(Ze(P,!0,!1,null,!1,!1))},markAsReview:(e,a,c,u)=>{W.trackFluxAnalysisReviewed(c.month,c.year,u??!1,e),t(io(a,e,c,u??!1))},onUpdateFluxAnalysisUIState:e=>{t(co(e))},updateOperatingExpensesIdsForReview:e=>{t(oo({operatingExpenseIds:e,selectedPeriod:P}))},redirectToVendorDetailPage:e=>{if(n.tenantEmailDomain!=null){const a=Si(e.id,e.qboId,n.tenantEmailDomain),c=ee(n.location.state?.pathnameStackToGoBack,n.location.pathname);n.navigate(a,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(so({sectionId:e,selectedPeriod:P}))},onFetchReimbursementView:(e,a,c)=>{t(Ze(e,!0,!1,a,!0,c))},onReviewClicked:e=>{t(ue(P,e))},setOpenDrawerClicked:e=>{t(tt({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,a)=>{t(Fa("expense_automation_reconcile",e,a))},onEstablishConnectionClick:(e,a)=>{const c=v?.companyId;c!=null&&(t(_a(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",a)),t(Ma({accountId:a,connectionInProgress:!0})))},onAddStatementClick:e=>{t(tt({selectedDrawerAccountId:e})),t(Qe({accountId:e,selectedPeriod:P,localData:{accountSource:"bank_statement"}})),t(Xe({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ue(P,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(no({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,a)=>{t(ao({sortKey:e,sortOrder:a}))},onReconReviewTabColumnSortConfigChanged:(e,a)=>{t(to({sortKey:e,sortOrder:a}))},onReconTabUpdate:e=>{n.closeSidePanel?.(),t(eo({selectedTab:e}))},updateReconReviewTabLocalData:(e,a,c)=>{const u=e.vendor?.id;c&&u!=null&&t(Xs(u)),t(Zs({data:e,transactionId:a}))},onReconMatchedTransactionClick:e=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,Pt("bill"));const a=ee(r.state?.pathnameStackToGoBack,r.pathname);C(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{C(-1)},onReconListPageScroll:e=>{t(ha({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(pa({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onReconNodeCollapseToggled:(e,a)=>{t(Qs({nodeId:e,collapsed:a}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Ra({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Da({accountId:e}))}}}),((t,n,S)=>{const{isMissingReceiptsBulkUploadEnabled:g,...d}=S;return(function(i,r,A){return{...i,...r,...A,onUploadTransactionReceipt:(l,v,x,T,C)=>{r.onUploadTransactionReceipt(l,v,x,T,C,i.authParams)}}})(t,n,d)}))(Kc(Qc)),kt="newScheduleMode",bt="newScheduleType",Bi=wi(ri((function(t){const n=t.displayName??t.name??"Component",S=La.memo(t),g=d=>{const i=ge(),r=(function(){const I=ge(),p=F((P=>Oe(P).reconciliation.selectedDrawerAccountId));return{isOpen:p!=null,selectedAccountId:p,openPanel:s.useCallback((P=>{I(tt({selectedDrawerAccountId:P}))}),[I]),closePanel:s.useCallback((()=>{I(tt({selectedDrawerAccountId:void 0}))}),[I])}})(),A=F((I=>Oe(I).reconciliation)),l=F((I=>ke(I))),v=s.useCallback(((I,p)=>{i(Fa("expense_automation_reconcile",I,p))}),[i]),x=s.useCallback(((I,p)=>{const P=l?.companyId;P!=null&&(i(_a(I,P,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",p)),i(Ma({accountId:p,connectionInProgress:!0})))}),[i,l?.companyId]),T=s.useMemo((()=>{if(r.isOpen&&r.selectedAccountId!=null)return k.jsx(Pi,{reconciliation:A,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:v,onEstablishConnectionClick:x})}),[r.isOpen,r.selectedAccountId,r.closePanel,A,v,x]),C=s.useMemo((()=>({reconPanelContent:T,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel})),[T,r.isOpen,r.closePanel]),{useFeatureGate:f}=Ve(),{isFeatureEnabled:m}=f(H.isReconV3Enabled),z=s.useContext(Ta),w=s.useMemo((()=>r.isOpen?m===!0?{selectedItemId:r.selectedAccountId}:{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:z),[r.isOpen,r.closePanel,r.selectedAccountId,z,m]);return k.jsx(Ta.Provider,{value:w,children:k.jsx(S,{...d,...C})})};return g.displayName=`withReconSidePanel(${n})`,g})(Ti((({closeMatchSidePanel:t,closeReconSidePanel:n,closeSidePanel:S,matchPanelContent:g,isMatchPanelOpen:d,matchPanelMatchId:i,openMatchPanel:r,openTransactionPanel:A,panelContent:l,reconPanelContent:v,reconSidePanelIsOpen:x,isSchedulePanelOpen:T,closeSchedulePanel:C,openSchedulePanel:f,schedulePanelContent:m,schedulePendingDiscardConfirmation:z,sidePanelIsFullView:w,sidePanelIsOpen:I})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:P}=Uc(),_=Bc(),{isOpen:G}=Vc(),N=nt(),q=be(),h=ge(),{isAiCfoAccessEnabled:$,onAskAiCfoClick:e}=qa({mobileExploreReferrer:"Transaction categorization"}),a=s.useCallback((()=>{d===!0&&t?.(),I===!0&&w!==!0&&S?.()}),[t,S,d,w,I]),c=F(Es);s.useEffect((()=>{c!=null&&(i===c&&a(),h(As()))}),[c,a,h,i]);const u=F(xs);s.useEffect((()=>{u!=null&&(i===u&&a(),h(ws()))}),[u,a,h,i]);const{areTenantIdsInSync:b}=$a(),E=Fi(),D=jc(),[M,J]=s.useState(!1),[Y,oe]=Jn(),ae=s.useCallback((o=>{oe((R=>{const L=new URLSearchParams(R);return o==null?(L.delete(kt),L.delete(bt),L):(L.set(kt,o.scheduleDetailsMode),L.set(bt,o.scheduleType),L)}),{replace:!0})}),[oe]),[Pe,ye]=s.useState(void 0),ve=s.useCallback(((o,R,L)=>{const j=vt(o);ye(j),ae({scheduleDetailsMode:R,scheduleType:o}),h(da({scheduleType:j==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:L}))}),[h,ae]),K=s.useMemo((()=>{const o=Y.get(kt),R=Y.get(bt);return o!=null&&R!=null?{scheduleDetailsMode:o,scheduleType:R}:void 0}),[Y]),ot=s.useCallback((o=>{ae(o),o!=null&&h(da({scheduleType:vt(o.scheduleType)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:!0}))}),[h,ae]),Ee=F((o=>ra(o))),B=F((o=>ke(o))),[ct,Ae]=s.useState(!1),[je,y]=s.useState(!1),[Z,ne]=s.useState([]),[Q,ce]=s.useState(null),ie=s.useCallback((()=>{ce(null)}),[]),Et=Q?.contentType==="activity"?Q.detail.transactionId:void 0,it=s.useCallback((o=>{o!=null?(p&&P(!1),_(),a(),ce({contentType:"activity",detail:{transactionId:o}})):ce((R=>R?.contentType==="activity"?null:R))}),[a,p,_,P]),Xa=s.useCallback((o=>{p&&P(!1),_(),a(),ce({contentType:"transfer",detail:o})}),[a,p,_,P]),Za=s.useCallback((()=>{_(),ie(),a(),e()}),[a,ie,e,_]),At=s.useRef(p);s.useEffect((()=>{p===!0&&At.current===!1&&(_(),ie(),a()),At.current=p}),[a,ie,p,_]);const xt=s.useRef(G);s.useEffect((()=>{G===!0&&xt.current===!1&&(p&&P(!1),ie(),d===!0&&t?.(),I===!0&&w!==!0&&S?.()),xt.current=G}),[ie,t,S,G,p,d,P,w,I]);const ze=I===!0&&w!==!0||d===!0,wt=s.useRef(ze);s.useEffect((()=>{ze&&!wt.current&&(p&&P(!1),_(),ie()),wt.current=ze}),[ie,p,ze,_,P]);const[Rt,en]=s.useState(!1),Dt=s.useRef(!1),{selectedTab:tn}=Be(),{tenantEmailDomain:lt}=Be(),[rt,Ft]=s.useState(q.state?.message==="comingFromTransactionDetail"),_t=q.state?.message==="comingFromOverview",an=zc(),dt=st.getSignedInUser(),{useFeatureGate:le}=Ve(),{isFeatureEnabled:Mt}=le(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:xe}=le(H.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:ut}=le(H.isTransactionActivityEnabled),{isFeatureEnabled:me}=le(H.isAccrualEnabled),{isFeatureEnabled:Ot}=le(H.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:nn}=le(H.isProjectsTransactionsEnabled),{isFeatureEnabled:sn}=le(H.isReconV3Enabled),on=s.useCallback((o=>{const R=Pt(o.transactionType??(o.view==="reconciliation"?"bill":"expense")),L=ee(q.state?.pathnameStackToGoBack,q.pathname),j=new URLSearchParams({view:"full"});o.threadId!=null&&j.set("thread_id",o.threadId),o.entityType!=null&&j.set("entity_type",o.entityType),N(`/${lt}/transaction/${encodeURIComponent(R)}/${o.transactionId??o.entityId}?${j.toString()}`,{state:{pathnameStackToGoBack:L,message:"expenseAutomation"}})}),[N,lt,q.state,q.pathname]),cn=F((o=>Rs(o,"common"))),V=F((o=>Oe(o))),{categoryOptions:ln,paymentAccountNames:rn}=F((o=>Ds(o.accountState))),dn=F((o=>Fs(o.classState))),{monthEndCloseChecksView:X,currentSelectedView:O,selectedPeriod:U,selectedTransactionCategorizationTab:mt,currentSelectedViewBackgroundRefreshFetchState:un,currentSelectedViewFetchState:re,jeSchedules:pt,reconciliation:Ut}=V;Zc(O==="transaction_categorization");const mn=V.transactionView.saveStatus.fetchState,Le=V.transactionView.transactions,Bt=s.useRef(Le);Bt.current=Le;const Vt=F((o=>o.expenseAutomationTransactionsViewState?.transactionCategorizationView)),jt=F((o=>o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),zt=s.useRef(Vt);zt.current=Vt;const Lt=s.useRef(jt);Lt.current=jt;const $e=F((o=>{const R=o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab;return R!=null?o.expenseAutomationTransactionsViewState?.transactionCategorizationView?.[R]?.filters:void 0})),$t=s.useRef("");s.useEffect((()=>{if(O!=="transaction_categorization")return;const o=V.transactionView.uiState.searchString??"";if(re.fetchState!=="Completed"||o.length===0||o===$t.current)return;$t.current=o;const R=$e!=null?Lc($e):0,L=$e?.categories.filter((j=>j.values.length>0&&String(j.values[0]??"").trim()!=="")).map((j=>`${j.field}:${j.values.join(",")}`))??[];W.trackAiCloseTransactionSearch({filtersApplied:L,hasResults:Le.length>0,isFiltered:R>0,resultsCount:Le.length,searchTerm:o,searchType:"free_text"})}),[O,re.fetchState,V.transactionView.uiState.searchString,V.transactionView.transactions,$e]);const de=ei(mn,(()=>{const o=[],R=Lt.current,L=zt.current,j=L!=null&&R!=null?L[R]:void 0;if(j?.transactionReviewLocalDataById!=null)for(const fe of Object.values(j.transactionReviewLocalDataById)){const te=fe?.transactionReviewLocalData?.lineItemById;if(te!=null)for(const ht of Object.values(te)){const _e=ht?.account;_e?.accountId!=null&&o.push(_e.accountId)}}const Ce=Bt.current;for(const fe of Ce)for(const te of fe.lines??[])"account"in te&&te.account?.accountId!=null&&o.push(te.account.accountId);return o}));s.useEffect((()=>{O==="transaction_categorization"&&I!==!0||it(void 0)}),[O,it,I]),s.useEffect((()=>{x===!0&&n?.()}),[O,Ut.selectedAccountId]);const pn=V.transactionView.selectedTransactionCategorizationCompletedSubTab,hn=V.transactionView.selectedTransactionGroup,Ge=`${mt}|${pn}|${hn}`,Ne=s.useRef(null),Gt=s.useRef(null);s.useEffect((()=>{Ne.current!==null?Ne.current!==Ge&&(Ne.current=Ge,O==="transaction_categorization"&&ie()):Ne.current=Ge}),[ie,O,Ge]);const Sn=F((o=>Et==null?void 0:_s(o.transactionState,Et))),pe=Sn?.qboId,Nt=F((o=>pe==null?void 0:Ms(o,pe)));s.useEffect((()=>{pe!=null&&h(Os(pe))}),[h,pe]);const{createTransferEntryStatus:qt,creditCardTransferAccountsList:Jt,transferAccounts:Yt}=V.transactionView,Ht=s.useCallback((o=>ti(h,o)),[h]),Wt=s.useMemo((()=>O!=="transaction_categorization"||Q==null?null:Q.contentType==="activity"?ut===!0?k.jsx($c,{activityLogView:Nt,qboId:pe,onClose:()=>ce(null),selectedTransactionId:Q.detail.transactionId,isQuickViewCardStyle:!0},String(Q.detail.transactionId)):null:Q.contentType==="transfer"?k.jsx(Gc,{createTransferEntryStatus:qt,creditCardTransferAccountsList:Jt,transaction:Q.detail,transferAccounts:Yt,onClose:()=>ce(null),onCreateTransfer:Ht,isQuickViewCardStyle:!0},String(Q.detail.transactionId)):null),[O,Q,ut,Nt,pe,qt,Jt,Yt,Ht]),gn=Wt!=null,{selectedAccountId:we}=Ut,Kt=et(pt.accountSettingsView.saveState.fetchState),Cn=F((o=>Us(o.accountState,o.accountListState,"accountList"))),fn=F((o=>Bs(o))),Re=Ya(tn)??O,In=F((o=>o.entityAutoCompleteState.autoCompleteText.common));if(Ga({isDataReady:re.fetchState==="Completed"}),dt==null)throw Error("Can't access expense automation screen without signing in...");const Qt=Ua(U),De=at(Qt.start),Fe=at(Qt.end);if(De==null||Fe==null)throw Error(`Invalid start - ${De} and end - ${Fe} period from given ${U}`);const kn=s.useCallback((()=>{Ae(!1)}),[]),bn=s.useCallback((()=>{y(!0)}),[]),Tn=s.useCallback((o=>{ne(o),y(!1)}),[]),Pn=s.useCallback((()=>{ne([])}),[]),qe=V.missingReceipts.bulkUpload.phase,Xt=V.missingReceipts.bulkUpload.currentBatchId;s.useEffect((()=>{xe===!0&&O==="missing_receipts"&&qe==="matching"&&Xt!=null&&h(Ba({cacheOverride:!0}))}),[xe,O,qe,Xt,h]);const Zt=dt?.userId,yn=U.month,vn=U.year,ea=B?.tenantId;s.useEffect((()=>{O==="missing_receipts"&&xe!==!1&&qe==="idle"&&Zt!=null&&ea!=null&&h(Vs())}),[O,xe,qe,Zt,ea,yn,vn,h]),s.useEffect((()=>{Ee.newVendorState?.vendorDetailLocalData?.vendorName!=null?J(!0):J(!1)}),[Ee.newVendorState?.vendorDetailLocalData?.vendorName]),s.useEffect((()=>{Re!=null&&O!==Re&&h(Va(Re))}),[Re]),s.useEffect((()=>{Rt===!1&&re.fetchState==="Completed"&&b&&(en(!0),h(ua(!1,!1,me===!0)))}),[Rt,re,b,me]),s.useEffect((()=>{const o={month:U.month,year:U.year},R=Gt.current;Gt.current=o,R===null||R.month===o.month&&R.year===o.year||!_t&&b&&(h(ua(!1,!1,me===!0)),h(ue(U,we,!1,!1)))}),[U.month,U.year,b,me]);const Je=s.useCallback(((o=!1,R=!1)=>{const L={start:De,end:Fe};switch(O){case"transaction_categorization":h(Se(mt,L,o,!rt,void 0,void 0,R)),Ft(!1);break;case"flux_analysis":h(Ze(U,o,R,null));break;case"month_end_insights":if(R===!1){const j=new Date(U.year,U.month,0),Ce=zs(j.toDateString()).format(Qa.analytics.YYYYDashMMDashDDFormat);h(Ls(!0,B.companyId,B.tenantId,Ce)),h($s(B.companyId,B.tenantId))}break;case"je_schedules":h(js(L,R,me===!0));break;case"missing_receipts":h(ja(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},o,R));break;default:h(ue(U,we,o,R))}}),[O,De,Fe,B.companyId,B.tenantId,mt,U,we,rt,Ft,me]),En=s.useCallback((()=>{Je(!0,!0)}),[Je]);s.useEffect((()=>{O===Re&&re.fetchState==="Not-Started"&&b&&Je(!0)}),[re,De,Fe,B.companyId,B.tenantId,b]),s.useEffect((()=>{_t||rt||Dt.current||un.fetchState==="In-Progress"||re.fetchState!=="Completed"||(Dt.current=!0,Je(!0,!0))}),[]),s.useEffect((()=>{X.fetchState!=="In-Progress"&&X.fetchState!=="Completed"&&X.fetchState!=="Error"&&B?.tenantId!=null&&h(Me({tenantId:B.tenantId,period:U,refreshViewInBackground:!1}))}),[X.fetchState,B?.tenantId]),s.useEffect((()=>{X.fetchState!=="Completed"||!b||(X.monthEndCloseChecks?.monthEndCloseCheckList.some((o=>o.id==="reconciliation"))??!1)&&V.reconciliation.fetchStatus.fetchState==="Not-Started"&&h(ue(U,void 0,!1,!1))}),[X.fetchState,b,U.month,U.year,V.reconciliation.fetchStatus.fetchState,h]),s.useEffect((()=>{V.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?Ae(!0):Ae(!1)}),[V.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),s.useEffect((()=>{V.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&b&&(h(Me({tenantId:B.tenantId,period:U,refreshViewInBackground:!0})),h(Gs({companyId:B.companyId})),N("../"))}),[V.monthEndInsights?.sendMonthEndReportStatus?.fetchState,B.tenantId,U,B.companyId,b]),s.useEffect((()=>{const o=setInterval((()=>{X.fetchState!=="In-Progress"&&X.fetchState==="Completed"&&h(Me({tenantId:B.tenantId,period:U,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(o)}),[X.fetchState,B.tenantId,U,h]),s.useEffect((()=>{const o=setInterval((()=>{O==="reconciliation"&&we==null&&V.reconciliation.fetchStatus.fetchState==="Completed"&&V.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ue(U,void 0,!0,!0))}),3e5);return()=>clearInterval(o)}),[O,h,V.reconciliation.fetchStatus.fetchState,V.reconciliation.refreshStatus.fetchState,ue,we,U]);const An=ya(),{isFeatureEnabled:xn}=le(H.isRecommendationFeedbackEnabled),ta=Nc(),{onRecommendationSelection:aa,popup:wn}=ai({isEnabled:xn}),Rn=s.useMemo((()=>({...ta,onRecommendationSelection:aa})),[ta,aa]);s.useEffect((()=>{const o=(X.monthEndCloseChecks?.monthEndCloseCheckList.find((R=>R.id==="month_end_insights"))?.isDisabled??!1)&&!Mt;O!=="month_end_insights"||!o&&X.monthEndCloseChecks?.reportEmailSentDate==null||N("../")}),[O,X.monthEndCloseChecks]);const Dn=x===!0?v:l,Fn=x===!0||I===!0,_n=x===!0?n:S,Mn=x!==!0&&w;s.useEffect((()=>{Kt==="In-Progress"&&pt.accountSettingsView.saveState.fetchState==="Completed"&&h(ma())}),[Kt,pt.accountSettingsView.saveState.fetchState,ma]);const{transactionId:na,onSaveVendor:On,onSaveSuccess:Un,onCancel:Bn,vendorViewDetails:Vn}=(({expenseAutomationViewSelector:o,closeDrawerHandler:R,currentSelectedView:L})=>{const j=ge();let Ce,fe,te;const ht=ya(),_e=o.transactionView;let sa=()=>{};const{transactions:jn,selectedTransactionId:Ie,selectedTransactionLineId:Ye,transactionLocalData:zn}=_e;if(L==="transaction_categorization"){const St=zn.find((he=>he.transactionId===Ie)),se=jn.find((he=>he.id===Ie)),oa=Ye!=null?St?.transactionReviewLocalData?.lineItemById[Ye]:void 0,ca=oa?.account;fe=oa?.class?.classId,Ce=["Uncategorized Income","Uncategorized Expense"].includes(ca?.accountName??"")?void 0:ca?.accountId;const $n=hi(Ie,se?.typeOfTransaction);se!=null&&$n&&(te={id:Ie,type:Pt(se.typeOfTransaction)}),sa=()=>{if(Ie!=null&&Ye!=null&&se!=null){const he=_e.transactionLocalData.find((He=>He.transactionId===Ie))?.transactionReviewLocalData;if(he!=null&&se.lines!=null&&se.lines.length>0){const He=he.lineItemById[Ye];let gt=he.selectedEntity;if(vs(se)||(gt=He.selectedEntityLine),gt!=null){const Gn=gt,Nn={transactionId:{id:se.id,type:se.type},transaction:se,lineIds:se.lines.map((qn=>qn.id))??[]};j(yt({entity:Gn,amount:He.amount.amount,transactionDetails:Nn,flowType:"categorization",selectedTab:o.selectedTransactionCategorizationTab,isFetchCOT:ht}))}}}}}const Ln=F((St=>ra(St,void 0,Ce,fe)));return{transactionId:te,onSaveVendor:()=>{j(ys(te,void 0,!1,!0))},onSaveSuccess:sa,onCancel:()=>{te!=null&&j(bs({transactionId:te})),j(Ts()),j(Ps()),R()},vendorViewDetails:Ln}})({expenseAutomationViewSelector:V,closeDrawerHandler:()=>{J(!1)},currentSelectedView:O});return an?.loggedInUserRoleMap==null?X.fetchState==="Error"?k.jsx(qc,{onGoHome:()=>N("../",{replace:!0}),onReload:()=>window.location.reload()}):k.jsx(Na,{fetchState:"In-Progress"}):k.jsxs(k.Fragment,{children:[k.jsx(Ci,{isOpen:je,drawerLeftMargin:new Jc(0,0,300,650),onClose:()=>{y(!1)},children:k.jsx(Vi,{onClick:o=>o.stopPropagation(),children:k.jsx(Ri,{companyId:B.companyId,closeCustomerRequestDrawer:()=>y(!1),addCustomerRequest:Tn,resetCustomerRequest:Pn})})}),na!=null&&M&&k.jsx(oi,{isOpen:M,transactionId:na,onSaveVendor:On,onSaveSuccess:Un,onCancel:Bn,vendorViewDetails:Vn}),k.jsx(Yc,{toolkit:Rn,children:k.jsx(Ui,{events:[],eventCallback:(o,R,L)=>{},navigate:N,location:q,themeState:D,categoryOptions:ln,classesForFilters:dn,accountsForFilters:rn,vendorSearchAutoCompleteData:{autoCompleteText:In,entityAutoCompleteView:cn},expenseAutomationViewSelector:V,isMissingReceiptsBulkUploadEnabled:xe,monthEndInsightsPreviewMode:ct,monthEndInsightsCustomerRequestData:Z,isRealtimeInsightsFeatureEnabled:Mt,isCreateTransferEntryFromExpenseEnabled:Ot,isAccountingClassesEnabled:fn,isProjectsTransactionsEnabled:nn,isCOTEnabled:An,currentTenant:B,companyId:B.companyId,signedInUser:dt,isTransactionActivityEnabled:ut,isRightPanelOpen:gn,rightSidePanel:Wt,onOpenTransferRightPanel:Ot===!0?Xa:void 0,uncategorizedAccounts:Cn,newScheduleActiveType:Pe,isAccrualEnabled:me,newScheduleSelection:K,onNewScheduleSelectionChange:ot,onScheduleTypeChange:ve,onNewScheduleSaved:En,onClickCustomerRequest:bn,handleEditClick:kn,tenantEmailDomain:lt,trackExpenseAutomationTabAnalytics:E,setActivityLogTransactionId:it,closeMatchSidePanel:t,closeSidePanel:_n,openTransactionPanel:A,closeSchedulePanel:C,openSchedulePanel:f,openMatchPanel:r,sidePanelIsOpen:Fn,sidePanelIsFullView:Mn,panelContent:Dn,isAiCfoAccessEnabled:$,onAskAiCfoClick:Za,isReconV3Enabled:sn,onExpenseAutomationCommentingThreadClick:on,sidePanelListPercent:x===!0?66:void 0,isMatchPanelOpen:d,isSchedulePanelOpen:T,matchPanelContent:g,schedulePanelContent:m,schedulePendingDiscardConfirmation:z})}),wn,de.showPopup&&de.popupType!=null&&k.jsx(Hc,{popupType:de.popupType,currencySymbol:de.currencySymbol,accountId:de.popupAccountId??"",accountName:de.popupAccountName??"",onSubmit:de.handleSubmit,onDismiss:de.handleDismiss})]})}))))),Vi=Te(Ac)`
35
- display: flex;
36
- min-height: 100%;
37
- flex-direction: column;
38
- `;function ji(){const t=be(),{selectedTab:n,tenantEmailDomain:S}=Be(),g=F((r=>ke(r))),d=F((r=>r.expenseAutomationViewState.selectedPeriodByTenantId[g.tenantId]));if(Ya(n)==null)return k.jsx(za,{});const i=Ja({tenantEmailDomain:S,selectedTab:n,selectedPeriod:d!=null?`${d.month}-${d.year}`:void 0});return i==null?null:k.jsx(Wn,{to:i,replace:!0,state:t.state})}function Sl(){return k.jsxs(Hn,{children:[k.jsx(We,{index:!0,element:k.jsx(fi,{})}),k.jsx(We,{path:"/:selectedTab/:selectedPeriod/*",element:k.jsx(Bi,{})}),k.jsx(We,{path:"/:selectedTab",element:k.jsx(ji,{})}),k.jsx(We,{path:"*",element:k.jsx(za,{})})]})}export{Sl as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CzCs-qU3.js";import{a as r}from"./sentry-CWp8Ph3h.js";import{aw as d,ax as l,s as p,a4 as m}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import c from"./NotFoundScreen-BXryZNID.js";import{h as u,g as b}from"./core-BBG4mxvC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="052e3476-042d-44ff-b15b-67fe1524a52f",e._sentryDebugIdIdentifier="sentry-dbid-052e3476-042d-44ff-b15b-67fe1524a52f")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),f=r.useCallback((()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=d(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:f}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-CWp8Ph3h.js";import{u as l,h as f,g as m}from"./core-BBG4mxvC.js";import{h$ as p,UH as g,UI as b}from"./zeni-epic-state-FRanwwFO.js";import{u as _,L as h,z as y}from"./index-De2R2YuA.js";import"./liveblocks-CzCs-qU3.js";import"./recharts-CzGMTm3v.js";import"./mui-B2F_PvWe.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.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]="cbaf99b7-e770-4476-819d-df693b100290",e._sentryDebugIdIdentifier="sentry-dbid-cbaf99b7-e770-4476-819d-df693b100290")}catch{}})();function R(){const e=l(),n=f(),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"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{R as default};
@@ -1 +0,0 @@
1
- import{n as s}from"./liveblocks-CzCs-qU3.js";import{j as c}from"./core-BBG4mxvC.js";import{fI as f}from"./zeni-epic-state-FRanwwFO.js";import"./sentry-CWp8Ph3h.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]="25fc1afa-344c-4436-b7c0-ce0cb6697f63",e._sentryDebugIdIdentifier="sentry-dbid-25fc1afa-344c-4436-b7c0-ce0cb6697f63")}catch{}})();const b=()=>c((e=>f(e))).tenantId==null?{inboxNotifications:[],isLoading:!1,isFetchingMore:!1,hasFetchedAll:!0,fetchMore:()=>null}:(()=>{const{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}=s();return{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}})();export{b as u};