@zeniai/web-app-ui 5.2.13-qa → 5.2.14-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/assets/AddressRoutes-C5ICjwhT.js +1 -0
  2. package/dist/assets/AddressScreen-DqXE5RDJ.js +9 -0
  3. package/dist/assets/{AiCfoScreen-D4NgYwUZ.js → AiCfoScreen-Bq9qNM-U.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DLlsLPac.js → BillPayApprovalRoutes-Cgsqt2XF.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-ChrQ1pAZ.js → BillPayRoutes-D8ICOArG.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BGwTSYvf.js → BusinessVerificationPageScreen-DlMhX3L_.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-DFBwVCAL.js → CardsAiCfoScreen-evFd6UUn.js} +3 -3
  8. package/dist/assets/{ChargeCardRoutes-BPIoTFc8.js → ChargeCardRoutes-czvHDNab.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-uugzo1WU.js → CompanyPassportScreen-CzLA5zCy.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-5nIimMuJ.js → ConnectionAuthScreen-VR4MFOhW.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-B7Anpyxh.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BH_QwFxA.js → CustomerOnboardingRoutes-CeoeigLq.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-DevVcpsc.js → DashboardRoutes-522JIWbO.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-kfraLn2O.js → DefaultTenantHome-CBA28Llo.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-D-A33-aQ.js → DomesticWireDetailScreen-C-1bKP7r.js} +3 -3
  16. package/dist/assets/{DrawerScreen-CaJ0qHuQ.js → DrawerScreen-DAMt3OKh.js} +1 -1
  17. package/dist/assets/EntityDetailRoutes-CGG59Jmf.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-BeNa4w-O.js → ExpenseAutomationRoutes-DcYqfqSi.js} +1 -1
  19. package/dist/assets/FeaturePreviewScreen-IYXzvJjG.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-DuB_-O5h.js → HubSpotOAuthCallbackScreen-LTrYsA2J.js} +1 -1
  21. package/dist/assets/MagicLinkRoutes-DzdDjge4.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-CC54CnuQ.js +12 -0
  23. package/dist/assets/MobileAppDrawer-7KFASJmR.js +1 -0
  24. package/dist/assets/NotFoundScreen-1FWTFg5q.js +1 -0
  25. package/dist/assets/{NotificationRoutes-B4vYlLWS.js → NotificationRoutes-CLLE6idd.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-DNdUxTN0.js → OAuthConsentScreen-D4soKi0X.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-Dvmv9t_a.js → PandLWithForecastRoutes-CLOwX80d.js} +1 -1
  28. package/dist/assets/PeopleRoutes-RKPAQcdN.js +22 -0
  29. package/dist/assets/PerformanceRoutes-BL-ag8V3.js +1 -0
  30. package/dist/assets/{Preview-Mf-iNnbX.js → Preview-Crb4CpIB.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-DhWWlIqn.js → QBOConnectionScreen-Doubr8Lv.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-YqkT81e-.js → ReimbursementApprovalRoutes-CuXrRY6O.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CgQrnfRD.js → ReimbursementApprovalRuleDetailScreen-CxT_ZU1Q.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-59ojWJmB.js → ReimbursementRoutes-B9v1csuM.js} +7 -7
  35. package/dist/assets/{ReportsRoutes-BlJSzoDH.js → ReportsRoutes-CYYBopNx.js} +1 -1
  36. package/dist/assets/RewardsRoutes-DQ-aEUje.js +1 -0
  37. package/dist/assets/ScreenRoutes-3ZRh9969.js +2 -0
  38. package/dist/assets/{SettingsRoutes-DZmVvwdN.js → SettingsRoutes-CLHJHv6D.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-BA7qIYz5.js → SetupPagesScreen-D-KjoZ4s.js} +5 -5
  40. package/dist/assets/{SignInScreen-B1pXXUPE.js → SignInScreen-DzUQQLWX.js} +1 -1
  41. package/dist/assets/SignOutScreen-CrFXavCN.js +9 -0
  42. package/dist/assets/{TaskListScreen-FhRi98gu.js → TaskListScreen-D1GJ72DV.js} +2 -2
  43. package/dist/assets/TaskRoutes-BShsttwI.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-Cc6D8ifC.js → TransactionDetailRoutes-NBFzTv3J.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-BUXJ5aYk.js → TransactionDetailScreen-BXByY28g.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-mvNlEqh4.js → TransactionListRoutes-ClVpGZj3.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-DM7Eo_Ug.js → TreasuryRoutes-CmxZydJL.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-Dd1EboaF.js → VendorsRoutes-caL_MoH5.js} +13 -13
  49. package/dist/assets/WiseConfirmationScreen-C_2P8pKj.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-CPFO7nCH.js → ZeniAccountRoutes-3mgFL_9o.js} +1 -1
  51. package/dist/assets/ZeniAccountStatementScreen-B27kJkJn.js +9 -0
  52. package/dist/assets/{accountMappingHelper-DPo5_oRM.js → accountMappingHelper-B0l8lAeR.js} +1 -1
  53. package/dist/assets/{analytics-C3yKGO2p.js → analytics-CO5gayAE.js} +1 -1
  54. package/dist/assets/analyticsHelper-BaOtwD25.js +1 -0
  55. package/dist/assets/{core-QBDM2m9E.js → core-DrRun-Wp.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-V0q2i3Mt.js → decodeURIComponentSafe-BqXEXApE.js} +1 -1
  57. package/dist/assets/{dnd-DTpdpLY3.js → dnd-C7lg2kUY.js} +1 -1
  58. package/dist/assets/{empty-DOkYgcMg.js → empty-BxU8KR-q.js} +1 -1
  59. package/dist/assets/{empty-CFhDMTFy.js → empty-CcJKsg0A.js} +1 -1
  60. package/dist/assets/{emptyVideoElement--yp8X02p.js → emptyVideoElement-Jmh-gus6.js} +1 -1
  61. package/dist/assets/{epic-DhMQUuQ_.js → epic-CkW-Ur48.js} +1 -1
  62. package/dist/assets/getLocaleForTenant-C5iVY_JU.js +1 -0
  63. package/dist/assets/{index-PvNZ50rx.js → index-2hIX2kLH.js} +1 -1
  64. package/dist/assets/{index-Dgg3TEkF.js → index-4Tf9Bt0i.js} +1 -1
  65. package/dist/assets/{index-_F7n4D5D.js → index-BJ6_cpY3.js} +1 -1
  66. package/dist/assets/{index-BTTC92ci.js → index-CdzL9szH.js} +3235 -3221
  67. package/dist/assets/{index-ChYlKp3n.js → index-CfbU7SR1.js} +1 -1
  68. package/dist/assets/{index-BMXF4zS6.js → index-DdvKvtaE.js} +1 -1
  69. package/dist/assets/{index-C-I3RcJQ.js → index-T7IByhHr.js} +1 -1
  70. package/dist/assets/{index-BD-4IlOh.js → index-cnTKKS-Z.js} +2 -2
  71. package/dist/assets/{lexical-DBGXZJbY.js → lexical-Cceo9d8G.js} +1 -1
  72. package/dist/assets/{liveblocks-ufh19lah.js → liveblocks-0jcT8Dx_.js} +1 -1
  73. package/dist/assets/{lottie-Ceg93JYe.js → lottie-C4eBAM7n.js} +1 -1
  74. package/dist/assets/{mui-CB8RW45Z.js → mui-BCzMCgwZ.js} +1 -1
  75. package/dist/assets/{pathToGoBack-Bi5ALgzm.js → pathToGoBack-aFGIF63I.js} +1 -1
  76. package/dist/assets/{pdf-DdbTijar.js → pdf-C1ioMmzA.js} +3 -3
  77. package/dist/assets/{pdf-lib-DuOAYy25.js → pdf-lib-gor9sGMc.js} +1 -1
  78. package/dist/assets/{plaid-DAwCYgVP.js → plaid-B0k6aBM1.js} +1 -1
  79. package/dist/assets/{pusher-CiZh5qhj.js → pusher-CnlBFFea.js} +1 -1
  80. package/dist/assets/{react-XuQaBloD.js → react-5qcvQnQi.js} +1 -1
  81. package/dist/assets/{react-b_GUNHoi.js → react-C6dV2Ihe.js} +1 -1
  82. package/dist/assets/{react-BNUtRbVm.js → react-COTuHHMD.js} +1 -1
  83. package/dist/assets/{react-C-M5T2pV.js → react-CPmZ-IlI.js} +1 -1
  84. package/dist/assets/{react-C4Bd6CfY.js → react-CbFHkYXj.js} +1 -1
  85. package/dist/assets/{react-BQkbVo66.js → react-CeH9yclr.js} +1 -1
  86. package/dist/assets/{recharts-B8SFxg38.js → recharts-BJColP3b.js} +1 -1
  87. package/dist/assets/{routePaths-DRm-ixUG.js → routePaths-CHhQNN3M.js} +1 -1
  88. package/dist/assets/{sentry-Co2H8v0G.js → sentry-Cix5j_Oe.js} +1 -1
  89. package/dist/assets/{url-D7tTbw7b.js → url-C58jRUwt.js} +1 -1
  90. package/dist/assets/{url-BD8IMRo-.js → url-C5XmMoE_.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DB15Xiff.js → useAiCfoDashboardSuggestedQuestionsChips-rxliwAgH.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-fe0P1a5j.js +1 -0
  93. package/dist/assets/{useCashManagementBanner-D33gFRsv.js → useCashManagementBanner-BT0je4k3.js} +1 -1
  94. package/dist/assets/{useChargeCardPusherEvents-Dh8PVdN6.js → useChargeCardPusherEvents-BbwX5V1a.js} +1 -1
  95. package/dist/assets/{useDeviceId-SWL_t36p.js → useDeviceId-34Upzybn.js} +1 -1
  96. package/dist/assets/{useEmailConnectResultRefresh-BjbbVkjV.js → useEmailConnectResultRefresh-BeuZj6XY.js} +1 -1
  97. package/dist/assets/{useInitialThreadRequest-B3FrSAeQ.js → useInitialThreadRequest-E7aaQNIx.js} +1 -1
  98. package/dist/assets/{utils-CWM6Tene.js → utils-CvfvTDv6.js} +1 -1
  99. package/dist/assets/{withTransactionSidePanel-DhAeegie.js → withTransactionSidePanel-B_GhVWS9.js} +2 -2
  100. package/dist/assets/{zeni-epic-state-BF09v22i.js → zeni-epic-state-D1OApLJ3.js} +3 -3
  101. package/dist/index.html +1 -1
  102. package/package.json +3 -3
  103. package/dist/assets/AddressRoutes-ByLwqq1f.js +0 -1
  104. package/dist/assets/AddressScreen-Bn9eD_vN.js +0 -9
  105. package/dist/assets/CustomerOnboardingAuthScreen-B9Xfrjh0.js +0 -1
  106. package/dist/assets/EntityDetailRoutes-DYfqqhFQ.js +0 -1
  107. package/dist/assets/FeaturePreviewScreen-C9BLvwka.js +0 -1
  108. package/dist/assets/MagicLinkRoutes-ZPdOYVHg.js +0 -72
  109. package/dist/assets/MagicLinkSignInScreen-wqd6TRdZ.js +0 -12
  110. package/dist/assets/MobileAppDrawer-CWymkkwv.js +0 -1
  111. package/dist/assets/NotFoundScreen-CIe1EEoJ.js +0 -1
  112. package/dist/assets/PeopleRoutes-f84JOb6h.js +0 -22
  113. package/dist/assets/PerformanceRoutes-CQbkvkKD.js +0 -1
  114. package/dist/assets/RewardsRoutes-DkHhpbpf.js +0 -1
  115. package/dist/assets/ScreenRoutes-DoO6VBZw.js +0 -2
  116. package/dist/assets/SignOutScreen-Dc75amk7.js +0 -9
  117. package/dist/assets/TaskRoutes-Gzx1KgZq.js +0 -9
  118. package/dist/assets/WiseConfirmationScreen-DC9T83oN.js +0 -12
  119. package/dist/assets/ZeniAccountStatementScreen-Cm4JCiss.js +0 -9
  120. package/dist/assets/analyticsHelper-BveTv6Ie.js +0 -1
  121. package/dist/assets/getLocaleForTenant-D6zJFfH-.js +0 -1
  122. package/dist/assets/useAskAiCfoHostNavButtonProps-CPVGdgCK.js +0 -1
@@ -1,8 +1,8 @@
1
- import{j as a}from"./liveblocks-ufh19lah.js";import{t as ht,A as Ue}from"./AddressScreen-Bn9eD_vN.js";import St from"./NotFoundScreen-CIe1EEoJ.js";import{a as d}from"./sentry-Co2H8v0G.js";import{h as Ce,g as Ie,u as ae,i as ke,j as k,N as B,l as bt,n as tt,o as Ct,p as H}from"./core-QBDM2m9E.js";import{eZ as Y,fG as _e,fE as ve,bs as It,fU as kt,bS as _t,og as vt,tH as Ot,tK as Tt,Ne as xt,Nf as Et,ki as he,kl as nt,ML as wt,bZ as At,c7 as ue,u9 as Oe,tW as Pt,Ng as de,ua as at,KE as Dt,lm as ot,Nh as jt,Ni as Ft,rF as Bt,hu as Nt,MD as me,hr as Ut,ME as Vt,ym as Rt,rJ as Lt,hj as Gt,hm as Ve,Nj as st,Nk as $t,Ep as Mt,Nl as Qt,Et as zt,tN as Kt,Nm as qt,Nn as Ht,kg as Zt,kj as Jt,um as Wt,tY as it,u8 as Yt,bE as Re,cA as Xt,ul as Le,rY as en,rM as tn,le as nn,gl as an,gk as on,gj as sn,No as rn,tQ as cn,un as dn,uq as un,ut as ln,uz as pn,cZ as mn}from"./zeni-epic-state-BF09v22i.js";import{z as L,A as Te,c as Z,n as gn,v as z,F as oe,f as N,aq as fn,J as yn,B as rt,e as ct,ar as Ge,m as Se,h as be,as as hn,o as $e,at as Me,au as Sn,av as Qe,aw as bn,ax as Cn}from"./index-BTTC92ci.js";import{n as xe}from"./mui-CB8RW45Z.js";import{g as In,h as kn,q as se}from"./QBOConnectionScreen-DhWWlIqn.js";import{u as _n,a as vn}from"./useEmailConnectResultRefresh-BjbbVkjV.js";import{u as On}from"./useChargeCardPusherEvents-Dh8PVdN6.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./empty-DOkYgcMg.js";import"./pdf-lib-DuOAYy25.js";import"./index-_F7n4D5D.js";import"./url-D7tTbw7b.js";import"./index-PvNZ50rx.js";import"./decodeURIComponentSafe-V0q2i3Mt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new e.Error().stack;u&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[u]="eddc3735-81fb-44fe-9c6f-84bc7dc3566f",e._sentryDebugIdIdentifier="sentry-dbid-eddc3735-81fb-44fe-9c6f-84bc7dc3566f")}catch{}})();const ze=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Tn=()=>{const e=Ce(),u=Ie(),i=ae(),[o,l]=d.useState(!1),[c,y]=d.useState(!1),{tenantEmailDomain:S}=ke(),t=L.getSignedInUser(),{useFeatureGate:n}=Te(),{isFeatureEnabled:s}=n(Z.isApAgingFeatureEnabled),{isFeatureEnabled:b}=n(Z.isArAgingFeatureEnabled),{isFeatureEnabled:_}=n(Z.isReferralFeatureEnabled),{isFeatureEnabled:I}=n(Z.isExpenseAutomationEnabledV2),{isFeatureEnabled:x}=n(Z.isDebitCardFeatureEnabled),r=gn(),g=k((h=>Y(h))),p=k((h=>h.onboardingCustomerViewState.fetchState)),v=g.excludedResources,T=g.companyId??L.getSignedInUserTenant(S)?.companyId;if(t==null)throw Error("Can't access onboarding flow without signing in...");const E=_e(x,g),D=ve(g),m=[],G=v?.resources?.find((h=>h.resource==="/reports/top_expenses"))==null,j=v?.resources?.find((h=>h.resource==="/reports/task_card"))==null,$=g?.userRole!=null&&It(g?.userRole),M=v?.resources?.find((h=>h.resource==="/bills"))==null&&!$,A=v?.resources?.find((h=>h.resource==="/reimbursements"))==null;G===!1&&m.push("top_expenses"),j===!1&&m.push("task_card"),M===!1&&m.push("bill_pay_card","bill_pay_promo_card"),A===!1&&m.push("reimbursement_card","reimbursement_promo_card"),m.push("zeni_accounts_promo_card","treasury_promo_card"),_===!1&&m.push("rewards_card");const F=k((h=>{const O=[];s===!1&&O.push("accounts_payable_aging"),b===!1&&O.push("accounts_receivable_aging"),O.push("zeni_accounts_promo_card","treasury_promo_card"),_===!1&&O.push("rewards_card"),r===!1&&O.push("expense_automation_card");const J=kt(h,O,t,I,r);return _t(J.reportsInOrder.map((P=>({fetchState:P.fetchState,error:P.error})))).fetchState}));d.useEffect((()=>{p!=="Completed"||o||E||D||(l(!0),i(vt(t.userId,T,g.tenantId,!0,!1,m)))}),[o,p,E,D,t,g.tenantId,i]);const K=d.useRef(!1),Q=d.useCallback((()=>{const h={pathnameStackToGoBack:z(u.state?.pathnameStackToGoBack,u.pathname),message:"activation"};e(E?"../../checking":D?"../../cards":"../../dashboard",{state:h})}),[e,u,E,D]),U=d.useCallback((()=>{K.current||(K.current=!0,Q())}),[Q]);if(d.useEffect((()=>{const h=setTimeout((()=>y(!0)),3e3);return()=>clearTimeout(h)}),[]),d.useEffect((()=>{const h=setTimeout(U,6e3);return()=>clearTimeout(h)}),[U]),d.useEffect((()=>{E||D||!c||F!=="Completed"&&F!=="Error"||U()}),[c,F,E,D,U]),p!=="Completed")return a.jsx(B,{to:"../"});const V=g.company?.companyOnboardingInfo?.onboardingInfo,q={timeSinceQuoteSign:V?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:V?.onboardingToQuoteSignMinutes??0,isKybDone:ze(V?.businessVerified?.status),isKycDone:ze(V?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:V?.accountingConnectionCreationMode??""};return a.jsxs(a.Fragment,{children:[a.jsx(oe,{analytics:N,onLoad:h=>h.trackOnboardingDashboardActivation(q)}),a.jsx(fn,{show:!0,onComplete:U})]})},ge=["reading_books","finance_graph","reconciliation","cfo_foundation"],fe=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],Ke=(e,u)=>{const i=new Map(e.map((o=>[o.key,o])));return u.map((o=>{return l=i.get(o)?.status,l==="starting"||l==="building"?l:"idle";var l}))},qe=(e,u)=>{if(e.length===0)return!1;const i=new Map(e.map((o=>[o.key,o])));return u.every((o=>i.get(o)?.status==="ready"))},He=xe.div`
1
+ import{j as a}from"./liveblocks-0jcT8Dx_.js";import{t as ht,A as Ue}from"./AddressScreen-DqXE5RDJ.js";import St from"./NotFoundScreen-1FWTFg5q.js";import{a as d}from"./sentry-Cix5j_Oe.js";import{h as Ce,g as Ie,u as ae,i as ke,j as k,N,l as bt,n as tt,o as Ct,p as H}from"./core-DrRun-Wp.js";import{eZ as Y,fG as _e,fE as Oe,bs as It,fU as kt,bS as _t,og as Ot,tH as vt,tK as Tt,Ne as Et,Nf as wt,ki as he,kl as nt,ML as xt,bZ as At,c7 as ue,u9 as ve,tW as Pt,Ng as de,ua as at,KE as Dt,lm as ot,Nh as jt,Ni as Ft,rF as Nt,hu as Bt,MD as me,hr as Ut,ME as Vt,ym as Rt,rJ as Lt,hj as Gt,hm as Ve,Nj as st,Nk as $t,Ep as Mt,Nl as Qt,Et as zt,tN as Kt,Nm as qt,Nn as Ht,kg as Zt,kj as Jt,um as Wt,tY as it,u8 as Yt,bE as Re,cA as Xt,ul as Le,rY as en,rM as tn,le as nn,gl as an,gk as on,gj as sn,No as rn,tQ as cn,un as dn,uq as un,ut as ln,uz as pn,cZ as mn}from"./zeni-epic-state-D1OApLJ3.js";import{z as L,A as Te,c as Z,i as gn,w as z,E as oe,g as B,aq as fn,J as yn,S as rt,f as ct,ar as Ge,p as Se,j as be,as as hn,o as $e,at as Me,au as Sn,av as Qe,aw as bn,ax as Cn}from"./index-CdzL9szH.js";import{n as Ee}from"./mui-BCzMCgwZ.js";import{g as In,h as kn,q as se}from"./QBOConnectionScreen-Doubr8Lv.js";import{u as _n,a as On}from"./useEmailConnectResultRefresh-BeuZj6XY.js";import{u as vn}from"./useChargeCardPusherEvents-BbwX5V1a.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./empty-BxU8KR-q.js";import"./pdf-lib-gor9sGMc.js";import"./index-BJ6_cpY3.js";import"./url-C58jRUwt.js";import"./index-2hIX2kLH.js";import"./decodeURIComponentSafe-BqXEXApE.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new e.Error().stack;u&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[u]="3de16f2c-e8d1-499b-b41f-03524b9c5a03",e._sentryDebugIdIdentifier="sentry-dbid-3de16f2c-e8d1-499b-b41f-03524b9c5a03")}catch{}})();const ze=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Tn=()=>{const e=Ce(),u=Ie(),i=ae(),[o,l]=d.useState(!1),[c,y]=d.useState(!1),{tenantEmailDomain:S}=ke(),t=L.getSignedInUser(),{useFeatureGate:n}=Te(),{isFeatureEnabled:s}=n(Z.isApAgingFeatureEnabled),{isFeatureEnabled:b}=n(Z.isArAgingFeatureEnabled),{isFeatureEnabled:_}=n(Z.isReferralFeatureEnabled),{isFeatureEnabled:I}=n(Z.isExpenseAutomationEnabledV2),{isFeatureEnabled:E}=n(Z.isDebitCardFeatureEnabled),r=gn(),g=k((h=>Y(h))),p=k((h=>h.onboardingCustomerViewState.fetchState)),O=g.excludedResources,T=g.companyId??L.getSignedInUserTenant(S)?.companyId;if(t==null)throw Error("Can't access onboarding flow without signing in...");const w=_e(E,g),D=Oe(g),m=[],G=O?.resources?.find((h=>h.resource==="/reports/top_expenses"))==null,j=O?.resources?.find((h=>h.resource==="/reports/task_card"))==null,$=g?.userRole!=null&&It(g?.userRole),M=O?.resources?.find((h=>h.resource==="/bills"))==null&&!$,A=O?.resources?.find((h=>h.resource==="/reimbursements"))==null;G===!1&&m.push("top_expenses"),j===!1&&m.push("task_card"),M===!1&&m.push("bill_pay_card","bill_pay_promo_card"),A===!1&&m.push("reimbursement_card","reimbursement_promo_card"),m.push("zeni_accounts_promo_card","treasury_promo_card"),_===!1&&m.push("rewards_card");const F=k((h=>{const v=[];s===!1&&v.push("accounts_payable_aging"),b===!1&&v.push("accounts_receivable_aging"),v.push("zeni_accounts_promo_card","treasury_promo_card"),_===!1&&v.push("rewards_card"),r===!1&&v.push("expense_automation_card");const J=kt(h,v,t,I,r);return _t(J.reportsInOrder.map((P=>({fetchState:P.fetchState,error:P.error})))).fetchState}));d.useEffect((()=>{p!=="Completed"||o||w||D||(l(!0),i(Ot(t.userId,T,g.tenantId,!0,!1,m)))}),[o,p,w,D,t,g.tenantId,i]);const K=d.useRef(!1),Q=d.useCallback((()=>{const h={pathnameStackToGoBack:z(u.state?.pathnameStackToGoBack,u.pathname),message:"activation"};e(w?"../../checking":D?"../../cards":"../../dashboard",{state:h})}),[e,u,w,D]),U=d.useCallback((()=>{K.current||(K.current=!0,Q())}),[Q]);if(d.useEffect((()=>{const h=setTimeout((()=>y(!0)),3e3);return()=>clearTimeout(h)}),[]),d.useEffect((()=>{const h=setTimeout(U,6e3);return()=>clearTimeout(h)}),[U]),d.useEffect((()=>{w||D||!c||F!=="Completed"&&F!=="Error"||U()}),[c,F,w,D,U]),p!=="Completed")return a.jsx(N,{to:"../"});const V=g.company?.companyOnboardingInfo?.onboardingInfo,q={timeSinceQuoteSign:V?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:V?.onboardingToQuoteSignMinutes??0,isKybDone:ze(V?.businessVerified?.status),isKycDone:ze(V?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:V?.accountingConnectionCreationMode??""};return a.jsxs(a.Fragment,{children:[a.jsx(oe,{analytics:B,onLoad:h=>h.trackOnboardingDashboardActivation(q)}),a.jsx(fn,{show:!0,onComplete:U})]})},ge=["reading_books","finance_graph","reconciliation","cfo_foundation"],fe=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],Ke=(e,u)=>{const i=new Map(e.map((o=>[o.key,o])));return u.map((o=>{return l=i.get(o)?.status,l==="starting"||l==="building"?l:"idle";var l}))},qe=(e,u)=>{if(e.length===0)return!1;const i=new Map(e.map((o=>[o.key,o])));return u.every((o=>i.get(o)?.status==="ready"))},He=Ee.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${e=>e.theme.colors.grey4};
5
- `,Ze=xe.div`
5
+ `,Ze=Ee.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: center;
@@ -23,8 +23,8 @@ import{j as a}from"./liveblocks-ufh19lah.js";import{t as ht,A as Ue}from"./Addre
23
23
  }
24
24
 
25
25
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
26
- `,Je=tt((function(e,u){const{companyId:i,isAdmin:o,currentTenant:l,isOnAddressPage:c}=u,y=L.getSignedInUser(),S=l.tenantId,t={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},n=Y(e),s=Oe(e,i),b=st(e),_=ue(l?.userRole??[])&&s.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=$t(e.userRoleConfigState);return{onboardingCustomerView:s,analytics:N,isRefreshingViewInBackground:!1,isDisabled:_,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Sn.fileMicroServiceBaseUrl,authParams:t},signedInUser:L.getSignedInUser(),currentTenant:n,isAdmin:o,isOnAddressPage:c,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:b,isCardPaymentPopupOpen:!1,stripeKey:Se.stripeKey}}),(function(e,u){const{companyId:i,currentTenant:o,themeState:l,navigate:c,location:y}=u,{tenantEmailDomain:S}=o;return{onFetchLinkTokenClick:(t,n)=>{e(pn(t,n))},onEstablishConnectionClick:(t,n)=>{e(ln(t,n))},onUpdatePaymentAccountStatus:(t,n,s)=>{e(un(t,n,s))},onUpdatePaymentAccountLoginStatus:(t,n)=>{e(dn(!1,t,n))},onEstablishConnectionSuccess:()=>{e(cn(i,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),se.handleClick()},updateQBOPopupState:t=>{e(de({isQBOPopupOpen:t}))},onCompanyOfficerUpdated:t=>{const n=t.map((s=>{const{officerType:b,userId:_,name:I,email:x,ssn:r,nationalityCountryCode:g,dob:p,phone:v,syncToken:T,selectDocument:E,role:D,ownership:m,isSelectedForVerification:G,userVerificationStatus:j,fileIds:$,isPhoneVerified:M}=s;let A;return E.selectDocumentType==="driverLicense"?A="driving_license":E.selectDocumentType==="passport"?A="passport":E.selectDocumentType==="stateId"?A="id_document":E.selectDocumentType==="ssnCard"&&(A="social_security_card"),{officerType:b,userId:_,firstName:I.firstName,lastName:I.lastName,email:x,ssn:r,nationalityCountryCode:g?.selectedOption!=null?Qe(g.selectedOption):void 0,phone:v,birthday:p!=null?Re(p?.toString()):p,syncToken:T,titleAtCompany:D.selectedOption,ownershipInCompany:m,documentTypeSelectedForVerification:A,isSelectedForVerification:G,userVerificationStatus:j,fileIds:$,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:M}}));e(Le({officers:n}))},onGetOtp:(t,n)=>{e(sn(t,"CustomerOnboarding")),n!=null&&e(rn({officerType:n,phone:t}))},onResendOtp:t=>{e(on(t,"CustomerOnboarding"))},onVerifyOtp:(t,n)=>{e(an(t,n,"CustomerOnboarding"))},updateFilesEntity:t=>{e(nn({files:t}))},onDeleteFile:t=>{e(tn(t))},onEditFileName:(t,n)=>{e(en(t,n.split(".")[0]))},onCompanyDetailsChanged:t=>{const{companyDescription:n,companyIndustry:s,companyIndustryType:b,companyLegalName:_,companyTaxId:I,companyWebsite:x,companyPhone:r,primaryContactEmail:g,primaryContactName:p,primaryContactUserId:v,primaryContactSyncToken:T,syncToken:E,fileIds:D,typeOfIncorporation:m,stateOfIncorporation:G,incDate:j,companySourceOfFunds:$,companySourceOfFundsDescription:M,companySubIndustry:A,countriesOfOperations:F,purposeOfAccount:K,purposeOfAccountDescription:Q,regulatedStatus:U,regulatedStatusDescription:V,transactionVolume:q,transactionVolumeDescription:h,usNexus:O,usNexusTypes:J}=t,P={companyId:i,companyDescription:n,companyIndustry:s.selectedOption,companyIndustryType:b?.selectedOption??"",companyLegalName:_,taxIdOrEIN:I,website:x!=""&&x!=null?Xt(x):void 0,phone:r,syncToken:E,fileIds:D,incDate:j!=null?Re(j?.toString()):j,typeOfIncorporation:m?.selectedOption??"",stateOfIncorporation:G?.selectedOption??"",companySourceOfFunds:$?.selectedOption??"",companySourceOfFundsDescription:M,companySubIndustry:A?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((X=>X.length===2?X:Qe(X)))??[],purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:U??"",regulatedStatusDescription:V,transactionVolume:q?.selectedOption??"",transactionVolumeDescription:h,usNexus:O,usNexusTypes:J?.selectedOptions??[]},le={userId:v,firstName:p.firstName,lastName:p.lastName,email:g,syncToken:T};e(Le({companyDetails:P,primaryContactDetails:le}))},onAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onRegisteredAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onUpdateCustomerView:(t,n,s)=>{e(Yt(i,!1,n,s,t))},onAddressEditHandler:t=>{if(t!=null){const n=ht(t);e(ot({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);e(it(i,!1,!1)),c("./activation",{state:{pathnameStackToGoBack:t}})},onUpdateStep:t=>{e(at({step:t}))},onUpdateSubStep:t=>{e(Wt({subStep:t}))},onZeniLogoClick:()=>{l.toggle()},handleLogOutClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c("/signout",{replace:!0,state:{pathnameStackToGoBack:t,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{c(`/${S}/rewards`)},handleCreateCardSetupIntent:t=>{e(nt(t))},handleConfirmCardSetupIntent:t=>{e(Jt(t))},updateCardPaymentModalState:t=>{e(de({isCardPaymentPopupOpen:t}))},handleAddCardPaymentSource:(t,n,s)=>{e(Zt(t,n,s))},handleFetchPaymentSources:()=>{e(he())},resetCardPaymentViewState:()=>{e(Ht())},handleResetCardPaymentErrorStatuses:()=>{e(qt())},redirectToProductSuitePage:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:t,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(N.trackOnboardingAiFinanceTeamAcknowledged(),e(Kt(i)))},onIdentityDocumentUploadedForAutofill:t=>{if(i==null)return;const n=Qt(t.documentType);n!=null&&e(zt({target:"onboarding",companyId:i,officerType:t.officerType,fileId:t.fileId,documentType:n}))},onCompanyDocumentUploadedForAutofill:t=>{i!=null&&e(Mt({target:"onboarding",companyId:i,fileId:t.fileId,documentType:t.documentType}))}}}))(hn),ce=({taxCFOCustomer:e=!1,isOnAddressPage:u=!1,appContent:i})=>{const o=Ce(),l=Ie(),c=ae(),y=yn(),S=rt(),[t,n]=d.useState(!1),[s,b]=d.useState(!1),[_,I]=d.useState(!1),{tenantEmailDomain:x}=ke(),r=ct(),{useFeatureGate:g}=Te(),{isFeatureEnabled:p}=g(Z.isDebitCardFeatureEnabled),v=bt("/:tenantEmailDomain/onboarding")!==null&&l.search?.includes("code"),T=k((f=>f.onboardingCustomerViewState.fetchState)),E=k((f=>f.onboardingCustomerViewState.currentStep)),D=k((f=>f.onboardingCustomerViewState.uiState)),m=k((f=>Y(f))),G=k((f=>f.userRoleConfigState.fetchState)),j=k((f=>f.cardPaymentViewState)),$=Ge(j.addCardPaymentSourceStatus.fetchState),M=j.addCardPaymentSourceStatus.fetchState,{code:A,realmId:F,state:K}=In(l.search),Q=m.externalConnections?.accounting[0],U=Q?.connectionType,V=Q?.connectionName,q=Q?.connectionId??"",h=L.getSignedInUser()?.userId??"";d.useEffect((()=>{s||(b(!0),c(he()))}),[s,c]),d.useEffect((()=>{_||(nt(["card"]),I(!0))}),[_]),d.useEffect((()=>{$==="In-Progress"&&M==="Completed"&&c(he())}),[$,M]),d.useEffect((()=>{kn(A,F,K,q,h)===!0&&m.externalConnections?.saveConnectionState!=="In-Progress"&&T==="Completed"&&(c(wt(m.tenantId,{connection_type:U??"accounting",connection_name:V??"quickbooks_online",authorization_code:A,realm_id:F,connection_id:q,user_id:h},At(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(F,q),o(l.pathname))}),[A,F,K,l.pathname,T]),d.useEffect((()=>{se.isInitiated===!1&&T==="Completed"&&se.init("/onboarding/auth",m.tenantEmailDomain)}),[T]);const O=m.companyId??L.getSignedInUserTenant(x)?.companyId,J=ue(m?.userRole??[]),P=k((f=>Oe(f,O)));d.useEffect((()=>{t||T!=="Not-Started"||O==null||(n(!0),c(Pt(O,!0,!v)))}),[t,T,O]),d.useEffect((()=>{m.externalConnections?.saveConnectionState!=="Completed"&&m.externalConnections?.saveConnectionState!=="Error"||!D.isQBOPopupOpen||E!=="connect_ledger"||c(de({isQBOPopupOpen:!1}))}),[m.externalConnections?.saveConnectionState]),d.useEffect((()=>{T==="Completed"&&v&&(c(at({step:"connect_ledger"})),c(de({isQBOPopupOpen:!0})))}),[v,T]),d.useEffect((()=>{G==="Not-Started"&&c(Dt(!0))}),[G,c]);const le=Ge(P.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&P.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&le==null&&c(ot({addressType:"company_registered_address",addressToCreate:P.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[P.companyDetailsLocalData?.addressStatus?.addressToCreate,P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const X=P.isInterimEmailSent,Ee=L.getSignedInUser();if(Ee==null)throw Error("Can't access onboarding flow without signing in...");const dt=_e(p,m),ut=ve(m),we=m.company?.companyOnboardingInfo.isOnboardingCompleted,Ae=f=>f.trackPageLoaded(be.Event.onboardingPage),Pe=m.productSettings.isOtherProductsEnabled,lt=m.productSettings.isTreasuryEnabled,De=xn({tenantEmailDomain:x??"",signedInUserEmail:Ee.userEmail??"",companyId:O}),je=(({companyId:f})=>{const R=ae(),ie=k((w=>w.onboardingCustomerViewState?.aiAgentsActivation)),ee=k((w=>Y(w).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),pe=d.useCallback((()=>{R(Ot())}),[R]);d.useEffect((()=>{pe()}),[pe]);const Fe=d.useCallback((()=>{f==null||f===""||ee||R(Tt(f))}),[f,ee,R]),pt=d.useMemo((()=>{if(f==null||f==="")return[];const w=`private-encrypted-${f}`;return[`${w}.ledger-ingestion.counts-updated`,`${w}.ai-agents-activation.phase-changed`]}),[f]),mt=d.useCallback(((w,te)=>{if(te==null||typeof te!="object")return;const C=te;if(w!=="ledger-ingestion.counts-updated"){if(w==="ai-agents-activation.phase-changed"){const re=typeof C.phase_key=="string"?C.phase_key:typeof C.key=="string"?C.key:"",W=typeof C.status=="string"?C.status:"idle";if(re==="")return;R(Et({key:re,status:W==="starting"||W==="building"||W==="ready"?W:"idle",startedAt:typeof C.started_at=="string"?C.started_at:void 0,completedAt:typeof C.completed_at=="string"?C.completed_at:void 0}))}}else R(xt({customerCount:typeof C.customer_count=="number"?C.customer_count:void 0,glAccountCount:typeof C.gl_account_count=="number"?C.gl_account_count:void 0,targetTransactionCount:typeof C.target_transaction_count=="number"?C.target_transaction_count:void 0,transactionCount:typeof C.transaction_count=="number"?C.transaction_count:void 0,vendorCount:typeof C.vendor_count=="number"?C.vendor_count:void 0}))}),[R]);return On({events:pt,onEvent:mt,onSubscribed:pe}),d.useMemo((()=>{const w=ie?.phases??[],te=Ke(w,ge),C=Ke(w,fe),re=qe(w,ge),W=qe(w,fe),Be=w.some((yt=>yt.status!=="idle")),ne=!ee&&!Be,Ne=ee&&!Be,gt=Ne?ge.map((()=>"building")):te,ft=Ne?fe.map((()=>"building")):C;return{ledgerRowStatuses:ne?void 0:gt,backgroundRowStatuses:ne?void 0:ft,showLedgerReadyInLabel:ne?void 0:re,showBackgroundReadyInLabel:ne?void 0:W,forceContinueEnabled:!ne||void 0,counts:ie?.counts,onContinueClicked:Fe}}),[ie?.phases,ie?.counts,ee,Fe])})({companyId:O});if(we===!0){if(!Pe)return lt?a.jsx(B,{to:"../../treasury"}):dt?a.jsx(B,{to:"../../checking"}):ut?a.jsx(B,{to:"../../cards"}):a.jsx(B,{to:"../../dashboard"});const f=P.updateStatus.fetchState==="In-Progress";if(Pe&&!f)return e?a.jsxs(He,{children:[a.jsx(oe,{analytics:N,onLoad:R=>Ae(R)}),a.jsx(Je,{navigate:o,location:l,companyId:O,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):a.jsx(B,{to:"../../onboarding/thankyou"})}else if(we===!1&&r?.loggedInUserRoleMap!=null)return X===!0?a.jsx(B,{to:"../../onboarding/thankyou"}):a.jsxs(He,{children:[a.jsx(oe,{analytics:N,onLoad:f=>Ae(f)}),a.jsx(Je,{navigate:o,location:l,companyId:O,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ye="external_integrations",xn=({tenantEmailDomain:e,signedInUserEmail:u,companyId:i})=>{const o=ae(),{pendingAutoFocusTabId:l}=_n(),{plaidAccounts:c,onAddPlaidAccount:y}=vn({companyId:i}),S=k((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=k((r=>Y(r))),n=k((r=>r.tenantState.fetchState)),s=k((r=>jt(r,i))),b=k((r=>Ft(r,ye))),_=d.useMemo((()=>new Set(b.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[b]),I=t.tenantId,x=ue(t.userRole??[]);return d.useEffect((()=>{o(Bt(ye))}),[o]),d.useMemo((()=>({isAdmin:x,integrationsView:s,isLoading:n==="In-Progress",notifyMeRegisteredSlugs:_,autoFocusTabId:l??void 0,saveChargeBeeState:s.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:s.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:s.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:s.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:s.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(s.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,g])=>[r,g?.message]))),deleteConnectionState:s.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:s.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{o(Ve(I,"gmail",We()))},onConnectOutlook:()=>{o(Ve(I,"outlook",We()))},onConnectHubSpot:(r,g)=>{const p=s.externalConnections?.revenue?.find((T=>T.connectionName==="hubspot"))?.connectionId;if(p==null)return;const v=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:g,connection_id:p,redirect_uri:v,tenant_id:I})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(v)}`},onDisconnect:(r,g)=>{o(Gt(I,r,me(g)))},onNotifyMe:r=>{N.trackIntegrationsNotifyMeClicked("Onboarding",r),o(Lt(ye,r,u))},onReconnectQBO:()=>{se.init("/onboarding/auth",e),se.handleClick()},onRefreshClick:()=>{s.integrations.refreshQBO.fetchState!=="In-Progress"&&o(Rt())},onSaveChargeBeeCredentials:(r,g)=>{const p=s.externalConnections?.revenue?.find((v=>v.connectionName==="chargebee"))?.connectionId;p!=null&&o(Ut(I,p,me("revenue"),Vt("chargebee"),{api_key:r,site:g}))},onSaveConnectorCredentials:r=>{o(Nt(I,me("payments"),r))},plaidAccounts:c,onAddPlaidAccount:y,plaidConnectionDetails:S})),[x,s,n,_,l,I,u,e,o,c,y,S])};function We(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function Ye(e,u,i){let o=`/${e}/onboarding/address`;return o=i!=null?o.concat(`/edit/${u}/${encodeURIComponent(i)}`):o.concat(`/new/${u}`),o}const Xe=xe.div`
26
+ `,Je=tt((function(e,u){const{companyId:i,isAdmin:o,currentTenant:l,isOnAddressPage:c}=u,y=L.getSignedInUser(),S=l.tenantId,t={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},n=Y(e),s=ve(e,i),b=st(e),_=ue(l?.userRole??[])&&s.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=$t(e.userRoleConfigState);return{onboardingCustomerView:s,analytics:B,isRefreshingViewInBackground:!1,isDisabled:_,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Sn.fileMicroServiceBaseUrl,authParams:t},signedInUser:L.getSignedInUser(),currentTenant:n,isAdmin:o,isOnAddressPage:c,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:b,isCardPaymentPopupOpen:!1,stripeKey:Se.stripeKey}}),(function(e,u){const{companyId:i,currentTenant:o,themeState:l,navigate:c,location:y}=u,{tenantEmailDomain:S}=o;return{onFetchLinkTokenClick:(t,n)=>{e(pn(t,n))},onEstablishConnectionClick:(t,n)=>{e(ln(t,n))},onUpdatePaymentAccountStatus:(t,n,s)=>{e(un(t,n,s))},onUpdatePaymentAccountLoginStatus:(t,n)=>{e(dn(!1,t,n))},onEstablishConnectionSuccess:()=>{e(cn(i,!0,!1))},handleOnConnectClick:()=>{B.trackOnboardingConnectQBO(),se.handleClick()},updateQBOPopupState:t=>{e(de({isQBOPopupOpen:t}))},onCompanyOfficerUpdated:t=>{const n=t.map((s=>{const{officerType:b,userId:_,name:I,email:E,ssn:r,nationalityCountryCode:g,dob:p,phone:O,syncToken:T,selectDocument:w,role:D,ownership:m,isSelectedForVerification:G,userVerificationStatus:j,fileIds:$,isPhoneVerified:M}=s;let A;return w.selectDocumentType==="driverLicense"?A="driving_license":w.selectDocumentType==="passport"?A="passport":w.selectDocumentType==="stateId"?A="id_document":w.selectDocumentType==="ssnCard"&&(A="social_security_card"),{officerType:b,userId:_,firstName:I.firstName,lastName:I.lastName,email:E,ssn:r,nationalityCountryCode:g?.selectedOption!=null?Qe(g.selectedOption):void 0,phone:O,birthday:p!=null?Re(p?.toString()):p,syncToken:T,titleAtCompany:D.selectedOption,ownershipInCompany:m,documentTypeSelectedForVerification:A,isSelectedForVerification:G,userVerificationStatus:j,fileIds:$,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:M}}));e(Le({officers:n}))},onGetOtp:(t,n)=>{e(sn(t,"CustomerOnboarding")),n!=null&&e(rn({officerType:n,phone:t}))},onResendOtp:t=>{e(on(t,"CustomerOnboarding"))},onVerifyOtp:(t,n)=>{e(an(t,n,"CustomerOnboarding"))},updateFilesEntity:t=>{e(nn({files:t}))},onDeleteFile:t=>{e(tn(t))},onEditFileName:(t,n)=>{e(en(t,n.split(".")[0]))},onCompanyDetailsChanged:t=>{const{companyDescription:n,companyIndustry:s,companyIndustryType:b,companyLegalName:_,companyTaxId:I,companyWebsite:E,companyPhone:r,primaryContactEmail:g,primaryContactName:p,primaryContactUserId:O,primaryContactSyncToken:T,syncToken:w,fileIds:D,typeOfIncorporation:m,stateOfIncorporation:G,incDate:j,companySourceOfFunds:$,companySourceOfFundsDescription:M,companySubIndustry:A,countriesOfOperations:F,purposeOfAccount:K,purposeOfAccountDescription:Q,regulatedStatus:U,regulatedStatusDescription:V,transactionVolume:q,transactionVolumeDescription:h,usNexus:v,usNexusTypes:J}=t,P={companyId:i,companyDescription:n,companyIndustry:s.selectedOption,companyIndustryType:b?.selectedOption??"",companyLegalName:_,taxIdOrEIN:I,website:E!=""&&E!=null?Xt(E):void 0,phone:r,syncToken:w,fileIds:D,incDate:j!=null?Re(j?.toString()):j,typeOfIncorporation:m?.selectedOption??"",stateOfIncorporation:G?.selectedOption??"",companySourceOfFunds:$?.selectedOption??"",companySourceOfFundsDescription:M,companySubIndustry:A?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((X=>X.length===2?X:Qe(X)))??[],purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:U??"",regulatedStatusDescription:V,transactionVolume:q?.selectedOption??"",transactionVolumeDescription:h,usNexus:v,usNexusTypes:J?.selectedOptions??[]},le={userId:O,firstName:p.firstName,lastName:p.lastName,email:g,syncToken:T};e(Le({companyDetails:P,primaryContactDetails:le}))},onAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onRegisteredAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onUpdateCustomerView:(t,n,s)=>{e(Yt(i,!1,n,s,t))},onAddressEditHandler:t=>{if(t!=null){const n=ht(t);e(ot({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);e(it(i,!1,!1)),c("./activation",{state:{pathnameStackToGoBack:t}})},onUpdateStep:t=>{e(at({step:t}))},onUpdateSubStep:t=>{e(Wt({subStep:t}))},onZeniLogoClick:()=>{l.toggle()},handleLogOutClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c("/signout",{replace:!0,state:{pathnameStackToGoBack:t,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{c(`/${S}/rewards`)},handleCreateCardSetupIntent:t=>{e(nt(t))},handleConfirmCardSetupIntent:t=>{e(Jt(t))},updateCardPaymentModalState:t=>{e(de({isCardPaymentPopupOpen:t}))},handleAddCardPaymentSource:(t,n,s)=>{e(Zt(t,n,s))},handleFetchPaymentSources:()=>{e(he())},resetCardPaymentViewState:()=>{e(Ht())},handleResetCardPaymentErrorStatuses:()=>{e(qt())},redirectToProductSuitePage:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:t,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(B.trackOnboardingAiFinanceTeamAcknowledged(),e(Kt(i)))},onIdentityDocumentUploadedForAutofill:t=>{if(i==null)return;const n=Qt(t.documentType);n!=null&&e(zt({target:"onboarding",companyId:i,officerType:t.officerType,fileId:t.fileId,documentType:n}))},onCompanyDocumentUploadedForAutofill:t=>{i!=null&&e(Mt({target:"onboarding",companyId:i,fileId:t.fileId,documentType:t.documentType}))}}}))(hn),ce=({taxCFOCustomer:e=!1,isOnAddressPage:u=!1,appContent:i})=>{const o=Ce(),l=Ie(),c=ae(),y=yn(),S=rt(),[t,n]=d.useState(!1),[s,b]=d.useState(!1),[_,I]=d.useState(!1),{tenantEmailDomain:E}=ke(),r=ct(),{useFeatureGate:g}=Te(),{isFeatureEnabled:p}=g(Z.isDebitCardFeatureEnabled),O=bt("/:tenantEmailDomain/onboarding")!==null&&l.search?.includes("code"),T=k((f=>f.onboardingCustomerViewState.fetchState)),w=k((f=>f.onboardingCustomerViewState.currentStep)),D=k((f=>f.onboardingCustomerViewState.uiState)),m=k((f=>Y(f))),G=k((f=>f.userRoleConfigState.fetchState)),j=k((f=>f.cardPaymentViewState)),$=Ge(j.addCardPaymentSourceStatus.fetchState),M=j.addCardPaymentSourceStatus.fetchState,{code:A,realmId:F,state:K}=In(l.search),Q=m.externalConnections?.accounting[0],U=Q?.connectionType,V=Q?.connectionName,q=Q?.connectionId??"",h=L.getSignedInUser()?.userId??"";d.useEffect((()=>{s||(b(!0),c(he()))}),[s,c]),d.useEffect((()=>{_||(nt(["card"]),I(!0))}),[_]),d.useEffect((()=>{$==="In-Progress"&&M==="Completed"&&c(he())}),[$,M]),d.useEffect((()=>{kn(A,F,K,q,h)===!0&&m.externalConnections?.saveConnectionState!=="In-Progress"&&T==="Completed"&&(c(xt(m.tenantId,{connection_type:U??"accounting",connection_name:V??"quickbooks_online",authorization_code:A,realm_id:F,connection_id:q,user_id:h},At(window.location.origin+"/onboarding/auth"))),B.trackOnboardingSaveQBOConnection(F,q),o(l.pathname))}),[A,F,K,l.pathname,T]),d.useEffect((()=>{se.isInitiated===!1&&T==="Completed"&&se.init("/onboarding/auth",m.tenantEmailDomain)}),[T]);const v=m.companyId??L.getSignedInUserTenant(E)?.companyId,J=ue(m?.userRole??[]),P=k((f=>ve(f,v)));d.useEffect((()=>{t||T!=="Not-Started"||v==null||(n(!0),c(Pt(v,!0,!O)))}),[t,T,v]),d.useEffect((()=>{m.externalConnections?.saveConnectionState!=="Completed"&&m.externalConnections?.saveConnectionState!=="Error"||!D.isQBOPopupOpen||w!=="connect_ledger"||c(de({isQBOPopupOpen:!1}))}),[m.externalConnections?.saveConnectionState]),d.useEffect((()=>{T==="Completed"&&O&&(c(at({step:"connect_ledger"})),c(de({isQBOPopupOpen:!0})))}),[O,T]),d.useEffect((()=>{G==="Not-Started"&&c(Dt(!0))}),[G,c]);const le=Ge(P.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&P.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&le==null&&c(ot({addressType:"company_registered_address",addressToCreate:P.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[P.companyDetailsLocalData?.addressStatus?.addressToCreate,P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const X=P.isInterimEmailSent,we=L.getSignedInUser();if(we==null)throw Error("Can't access onboarding flow without signing in...");const dt=_e(p,m),ut=Oe(m),xe=m.company?.companyOnboardingInfo.isOnboardingCompleted,Ae=f=>f.trackPageLoaded(be.Event.onboardingPage),Pe=m.productSettings.isOtherProductsEnabled,lt=m.productSettings.isTreasuryEnabled,De=En({tenantEmailDomain:E??"",signedInUserEmail:we.userEmail??"",companyId:v}),je=(({companyId:f})=>{const R=ae(),ie=k((x=>x.onboardingCustomerViewState?.aiAgentsActivation)),ee=k((x=>Y(x).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),pe=d.useCallback((()=>{R(vt())}),[R]);d.useEffect((()=>{pe()}),[pe]);const Fe=d.useCallback((()=>{f==null||f===""||ee||R(Tt(f))}),[f,ee,R]),pt=d.useMemo((()=>{if(f==null||f==="")return[];const x=`private-encrypted-${f}`;return[`${x}.ledger-ingestion.counts-updated`,`${x}.ai-agents-activation.phase-changed`]}),[f]),mt=d.useCallback(((x,te)=>{if(te==null||typeof te!="object")return;const C=te;if(x!=="ledger-ingestion.counts-updated"){if(x==="ai-agents-activation.phase-changed"){const re=typeof C.phase_key=="string"?C.phase_key:typeof C.key=="string"?C.key:"",W=typeof C.status=="string"?C.status:"idle";if(re==="")return;R(wt({key:re,status:W==="starting"||W==="building"||W==="ready"?W:"idle",startedAt:typeof C.started_at=="string"?C.started_at:void 0,completedAt:typeof C.completed_at=="string"?C.completed_at:void 0}))}}else R(Et({customerCount:typeof C.customer_count=="number"?C.customer_count:void 0,glAccountCount:typeof C.gl_account_count=="number"?C.gl_account_count:void 0,targetTransactionCount:typeof C.target_transaction_count=="number"?C.target_transaction_count:void 0,transactionCount:typeof C.transaction_count=="number"?C.transaction_count:void 0,vendorCount:typeof C.vendor_count=="number"?C.vendor_count:void 0}))}),[R]);return vn({events:pt,onEvent:mt,onSubscribed:pe}),d.useMemo((()=>{const x=ie?.phases??[],te=Ke(x,ge),C=Ke(x,fe),re=qe(x,ge),W=qe(x,fe),Ne=x.some((yt=>yt.status!=="idle")),ne=!ee&&!Ne,Be=ee&&!Ne,gt=Be?ge.map((()=>"building")):te,ft=Be?fe.map((()=>"building")):C;return{ledgerRowStatuses:ne?void 0:gt,backgroundRowStatuses:ne?void 0:ft,showLedgerReadyInLabel:ne?void 0:re,showBackgroundReadyInLabel:ne?void 0:W,forceContinueEnabled:!ne||void 0,counts:ie?.counts,onContinueClicked:Fe}}),[ie?.phases,ie?.counts,ee,Fe])})({companyId:v});if(xe===!0){if(!Pe)return lt?a.jsx(N,{to:"../../treasury"}):dt?a.jsx(N,{to:"../../checking"}):ut?a.jsx(N,{to:"../../cards"}):a.jsx(N,{to:"../../dashboard"});const f=P.updateStatus.fetchState==="In-Progress";if(Pe&&!f)return e?a.jsxs(He,{children:[a.jsx(oe,{analytics:B,onLoad:R=>Ae(R)}),a.jsx(Je,{navigate:o,location:l,companyId:v,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):a.jsx(N,{to:"../../onboarding/thankyou"})}else if(xe===!1&&r?.loggedInUserRoleMap!=null)return X===!0?a.jsx(N,{to:"../../onboarding/thankyou"}):a.jsxs(He,{children:[a.jsx(oe,{analytics:B,onLoad:f=>Ae(f)}),a.jsx(Je,{navigate:o,location:l,companyId:v,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ye="external_integrations",En=({tenantEmailDomain:e,signedInUserEmail:u,companyId:i})=>{const o=ae(),{pendingAutoFocusTabId:l}=_n(),{plaidAccounts:c,onAddPlaidAccount:y}=On({companyId:i}),S=k((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=k((r=>Y(r))),n=k((r=>r.tenantState.fetchState)),s=k((r=>jt(r,i))),b=k((r=>Ft(r,ye))),_=d.useMemo((()=>new Set(b.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[b]),I=t.tenantId,E=ue(t.userRole??[]);return d.useEffect((()=>{o(Nt(ye))}),[o]),d.useMemo((()=>({isAdmin:E,integrationsView:s,isLoading:n==="In-Progress",notifyMeRegisteredSlugs:_,autoFocusTabId:l??void 0,saveChargeBeeState:s.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:s.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:s.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:s.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:s.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(s.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,g])=>[r,g?.message]))),deleteConnectionState:s.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:s.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{o(Ve(I,"gmail",We()))},onConnectOutlook:()=>{o(Ve(I,"outlook",We()))},onConnectHubSpot:(r,g)=>{const p=s.externalConnections?.revenue?.find((T=>T.connectionName==="hubspot"))?.connectionId;if(p==null)return;const O=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:g,connection_id:p,redirect_uri:O,tenant_id:I})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(O)}`},onDisconnect:(r,g)=>{o(Gt(I,r,me(g)))},onNotifyMe:r=>{B.trackIntegrationsNotifyMeClicked("Onboarding",r),o(Lt(ye,r,u))},onReconnectQBO:()=>{se.init("/onboarding/auth",e),se.handleClick()},onRefreshClick:()=>{s.integrations.refreshQBO.fetchState!=="In-Progress"&&o(Rt())},onSaveChargeBeeCredentials:(r,g)=>{const p=s.externalConnections?.revenue?.find((O=>O.connectionName==="chargebee"))?.connectionId;p!=null&&o(Ut(I,p,me("revenue"),Vt("chargebee"),{api_key:r,site:g}))},onSaveConnectorCredentials:r=>{o(Bt(I,me("payments"),r))},plaidAccounts:c,onAddPlaidAccount:y,plaidConnectionDetails:S})),[E,s,n,_,l,I,u,e,o,c,y,S])};function We(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function Ye(e,u,i){let o=`/${e}/onboarding/address`;return o=i!=null?o.concat(`/edit/${u}/${encodeURIComponent(i)}`):o.concat(`/new/${u}`),o}const Xe=Ee.div`
27
27
  display: flex;
28
28
  height: 100vh;
29
29
  background-color: ${e=>e.theme.colors.grey4};
30
- `,et=tt((function(e,u){const{companyId:i,currentTenant:o}=u,l=Oe(e,i),c=st(e);return{hasVerifiedBankAccount:(l.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(c.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ue(o?.userRole??[])&&l.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:L.getSignedInUser(),currentTenant:o,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}}),(function(e,u){const{currentTenant:i,themeState:o,navigate:l,location:c}=u,{tenantEmailDomain:y}=i;return{onZeniLogoClick:()=>{o.toggle()},handleLogOutClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{l(`/${y}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l(`/${y}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}}))(Cn),En=()=>{const e=Ce(),u=ae(),i=Ie(),o=rt(),{useFeatureGate:l}=Te(),{isFeatureEnabled:c}=l(Z.isDebitCardFeatureEnabled),{tenantEmailDomain:y}=ke(),S=ct(),[t,n]=d.useState(!1);d.useEffect((()=>{t===!1&&i.state?.message==="OnboardingThankyou"&&n(!0)}),[i.state]);const s=k((p=>Y(p))),b=s.productSettings.isOtherProductsEnabled;d.useEffect((()=>{u(it(_,!1,!b))}),[]);const _=s.companyId??L.getSignedInUserTenant(y)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=_e(c,s),x=ve(s),r=k((p=>p.onboardingCustomerViewState.updateStatus.fetchState)),g=s.company?.companyOnboardingInfo.isOnboardingCompleted;if(g!==!0||b)return r==="Completed"&&g===!0&&b&&S?.loggedInUserRoleMap!=null?a.jsxs(Xe,{children:[a.jsx(oe,{analytics:N,onLoad:p=>{p.trackPageLoaded(be.Event.onboardingLandingPage,"Onboarding",mn(s.productSettings))}}),a.jsx(et,{navigate:e,showUpdatePaymentDetailButton:b,location:i,companyId:_,currentTenant:s,themeState:o,isVisitingFirstTime:t})]}):r==="Completed"&&g===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Xe,{children:[a.jsx(oe,{analytics:N,onLoad:p=>{p.trackPageLoaded(be.Event.onboardingInterimPage)}}),a.jsx(et,{navigate:e,showUpdatePaymentDetailButton:b,location:i,companyId:_,currentTenant:s,themeState:o,isVisitingFirstTime:t})]}):a.jsx(bn,{});{const p={pathnameStackToGoBack:i.state?.pathnameStackToGoBack,message:"activation"};return I?a.jsx(B,{to:"../../checking",state:p,replace:!0}):x?a.jsx(B,{to:"../../cards",state:p,replace:!0}):a.jsx(B,{to:"../../dashboard",state:p,replace:!0})}};function ta(){return a.jsxs(Ct,{children:[a.jsx(H,{path:"/",element:a.jsx(ce,{})}),a.jsx(H,{path:"/billing/edit",element:a.jsx(ce,{taxCFOCustomer:!0})}),a.jsx(H,{path:"/thankyou",element:a.jsx(En,{})}),a.jsx(H,{path:"/activation",element:a.jsx(Tn,{})}),a.jsx(H,{path:"/address/edit/:addressType/:addressId",element:a.jsx(ce,{isOnAddressPage:!0,appContent:a.jsx(Ue,{})})}),a.jsx(H,{path:"/address/new/:addressType",element:a.jsx(ce,{isOnAddressPage:!0,appContent:a.jsx(Ue,{})})}),a.jsx(H,{path:"*",element:a.jsx(St,{})})]})}export{ta as default};
30
+ `,et=tt((function(e,u){const{companyId:i,currentTenant:o}=u,l=ve(e,i),c=st(e);return{hasVerifiedBankAccount:(l.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(c.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ue(o?.userRole??[])&&l.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:L.getSignedInUser(),currentTenant:o,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}}),(function(e,u){const{currentTenant:i,themeState:o,navigate:l,location:c}=u,{tenantEmailDomain:y}=i;return{onZeniLogoClick:()=>{o.toggle()},handleLogOutClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{l(`/${y}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l(`/${y}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}}))(Cn),wn=()=>{const e=Ce(),u=ae(),i=Ie(),o=rt(),{useFeatureGate:l}=Te(),{isFeatureEnabled:c}=l(Z.isDebitCardFeatureEnabled),{tenantEmailDomain:y}=ke(),S=ct(),[t,n]=d.useState(!1);d.useEffect((()=>{t===!1&&i.state?.message==="OnboardingThankyou"&&n(!0)}),[i.state]);const s=k((p=>Y(p))),b=s.productSettings.isOtherProductsEnabled;d.useEffect((()=>{u(it(_,!1,!b))}),[]);const _=s.companyId??L.getSignedInUserTenant(y)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=_e(c,s),E=Oe(s),r=k((p=>p.onboardingCustomerViewState.updateStatus.fetchState)),g=s.company?.companyOnboardingInfo.isOnboardingCompleted;if(g!==!0||b)return r==="Completed"&&g===!0&&b&&S?.loggedInUserRoleMap!=null?a.jsxs(Xe,{children:[a.jsx(oe,{analytics:B,onLoad:p=>{p.trackPageLoaded(be.Event.onboardingLandingPage,"Onboarding",mn(s.productSettings))}}),a.jsx(et,{navigate:e,showUpdatePaymentDetailButton:b,location:i,companyId:_,currentTenant:s,themeState:o,isVisitingFirstTime:t})]}):r==="Completed"&&g===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Xe,{children:[a.jsx(oe,{analytics:B,onLoad:p=>{p.trackPageLoaded(be.Event.onboardingInterimPage)}}),a.jsx(et,{navigate:e,showUpdatePaymentDetailButton:b,location:i,companyId:_,currentTenant:s,themeState:o,isVisitingFirstTime:t})]}):a.jsx(bn,{});{const p={pathnameStackToGoBack:i.state?.pathnameStackToGoBack,message:"activation"};return I?a.jsx(N,{to:"../../checking",state:p,replace:!0}):E?a.jsx(N,{to:"../../cards",state:p,replace:!0}):a.jsx(N,{to:"../../dashboard",state:p,replace:!0})}};function ta(){return a.jsxs(Ct,{children:[a.jsx(H,{path:"/",element:a.jsx(ce,{})}),a.jsx(H,{path:"/billing/edit",element:a.jsx(ce,{taxCFOCustomer:!0})}),a.jsx(H,{path:"/thankyou",element:a.jsx(wn,{})}),a.jsx(H,{path:"/activation",element:a.jsx(Tn,{})}),a.jsx(H,{path:"/address/edit/:addressType/:addressId",element:a.jsx(ce,{isOnAddressPage:!0,appContent:a.jsx(Ue,{})})}),a.jsx(H,{path:"/address/new/:addressType",element:a.jsx(ce,{isOnAddressPage:!0,appContent:a.jsx(Ue,{})})}),a.jsx(H,{path:"*",element:a.jsx(St,{})})]})}export{ta as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-ufh19lah.js";import{i as K,j as _,g as H,u as $,h as W,n as ee,k as ra,o as bt,p as F,N as Dn}from"./core-QBDM2m9E.js";import{eZ as U,NH as We,bE as ia,bo as Pe,OV as Fn,j8 as On,OW as Kt,OX as Rn,jb as Ct,OY as Ze,OZ as Bn,jg as jn,O_ as qt,O$ as Mn,jk as kt,P0 as Qe,P1 as Ln,cq as yt,P2 as Un,P3 as Gn,N$ as Vn,kc as Nn,P4 as Yn,bn as Xe,P5 as ca,Nv as ce,bc as la,kq as da,oq as ua,k9 as ma,Nx as le,Nw as J,eY as pa,fu as $n,g5 as _t,P6 as zn,P7 as Kn,P8 as ha,P9 as Fe,wc as Me,wd as Le,wA as we,wu as de,wh as Ue,Pa as qn,Pb as Zn,Pc as Qn,Pd as fa,Pe as Oe,Pf as Hn,dI as Je,sw as ga,Pg as Wn,Ph as Xn,Pi as Jn,Pj as vt,MN as At,kG as xe,wI as It,sE as eo,Pk as to,we as Zt,sz as Ee,sv as ba,Pl as ge,Pm as ao,Pn as Et,MM as Tt,uD as Ca,Po as no,Pp as oo,Pq as so,Pr as Pt,uT as ro,Ps as io,wg as Qt,uC as ka,Pt as be,Pu as co,bs as _a,wM as Sa,Pv as lo,Pw as uo,Px as mo,Py as wt,wH as po,Pz as ho,wf as Ht,wL as ya,PA as Ce,PB as fo,PC as go,PD as va,kv as Aa,on as Ia,kA as Ea,ol as Ta,ok as Pa,oj as wa,t$ as bo,PE as Co,cU as ko,cV as _o,og as So,fU as yo,ox as vo,GZ as dt,GR as Ao,GV as Io,PF as Eo,PG as To,PH as Po,b5 as et,fM as wo,hN as xo,gn as Do,or as Fo,k2 as Oo,oo as Ro,om as Bo,fG as jo,fE as Mo}from"./zeni-epic-state-BF09v22i.js";import{z as M,a4 as te,v as w,f as T,O as q,a_ as Lo,a0 as Ge,F as Ve,a$ as xa,h as N,b0 as Uo,e as _e,b1 as Da,A as Se,c as B,y as Go,b2 as Vo,b3 as No,Z as Fa,J as Oa,a as Ra,$ as Yo,b4 as $o,W as zo,aS as Ba,a1 as se,b5 as ja,b6 as Ma,a3 as La,b7 as Ko,b8 as qo,n as Zo,ar as Qo,r as Ho,_ as Wo,b9 as Xo,ba as Jo,bb as es,bc as ts,bd as ke}from"./index-BTTC92ci.js";import{n as xt}from"./mui-CB8RW45Z.js";import{a as b}from"./sentry-Co2H8v0G.js";import{w as Ua}from"./withTransactionSidePanel-DhAeegie.js";import{c as Ga,t as De,f as ue,a as Dt,v as as}from"./routePaths-DRm-ixUG.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import je from"./NotFoundScreen-CIe1EEoJ.js";import{u as Ft}from"./useInitialThreadRequest-B3FrSAeQ.js";import{t as Va}from"./analyticsHelper-BveTv6Ie.js";import{C as ns}from"./CompanyPassportScreen-uugzo1WU.js";import{u as os}from"./useAiCfoDashboardSuggestedQuestionsChips-DB15Xiff.js";import{F as ss}from"./FeaturePreviewScreen-C9BLvwka.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./TransactionDetailScreen-BUXJ5aYk.js";import"./decodeURIComponentSafe-V0q2i3Mt.js";import"./MobileAppDrawer-CWymkkwv.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]="0cf34826-7630-4952-ab0c-22978a954d7e",e._sentryDebugIdIdentifier="sentry-dbid-0cf34826-7630-4952-ab0c-22978a954d7e")}catch{}})();const rs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((I=>I.tenantState.currentTenantId)),c=_((I=>U(I))),{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:`${te}/agingDetailedReport`,timezone:We()})),[]),h=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),p=$(),f=W(),S=_((I=>Fn(I,h,o))),E=b.useCallback((()=>{o!=null&&S.fetchState!=="In-Progress"&&S.fetchState!=="Completed"&&p(On(o,h))}),[h]),v=b.useCallback((()=>{f("../../",{relative:"path"})}),[]),k=b.useCallback(((I,L)=>{p(Kt({sortKey:I,sortOrder:L}))}),[]),P=b.useCallback((I=>{p(Kt({downloadState:I}))}),[]),x=b.useCallback((I=>{if(e)e(I.transactionId,I.transactionType);else if(m!=null){const L=Ga({id:I.transactionId,type:I.transactionType},m);f(L);const ne=w(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}}),[m,e]),y=b.useCallback((()=>{S.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),S.vendor.id,S.vendor.name)}),[S.vendor,h]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{S.fetchState==="Completed"&&y()}),[y,S.fetchState]),d.jsx(Lo,{apAgingDetail:S,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:x,onReload:E,onBackClick:v,onColumnSortConfigChanged:k,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),is=()=>{const e=$(),a=W(),t=_((k=>Rn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((k=>k.tenantState.currentTenantId)),i=_((k=>U(k))),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo((()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),C=t.apAgingUIState.selectedDate??Pe(),u=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(C))}),[]);b.useEffect((()=>{u()}),[]);const l=b.useCallback((()=>{a("../",{relative:"path"})}),[]),h=b.useCallback((k=>{e(Ze({searchString:k}))}),[]),p=b.useCallback(((k,P)=>{e(Ze({sortKey:P,sortOrder:k}))}),[]),f=b.useCallback((k=>{a(`./${k}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[C]),S=b.useCallback((k=>{e(Ze({downloadState:k}))}),[]),E=b.useCallback(((k,P)=>{}),[]),v=b.useCallback(((k,P)=>{e(Ze({selectedDate:k,agingDateSelectionType:P})),e(Ct(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:S,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((y=>U(y))),{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:`${te}/agingDetailedReport`,timezone:We()})),[]),l=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),h=$(),p=W(),f=_((y=>Bn(y,l,o))),S=b.useCallback((()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))}),[l]),E=b.useCallback((()=>{p("../../",{relative:"path"})}),[]),v=b.useCallback(((y,I)=>{h(qt({sortKey:y,sortOrder:I}))}),[]),k=b.useCallback((y=>{h(qt({downloadState:y}))}),[]),P=b.useCallback((y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const I=Ga({id:y.transactionId,type:y.transactionType},c);p(I);const L=w(m.state?.pathnameStackToGoBack,m.pathname);p(I,{state:{pathnameStackToGoBack:L}})}}),[c,e]),x=b.useCallback((()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)}),[f.customer,l]);return b.useEffect((()=>{S()}),[]),b.useEffect((()=>{f.fetchState==="Completed"&&x()}),[f.fetchState,x]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:P,onReload:S,onBackClick:E,onColumnSortConfigChanged:v,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=$(),a=W(),t=_((v=>Mn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((v=>U(v))),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),g=t.arAgingUIState.selectedDate??Pe(),C=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(g))}),[]);b.useEffect((()=>{C()}),[]);const u=b.useCallback((()=>{a("../",{relative:"path"})}),[]),l=b.useCallback((v=>{e(Qe({searchString:v}))}),[]),h=b.useCallback(((v,k)=>{e(Qe({sortKey:k,sortOrder:v}))}),[]),p=b.useCallback((v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[g]),f=b.useCallback((v=>{e(Qe({downloadState:v}))}),[]),S=b.useCallback(((v,k)=>{e(Qe({selectedDate:v,agingDateSelectionType:k})),e(kt(v))}),[]),E=b.useCallback(((v,k)=>{e(Ln({nodeId:v,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Na=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee((function(e){const a=Un(e).accountsInOrder.map(((n,o)=>Na(n,o))),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ya)(Da),us=ee((function(e){const a=Yn(e).accountsInOrder.map(((o,r)=>Na(o,r))),t=M.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ya)(Da);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1)),r=yt(n?.loggedInUserRoleMap);return _((s=>s.cashBalanceState.fetchState))==="Error"?d.jsx(je,{}):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=_e(),o=yt(n?.loggedInUserRoleMap),r=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1));return _((s=>s.cardBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=xt.div`
1
+ import{j as d}from"./liveblocks-0jcT8Dx_.js";import{i as K,j as _,g as H,u as $,h as W,n as ee,k as ra,o as bt,p as F,N as Dn}from"./core-DrRun-Wp.js";import{eZ as U,NH as We,bE as ia,bo as Pe,OV as Fn,j8 as On,OW as Kt,OX as Rn,jb as Ct,OY as Ze,OZ as Bn,jg as jn,O_ as qt,O$ as Mn,jk as kt,P0 as Qe,P1 as Ln,cq as yt,P2 as Un,P3 as Gn,N$ as Vn,kc as Nn,P4 as Yn,bn as Xe,P5 as ca,Nv as ce,bc as la,kq as da,oq as ua,k9 as ma,Nx as le,Nw as J,eY as pa,fu as $n,g5 as _t,P6 as zn,P7 as Kn,P8 as ha,P9 as Fe,wc as Me,wd as Le,wA as we,wu as de,wh as Ue,Pa as qn,Pb as Zn,Pc as Qn,Pd as fa,Pe as Oe,Pf as Hn,dI as Je,sw as ga,Pg as Wn,Ph as Xn,Pi as Jn,Pj as vt,MN as At,kG as xe,wI as It,sE as eo,Pk as to,we as Zt,sz as Ee,sv as ba,Pl as ge,Pm as ao,Pn as Et,MM as Tt,uD as Ca,Po as no,Pp as oo,Pq as so,Pr as Pt,uT as ro,Ps as io,wg as Qt,uC as ka,Pt as be,Pu as co,bs as _a,wM as Sa,Pv as lo,Pw as uo,Px as mo,Py as wt,wH as po,Pz as ho,wf as Ht,wL as ya,PA as Ce,PB as fo,PC as go,PD as va,kv as Aa,on as Ia,kA as Ea,ol as Ta,ok as Pa,oj as wa,t$ as bo,PE as Co,cU as ko,cV as _o,og as So,fU as yo,ox as vo,GZ as dt,GR as Ao,GV as Io,PF as Eo,PG as To,PH as Po,b5 as et,fM as wo,hN as xo,gn as Do,or as Fo,k2 as Oo,oo as Ro,om as Bo,fG as jo,fE as Mo}from"./zeni-epic-state-D1OApLJ3.js";import{z as M,a4 as te,w,g as T,O as q,a_ as Lo,a0 as Ge,E as Ve,a$ as xa,j as N,b0 as Uo,f as _e,b1 as Da,A as Se,c as B,y as Go,b2 as Vo,b3 as No,Z as Fa,J as Oa,a as Ra,$ as Yo,b4 as $o,U as zo,aS as Ba,a1 as se,b5 as ja,b6 as Ma,a3 as La,b7 as Ko,b8 as qo,i as Zo,ar as Qo,s as Ho,_ as Wo,b9 as Xo,ba as Jo,bb as es,bc as ts,bd as ke}from"./index-CdzL9szH.js";import{n as xt}from"./mui-BCzMCgwZ.js";import{a as b}from"./sentry-Cix5j_Oe.js";import{w as Ua}from"./withTransactionSidePanel-B_GhVWS9.js";import{c as Ga,t as De,f as ue,a as Dt,v as as}from"./routePaths-CHhQNN3M.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-fe0P1a5j.js";import je from"./NotFoundScreen-1FWTFg5q.js";import{u as Ft}from"./useInitialThreadRequest-E7aaQNIx.js";import{t as Va}from"./analyticsHelper-BaOtwD25.js";import{C as ns}from"./CompanyPassportScreen-CzLA5zCy.js";import{u as os}from"./useAiCfoDashboardSuggestedQuestionsChips-rxliwAgH.js";import{F as ss}from"./FeaturePreviewScreen-IYXzvJjG.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./TransactionDetailScreen-BXByY28g.js";import"./decodeURIComponentSafe-BqXEXApE.js";import"./MobileAppDrawer-7KFASJmR.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]="0f8adf37-91b8-4864-ac7a-680024847ab8",e._sentryDebugIdIdentifier="sentry-dbid-0f8adf37-91b8-4864-ac7a-680024847ab8")}catch{}})();const rs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((I=>I.tenantState.currentTenantId)),c=_((I=>U(I))),{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:`${te}/agingDetailedReport`,timezone:We()})),[]),h=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),p=$(),f=W(),S=_((I=>Fn(I,h,o))),E=b.useCallback((()=>{o!=null&&S.fetchState!=="In-Progress"&&S.fetchState!=="Completed"&&p(On(o,h))}),[h]),v=b.useCallback((()=>{f("../../",{relative:"path"})}),[]),k=b.useCallback(((I,L)=>{p(Kt({sortKey:I,sortOrder:L}))}),[]),P=b.useCallback((I=>{p(Kt({downloadState:I}))}),[]),x=b.useCallback((I=>{if(e)e(I.transactionId,I.transactionType);else if(m!=null){const L=Ga({id:I.transactionId,type:I.transactionType},m);f(L);const ne=w(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}}),[m,e]),y=b.useCallback((()=>{S.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),S.vendor.id,S.vendor.name)}),[S.vendor,h]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{S.fetchState==="Completed"&&y()}),[y,S.fetchState]),d.jsx(Lo,{apAgingDetail:S,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:x,onReload:E,onBackClick:v,onColumnSortConfigChanged:k,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),is=()=>{const e=$(),a=W(),t=_((k=>Rn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((k=>k.tenantState.currentTenantId)),i=_((k=>U(k))),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo((()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),C=t.apAgingUIState.selectedDate??Pe(),u=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(C))}),[]);b.useEffect((()=>{u()}),[]);const l=b.useCallback((()=>{a("../",{relative:"path"})}),[]),h=b.useCallback((k=>{e(Ze({searchString:k}))}),[]),p=b.useCallback(((k,P)=>{e(Ze({sortKey:P,sortOrder:k}))}),[]),f=b.useCallback((k=>{a(`./${k}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[C]),S=b.useCallback((k=>{e(Ze({downloadState:k}))}),[]),E=b.useCallback(((k,P)=>{}),[]),v=b.useCallback(((k,P)=>{e(Ze({selectedDate:k,agingDateSelectionType:P})),e(Ct(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:S,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((y=>U(y))),{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:`${te}/agingDetailedReport`,timezone:We()})),[]),l=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),h=$(),p=W(),f=_((y=>Bn(y,l,o))),S=b.useCallback((()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))}),[l]),E=b.useCallback((()=>{p("../../",{relative:"path"})}),[]),v=b.useCallback(((y,I)=>{h(qt({sortKey:y,sortOrder:I}))}),[]),k=b.useCallback((y=>{h(qt({downloadState:y}))}),[]),P=b.useCallback((y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const I=Ga({id:y.transactionId,type:y.transactionType},c);p(I);const L=w(m.state?.pathnameStackToGoBack,m.pathname);p(I,{state:{pathnameStackToGoBack:L}})}}),[c,e]),x=b.useCallback((()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)}),[f.customer,l]);return b.useEffect((()=>{S()}),[]),b.useEffect((()=>{f.fetchState==="Completed"&&x()}),[f.fetchState,x]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:P,onReload:S,onBackClick:E,onColumnSortConfigChanged:v,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=$(),a=W(),t=_((v=>Mn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((v=>U(v))),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),g=t.arAgingUIState.selectedDate??Pe(),C=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(g))}),[]);b.useEffect((()=>{C()}),[]);const u=b.useCallback((()=>{a("../",{relative:"path"})}),[]),l=b.useCallback((v=>{e(Qe({searchString:v}))}),[]),h=b.useCallback(((v,k)=>{e(Qe({sortKey:k,sortOrder:v}))}),[]),p=b.useCallback((v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[g]),f=b.useCallback((v=>{e(Qe({downloadState:v}))}),[]),S=b.useCallback(((v,k)=>{e(Qe({selectedDate:v,agingDateSelectionType:k})),e(kt(v))}),[]),E=b.useCallback(((v,k)=>{e(Ln({nodeId:v,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Na=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee((function(e){const a=Un(e).accountsInOrder.map(((n,o)=>Na(n,o))),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ya)(Da),us=ee((function(e){const a=Yn(e).accountsInOrder.map(((o,r)=>Na(o,r))),t=M.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ya)(Da);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1)),r=yt(n?.loggedInUserRoleMap);return _((s=>s.cashBalanceState.fetchState))==="Error"?d.jsx(je,{}):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=_e(),o=yt(n?.loggedInUserRoleMap),r=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1));return _((s=>s.cardBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=xt.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-ufh19lah.js";import{a as u}from"./sentry-Co2H8v0G.js";import{u as y,j as b,n as w,g as A,N}from"./core-QBDM2m9E.js";import{Mf as U,eZ as _,g3 as k,Mg as L,oi as R,Mh as z}from"./zeni-epic-state-BF09v22i.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-BTTC92ci.js";import"./mui-CB8RW45Z.js";import{t as P}from"./getLocaleForTenant-D6zJFfH-.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="629357ad-2f1f-43ad-9e60-676a80845bdc",t._sentryDebugIdIdentifier="sentry-dbid-629357ad-2f1f-43ad-9e60-676a80845bdc")}catch{}})();const M=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=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{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}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>U(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(M,{})}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"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-0jcT8Dx_.js";import{a as u}from"./sentry-Cix5j_Oe.js";import{u as y,j as b,n as w,g as A,N}from"./core-DrRun-Wp.js";import{Mf as U,eZ as _,g3 as k,Mg as L,oi as R,Mh as z}from"./zeni-epic-state-D1OApLJ3.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import{t as P}from"./getLocaleForTenant-C5iVY_JU.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.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]="629357ad-2f1f-43ad-9e60-676a80845bdc",t._sentryDebugIdIdentifier="sentry-dbid-629357ad-2f1f-43ad-9e60-676a80845bdc")}catch{}})();const M=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=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{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}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>U(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(M,{})}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"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-ufh19lah.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-QBDM2m9E.js";import{Qm as k,Qt as _,gl as W,gk as J,gj as q,jD as K,Nw as L,rP as M,eZ as D,PU as V,jB as j,Qn as v,Qw as T,jz as F,jW as G}from"./zeni-epic-state-BF09v22i.js";import{bz as X,J as N,A as R,z as U,y as z,r as p,c as S,E as Z,bA as Y,o as O,bB as ee,v as te}from"./index-BTTC92ci.js";import{n as Q}from"./mui-CB8RW45Z.js";import"./sentry-Co2H8v0G.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]="0118eb55-f83a-4167-ac91-c924784cfc6a",e._sentryDebugIdIdentifier="sentry-dbid-0118eb55-f83a-4167-ac91-c924784cfc6a")}catch{}})();const ne=A(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(M(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Q.div`
1
+ import{j as l}from"./liveblocks-0jcT8Dx_.js";import{h as y,g as C,j as h,n as A,i as B}from"./core-DrRun-Wp.js";import{Qm as k,Qt as _,gl as W,gk as J,gj as q,jD as K,Nw as L,rP as M,eZ as D,PU as V,jB as j,Qn as S,Qw as T,jz as F,jW as G}from"./zeni-epic-state-D1OApLJ3.js";import{bz as X,J as N,A as R,z as U,y as z,s as p,c as v,C as Z,bA as Y,o as O,bB as ee,w as te}from"./index-CdzL9szH.js";import{n as Q}from"./mui-BCzMCgwZ.js";import"./sentry-Cix5j_Oe.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]="51d65557-d0bc-478c-916f-5c80fe2d81b2",e._sentryDebugIdIdentifier="sentry-dbid-51d65557-d0bc-478c-916f-5c80fe2d81b2")}catch{}})();const ne=A(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(M(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=y(),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=Q.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{h as w,g as C,j as h,n as A,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(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(F(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),r=s.poppedPathname??E();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(T({data:r}))},onBackClick:()=>{if(e(j({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??E(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}}))(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=B(),d=e??s,{useFeatureGate:c}=R(),i=U.getSignedInUser(),b=h((u=>D(u))),g=z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:I}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(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 ve(e,t,n){return $(e,"ach",t,n)}function Se(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=Q.div`
9
+ `,oe=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(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(F(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??P();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onBackClick:()=>{if(e(j({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??P(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(Y);function fe({vendorIdParam:e,accountContext:t}){const n=y(),a=C(),o=N(),{vendorId:s,billId:d}=B(),i=e??s,{useFeatureGate:c}=R(),r=U.getSignedInUser(),b=h((u=>D(u))),g=z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:w}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:w})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(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=(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(e,"ach",t,n)}function ve(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(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=Q.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{h as w,g as C,j as h,n as A,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,re=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(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:r}=t,{tenantEmailDomain:d}=r;return{onFetchBankName:c=>{e(G(c))},onSaveHandler:c=>{e(F(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:i}=c;e(T({data:i}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),i=c.poppedPathname??P();a(i,{state:{pathnameStackToGoBack:c.newStack}})})(),e(v())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(j({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),i=c.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:c.newStack}})}e(v())}}}))(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=B(),d=e??s,c=U.getSignedInUser(),{useFeatureGate:i}=R(),b=z(),g=h((u=>D(u))),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
18
+ `,de=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(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(F(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:r}=c;e(T({data:r}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),r=c.poppedPathname??$();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),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(r,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(j({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),r=c.poppedPathname??$(0);t.navigate(r,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}}))(ee);function xe({vendorIdParam:e,accountContext:t}){const n=y(),a=C(),o=N(),{vendorId:s,billId:d}=B(),i=e??s,c=U.getSignedInUser(),{useFeatureGate:r}=R(),b=z(),g=h((u=>D(u))),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:w}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:w})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-ufh19lah.js";import{J as c,H as f,y as l}from"./index-BTTC92ci.js";import{D as b}from"./mui-CB8RW45Z.js";import"./sentry-Co2H8v0G.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]="319c5930-e5fb-4b9b-9fc6-117cfd4193ad",e._sentryDebugIdIdentifier="sentry-dbid-319c5930-e5fb-4b9b-9fc6-117cfd4193ad")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=l();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{h as D};
1
+ import{j as i}from"./liveblocks-0jcT8Dx_.js";import{J as c,H as f,y as l}from"./index-CdzL9szH.js";import{D as b}from"./mui-BCzMCgwZ.js";import"./sentry-Cix5j_Oe.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]="319c5930-e5fb-4b9b-9fc6-117cfd4193ad",e._sentryDebugIdIdentifier="sentry-dbid-319c5930-e5fb-4b9b-9fc6-117cfd4193ad")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=l();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{h as D};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-0jcT8Dx_.js";import{a as d}from"./sentry-Cix5j_Oe.js";import{h as v,u as A,g as N,i as B,j as l,N as q,n as F,o as _,p as K}from"./core-DrRun-Wp.js";import{OE as z,eZ as M,O0 as R,lG as W,Kx as I,OJ as Y,Nv as $,kG as J,Ky as S,O5 as V,O6 as X,Nx as Z,Nw as H}from"./zeni-epic-state-D1OApLJ3.js";import{aX as L,g as Q,s as U,w as tt}from"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import{d as k}from"./decodeURIComponentSafe-BqXEXApE.js";import{w as et}from"./withTransactionSidePanel-B_GhVWS9.js";import{f as at,c as nt}from"./routePaths-CHhQNN3M.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./useAskAiCfoHostNavButtonProps-fe0P1a5j.js";import"./TransactionDetailScreen-BXByY28g.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]="a725d084-b0e1-45e6-99af-dc1b3afae94d",a._sentryDebugIdIdentifier="sentry-dbid-a725d084-b0e1-45e6-99af-dc1b3afae94d")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:Q,isAccountingClassesEnabled:J(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(Z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(H("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=U(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}))}}}}))(L),it=et((function({entityType:a,...t}){const e=v(),o=A(),c=N(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:w}=B(),r=k(x??""),p=k(w??""),f=rt(r,p),G=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l((n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),O=l((n=>M(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>R(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(W(i)))}),[m,f,i]);const E=l((n=>n.trendState.fetchState)),P=u?.selectedPeriod?.timePeriod??D,j=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,D);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:O,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:j,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:b(G.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(_,{children:s.jsx(K,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as S}from"./liveblocks-ufh19lah.js";import da from"./NotFoundScreen-CIe1EEoJ.js";import{a,b as tn}from"./sentry-Co2H8v0G.js";import{n as Ge,S as ua}from"./mui-CB8RW45Z.js";import{u as ke,h as nn,g as st,j as x,n as ma,i as Bt,o as pa,p as et}from"./core-QBDM2m9E.js";import{eZ as Me,Tk as ha,os as we,f_ as ga,sq as Ca,Tl as tt,fB as Le,Tm as Vt,ei as Sa,fk as fa,Tn as Ot,To as Oe,pa as Ia,Tp as ka,pr as Ea,oK as an,oI as re,Tq as on,Tr as Ta,p3 as sn,pl as ba,Ts as cn,oD as ya,rY as va,fL as Ae,Tt as je,uw as ln,ES as rn,Tu as dn,Tv as Pa,rw as ct,OF as zt,OH as Aa,kJ as wa,OI as Ra,kQ as xa,c_ as Da,vM as it,oQ as un,pv as $e,p6 as Fa,Tw as _a,Nx as Mt,Nw as Ve,Tx as Lt,l5 as Ua,Ty as Ba,Tz as Va,TA as Oa,TB as za,oX as Ma,py as ze,TC as La,TD as ja,TE as $a,pF as qa,kU as Ga,kL as Na,TF as Ja,kT as jt,OP as Ya,TG as Ka,TH as Qa,rs as Za,r4 as Ha,pw as Ie,r3 as nt,TI as Wa,TJ as Xa,TK as eo,mo as to,bo as no,mj as $t,m5 as ao,TL as oo,gB as so,mg as co,xF as io,TM as lo,q4 as ro,p$ as uo,q3 as mo,pQ as po,TN as ho,fO as mn,pe as go,oT as Co,f$ as qt,pA as So,TO as fo,TP as Io,px as pn,TQ as ko,TR as Eo,TS as To,TT as bo,TU as Gt,rE as yo,qX as vo,Nv as Po,TV as Ao,TW as wo,kS as Ro,TX as xo,Jy as Do,kR as Fo,kG as _o,fN as Uo,qt as hn,qP as Bo,pu as Nt,pz as Vo,bE as Oo,md as zo,ma as Mo,TY as Lo,pP as Jt,qL as Yt,qJ as jo,TZ as $o,qy as qo,qe as Go,qM as No,T_ as Jo,T$ as Yo,qi as Ko,U0 as Qo,q9 as Zo,qh as Ho,qf as Wo,qS as Xo}from"./zeni-epic-state-BF09v22i.js";import{A as qe,c as Y,f as G,v as le,_ as gn,a0 as Cn,cZ as es,z as Ne,c_ as Kt,c$ as ts,d0 as ns,d1 as as,au as Re,d2 as os,aZ as Qt,E as Sn,d3 as ss,ar as at,O as cs,a9 as is,d4 as ls,a4 as rs,d5 as ds,Z as us,d6 as ms,d7 as ps,B as hs,e as gs,aS as Cs,d8 as Ss,d9 as fs,be as Is,H as ks,aV as Es}from"./index-BTTC92ci.js";import{u as fn}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import{f as Zt,a as Ts,b as bs,g as ys,C as vs}from"./TransactionDetailScreen-BUXJ5aYk.js";import{w as Ps}from"./withTransactionSidePanel-DhAeegie.js";import{h as As,v as ws}from"./routePaths-DRm-ixUG.js";import{g as ot}from"./accountMappingHelper-DPo5_oRM.js";import{D as Rs}from"./DrawerScreen-CaJ0qHuQ.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./decodeURIComponentSafe-V0q2i3Mt.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]="91b08d65-d8ff-4b32-9522-3b1e24d1907c",t._sentryDebugIdIdentifier="sentry-dbid-91b08d65-d8ff-4b32-9522-3b1e24d1907c")}catch{}})();const xs=()=>{const t=ke(),s=nn(),w=st(),b=x((m=>Me(m))),{useFeatureGate:A}=qe(),{isFeatureEnabled:i}=A(Y.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:p}=A(Y.aiAuditScorePercentage),I=x((m=>m.expenseAutomationViewState.selectedPeriodByTenantId)),l=x((m=>ha(m,b.tenantId))),{isAiCfoAccessEnabled:C,onAskAiCfoClick:g}=fn({mobileExploreReferrer:"Month-End Close Overview"}),R=a.useCallback(((m,V,te=!1)=>{t(we({tenantId:V,period:{month:m.month,year:m.year},refreshViewInBackground:te}))}),[]),y=a.useCallback((m=>{const V=w.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&G.trackMonthCloseAuditPage(m.month,m.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,V??null),t(ga(b.tenantId,m))}),[b.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),r=I[b.tenantId],h=a.useCallback((()=>{const m=w.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&G.trackMonthCloseAuditPage(r.month,r.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,m??null),R(r,b.tenantId,!0)}),[R,r,b.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),F=le(w.state?.pathnameStackToGoBack,w.pathname),J=a.useCallback((()=>{if(l.monthEndCloseChecks!=null&&r!=null){const m=l.monthEndCloseChecks.monthEndCloseCheckList.find((V=>V.progress<100));if(m!=null)return void s(`./${m.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}});s(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,r]),{areTenantIdsInSync:u}=gn();return Cn({isDataReady:l.fetchState==="Completed"}),a.useEffect((()=>{r!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&u&&R(r,b.tenantId)}),[R,r,l.fetchState,b.tenantId,u]),a.useEffect((()=>{r!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&u&&t(Ca(r))}),[r,l.monthClosePerformanceTrendFetchStatus.fetchState,u]),a.useEffect((()=>{const m=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&h()}),3e5);return()=>clearInterval(m)}),[l.fetchState]),a.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const m=w.state?.referrer;G.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,m??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Ds,{children:S.jsx(es,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:m=>{s(`./${m}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:J,onBackClick:()=>{s("../../dashboard")},onReload:h,isAiCfoAccessEnabled:C,onAskAiCfoClick:g,aiAuditScorePercentageEnabled:p})})},Ds=Ge.div`
1
+ import{j as S}from"./liveblocks-0jcT8Dx_.js";import da from"./NotFoundScreen-1FWTFg5q.js";import{a,b as tn}from"./sentry-Cix5j_Oe.js";import{n as Ge,S as ua}from"./mui-BCzMCgwZ.js";import{u as ke,h as nn,g as st,j as x,n as ma,i as Bt,o as pa,p as et}from"./core-DrRun-Wp.js";import{eZ as Me,Tk as ha,os as we,f_ as ga,sq as Ca,Tl as tt,fB as Le,Tm as Vt,ei as Sa,fk as fa,Tn as Ot,To as Oe,pa as Ia,Tp as ka,pr as Ea,oK as an,oI as re,Tq as on,Tr as Ta,p3 as sn,pl as ba,Ts as cn,oD as ya,rY as va,fL as Ae,Tt as je,uw as ln,ES as rn,Tu as dn,Tv as Pa,rw as ct,OF as zt,OH as Aa,kJ as wa,OI as Ra,kQ as xa,c_ as Da,vM as it,oQ as un,pv as $e,p6 as Fa,Tw as _a,Nx as Mt,Nw as Ve,Tx as Lt,l5 as Ua,Ty as Ba,Tz as Va,TA as Oa,TB as za,oX as Ma,py as ze,TC as La,TD as ja,TE as $a,pF as qa,kU as Ga,kL as Na,TF as Ja,kT as jt,OP as Ya,TG as Ka,TH as Qa,rs as Za,r4 as Ha,pw as Ie,r3 as nt,TI as Wa,TJ as Xa,TK as eo,mo as to,bo as no,mj as $t,m5 as ao,TL as oo,gB as so,mg as co,xF as io,TM as lo,q4 as ro,p$ as uo,q3 as mo,pQ as po,TN as ho,fO as mn,pe as go,oT as Co,f$ as qt,pA as So,TO as fo,TP as Io,px as pn,TQ as ko,TR as Eo,TS as To,TT as bo,TU as Gt,rE as yo,qX as vo,Nv as Po,TV as Ao,TW as wo,kS as Ro,TX as xo,Jy as Do,kR as Fo,kG as _o,fN as Uo,qt as hn,qP as Bo,pu as Nt,pz as Vo,bE as Oo,md as zo,ma as Mo,TY as Lo,pP as Jt,qL as Yt,qJ as jo,TZ as $o,qy as qo,qe as Go,qM as No,T_ as Jo,T$ as Yo,qi as Ko,U0 as Qo,q9 as Zo,qh as Ho,qf as Wo,qS as Xo}from"./zeni-epic-state-D1OApLJ3.js";import{A as qe,c as Y,g as G,w as le,_ as gn,a0 as Cn,cZ as es,z as Ne,c_ as Kt,c$ as ts,d0 as ns,d1 as as,au as Re,d2 as os,aZ as Qt,C as Sn,d3 as ss,ar as at,O as cs,a9 as is,d4 as ls,a4 as rs,d5 as ds,Z as us,d6 as ms,d7 as ps,S as hs,f as gs,aS as Cs,d8 as Ss,d9 as fs,be as Is,H as ks,aV as Es}from"./index-CdzL9szH.js";import{u as fn}from"./useAskAiCfoHostNavButtonProps-fe0P1a5j.js";import{f as Zt,a as Ts,b as bs,g as ys,C as vs}from"./TransactionDetailScreen-BXByY28g.js";import{w as Ps}from"./withTransactionSidePanel-B_GhVWS9.js";import{h as As,v as ws}from"./routePaths-CHhQNN3M.js";import{g as ot}from"./accountMappingHelper-B0l8lAeR.js";import{D as Rs}from"./DrawerScreen-DAMt3OKh.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./decodeURIComponentSafe-BqXEXApE.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]="46e86b10-42d1-4255-9256-9404b5434e2c",t._sentryDebugIdIdentifier="sentry-dbid-46e86b10-42d1-4255-9256-9404b5434e2c")}catch{}})();const xs=()=>{const t=ke(),s=nn(),w=st(),b=x((m=>Me(m))),{useFeatureGate:A}=qe(),{isFeatureEnabled:i}=A(Y.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:p}=A(Y.aiAuditScorePercentage),I=x((m=>m.expenseAutomationViewState.selectedPeriodByTenantId)),l=x((m=>ha(m,b.tenantId))),{isAiCfoAccessEnabled:C,onAskAiCfoClick:g}=fn({mobileExploreReferrer:"Month-End Close Overview"}),R=a.useCallback(((m,V,te=!1)=>{t(we({tenantId:V,period:{month:m.month,year:m.year},refreshViewInBackground:te}))}),[]),y=a.useCallback((m=>{const V=w.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&G.trackMonthCloseAuditPage(m.month,m.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,V??null),t(ga(b.tenantId,m))}),[b.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),r=I[b.tenantId],h=a.useCallback((()=>{const m=w.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&G.trackMonthCloseAuditPage(r.month,r.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,m??null),R(r,b.tenantId,!0)}),[R,r,b.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),F=le(w.state?.pathnameStackToGoBack,w.pathname),J=a.useCallback((()=>{if(l.monthEndCloseChecks!=null&&r!=null){const m=l.monthEndCloseChecks.monthEndCloseCheckList.find((V=>V.progress<100));if(m!=null)return void s(`./${m.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}});s(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,r]),{areTenantIdsInSync:u}=gn();return Cn({isDataReady:l.fetchState==="Completed"}),a.useEffect((()=>{r!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&u&&R(r,b.tenantId)}),[R,r,l.fetchState,b.tenantId,u]),a.useEffect((()=>{r!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&u&&t(Ca(r))}),[r,l.monthClosePerformanceTrendFetchStatus.fetchState,u]),a.useEffect((()=>{const m=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&h()}),3e5);return()=>clearInterval(m)}),[l.fetchState]),a.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const m=w.state?.referrer;G.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,m??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Ds,{children:S.jsx(es,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:m=>{s(`./${m}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:J,onBackClick:()=>{s("../../dashboard")},onReload:h,isAiCfoAccessEnabled:C,onAskAiCfoClick:g,aiAuditScorePercentageEnabled:p})})},Ds=Ge.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-0jcT8Dx_.js";import{a as r}from"./sentry-Cix5j_Oe.js";import{a5 as i,a6 as l,a7 as p,s as d}from"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import m from"./NotFoundScreen-1FWTFg5q.js";import{h as u,g as b}from"./core-DrRun-Wp.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]="6a5c7a1c-cf7f-40e6-99b9-63f1853bff19",e._sentryDebugIdIdentifier="sentry-dbid-6a5c7a1c-cf7f-40e6-99b9-63f1853bff19")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),f=r.useCallback((()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},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 r}from"./sentry-Co2H8v0G.js";import{u as l,h as f,g as m}from"./core-QBDM2m9E.js";import{hx as p,MD as g,ME as b}from"./zeni-epic-state-BF09v22i.js";import{u as _,L as h,z as y}from"./index-BTTC92ci.js";import"./liveblocks-ufh19lah.js";import"./recharts-B8SFxg38.js";import"./mui-CB8RW45Z.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="3dd5c1ed-f33b-4032-9e7e-e8a6b1b794cf",e._sentryDebugIdIdentifier="sentry-dbid-3dd5c1ed-f33b-4032-9e7e-e8a6b1b794cf")}catch{}})();function M(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=_(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{M as default};
1
+ import{a as r}from"./sentry-Cix5j_Oe.js";import{u as l,h as f,g as m}from"./core-DrRun-Wp.js";import{hx as p,MD as g,ME as b}from"./zeni-epic-state-D1OApLJ3.js";import{u as _,L as h,z as y}from"./index-CdzL9szH.js";import"./liveblocks-0jcT8Dx_.js";import"./recharts-BJColP3b.js";import"./mui-BCzMCgwZ.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.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]="3dd5c1ed-f33b-4032-9e7e-e8a6b1b794cf",e._sentryDebugIdIdentifier="sentry-dbid-3dd5c1ed-f33b-4032-9e7e-e8a6b1b794cf")}catch{}})();function M(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=_(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{M as default};
@@ -0,0 +1,72 @@
1
+ import{j as t}from"./liveblocks-0jcT8Dx_.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-DrRun-Wp.js";import{Mw as k,Mx as v,My as F,BA as B,Bm as T,Mz as A,MA as oe,MB as se,Bq as ie,fC as $,Bx as le,Bu as de}from"./zeni-epic-state-D1OApLJ3.js";import{J as g,o as d,r as re,g as j,p as G,D as ce,s as me,v as pe,w as V,A as ue,c as he,x as xe,S as ge,y as fe,B as we,C as be,E as Se,V as ye,G as ke,Y as ve,H as je,I as $e}from"./index-CdzL9szH.js";import{n as m}from"./mui-BCzMCgwZ.js";import f from"./NotFoundScreen-1FWTFg5q.js";import{a as I}from"./sentry-Cix5j_Oe.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.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]="290d42f9-f654-4788-a0e4-ac829d1dd421",e._sentryDebugIdIdentifier="sentry-dbid-290d42f9-f654-4788-a0e4-ac829d1dd421")}catch{}})();const Ie=m.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=x((function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}}),(function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(F({data:l}))}}}))(re);function M(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
11
+ display: flex;
12
+ height: 100vh;
13
+ width: 100%;
14
+ flex: 1 1 auto;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ background-color: ${e=>e.theme.colors.grey4};
18
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Ae=x((function(e,a){const{isSubPage:n}=a;return{addressToEdit:A(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}}),(function(e,a){const{navigate:n,location:o}=a,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}}))(ce);function De({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(Ae,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
20
+ display: flex;
21
+ height: 100%;
22
+ width: 100%;
23
+ flex: 1 1 auto;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ background-color: ${e=>e.theme.colors.grey4};
27
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Ne=x((function(e){const a=k(e),n=v(e),o=A(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:r}=i;e(F({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),r=V(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}}))(pe);function Ee(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Me=m.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Fe=x((function(e){const a=k(e),n=v(e),o=A(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:r}=i;e(se({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),r=V(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}}))(xe);function Te(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Me,{windowSize:n,children:t.jsx(Fe,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Ge={containerWidth:new je(100,58)},Ve=m(ke)`
38
+ width: ${d.sp4};
39
+ height: ${d.sp4};
40
+ margin-bottom: ${d.sp3};
41
+ margin-top: ${d.sp3};
42
+ margin-left: ${d.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,He=m.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,_e=m.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
61
+ `,Ke=m.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,We=x((function(e,a){return{file:a.file,type:a.type}}))(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),r=i.get("token"),H=n.pathname.includes("address"),w=g(),_=ge(),D=fe(),b=we(),K=()=>{_.toggle()},W=E((u=>k(u))),U=E((u=>v(u))),{authParams:q,fetchState:c,billAttachment:J,billFetchState:P,companyName:Y,currencySymbol:O,amount:Q}=W,{tenantId:z,userId:L,sessionId:N}=q,{fetchState:R,internationalBankAccountCreateStatus:X}=U;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&r!=null&&a(le(s,o,r))}),[b,c,s,o,r,a]),I.useEffect((()=>{b&&c==="Completed"&&($(L,N,z),l!=null&&a(de(l)))}),[c,b,L,N,z,l,a]),c==="Error"?t.jsx(f,{}):R==="Completed"||X.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${D.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",Y,l??"",Ue(n.pathname),O,Q))(u)}),t.jsxs(He,{windowSize:w,children:[w!=="small"?t.jsx(Ve,{onClick:K}):null,t.jsx(Ke,{windowSize:w,isAddressPage:H,children:P==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(We,{file:J,type:"bill"})}),t.jsx(_e,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function qe(){return t.jsx($e,{})}function rt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(qe,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(M,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(M,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(De,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Te,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{rt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-0jcT8Dx_.js";import{a as g}from"./sentry-Cix5j_Oe.js";import{u as U,g as O,h as _,t as w,j as l,N as T}from"./core-DrRun-Wp.js";import{z as r,y as V,O as P,h as A,g as N,j as Z,F as R,V as W,m as $}from"./index-CdzL9szH.js";import{eZ as q,Mh as B,Mr as G,Mi as H,fC as J,g2 as K,Mn as Q,gs as X,cZ as Y,Ms as ee,Mt as te}from"./zeni-epic-state-D1OApLJ3.js";import{n as ne}from"./mui-BCzMCgwZ.js";import{u as se}from"./useDeviceId-34Upzybn.js";import{f as ae}from"./analyticsHelper-BaOtwD25.js";import{t as ie}from"./getLocaleForTenant-C5iVY_JU.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="10fe2dc9-8c4f-4d6c-9559-6794964bdaca",t._sentryDebugIdIdentifier="sentry-dbid-10fe2dc9-8c4f-4d6c-9559-6794964bdaca")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=U(),a=O(),m=_(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:D}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),b=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>q(e))),y=l((e=>B(e))),M=r.getSignedInUser(),v=V().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),g.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(y.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,y.tenantsInOrder),X().then((()=>{const e=$();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(Z.Event.loginSuccess,"email",Y(o.productSettings))}),2e3))}),[h,S,b,s,o,y,v,a.state,t]);const E=g.useCallback((()=>{m("/signin/auth")}),[m]),j=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),F=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:E});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||M!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{Ce as default};
@@ -0,0 +1 @@
1
+ import{j as V}from"./liveblocks-0jcT8Dx_.js";import{a as c}from"./sentry-Cix5j_Oe.js";import{u as fe,j as n,i as He,g as We,h as Je,l as G}from"./core-DrRun-Wp.js";import{eZ as me,fH as Ke,fI as pe,ft as Qe,bn as Xe,eY as qe,fJ as ea,fK as aa,fM as ta,fP as na,fQ as g,fS as sa,fT as de,fW as oa,fU as ia,fV as ra,fX as da,cP as la,fZ as ca,cV as ua,fs as fa,g2 as ma,g3 as pa,g1 as ba}from"./zeni-epic-state-D1OApLJ3.js";import{a9 as ha,aa as Sa,S as ga,A as Ea,z as k,B as ka,u as Ca,c as r,d as ya,i as Ia,ab as Ta,f as wa,a as Aa,ac as _a,a5 as Da,ad as Fa,ae as va,af as le,ag as ce,L as Ba,ah as Pa,ai as ue,g as x,a1 as Ma,w,aj as R,ak as Ga}from"./index-CdzL9szH.js";import{D as xa}from"./mui-BCzMCgwZ.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="fa865b67-408a-42fd-91c7-810ad4535117",f._sentryDebugIdIdentifier="sentry-dbid-fa865b67-408a-42fd-91c7-810ad4535117")}catch{}})();const Ra=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=He(),a=We(),C=ga(),o=Je(),$=Qe(),m=fe(),{useFeatureGate:i}=Ea(),N=k.getSignedInUser(),U=Xe(N),s=n((e=>me(e))),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>qe(e))),j=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[A,L]=c.useState(void 0),_=G("/:tenantEmailDomain/dashboard")!==null,Z=G("/:tenantEmailDomain/reports")!==null,I=G("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n((e=>aa(e)));c.useEffect((()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,D.fetchState,I]);const h=k.getSignedInUser(),F=n((e=>e.tenantState)),Ce=n((e=>F.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),H=Ia(),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=U||!U&&ve,Pe=n((e=>g(e).totalUnreadCount)),Me=n((e=>g(e).reducedFetchCountState)),W=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),J=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),Ge=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),B=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:K,isLoading:Q,isFetchingMore:X,hasFetchedAll:q,fetchMore:xe}=Ta();c.useEffect((()=>{const e=setTimeout((()=>xe?.()),0);return()=>clearTimeout(e)})),c.useEffect((()=>{if(Q===!1&&X===!1&&q===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;L(K.filter((u=>u.roomId===e&&u.readAt==null)).length)}else L(0)}),[Q,X,q]),c.useEffect((()=>{y&&!I&&Ge.fetchState==="Not-Started"&&$.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,$.tenantId]),c.useEffect((()=>{I||B.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),c.useEffect((()=>{A!=null&&B.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:A},"comments")))}),[A,B.fetchState]);const Re={fetchStatus:Me,count:Pe},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),H===!1&&S.push("expense_automation_card");const Ve=wa(),te=n((e=>ia(e,S,h,we,Te).fetchState)),ne=n((e=>ra(e).fetchState)),$e=_&&(te==="Completed"||te==="Error")||Z&&(ne==="Completed"||ne==="Error")||!_&&!Z?void 0:"disabled",Ne=c.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=la(Ne),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&Y.fetchState==="Completed"&&ca(Y.notificationSettings,h.userEmail,z,s),se=Aa(),Le=se&&_a(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,P=c.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Da(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[Ze,re]=c.useState(P);c.useEffect((()=>{re(P())}),[P]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);return V.jsx(xa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:N,currentTenantId:F.currentTenantId??"",tenants:F.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:$e,isSettings:ce(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:je,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:H,selectedMenu:le(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=W===0&&J>0?"notifications/comments":"notifications/tasks";ce(a)&&(e=W===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=w(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!be)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=w(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=w(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&x.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),p&&E[s.tenantId]!=null){const b=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=Ga(e.type);ue(e.type)?(j!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he(Ba.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=le(a);let p=`/${encodeURIComponent(u)}/`;const M=R(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Pa(l)?p+="settings/my_profile":ue(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(pa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;x.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Le,aiCfoView:O,isOnDashboard:_,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:De,newYearAnimationEnabled:Fe})})})),La=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&Ke(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ra,{...f,...a})};export{La as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-0jcT8Dx_.js";import{h as r,n}from"./core-DrRun-Wp.js";import{W as i}from"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import"./sentry-Cix5j_Oe.js";import"./zeni-epic-state-D1OApLJ3.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="57c66330-e90a-42a0-92cf-4e53bf44289b",o._sentryDebugIdIdentifier="sentry-dbid-57c66330-e90a-42a0-92cf-4e53bf44289b")}catch{}})();const a=n(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-ufh19lah.js";import lt from"./NotFoundScreen-CIe1EEoJ.js";import{a as k}from"./sentry-Co2H8v0G.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as K}from"./core-QBDM2m9E.js";import{cw as St,fJ as q,eZ as H,fX as bt,fQ as b,Tf as Q,fT as d,fI as y,sK as M,yg as It,Tg as Tt,fH as Ct,fZ as yt,sP as _t,Th as $,bo as F,fB as x,sT as X,Ti as At,cI as Et,cB as Bt}from"./zeni-epic-state-BF09v22i.js";import{_ as Nt,z as wt,A as xt,c as Rt,a0 as vt,cW as Dt,v as B,a9 as Pt,cX as Ut,aa as Gt,r as $t}from"./index-BTTC92ci.js";import"./mui-CB8RW45Z.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="4d06b23b-a093-467b-a6f8-c14c38a03527",t._sentryDebugIdIdentifier="sentry-dbid-4d06b23b-a093-467b-a6f8-c14c38a03527")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:N,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(X("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(N(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=B(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Bt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=B(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(X("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{m==="read"&&(N(r),t($([r],F())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,N).then((()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Pt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Nt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[N,R]=k.useState(!1),a=S((e=>q(e))),o=S((e=>H(e))),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});vt({isDataReady:!0});const O=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),v=S((e=>b(e).currentSubTab)),Y=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),D=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Dt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:T,isFetchingMore:P,fetchMore:ot}=ct(),{threads:W,isLoading:L,fetchMore:Z,isFetchingMore:z,hasFetchedAll:J}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(_===!1&&T===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter((C=>C.roomId===e&&C.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,T]),k.useEffect((()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const U=_||P===!0||T!==!0||_||P===!0||T!==!0;k.useEffect((()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))}),[U,D]),k.useEffect((()=>{s(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&N===!1&&(R(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&L===!1&&w!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=w.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const G=W.find((rt=>rt.id===f.threadId));return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(z||J===!0||Z==null||Z(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[_,P,z,T,J,L,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];v==="all"?A.push("read","unread"):v!=="mentions"&&A.push(v),s(M("task_manager",C,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:O,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(K,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(K,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
1
+ import{l as ct,a as dt,m as mt,j as E}from"./liveblocks-0jcT8Dx_.js";import lt from"./NotFoundScreen-1FWTFg5q.js";import{a as k}from"./sentry-Cix5j_Oe.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as K}from"./core-DrRun-Wp.js";import{cw as St,fJ as q,eZ as H,fX as bt,fQ as b,Tf as Q,fT as m,fI as y,sK as M,yg as It,Tg as Tt,fH as Ct,fZ as yt,sP as _t,Th as $,bo as F,fB as x,sT as X,Ti as At,cI as Et,cB as Bt}from"./zeni-epic-state-D1OApLJ3.js";import{_ as Nt,z as wt,A as xt,c as Rt,a0 as Dt,cW as Pt,w as B,a9 as vt,cX as Ut,aa as Gt,s as $t}from"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-fe0P1a5j.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.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]="1a9b637f-c5ce-4daa-84f7-a7fd6dd38691",t._sentryDebugIdIdentifier="sentry-dbid-1a9b637f-c5ce-4daa-84f7-a7fd6dd38691")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:N,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,d,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=B(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}d==="unread"&&t(X("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,d)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){d==="unread"&&(N(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=B(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Bt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(m(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const d=`../${a}`,c=B(n.state?.pathnameStackToGoBack,n.pathname);h(d,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const d=[];o==="all"?d.push("read","unread"):o!=="mentions"&&d.push(o),t(M("task_manager","dashboard",d))}else R?.()},onUpdateNotificationStatus:(a,o,d,c)=>{a==="tasks"?t(X("task_manager",d,c)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{d==="read"&&(N(r),t($([r],F())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,N).then((()=>{t($(s,F())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(m({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(vt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Nt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[N,R]=k.useState(!1),a=S((e=>q(e))),o=S((e=>H(e))),{useFeatureGate:d}=xt(),{isFeatureEnabled:c}=d(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const O=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),Y=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),P=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Pt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:T,isFetchingMore:v,fetchMore:ot}=ct(),{threads:W,isLoading:L,fetchMore:Z,isFetchingMore:z,hasFetchedAll:J}=dt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(_===!1&&T===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter((C=>C.roomId===e&&C.readAt==null)).length;s(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,T]),k.useEffect((()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const U=_||v===!0||T!==!0||_||v===!0||T!==!0;k.useEffect((()=>{U&&P!=="In-Progress"?s(m({fetchState:"In-Progress",error:void 0},"comments")):U||P!=="In-Progress"||s(m({fetchState:"Completed",error:void 0},"comments"))}),[U,P]),k.useEffect((()=>{s(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&N===!1&&(R(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&L===!1&&w!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=w.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const G=W.find((rt=>rt.id===f.threadId));return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(z||J===!0||Z==null||Z(),null)})).filter((f=>f!=null));s(m({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[_,v,z,T,J,L,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(M("task_manager",C,A,!0))}}}},nt=mt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:O,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(K,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(K,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};