@zeniai/web-app-ui 5.1.51-qa → 5.1.52-qa

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 (122) hide show
  1. package/dist/assets/AddressRoutes-odXkPzQ0.js +1 -0
  2. package/dist/assets/{AddressScreen-DHENiPsE.js → AddressScreen-BJ-IOcKb.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BDeqJ8PX.js → AiCfoScreen-CRoxnDRU.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-re8xxMBE.js → BillPayApprovalRoutes-BWlPp4gg.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BKu8tYXF.js → BillPayRoutes-BcERL4gz.js} +8 -8
  6. package/dist/assets/{BusinessVerificationPageScreen-7ydI8UR9.js → BusinessVerificationPageScreen-DWX7ySZI.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-QyowC-mN.js → CardsAiCfoScreen-DEKa5Xew.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BbZEL-b5.js → ChargeCardRoutes-FSWFOO49.js} +10 -10
  9. package/dist/assets/{CompanyPassportScreen-AZhDXSZE.js → CompanyPassportScreen-CrpUoXvt.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-DDij7-L5.js → ConnectionAuthScreen-DDK9ow_u.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-CDJwl_XS.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-COHKYeEq.js → CustomerOnboardingRoutes-BdqZkh_s.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-B1cE2wJc.js → DashboardRoutes-BGmqy8sI.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-DivCz85L.js → DefaultTenantHome-dUxiOroS.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-BA2EKhEI.js +18 -0
  16. package/dist/assets/DrawerScreen-BSfM66hM.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-VUYCsTyx.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-pmgLYKV-.js → ExpenseAutomationRoutes-Baf_deUk.js} +3 -3
  19. package/dist/assets/FeaturePreviewScreen-DoKDdD4M.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BrjX8V0E.js → HubSpotOAuthCallbackScreen-DLXvcbO1.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-Dn4g326h.js → MagicLinkRoutes-NK00hAHs.js} +9 -9
  22. package/dist/assets/MagicLinkSignInScreen-DnxlEFNW.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-CjoW3Rax.js → MobileAppDrawer-BzOopfIc.js} +1 -1
  24. package/dist/assets/NotFoundScreen-6vyCFr5S.js +1 -0
  25. package/dist/assets/{NotificationRoutes-DE-Z8DSv.js → NotificationRoutes-BfWTxi_L.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-DKtWI-tp.js +1 -0
  27. package/dist/assets/{PandLWithForecastRoutes-C3Yczwgv.js → PandLWithForecastRoutes-DgT8jx_6.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-ZidIbEdd.js → PeopleRoutes-Cd2xa-tF.js} +3 -3
  29. package/dist/assets/PerformanceRoutes-xYB_POFo.js +1 -0
  30. package/dist/assets/{Preview-OiplHjn8.js → Preview-BBgrn4cd.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-B8QVReQm.js → QBOConnectionScreen-DiXbUmxS.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-Cnd7u4T9.js → ReferralListScreen-BFHfgY0C.js} +2 -2
  33. package/dist/assets/ReimbursementApprovalRoutes-BYBFJrYx.js +1 -0
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BgYFphfr.js → ReimbursementApprovalRuleDetailScreen-DiIBy_Kn.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-BeD0lwna.js → ReimbursementRoutes-Byj4p7dn.js} +5 -5
  36. package/dist/assets/{ReportsRoutes-CPI-jy1F.js → ReportsRoutes-urJtOHDo.js} +1 -1
  37. package/dist/assets/RewardsRoutes-CHiDiriW.js +1 -0
  38. package/dist/assets/{ScreenRoutes-B24ySlpK.js → ScreenRoutes-DgHGyuTa.js} +2 -2
  39. package/dist/assets/SettingsRoutes-B9XEOz3c.js +57 -0
  40. package/dist/assets/{SetupPagesScreen-DtddTp_T.js → SetupPagesScreen-DiqU6iZv.js} +5 -5
  41. package/dist/assets/SignInScreen-DqVi8QMM.js +1 -0
  42. package/dist/assets/{SignOutScreen-Djs9TXWR.js → SignOutScreen-BcKxVgCr.js} +1 -1
  43. package/dist/assets/{TaskListScreen-DMgU1v4z.js → TaskListScreen-CIIrTWF0.js} +2 -2
  44. package/dist/assets/{TaskRoutes-Cmtr7KFm.js → TaskRoutes-C3BwKdkV.js} +2 -2
  45. package/dist/assets/{TransactionDetailRoutes-CjrDVjtT.js → TransactionDetailRoutes-L60jmvh4.js} +1 -1
  46. package/dist/assets/TransactionDetailScreen-BHKf3UvG.js +5 -0
  47. package/dist/assets/{TransactionListRoutes-uZihQK3F.js → TransactionListRoutes-B8V8eaVr.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-ZtY_hGM6.js → TreasuryRoutes-BIv9NJIQ.js} +6 -6
  49. package/dist/assets/{VendorsRoutes-DcUkIEvd.js → VendorsRoutes-CInyDoSC.js} +1 -1
  50. package/dist/assets/WiseConfirmationScreen-DmiV73IN.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-Cbm2k-08.js → ZeniAccountRoutes-CbhJXy_a.js} +11 -11
  52. package/dist/assets/ZeniAccountStatementScreen-BuDvio8F.js +9 -0
  53. package/dist/assets/{accountMappingHelper-DDqSB3xQ.js → accountMappingHelper-DoYWzqd9.js} +1 -1
  54. package/dist/assets/{analytics-DoyQ8ezf.js → analytics-DVTbnjlr.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CvGdvadP.js → analyticsHelper-CfMFPPIh.js} +1 -1
  56. package/dist/assets/{core-CQnSJ9vO.js → core-k_c8SCBE.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-BprI0TcI.js → decodeURIComponentSafe-ClSfwHJC.js} +1 -1
  58. package/dist/assets/{dnd-DoHm848q.js → dnd-CKEs-Nbe.js} +1 -1
  59. package/dist/assets/{empty-BZMPWXIo.js → empty-CaaFsHZq.js} +1 -1
  60. package/dist/assets/{empty-DjW_4H8B.js → empty-rBU__xZH.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-CD9clJu_.js → emptyVideoElement-BiPjnR5F.js} +1 -1
  62. package/dist/assets/{epic-2G17lmbK.js → epic-BY3t4hzo.js} +2 -2
  63. package/dist/assets/getLocaleForTenant-CTwYyvWj.js +1 -0
  64. package/dist/assets/{index-BtlQ6O6E.js → index-B0M_M2si.js} +1 -1
  65. package/dist/assets/{index-W83PhAZh.js → index-B4wUHn-k.js} +12999 -13025
  66. package/dist/assets/{index-CF7DasjB.js → index-C9JBC9EP.js} +1 -1
  67. package/dist/assets/{index-Ci7GqulV.js → index-CAPOi0Fj.js} +1 -1
  68. package/dist/assets/{index-C6MtcitK.js → index-CBl-jehm.js} +1 -1
  69. package/dist/assets/{index-B6GtF9yZ.js → index-CrxfuqRy.js} +2 -2
  70. package/dist/assets/{index-DgHQU_66.js → index-D7n4W-6R.js} +1 -1
  71. package/dist/assets/{index-KsPtT3xm.js → index-_Ds-L3qG.js} +1 -1
  72. package/dist/assets/{lexical-WXHH1XHj.js → lexical-k-PQZXkn.js} +1 -1
  73. package/dist/assets/{liveblocks-DvKPzrwo.js → liveblocks-D3ESVZyk.js} +1 -1
  74. package/dist/assets/{lottie-DNsrs-P3.js → lottie-BYni7Ovk.js} +1 -1
  75. package/dist/assets/{mui-sKCdI-e6.js → mui-UJrLjp1k.js} +1 -1
  76. package/dist/assets/{pathToGoBack-DDBtlyQ4.js → pathToGoBack-D0Z5Ycmy.js} +1 -1
  77. package/dist/assets/{pdf-iXI4qQyj.js → pdf-CaeTpLUv.js} +4 -4
  78. package/dist/assets/{pdf-lib-C9eLuUx2.js → pdf-lib-Cgly_u4z.js} +1 -1
  79. package/dist/assets/{plaid-BOu_8LCE.js → plaid-B1j5PXHV.js} +1 -1
  80. package/dist/assets/{pusher-BxMucY8d.js → pusher-IzmLENf0.js} +1 -1
  81. package/dist/assets/{react-BfWAIeRe.js → react-BPazXlgj.js} +1 -1
  82. package/dist/assets/{react-Bfv7BUzV.js → react-BhDdWL-M.js} +1 -1
  83. package/dist/assets/{react-CHbhfie6.js → react-Cbn9UGi3.js} +1 -1
  84. package/dist/assets/{react-DW2tK8z_.js → react-D9CNJCXY.js} +1 -1
  85. package/dist/assets/{react-BY08R1tD.js → react-RV2byy3l.js} +1 -1
  86. package/dist/assets/{react-DVBLaOmV.js → react-iNsCZPRe.js} +1 -1
  87. package/dist/assets/{recharts-Cv5d-Vxs.js → recharts-Q-kkTNuO.js} +1 -1
  88. package/dist/assets/{routePaths-stnXzrYV.js → routePaths-ooqctjvV.js} +1 -1
  89. package/dist/assets/{sentry-Be8twC83.js → sentry-B_92GPgU.js} +1 -1
  90. package/dist/assets/{url-CuDHWvgT.js → url-CGw_V4gG.js} +1 -1
  91. package/dist/assets/{url-AlENSCVt.js → url-DLQKrj-e.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js → useAiCfoDashboardSuggestedQuestionsChips-Cx3WWldL.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-BJGg886y.js +1 -0
  94. package/dist/assets/useCashManagementBanner-Cjm3Ayi5.js +1 -0
  95. package/dist/assets/{useDeviceId-KC-rY1dP.js → useDeviceId-BE1s-3Wf.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-BDAn-AM4.js → useInitialThreadRequest-C_cJhQDA.js} +1 -1
  97. package/dist/assets/{utils-BcJ2NV01.js → utils-Mjhh9T8E.js} +1 -1
  98. package/dist/assets/withTransactionSidePanel-3cc8um6s.js +21 -0
  99. package/dist/assets/{zeni-epic-state-DKeO4Z0C.js → zeni-epic-state-C3zBO1No.js} +4 -4
  100. package/dist/index.html +1 -1
  101. package/package.json +3 -3
  102. package/dist/assets/AddressRoutes-gPXkxz7s.js +0 -1
  103. package/dist/assets/CustomerOnboardingAuthScreen-DO3NyaR6.js +0 -1
  104. package/dist/assets/DomesticWireDetailScreen-Bx2DINVR.js +0 -18
  105. package/dist/assets/DrawerScreen-BtLrlXnn.js +0 -1
  106. package/dist/assets/EntityDetailRoutes-CTo7No6n.js +0 -1
  107. package/dist/assets/FeaturePreviewScreen-9NvuDbvP.js +0 -1
  108. package/dist/assets/MagicLinkSignInScreen-CTkVv0M2.js +0 -12
  109. package/dist/assets/NotFoundScreen-FcrdBNP0.js +0 -1
  110. package/dist/assets/OAuthConsentScreen-Swpq9wju.js +0 -1
  111. package/dist/assets/PerformanceRoutes-VzYGFOXy.js +0 -1
  112. package/dist/assets/ReimbursementApprovalRoutes-DOhkjING.js +0 -1
  113. package/dist/assets/RewardsRoutes-Vdol6ACr.js +0 -1
  114. package/dist/assets/SettingsRoutes-D7qVKl5_.js +0 -57
  115. package/dist/assets/SignInScreen-u3NwSgsj.js +0 -1
  116. package/dist/assets/TransactionDetailScreen-ABqf1zzA.js +0 -5
  117. package/dist/assets/WiseConfirmationScreen-DYcjQlfc.js +0 -12
  118. package/dist/assets/ZeniAccountStatementScreen-Ciuw5n7i.js +0 -9
  119. package/dist/assets/getLocaleForTenant-CAvD8CfA.js +0 -1
  120. package/dist/assets/useAskAiCfoHostNavButtonProps-DAlpTVgV.js +0 -1
  121. package/dist/assets/useCashManagementBanner-D8slgHwh.js +0 -1
  122. package/dist/assets/withTransactionSidePanel-B9fglQqM.js +0 -21
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-DvKPzrwo.js";import{a}from"./sentry-Be8twC83.js";import{u as S,g as w,j as u,N as v}from"./core-CQnSJ9vO.js";import{Lw as A,eW as L,fE as O,o5 as _,gr as h,fD as j,fa as U,LD as F}from"./zeni-epic-state-DKeO4Z0C.js";import{u as $,z as m,L as g,D as k,o as H}from"./index-W83PhAZh.js";import{n as z}from"./mui-sKCdI-e6.js";import{t as R}from"./getLocaleForTenant-CAvD8CfA.js";import{g as P,Q as G}from"./QBOConnectionScreen-B8QVReQm.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./empty-DjW_4H8B.js";import"./pdf-lib-C9eLuUx2.js";import"./index-BtlQ6O6E.js";import"./url-CuDHWvgT.js";import"./index-DgHQU_66.js";import"./decodeURIComponentSafe-BprI0TcI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="23f4bc6c-d07a-4984-9583-00b38bac6c29",t._sentryDebugIdIdentifier="sentry-dbid-23f4bc6c-d07a-4984-9583-00b38bac6c29")}catch{}})();const Q=z.div`
1
+ import{j as C}from"./liveblocks-D3ESVZyk.js";import{a}from"./sentry-B_92GPgU.js";import{u as S,g as w,j as u,N as v}from"./core-k_c8SCBE.js";import{Lw as A,eW as L,fE as O,o5 as _,gr as h,fD as j,fa as U,LD as F}from"./zeni-epic-state-C3zBO1No.js";import{u as $,z as m,L as g,D as k,o as H}from"./index-B4wUHn-k.js";import{n as z}from"./mui-UJrLjp1k.js";import{t as R}from"./getLocaleForTenant-CTwYyvWj.js";import{g as P,Q as G}from"./QBOConnectionScreen-DiXbUmxS.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./empty-rBU__xZH.js";import"./pdf-lib-Cgly_u4z.js";import"./index-B0M_M2si.js";import"./url-CGw_V4gG.js";import"./index-D7n4W-6R.js";import"./decodeURIComponentSafe-ClSfwHJC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="23f4bc6c-d07a-4984-9583-00b38bac6c29",t._sentryDebugIdIdentifier="sentry-dbid-23f4bc6c-d07a-4984-9583-00b38bac6c29")}catch{}})();const Q=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-D3ESVZyk.js";import{z as n}from"./index-B4wUHn-k.js";import{g as d}from"./QBOConnectionScreen-DiXbUmxS.js";import"./sentry-B_92GPgU.js";import{g as p,N as s}from"./core-k_c8SCBE.js";import"./zeni-epic-state-C3zBO1No.js";import"./recharts-Q-kkTNuO.js";import"./mui-UJrLjp1k.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./empty-rBU__xZH.js";import"./pdf-lib-Cgly_u4z.js";import"./index-B0M_M2si.js";import"./url-CGw_V4gG.js";import"./index-D7n4W-6R.js";import"./decodeURIComponentSafe-ClSfwHJC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DvKPzrwo.js";import{t as Me,A as Ce}from"./AddressScreen-DHENiPsE.js";import $e from"./NotFoundScreen-FcrdBNP0.js";import{a as g}from"./sentry-Be8twC83.js";import{h as oe,g as se,u as ie,i as re,j as D,N as E,n as ce,l as ze,o as qe,p as z}from"./core-CQnSJ9vO.js";import{W as de,j as le,z as B,H as ue,m as Qe,x as _,r as V,w as H,c as N,B as je,e as J,ap as Ke,K as Ze,aq as ke,h as te,ar as We,as as Ie,o as He,at as Ye,au as Ee,av as Je}from"./index-W83PhAZh.js";import{bn as Xe,eW as ee,fw as et,fe as pe,fc as me,bt as tt,o3 as at,fs as nt,bS as ot,k4 as ae,k7 as ve,M0 as st,bY as it,c7 as ge,tD as he,to as rt,Mv as X,tE as _e,JV as ct,l8 as Ue,Mw as Ve,Mx as dt,My as lt,Mz as ut,k2 as pt,k5 as mt,tq as Be,tC as gt,bE as xe,cz as ht,tQ as Te,ry as ft,rm as yt,l0 as bt,gg as St,gf as Ct,ge as kt,MA as It,ti as Et,tR as xt,tU as Tt,tX as Ot,u1 as Pt,cY as At}from"./zeni-epic-state-DKeO4Z0C.js";import{n as fe}from"./mui-sKCdI-e6.js";import{g as Dt,h as wt,q as ne}from"./QBOConnectionScreen-B8QVReQm.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./empty-DjW_4H8B.js";import"./pdf-lib-C9eLuUx2.js";import"./index-BtlQ6O6E.js";import"./url-CuDHWvgT.js";import"./index-DgHQU_66.js";import"./decodeURIComponentSafe-BprI0TcI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="d9207c77-d198-45b7-bb8b-883048fd15b1",t._sentryDebugIdIdentifier="sentry-dbid-d9207c77-d198-45b7-bb8b-883048fd15b1")}catch{}})();const Ft=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),I=Qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:w}=m(_.isDebitCardFeatureEnabled),M=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),F=c.company!=null&&et(c.company),R=L&&F,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(w,c),P=me(c),A=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,Q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),$===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),Q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(J.Event.onboardingDashboardActivation))(l)}),a.jsx(Ft,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:M,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-D3ESVZyk.js";import{t as Me,A as Ce}from"./AddressScreen-BJ-IOcKb.js";import $e from"./NotFoundScreen-6vyCFr5S.js";import{a as g}from"./sentry-B_92GPgU.js";import{h as oe,g as se,u as ie,i as re,j as D,N as E,n as ce,l as ze,o as qe,p as z}from"./core-k_c8SCBE.js";import{Y as de,j as le,z as B,N as ue,m as Qe,x as _,n as V,r as W,c as N,B as je,e as J,ap as Ke,h as Ze,aq as ke,f as te,ar as Ye,as as Ie,o as We,at as He,au as Ee,av as Je}from"./index-B4wUHn-k.js";import{bn as Xe,eW as ee,fw as et,fe as pe,fc as me,bt as tt,o3 as at,fs as nt,bS as ot,k4 as ae,k7 as ve,M0 as st,bY as it,c7 as ge,tD as he,to as rt,Mv as X,tE as _e,JV as ct,l8 as Ue,Mw as Ve,Mx as dt,My as lt,Mz as ut,k2 as pt,k5 as mt,tq as Be,tC as gt,bE as xe,cz as ht,tQ as Te,ry as ft,rm as yt,l0 as bt,gg as St,gf as Ct,ge as kt,MA as It,ti as Et,tR as xt,tU as Tt,tX as Ot,u1 as Pt,cY as At}from"./zeni-epic-state-C3zBO1No.js";import{n as fe}from"./mui-UJrLjp1k.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DiXbUmxS.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./empty-rBU__xZH.js";import"./pdf-lib-Cgly_u4z.js";import"./index-B0M_M2si.js";import"./url-CGw_V4gG.js";import"./index-D7n4W-6R.js";import"./decodeURIComponentSafe-ClSfwHJC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="c9bcaa04-dae9-40a5-a8bb-c73c458322a3",t._sentryDebugIdIdentifier="sentry-dbid-c9bcaa04-dae9-40a5-a8bb-c73c458322a3")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),I=Qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),M=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,Q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),$===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),Q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(J.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:M,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -12,12 +12,12 @@ import{j as a}from"./liveblocks-DvKPzrwo.js";import{t as Me,A as Ce}from"./Addre
12
12
 
13
13
  ${t=>t.theme.breakpoints.down("md")} {
14
14
  width: 100%;
15
- padding-left: ${He.sp0};
15
+ padding-left: ${We.sp0};
16
16
  }
17
17
 
18
18
  ${t=>t.windowSize!=="small"?"overflow: auto;":""}
19
- `,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Ye.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:b}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:x,ssn:T,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:w,role:M,ownership:c,isSelectedForVerification:L,userVerificationStatus:F,fileIds:R,isPhoneVerified:O}=i;let S;return w.selectDocumentType==="driverLicense"?S="driving_license":w.selectDocumentType==="passport"?S="passport":w.selectDocumentType==="stateId"?S="id_document":w.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:x,ssn:T,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:f!=null?xe(f?.toString()):f,syncToken:C,titleAtCompany:M.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:F,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:x,companyPhone:T,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:w,fileIds:M,typeOfIncorporation:c,stateOfIncorporation:L,incDate:F,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:K,transactionVolume:$,transactionVolumeDescription:q,usNexus:v,usNexusTypes:Q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:x!=""&&x!=null?ht(x):void 0,phone:T,syncToken:w,fileIds:M,incDate:F!=null?xe(F?.toString()):F,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(W=>W.length===2?W:Ee(W))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:K,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:Q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(Te({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=Me(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(X({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(We),Y=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),b=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:x}=re(),T=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),w=D(y=>y.onboardingCustomerViewState.currentStep),M=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),F=D(y=>y.cardPaymentViewState),R=ke(F.addCardPaymentSourceStatus.fetchState),O=F.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:j}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,K=P?.connectionName,$=P?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{wt(S,G,j,$,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:K??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:$,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,$),u(d.pathname))},[S,G,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(x)?.companyId,Q=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!M.isQBOPopupOpen||w!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const W=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(J.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&T?.loggedInUserRoleMap!=null)return W===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>be(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const we=fe.div`
19
+ `,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:He.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:b}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:x,ssn:T,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:M,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,isPhoneVerified:O}=i;let S;return F.selectDocumentType==="driverLicense"?S="driving_license":F.selectDocumentType==="passport"?S="passport":F.selectDocumentType==="stateId"?S="id_document":F.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:x,ssn:T,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:f!=null?xe(f?.toString()):f,syncToken:C,titleAtCompany:M.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:x,companyPhone:T,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:M,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:K,transactionVolume:$,transactionVolumeDescription:q,usNexus:v,usNexusTypes:Q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:x!=""&&x!=null?ht(x):void 0,phone:T,syncToken:F,fileIds:M,incDate:w!=null?xe(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(Y=>Y.length===2?Y:Ee(Y))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:K,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:Q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(Te({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=Me(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(X({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Ye),H=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),b=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:x}=re(),T=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),M=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),w=D(y=>y.cardPaymentViewState),R=ke(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:j}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,K=P?.connectionName,$=P?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(S,G,j,$,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:K??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:$,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,$),u(d.pathname))},[S,G,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(x)?.companyId,Q=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!M.isQBOPopupOpen||F!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Y=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(J.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&T?.loggedInUserRoleMap!=null)return Y===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:y=>be(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
20
20
  display: flex;
21
21
  height: 100vh;
22
22
  background-color: ${t=>t.theme.colors.grey4};
23
- `,Fe=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Je),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),x=me(i),T=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?T==="Completed"&&k===!0&&h&&b?.loggedInUserRoleMap!=null?a.jsxs(we,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(J.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(Fe,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):T==="Completed"&&k===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(we,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(J.Event.onboardingInterimPage)}}),a.jsx(Fe,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:T}):I?a.jsx(E,{to:"../../checking"}):x?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(z,{path:"/",element:a.jsx(Y,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(Y,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(Y,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(Y,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx($e,{})})]})}export{oa as default};
23
+ `,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Je),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),x=me(i),T=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?T==="Completed"&&k===!0&&h&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:f=>{f.trackPageLoaded(J.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):T==="Completed"&&k===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:f=>{f.trackPageLoaded(J.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:T}):I?a.jsx(E,{to:"../../checking"}):x?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(z,{path:"/",element:a.jsx(H,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(H,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(H,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(H,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx($e,{})})]})}export{oa as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-DvKPzrwo.js";import{i as K,j as S,g as H,u as z,h as W,n as te,k as ca,o as Ct,p as w}from"./core-CQnSJ9vO.js";import{eW as U,MQ as Xe,bE as la,bq as Oe,O1 as Pn,iW as Fn,O2 as Zt,O3 as Rn,iZ as kt,O4 as Qe,O5 as Bn,j2 as jn,O6 as Qt,O7 as Mn,j6 as St,O8 as He,O9 as Ln,cp as At,Oa as Un,Ob as Gn,N8 as Vn,j_ as Yn,Oc as Nn,bn as Ge,Od as da,ME as ie,bc as ua,kc as ma,od as pa,jX as ha,MG as ce,MF as ee,eV as fa,f2 as $n,fG as _t,Oe as zn,Of as Kn,Og as ga,Oh as Be,vC as Ve,vD as Ye,v_ as xe,vU as le,vH as Ne,Oi as qn,Oj as Zn,Ok as Qn,Ol as ba,Om as je,On as Hn,dJ as Je,s6 as Ca,Oo as Wn,Op as Xn,Oq as Jn,Or as vt,M2 as Et,ks as De,w6 as It,se as eo,Os as to,vE as Ht,s9 as Ie,s5 as ka,Ot as ge,Ou as ao,Ov as Tt,M1 as Ot,u5 as Sa,Ow as no,Ox as oo,Oy as so,Oz as xt,ui as ro,OA as io,vG as Wt,u4 as _a,OB as be,OC as co,bt as ya,wa as Aa,OD as lo,OE as uo,OF as mo,OG as Dt,w5 as po,OH as ho,vF as Xt,w9 as va,OI as Ce,OJ as fo,OK as go,OL as Ea,kh as Ia,oa as Ta,km as Oa,o8 as xa,o7 as Da,o6 as wa,tt as bo,fw as Co,cS as ko,cT as So,o3 as _o,fs as yo,ok as Ao,Ge as ut,G6 as vo,Ga as Eo,OM as Io,ON as To,OO as Oo,b5 as et,fk as xo,hE as Do,gi as wo,oe as Po,jQ as Fo,ob as Ro,o9 as Bo,fe as jo,fc as Mo}from"./zeni-epic-state-DKeO4Z0C.js";import{z as M,a2 as ae,r as x,c as O,D as q,aV as Lo,_ as $e,w as ze,aW as Pa,e as N,aX as Uo,j as Se,aY as Fa,H as _e,x as R,m as Go,aZ as Vo,a_ as Yo,X as Ra,K as Ba,a as ja,Z as No,a$ as $o,U as zo,aN as Ma,$ as oe,b0 as La,b1 as Ua,a1 as Ga,b2 as Ko,b3 as qo,aq as Zo,q as Qo,Y as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as ke}from"./index-W83PhAZh.js";import{n as wt}from"./mui-sKCdI-e6.js";import{a as b}from"./sentry-Be8twC83.js";import{w as Va}from"./withTransactionSidePanel-B9fglQqM.js";import{c as Ya,t as we,f as de,a as Pt,v as ts}from"./routePaths-stnXzrYV.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import Ue from"./NotFoundScreen-FcrdBNP0.js";import{u as Ft}from"./useInitialThreadRequest-BDAn-AM4.js";import{t as Na}from"./analyticsHelper-CvGdvadP.js";import{C as as}from"./CompanyPassportScreen-AZhDXSZE.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js";import{F as os}from"./FeaturePreviewScreen-9NvuDbvP.js";import{R as ss}from"./ReferralListScreen-Cnd7u4T9.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./TransactionDetailScreen-ABqf1zzA.js";import"./decodeURIComponentSafe-BprI0TcI.js";import"./MobileAppDrawer-CjoW3Rax.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]="fd66ec10-033b-4071-a9ef-974b614ba1cb",e._sentryDebugIdIdentifier="sentry-dbid-fd66ec10-033b-4071-a9ef-974b614ba1cb")}catch{}})();const rs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(A=>A.tenantState.currentTenantId),c=S(A=>U(A)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?la(r):Oe(),[r]),p=z(),f=W(),v=S(A=>Pn(A,h,o)),E=b.useCallback(()=>{o!=null&&v.fetchState!=="In-Progress"&&v.fetchState!=="Completed"&&p(Fn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),T=b.useCallback((A,B)=>{p(Zt({sortKey:A,sortOrder:B}))},[]),I=b.useCallback(A=>{p(Zt({downloadState:A}))},[]),L=b.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(m!=null){const B=Ya({id:A.transactionId,type:A.transactionType},m);f(B);const X=x(g.state?.pathnameStackToGoBack,g.pathname);f(B,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{v.vendor!=null&&O.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),v.vendor.id,v.vendor.name)},[v.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{v.fetchState==="Completed"&&k()},[k,v.fetchState]),d.jsx(Lo,{apAgingDetail:v,downloadParams:l,reportDate:h,analytics:O,onTransactionClick:L,onReload:E,onBackClick:_,onColumnSortConfigChanged:T,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(T=>Rn(T)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(T=>T.tenantState.currentTenantId),i=S(T=>U(T)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??Oe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(T=>{e(Qe({searchString:T}))},[]),p=b.useCallback((T,I)=>{e(Qe({sortKey:I,sortOrder:T}))},[]),f=b.useCallback(T=>{a(`./${T}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),v=b.useCallback(T=>{e(Qe({downloadState:T}))},[]),E=b.useCallback((T,I)=>{},[]),_=b.useCallback((T,I)=>{e(Qe({selectedDate:T,agingDateSelectionType:I})),e(kt(T))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:T=>T.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:O,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:_,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?la(r):Oe(),[r]),h=z(),p=W(),f=S(k=>Bn(k,l,o)),v=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((k,A)=>{h(Qt({sortKey:k,sortOrder:A}))},[]),T=b.useCallback(k=>{h(Qt({downloadState:k}))},[]),I=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const A=Ya({id:k.transactionId,type:k.transactionType},c);p(A);const B=x(m.state?.pathnameStackToGoBack,m.pathname);p(A,{state:{pathnameStackToGoBack:B}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&O.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{v()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:O,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:_,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(_=>Mn(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??Oe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(He({searchString:_}))},[]),h=b.useCallback((_,T)=>{e(He({sortKey:T,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(He({downloadState:_}))},[]),v=b.useCallback((_,T)=>{e(He({selectedDate:_,agingDateSelectionType:T})),e(St(_))},[]),E=b.useCallback((_,T)=>{e(Ln({nodeId:_,isCollapsed:T}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:O,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},$a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function za(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=we(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Yn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?O.trackZeniAccountsCashBalancePromoClicked("Move Money"):(O.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else O.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=te(function(e){const a=Un(e).accountsInOrder.map((n,o)=>$a(n,o)),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:O}},za)(Fa),us=te(function(e){const a=Nn(e).accountsInOrder.map((o,r)=>$a(o,r)),t=M.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:O}},za)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=At(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=At(n?.loggedInUserRoleMap),r=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=wt.div`
1
+ import{j as d}from"./liveblocks-D3ESVZyk.js";import{i as K,j as S,g as H,u as z,h as W,n as te,k as ca,o as Ct,p as w}from"./core-k_c8SCBE.js";import{eW as U,MQ as Xe,bE as la,bq as Oe,O2 as Pn,iW as Fn,O3 as Zt,O4 as Rn,iZ as kt,O5 as Qe,O6 as Bn,j2 as jn,O7 as Qt,O8 as Mn,j6 as St,O9 as He,Oa as Ln,cp as At,Ob as Un,Oc as Gn,N8 as Vn,j_ as Yn,Od as Nn,bn as Ge,Oe as da,ME as ie,bc as ua,kc as ma,od as pa,jX as ha,MG as ce,MF as ee,eV as fa,f2 as $n,fG as _t,Of as zn,Og as Kn,Oh as ga,Oi as Be,vC as Ve,vD as Ye,v_ as xe,vU as le,vH as Ne,Oj as qn,Ok as Zn,Ol as Qn,Om as ba,On as je,Oo as Hn,dJ as Je,s6 as Ca,Op as Wn,Oq as Xn,Or as Jn,Os as vt,M2 as Et,ks as De,w6 as It,se as eo,Ot as to,vE as Ht,s9 as Ie,s5 as ka,Ou as ge,Ov as ao,Ow as Tt,M1 as Ot,u5 as Sa,Ox as no,Oy as oo,Oz as so,OA as xt,ui as ro,OB as io,vG as Wt,u4 as _a,OC as be,OD as co,bt as ya,wa as Aa,OE as lo,OF as uo,OG as mo,OH as Dt,w5 as po,OI as ho,vF as Xt,w9 as va,OJ as Ce,OK as fo,OL as go,OM as Ea,kh as Ia,oa as Ta,km as Oa,o8 as xa,o7 as Da,o6 as wa,tt as bo,fw as Co,cS as ko,cT as So,o3 as _o,fs as yo,ok as Ao,Ge as ut,G6 as vo,Ga as Eo,ON as Io,OO as To,OP as Oo,b5 as et,fk as xo,hE as Do,gi as wo,oe as Po,jQ as Fo,ob as Ro,o9 as Bo,fe as jo,fc as Mo}from"./zeni-epic-state-C3zBO1No.js";import{z as M,a2 as ae,n as x,c as O,D as q,aV as Lo,_ as $e,r as ze,aW as Pa,e as N,aX as Uo,j as Se,aY as Fa,N as _e,x as R,m as Go,aZ as Vo,a_ as Yo,V as Ra,h as Ba,a as ja,Z as No,a$ as $o,T as zo,aN as Ma,$ as oe,b0 as La,b1 as Ua,a1 as Ga,b2 as Ko,b3 as qo,aq as Zo,p as Qo,X as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as ke}from"./index-B4wUHn-k.js";import{n as wt}from"./mui-UJrLjp1k.js";import{a as b}from"./sentry-B_92GPgU.js";import{w as Va}from"./withTransactionSidePanel-3cc8um6s.js";import{c as Ya,t as we,f as de,a as Pt,v as ts}from"./routePaths-ooqctjvV.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import Ue from"./NotFoundScreen-6vyCFr5S.js";import{u as Ft}from"./useInitialThreadRequest-C_cJhQDA.js";import{t as Na}from"./analyticsHelper-CfMFPPIh.js";import{C as as}from"./CompanyPassportScreen-CrpUoXvt.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-Cx3WWldL.js";import{F as os}from"./FeaturePreviewScreen-DoKDdD4M.js";import{R as ss}from"./ReferralListScreen-BFHfgY0C.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./TransactionDetailScreen-BHKf3UvG.js";import"./decodeURIComponentSafe-ClSfwHJC.js";import"./MobileAppDrawer-BzOopfIc.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]="ad641902-1d95-4cc4-a252-b9f8f99fa19c",e._sentryDebugIdIdentifier="sentry-dbid-ad641902-1d95-4cc4-a252-b9f8f99fa19c")}catch{}})();const rs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(A=>A.tenantState.currentTenantId),c=S(A=>U(A)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?la(r):Oe(),[r]),p=z(),f=W(),v=S(A=>Pn(A,h,o)),E=b.useCallback(()=>{o!=null&&v.fetchState!=="In-Progress"&&v.fetchState!=="Completed"&&p(Fn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),T=b.useCallback((A,B)=>{p(Zt({sortKey:A,sortOrder:B}))},[]),I=b.useCallback(A=>{p(Zt({downloadState:A}))},[]),L=b.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(m!=null){const B=Ya({id:A.transactionId,type:A.transactionType},m);f(B);const X=x(g.state?.pathnameStackToGoBack,g.pathname);f(B,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{v.vendor!=null&&O.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),v.vendor.id,v.vendor.name)},[v.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{v.fetchState==="Completed"&&k()},[k,v.fetchState]),d.jsx(Lo,{apAgingDetail:v,downloadParams:l,reportDate:h,analytics:O,onTransactionClick:L,onReload:E,onBackClick:_,onColumnSortConfigChanged:T,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(T=>Rn(T)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(T=>T.tenantState.currentTenantId),i=S(T=>U(T)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??Oe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(T=>{e(Qe({searchString:T}))},[]),p=b.useCallback((T,I)=>{e(Qe({sortKey:I,sortOrder:T}))},[]),f=b.useCallback(T=>{a(`./${T}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),v=b.useCallback(T=>{e(Qe({downloadState:T}))},[]),E=b.useCallback((T,I)=>{},[]),_=b.useCallback((T,I)=>{e(Qe({selectedDate:T,agingDateSelectionType:I})),e(kt(T))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:T=>T.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:O,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:_,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?la(r):Oe(),[r]),h=z(),p=W(),f=S(k=>Bn(k,l,o)),v=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((k,A)=>{h(Qt({sortKey:k,sortOrder:A}))},[]),T=b.useCallback(k=>{h(Qt({downloadState:k}))},[]),I=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const A=Ya({id:k.transactionId,type:k.transactionType},c);p(A);const B=x(m.state?.pathnameStackToGoBack,m.pathname);p(A,{state:{pathnameStackToGoBack:B}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&O.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{v()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:O,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:_,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(_=>Mn(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??Oe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(He({searchString:_}))},[]),h=b.useCallback((_,T)=>{e(He({sortKey:T,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(He({downloadState:_}))},[]),v=b.useCallback((_,T)=>{e(He({selectedDate:_,agingDateSelectionType:T})),e(St(_))},[]),E=b.useCallback((_,T)=>{e(Ln({nodeId:_,isCollapsed:T}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:O,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},$a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function za(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=we(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Yn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?O.trackZeniAccountsCashBalancePromoClicked("Move Money"):(O.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else O.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=te(function(e){const a=Un(e).accountsInOrder.map((n,o)=>$a(n,o)),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:O}},za)(Fa),us=te(function(e){const a=Nn(e).accountsInOrder.map((o,r)=>$a(o,r)),t=M.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:O}},za)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=At(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=At(n?.loggedInUserRoleMap),r=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=wt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-DvKPzrwo.js";import{a as u}from"./sentry-Be8twC83.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-CQnSJ9vO.js";import{Lw as N,eW as _,fE as U,Lx as k,o5 as R,Ly as z}from"./zeni-epic-state-DKeO4Z0C.js";import{u as j,z as f,L as E,t as I,D as O,b as $}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import{t as P}from"./getLocaleForTenant-CAvD8CfA.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="a9170a69-e734-456e-a827-61972c723514",t._sentryDebugIdIdentifier="sentry-dbid-a9170a69-e734-456e-a827-61972c723514")}catch{}})();const Q=w(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=A(),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=T(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=T(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(L,{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(E.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(E.TENANT_FETCHING),t(U(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"&&!k(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(Q,{})}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"],G={"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 T(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-D3ESVZyk.js";import{a as u}from"./sentry-B_92GPgU.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-k_c8SCBE.js";import{Lw as N,eW as _,fE as U,Lx as k,o5 as R,Ly as z}from"./zeni-epic-state-C3zBO1No.js";import{u as j,z as f,L as E,t as I,D as O,b as $}from"./index-B4wUHn-k.js";import"./mui-UJrLjp1k.js";import{t as P}from"./getLocaleForTenant-CTwYyvWj.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.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]="a9170a69-e734-456e-a827-61972c723514",t._sentryDebugIdIdentifier="sentry-dbid-a9170a69-e734-456e-a827-61972c723514")}catch{}})();const Q=w(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=A(),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=T(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=T(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(L,{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(E.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(E.TENANT_FETCHING),t(U(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"&&!k(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(Q,{})}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"],G={"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 T(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -0,0 +1,18 @@
1
+ import{j as l}from"./liveblocks-D3ESVZyk.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-k_c8SCBE.js";import{Px as k,PE as W,gg as M,gf as q,ge as J,jp as K,MF as L,rp as Q,eW as V,P3 as D,jn as F,Py as S,PH as T,jl as j,jI as G}from"./zeni-epic-state-C3zBO1No.js";import{bw as X,h as N,N as R,z as U,m as H,p as b,x as v,B as O,bx as Y,o as Z,by as ee,n as te}from"./index-B4wUHn-k.js";import{n as z}from"./mui-UJrLjp1k.js";import"./sentry-B_92GPgU.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]="c4c1686e-c555-4de3-b20a-13f1c1e77edd",e._sentryDebugIdIdentifier="sentry-dbid-c4c1686e-c555-4de3-b20a-13f1c1e77edd")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(M(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=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=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{e(j(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=b(a.state?.pathnameStackToGoBack),d=s.poppedPathname??A();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=b(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??A(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function me({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:d}=B(),i=e??s,{useFeatureGate:c}=R(),r=U.getSignedInUser(),p=h(u=>V(u)),g=H(),x=b(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,i)),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:i,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:p,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const A=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},fe=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},$=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return $(e,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=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 ${Z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
+ `,de=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:i}=d;return{onFetchBankName:c=>{e(G(c))},onSaveHandler:c=>{e(j(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:r}=c;e(T({data:r}))},onCancel:()=>{(()=>{const c=b(o.state?.pathnameStackToGoBack),r=c.poppedPathname??E();a(r,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const r=se(i,c,n),p=te(o.state?.pathnameStackToGoBack,o.pathname);a(r,{state:{pathnameStackToGoBack:p}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=b(t.location.state?.pathnameStackToGoBack),r=c.poppedPathname??E(0);t.navigate(r,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:d}=B(),i=e??s,c=U.getSignedInUser(),{useFeatureGate:r}=R(),p=H(),g=h(u=>V(u)),x=b(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,i)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${Z.sp1} ${p.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(_,{vendorId:i,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:g,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{me as A,xe as D,_ as V,fe as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-D3ESVZyk.js";import{h as c,w as l,m as f}from"./index-B4wUHn-k.js";import{D as b}from"./mui-UJrLjp1k.js";import"./sentry-B_92GPgU.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]="0e97b545-474c-49a0-ae25-bb2e8a6d5fcc",e._sentryDebugIdIdentifier="sentry-dbid-0e97b545-474c-49a0-ae25-bb2e8a6d5fcc")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-D3ESVZyk.js";import{a as d}from"./sentry-B_92GPgU.js";import{h as A,u as B,g as G,i as q,j as l,N as F,n as M,o as O,p as W}from"./core-k_c8SCBE.js";import{NN as _,eW as J,N9 as R,ls as Y,JO as I,NS as $,ME as z,ks as V,JP as S,Ne as H,Nf as K,MG as L,MF as Q}from"./zeni-epic-state-C3zBO1No.js";import{aS as U,c as X,p as Z,n as tt}from"./index-B4wUHn-k.js";import"./mui-UJrLjp1k.js";import{d as k}from"./decodeURIComponentSafe-ClSfwHJC.js";import{w as et}from"./withTransactionSidePanel-3cc8um6s.js";import{f as at,c as nt}from"./routePaths-ooqctjvV.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import"./TransactionDetailScreen-BHKf3UvG.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]="ad8e2313-e2ef-4a71-9afa-72b895ea2e0a",a._sentryDebugIdIdentifier="sentry-dbid-ad8e2313-e2ef-4a71-9afa-72b895ea2e0a")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,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)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(K()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();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(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:N}=q(),r=k(x??""),p=k(N??""),f=rt(r,p),j=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:b(j.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,11 +1,11 @@
1
- import{j as h}from"./liveblocks-DvKPzrwo.js";import oa from"./NotFoundScreen-FcrdBNP0.js";import{a as o,b as Jt}from"./sentry-Be8twC83.js";import{n as Ue,S as sa}from"./mui-sKCdI-e6.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-CQnSJ9vO.js";import{eW as Re,Sz as la,of as Ee,fz as ra,s0 as da,ox as Kt,oS as Qt,SA as Ht,p0 as ua,SB as Wt,oq as ma,ry as pa,fj as Ie,SC as De,t_ as Zt,E7 as Xt,SD as en,SE as ha,r6 as Qe,NN as Pt,NP as Sa,kv as ga,NQ as Ca,kC as fa,c_ as Ia,va as He,oD as tn,p5 as Fe,ov as re,SF as Ea,MG as Rt,MF as we,SG as Dt,kT as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oK as Aa,p8 as xe,SL as wa,SM as xa,SN as Pa,pf as Ra,kG as Da,kx as Fa,SO as Ua,kF as Ft,NX as Ba,SP as _a,SQ as Va,r2 as Oa,qG as za,p6 as me,qF as Ne,SR as Ma,SS as ja,ST as La,ma as $a,bq as qa,m5 as Ut,lT as Ga,SU as Na,f9 as Bt,gw as Ja,m2 as Ya,x3 as Ka,SV as Qa,pG as Ha,pB as Wa,pF as Za,pq as Xa,SW as eo,fm as nn,oV as to,oG as no,fA as _t,pa as ao,SX as oo,SY as so,p7 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as Vt,re as uo,qx as mo,ME as po,T2 as ho,T3 as So,kE as go,T4 as Co,IP as fo,kD as Io,ks as Eo,fl as ko,q3 as on,qp as yo,p4 as Ot,p9 as bo,bE as To,l$ as vo,lY as Ao,T5 as wo,pp as zt,ql as Mt,qj as xo,T6 as Po,q8 as Ro,pQ as Do,qm as Fo,T7 as Uo,T8 as Bo,pU as _o,T9 as Vo,pL as Oo,pT as zo,pR as Mo,qs as jo}from"./zeni-epic-state-DKeO4Z0C.js";import{H as sn,x as X,c as q,r as ne,Y as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as Pe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Ko,d0 as Qo,X as Ho,d1 as Wo,d2 as Zo,W as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,A as ss,aQ as cs}from"./index-W83PhAZh.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-ABqf1zzA.js";import{w as us}from"./withTransactionSidePanel-B9fglQqM.js";import{h as ms,v as ps}from"./routePaths-stnXzrYV.js";import{g as Ye}from"./accountMappingHelper-DDqSB3xQ.js";import{D as hs}from"./DrawerScreen-BtLrlXnn.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./decodeURIComponentSafe-BprI0TcI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="f6b45a56-81c0-4eb0-b5af-8372c3f4ed86",t._sentryDebugIdIdentifier="sentry-dbid-f6b45a56-81c0-4eb0-b5af-8372c3f4ed86")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ne(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
1
+ import{j as h}from"./liveblocks-D3ESVZyk.js";import oa from"./NotFoundScreen-6vyCFr5S.js";import{a as o,b as Yt}from"./sentry-B_92GPgU.js";import{n as Ue,S as sa}from"./mui-UJrLjp1k.js";import{u as pe,h as Jt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-k_c8SCBE.js";import{eW as Re,Sz as la,of as Ee,fz as ra,s0 as da,ox as Kt,oS as Qt,SA as Zt,p0 as ua,SB as Ht,oq as ma,ry as pa,fj as Ie,SC as De,t_ as Wt,E7 as Xt,SD as en,SE as ha,r6 as Qe,NO as Pt,NQ as Sa,kv as ga,NR as Ca,kC as fa,c_ as Ia,va as Ze,oD as tn,p5 as Fe,ov as de,SF as Ea,MG as Rt,MF as we,SG as Dt,kT as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oK as Aa,p8 as xe,SL as wa,SM as xa,SN as Pa,pf as Ra,kG as Da,kx as Fa,SO as Ua,kF as Ft,NY as Ba,SP as Va,SQ as _a,r2 as Oa,qG as za,p6 as me,qF as Ne,SR as Ma,SS as ja,ST as La,ma as $a,bq as qa,m5 as Ut,lT as Ga,SU as Na,f9 as Bt,gw as Ya,m2 as Ja,x3 as Ka,SV as Qa,pG as Za,pB as Ha,pF as Wa,pq as Xa,SW as eo,fm as nn,oV as to,oG as no,fA as Vt,pa as ao,SX as oo,SY as so,p7 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as _t,re as uo,qx as mo,ME as po,T2 as ho,T3 as So,kE as go,T4 as Co,IP as fo,kD as Io,ks as Eo,fl as ko,q3 as on,qp as yo,p4 as Ot,p9 as bo,bE as To,l$ as vo,lY as Ao,T5 as wo,pp as zt,ql as Mt,qj as xo,T6 as Po,q8 as Ro,pQ as Do,qm as Fo,T7 as Uo,T8 as Bo,pU as Vo,T9 as _o,pL as Oo,pT as zo,pR as Mo,qs as jo}from"./zeni-epic-state-C3zBO1No.js";import{N as sn,x as X,c as q,n as ae,X as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as Pe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Ye,D as No,a7 as Yo,c$ as Jo,a2 as Ko,d0 as Qo,V as Zo,d1 as Ho,d2 as Wo,Y as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,w as ss,aQ as cs}from"./index-B4wUHn-k.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-BHKf3UvG.js";import{w as us}from"./withTransactionSidePanel-3cc8um6s.js";import{h as ms,v as ps}from"./routePaths-ooqctjvV.js";import{g as Je}from"./accountMappingHelper-DoYWzqd9.js";import{D as hs}from"./DrawerScreen-BSfM66hM.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./decodeURIComponentSafe-ClSfwHJC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8fd8d6df-7366-41b8-a941-13c25c4b76e0",t._sentryDebugIdIdentifier="sentry-dbid-8fd8d6df-7366-41b8-a941-13c25c4b76e0")}catch{}})();const Ss=()=>{const t=pe(),l=Jt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,Cs=Jt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:T})=>{const C=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,S=u[l],m=S?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{C(pa(e,n.split(".")[0]))},E=e=>{m!=null&&C(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},y=()=>{C(Ht({statementUploadChosen:!1}))},d=e=>{C(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{C(Wt({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback(()=>{C(Kt({accountId:l}))},[C,l]),z=o.useCallback(()=>{C(Qt({accountId:l}))},[C,l]),V=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return S!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:S,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:P,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:ee})})}):V!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:V,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
8
+ `,Cs=Yt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:T})=>{const C=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,S=u[l],m=S?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{C(pa(e,n.split(".")[0]))},E=e=>{m!=null&&C(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},y=()=>{C(Zt({statementUploadChosen:!1}))},d=e=>{C(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{C(Ht({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback(()=>{C(Kt({accountId:l}))},[C,l]),z=o.useCallback(()=>{C(Qt({accountId:l}))},[C,l]),_=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return S!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:S,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:P,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:ee})})}):_!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
@@ -18,7 +18,7 @@ import{j as h}from"./liveblocks-DvKPzrwo.js";import oa from"./NotFoundScreen-Fcr
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const T=Be.getSignedInUser();if(T==null)throw Error("Can't access Customer Request page without signing in...");const C=x(r=>ha(r,t,T));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:C.fetchState==="In-Progress"||C.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:C.companyMonthEndReportTemplatesData,bulletPoints:C.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=No.getLocalizedStrings(),Nt=jo,ys=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:S}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:S,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:C,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:S,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),V=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,b,g)=>{t(Vt(e,n,{fetchState:"In-Progress"}));const A=()=>t(Vt(e,n,{fetchState:"Error"}));Qo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,c,i,b).then(_=>{_!=null?t(uo(e,_)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{V!=null&&z!=null&&t(an({start:z,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Vo(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(_o(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),V!=null&&z!=null&&t(me(c,{start:z,end:V},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(C))},onClose:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0})),v("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ne(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,g=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),_=Ye(G.accruedExpensesAccountList,b.selectedOptions),R={selectedPrepaidExpensesAccountIds:g.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:_.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:g,vendor:A}=n,{allAccountList:_,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(J=>J.id===A?.selectedOption):void 0,ae={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(J=>J.value===A?.selectedOption)?.label??"",logo:j?.logo},oe=g?.selectedOption!=null?_.find(J=>J.qboId===g.selectedOption):void 0,_e=b?.selectedOption!=null?R.find(J=>J.classId===b.selectedOption):void 0,Ve=i?.selectedOption!=null?D.find(J=>J.qboId===i.selectedOption):void 0;t(Za({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:oe?.accountId,updatedClassId:_e?.classId,updatedAccumulatedDepreciationCategoryID:Ve?.accountId,updatedVendor:{id:ae.id,name:ae.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Wa(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Ha({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Qa())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:S,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ja())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,g,A,_,R,D,j,ae,oe)=>{t(La(e,n,c,i,k,b,g,A,_,R,D,j,ae,oe))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(me(e,{start:z,end:V},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:V},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),V!=null&&z!=null&&t(me(e,{start:z,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,g,A)=>{V!=null&&z!=null&&t(me(e,{start:z,end:V},!0,c,n,i,b,g,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,g,A,_)=>{t(za(e,n,c,i,_??null,b,g,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Oa(e,n,c,C))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Va({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&t(Ba({transactionId:_,customerUpdates:g})),t(_a({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(He({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&(t(Da({transactionId:_,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(Fa({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Ft({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(He({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:_.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ne(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(re(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Zt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Wt({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Ht({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(re(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ta({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ba({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(ya({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Qe("bill"));const n=ne(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Qt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(re(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(C,r,I){return{...C,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,C.authParams)}}}(t,l,T)})(Jo(Yo)),bs=us(function(t){const l=t.displayName??t.name??"Component",B=Jt.memo(t),f=T=>{const C=pe(),r=function(){const P=pe(),E=x(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(y=>{P(De({selectedDrawerAccountId:y}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,E)=>{C(Zt("expense_automation_reconcile",P,E))},[C]),u=o.useCallback((P,E)=>{const y=s?.companyId;y!=null&&(C(Xt(P,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),C(en({accountId:E,connectionInProgress:!0})))},[C,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Cs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),S=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:S,[r.isOpen,r.closePanel,r.selectedAccountId,S]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...T,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:T,reconPanelContent:C,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Ho(),u=Wo(),{isOpen:k}=Zo(),v=Yt(),S=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{T===!0&&f!==!0&&t?.()},[t,T,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(N=>Ie(N)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,W=Je($),Y=Je(L.fetchState),H=o.useCallback(N=>{const Z=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,Z??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,Z??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,Z??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,Z??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),Z??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,Z??null)},[w,a]);return o.useEffect(()=>{Y===L.fetchState&&$===W||L.fetchState!=="Completed"||H(!1)},[$,L.fetchState,W]),H})(),ee=Xo(),[z,V]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[b,g]=o.useState(!1),[A,_]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),ae=R?.contentType==="activity"?R.detail.transactionId:void 0,oe=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[y,s,u,p]),_e=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),Ve=o.useCallback(()=>{u(),j(),y(),E()},[y,j,E,u]),J=o.useRef(s);o.useEffect(()=>{s===!0&&J.current===!1&&(u(),j(),y()),J.current=s},[y,j,s,u]);const We=o.useRef(k);o.useEffect(()=>{k===!0&&We.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),We.current=k},[j,t,k,s,p,f,T]);const ke=T===!0&&f!==!0,Ze=o.useRef(ke);o.useEffect(()=>{ke&&!Ze.current&&(s&&p(!1),u(),j()),Ze.current=ke},[j,s,ke,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:Sn}=xt(),[Oe,nt]=o.useState(S.state?.message==="comingFromTransactionDetail"),at=S.state?.message==="comingFromOverview",gn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Cn,useFeatureGate:se}=sn(),{configValue:fn}=Cn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=se(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=se(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=se(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=se(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=se(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=se(X.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=se(X.isJEScheduleCOTEnabled),yn=o.useCallback(a=>{const U=Qe(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),bn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:Tn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>So(a.classState)),{monthEndCloseChecksView:Q,currentSelectedView:F,selectedPeriod:O,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ce,jeSchedules:Le,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const de=ls(Pn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const W of Object.values($.transactionReviewLocalDataById)){const Y=W?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const H of Object.values(Y)){const N=H?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const W of w)for(const Y of W.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&T!==!0||oe(void 0)},[F,oe,T]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Rn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,F==="transaction_categorization"&&j()):be.current=ye},[j,F,ye]);const Dn=x(a=>ae==null?void 0:go(a.transactionState,ae)),ie=Dn?.qboId,mt=x(a=>ie==null?void 0:Co(a,ie));o.useEffect(()=>{ie!=null&&m(fo(ie))},[m,ie]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:St}=M.transactionView,gt=o.useCallback(a=>rs(m,a),[m]),Ct=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:ie,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:St,onClose:()=>D(null),onCreateTransfer:gt,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,ie,pt,ht,St,gt]),Fn=Ct!=null,{selectedAccountId:Se}=xn,ft=Je(Le.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>Eo(a)),ge=tt!=null?ko(tt):F,_n=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ce.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(O),Ce=Fe(It.start),fe=Fe(It.end);if(Ce==null||fe==null)throw Error(`Invalid start - ${Ce} and end - ${fe} period from given ${O}`);const Vn=o.useCallback(()=>{i(!1)},[]),On=o.useCallback(()=>{g(!0)},[]),zn=o.useCallback(a=>{_(a),g(!1)},[]),Mn=o.useCallback(()=>{_([])},[]),Te=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&Te==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,F,Te,Et,m]);const kt=ze?.userId,jn=O.month,Ln=O.year,yt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&Te==="idle"&&kt!=null&&yt!=null&&m(yo())},[F,he,Te,kt,yt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?V(!0):V(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{ge!=null&&F!==ge&&m(nn(ge))},[ge]),o.useEffect(()=>{Xe!==!1||ce.fetchState!=="Completed"&&ce.fetchState!=="Error"||!d||(hn(!0),m(Ot(!1,!1,te)))},[Xe,ce,d,te]),o.useEffect(()=>{!at&&d&&(m(Ot(!1,!1,te)),m(re(O,Se,!1,!1)))},[O.month,O.year,d,te]);const bt=o.useCallback((a=!1,U=!1)=>{const L={start:Ce,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!Oe,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(O,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(O.year,O.month,0),w=To($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(bo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(re(O,Se,a,U))}},[F,Ce,fe,n.companyId,n.tenantId,je,O,Se,Oe,nt,te]);o.useEffect(()=>{F===ge&&ce.fetchState==="Not-Started"&&d&&bt(!0)},[ce,Ce,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Oe||et.current||wn.fetchState==="In-Progress"||ce.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!1}))},[Q.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,O,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Q.fetchState,n.tenantId,O,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&Se==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(re(O,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,re,Se,O]);const $n=Lt();o.useEffect(()=>{const a=(Q.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Q.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Q.monthEndCloseChecks]);const qn=r===!0?C:B,Gn=r===!0||T===!0,Nn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let W,Y,H;const N=Lt(),Z=a.transactionView;let vt=()=>{};const{transactions:Wn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Zn}=Z;if(L==="transaction_categorization"){const $e=Zn.find(le=>le.transactionId===ue),K=Wn.find(le=>le.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,W=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(H={id:ue,type:Qe(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const le=Z.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(le!=null&&K.lines!=null&&K.lines.length>0){const Ae=le.lineItemById[ve];let qe=le.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(He({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x($e=>Pt($e,void 0,W,Y));return{transactionId:H,onSaveVendor:()=>{w(fa(H,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{H!=null&&w(Sa({transactionId:H})),w(ga()),w(Ca()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{V(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Hn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return gn?.loggedInUserRoleMap==null?Q.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:b,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{g(!1)},children:h.jsx(Ts,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),Tt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}),h.jsx(ys,{...Hn,navigate:v,location:S,themeState:ee,categoryOptions:Tn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:_n,entityAutoCompleteView:bn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:Ct,onOpenTransferRightPanel:st===!0?_e:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:On,handleEditClick:Vn,tenantEmailDomain:Sn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:oe,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:Ve,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:yn,sidePanelListPercent:r===!0?66:void 0}),de.showPopup&&de.popupType!=null&&h.jsx(cs,{popupType:de.popupType,currencySymbol:de.currencySymbol,onSubmit:de.handleSubmit,onDismiss:de.handleDismiss})]})})),Ts=Ue(sa)`
21
+ `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const T=Be.getSignedInUser();if(T==null)throw Error("Can't access Customer Request page without signing in...");const C=x(r=>ha(r,t,T));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:C.fetchState==="In-Progress"||C.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:C.companyMonthEndReportTemplatesData,bulletPoints:C.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=No.getLocalizedStrings(),Nt=jo,ys=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:S}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:S,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:C,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:S,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),_=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,b,g)=>{t(_t(e,n,{fetchState:"In-Progress"}));const A=()=>t(_t(e,n,{fetchState:"Error"}));Qo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,c,i,b).then(V=>{V!=null?t(uo(e,V)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{_!=null&&z!=null&&t(an({start:z,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(_o(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(Vo(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),_!=null&&z!=null&&t(me(c,{start:z,end:_},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(C))},onClose:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0})),v("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,g=Je(G.prepaidExpensesAccountList,c.selectedOptions),A=Je(G.fixedAssetsAccountList,i.selectedOptions),V=Je(G.accruedExpensesAccountList,b.selectedOptions),R={selectedPrepaidExpensesAccountIds:g.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:V.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:g,vendor:A}=n,{allAccountList:V,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(Y=>Y.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(Y=>Y.value===A?.selectedOption)?.label??"",logo:j?.logo},se=g?.selectedOption!=null?V.find(Y=>Y.qboId===g.selectedOption):void 0,Ve=b?.selectedOption!=null?R.find(Y=>Y.classId===b.selectedOption):void 0,_e=i?.selectedOption!=null?D.find(Y=>Y.qboId===i.selectedOption):void 0;t(Wa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Ve?.classId,updatedAccumulatedDepreciationCategoryID:_e?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ha(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Za({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Qa())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ja(e,u.companyId,u.tenantId))},onClickCustomerRequest:S,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ya())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,g,A,V,R,D,j,oe,se)=>{t(La(e,n,c,i,k,b,g,A,V,R,D,j,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(me(e,{start:z,end:_},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:_},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),_!=null&&z!=null&&t(me(e,{start:z,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,g,A)=>{_!=null&&z!=null&&t(me(e,{start:z,end:_},!0,c,n,i,b,g,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,g,A,V)=>{t(za(e,n,c,i,V??null,b,g,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Oa(e,n,c,C))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(_a({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,g,A)=>{const{transactionId:V,transaction:R,lineIds:D}=n;g!=null&&t(Ba({transactionId:V,customerUpdates:g})),t(Va({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(Ze({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,g,A)=>{const{transactionId:V,transaction:R,lineIds:D}=n;g!=null&&(t(Da({transactionId:V,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(Fa({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Ft({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(Ze({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:V.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ht({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Zt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ta({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ba({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(ya({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Qe("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Qt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(de(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(C,r,I){return{...C,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,C.authParams)}}}(t,l,T)})(Yo(Jo)),bs=us(function(t){const l=t.displayName??t.name??"Component",B=Yt.memo(t),f=T=>{const C=pe(),r=function(){const P=pe(),E=x(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(y=>{P(De({selectedDrawerAccountId:y}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,E)=>{C(Wt("expense_automation_reconcile",P,E))},[C]),u=o.useCallback((P,E)=>{const y=s?.companyId;y!=null&&(C(Xt(P,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),C(en({accountId:E,connectionInProgress:!0})))},[C,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Cs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),S=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:S,[r.isOpen,r.closePanel,r.selectedAccountId,S]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...T,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:T,reconPanelContent:C,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Zo(),u=Ho(),{isOpen:k}=Wo(),v=Jt(),S=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{T===!0&&f!==!0&&t?.()},[t,T,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(N=>Ie(N)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,H=Ye($),J=Ye(L.fetchState),Z=o.useCallback(N=>{const W=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,W??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,W??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,W??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,W??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),W??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,W??null)},[w,a]);return o.useEffect(()=>{J===L.fetchState&&$===H||L.fetchState!=="Completed"||Z(!1)},[$,L.fetchState,H]),Z})(),ee=Xo(),[z,_]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[b,g]=o.useState(!1),[A,V]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[y,s,u,p]),Ve=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),_e=o.useCallback(()=>{u(),j(),y(),E()},[y,j,E,u]),Y=o.useRef(s);o.useEffect(()=>{s===!0&&Y.current===!1&&(u(),j(),y()),Y.current=s},[y,j,s,u]);const He=o.useRef(k);o.useEffect(()=>{k===!0&&He.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),He.current=k},[j,t,k,s,p,f,T]);const ke=T===!0&&f!==!0,We=o.useRef(ke);o.useEffect(()=>{ke&&!We.current&&(s&&p(!1),u(),j()),We.current=ke},[j,s,ke,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:Sn}=xt(),[Oe,nt]=o.useState(S.state?.message==="comingFromTransactionDetail"),at=S.state?.message==="comingFromOverview",gn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Cn,useFeatureGate:ce}=sn(),{configValue:fn}=Cn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=ce(X.isJEScheduleCOTEnabled),yn=o.useCallback(a=>{const U=Qe(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),bn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:Tn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>So(a.classState)),{monthEndCloseChecksView:Q,currentSelectedView:F,selectedPeriod:O,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:Le,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const J=H?.transactionReviewLocalData?.lineItemById;if(J!=null)for(const Z of Object.values(J)){const N=Z?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const H of w)for(const J of H.lines??[])"account"in J&&J.account?.accountId!=null&&a.push(J.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&T!==!0||se(void 0)},[F,se,T]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Rn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,F==="transaction_categorization"&&j()):be.current=ye},[j,F,ye]);const Dn=x(a=>oe==null?void 0:go(a.transactionState,oe)),le=Dn?.qboId,mt=x(a=>le==null?void 0:Co(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:St}=M.transactionView,gt=o.useCallback(a=>rs(m,a),[m]),Ct=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:St,onClose:()=>D(null),onCreateTransfer:gt,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,St,gt]),Fn=Ct!=null,{selectedAccountId:Se}=xn,ft=Ye(Le.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>Eo(a)),ge=tt!=null?ko(tt):F,Vn=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(O),Ce=Fe(It.start),fe=Fe(It.end);if(Ce==null||fe==null)throw Error(`Invalid start - ${Ce} and end - ${fe} period from given ${O}`);const _n=o.useCallback(()=>{i(!1)},[]),On=o.useCallback(()=>{g(!0)},[]),zn=o.useCallback(a=>{V(a),g(!1)},[]),Mn=o.useCallback(()=>{V([])},[]),Te=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&Te==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,F,Te,Et,m]);const kt=ze?.userId,jn=O.month,Ln=O.year,yt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&Te==="idle"&&kt!=null&&yt!=null&&m(yo())},[F,he,Te,kt,yt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{ge!=null&&F!==ge&&m(nn(ge))},[ge]),o.useEffect(()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Ot(!1,!1,te)))},[Xe,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(Ot(!1,!1,te)),m(de(O,Se,!1,!1)))},[O.month,O.year,d,te]);const bt=o.useCallback((a=!1,U=!1)=>{const L={start:Ce,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!Oe,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(O,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(O.year,O.month,0),w=To($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(bo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(O,Se,a,U))}},[F,Ce,fe,n.companyId,n.tenantId,je,O,Se,Oe,nt,te]);o.useEffect(()=>{F===ge&&ie.fetchState==="Not-Started"&&d&&bt(!0)},[ie,Ce,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Oe||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!1}))},[Q.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,O,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Q.fetchState,n.tenantId,O,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&Se==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(O,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,Se,O]);const $n=Lt();o.useEffect(()=>{const a=(Q.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Q.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Q.monthEndCloseChecks]);const qn=r===!0?C:B,Gn=r===!0||T===!0,Nn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:Tt,onSaveVendor:Yn,onSaveSuccess:Jn,onCancel:Kn,vendorViewDetails:Qn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let H,J,Z;const N=Lt(),W=a.transactionView;let vt=()=>{};const{transactions:Hn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Wn}=W;if(L==="transaction_categorization"){const $e=Wn.find(re=>re.transactionId===ue),K=Hn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;J=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(Z={id:ue,type:Qe(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=W.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(Ze({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x($e=>Pt($e,void 0,H,J));return{transactionId:Z,onSaveVendor:()=>{w(fa(Z,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{Z!=null&&w(Sa({transactionId:Z})),w(ga()),w(Ca()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{_(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Zn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return gn?.loggedInUserRoleMap==null?Q.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:b,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{g(!1)},children:h.jsx(Ts,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),Tt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:Tt,onSaveVendor:Yn,onSaveSuccess:Jn,onCancel:Kn,vendorViewDetails:Qn}),h.jsx(ys,{...Zn,navigate:v,location:S,themeState:ee,categoryOptions:Tn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:Vn,entityAutoCompleteView:bn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:Ct,onOpenTransferRightPanel:st===!0?Ve:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:On,handleEditClick:_n,tenantEmailDomain:Sn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:_e,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:yn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),Ts=Ue(sa)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-D3ESVZyk.js";import{a as r}from"./sentry-B_92GPgU.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-B4wUHn-k.js";import"./mui-UJrLjp1k.js";import c from"./NotFoundScreen-6vyCFr5S.js";import{h as u,g as b}from"./core-k_c8SCBE.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as o}from"./sentry-Be8twC83.js";import{u,h as l,g as m}from"./core-CQnSJ9vO.js";import{ho as p,LU as g,LV as _}from"./zeni-epic-state-DKeO4Z0C.js";import{u as b,L as h,z as y}from"./index-W83PhAZh.js";import"./liveblocks-DvKPzrwo.js";import"./recharts-Cv5d-Vxs.js";import"./mui-sKCdI-e6.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="28929437-ef53-4c9d-aefa-6dcb5e18dfff",e._sentryDebugIdIdentifier="sentry-dbid-28929437-ef53-4c9d-aefa-6dcb5e18dfff")}catch{}})();function j(){const e=u(),n=l(),r=m(),{setLoading:i,clearAllLoading:c}=b(),s=o.useRef(!1);return o.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),o.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.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"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const f=y.getActiveTenantForUser();n(f?.tenantEmailDomain!=null?`/${f.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
1
+ import{a as o}from"./sentry-B_92GPgU.js";import{u,h as l,g as m}from"./core-k_c8SCBE.js";import{ho as p,LU as g,LV as _}from"./zeni-epic-state-C3zBO1No.js";import{u as b,L as h,z as y}from"./index-B4wUHn-k.js";import"./liveblocks-D3ESVZyk.js";import"./recharts-Q-kkTNuO.js";import"./mui-UJrLjp1k.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.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]="28929437-ef53-4c9d-aefa-6dcb5e18dfff",e._sentryDebugIdIdentifier="sentry-dbid-28929437-ef53-4c9d-aefa-6dcb5e18dfff")}catch{}})();function j(){const e=u(),n=l(),r=m(),{setLoading:i,clearAllLoading:c}=b(),s=o.useRef(!1);return o.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),o.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.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"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const f=y.getActiveTenantForUser();n(f?.tenantEmailDomain!=null?`/${f.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};