@zeniai/web-app-ui 5.1.25-qa → 5.1.26-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 (129) hide show
  1. package/dist/assets/AddressRoutes-0R3_aA41.js +1 -0
  2. package/dist/assets/{AddressScreen-qDs8FTIM.js → AddressScreen-CwUitmLb.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BdfrkE-x.js → AiCfoScreen-BM-zywQS.js} +5 -5
  4. package/dist/assets/BillPayApprovalRoutes-CeirfROW.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DtWSNOxA.js → BillPayRoutes-DizlFO2c.js} +33 -33
  6. package/dist/assets/{BusinessVerificationPageScreen-DmTGb48M.js → BusinessVerificationPageScreen-DelMZ43T.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-BCHHiOh2.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-CBnJsrN4.js → CompanyPassportScreen-bMh32BNk.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-CND1CVE1.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-i3t4DdMS.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-Ckf9CRVp.js +23 -0
  12. package/dist/assets/{DashboardRoutes-e8rwyA4g.js → DashboardRoutes-Xz9tLvD4.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-CKZbeU4z.js → DefaultTenantHome-BL1VliOs.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-DBmeU2Lc.js → DomesticWireDetailScreen-C-2o-pdl.js} +4 -4
  15. package/dist/assets/DrawerScreen-B6LOqRIW.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-Ber7e70j.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-D2gCOOi9.js +25 -0
  18. package/dist/assets/{FeaturePreviewScreen-cfOOP0Wo.js → FeaturePreviewScreen-B3xiV9TQ.js} +1 -1
  19. package/dist/assets/HubSpotOAuthCallbackScreen-DkX4qyEK.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-CsBDI8QQ.js → MagicLinkRoutes-BNSEJyYK.js} +9 -9
  21. package/dist/assets/MagicLinkSignInScreen-napOy1l_.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-BmawIQiO.js → MobileAppDrawer-BUMTEMjO.js} +1 -1
  23. package/dist/assets/NotFoundScreen-D9VlElva.js +1 -0
  24. package/dist/assets/NotificationRoutes-DSGiis40.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-BJzmb188.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-CRfRYmWG.js +1 -0
  27. package/dist/assets/{PeopleRoutes-OPsUJqGZ.js → PeopleRoutes-BVuTVBzj.js} +3 -3
  28. package/dist/assets/PerformanceRoutes-CxloQO2x.js +1 -0
  29. package/dist/assets/{Preview-CmzR2zNp.js → Preview-Bs7oNsaZ.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-Jf2FDuvS.js → QBOConnectionScreen-DQcyCDZo.js} +1 -1
  31. package/dist/assets/ReferralListScreen-BTfLX813.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-B-jnIbQC.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.js → ReimbursementApprovalRuleDetailScreen-DW8nJs5W.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-BppSio00.js → ReimbursementRoutes-DJRM01sd.js} +9 -9
  35. package/dist/assets/{ReportsRoutes-CpXDACgQ.js → ReportsRoutes-BPWLXTzc.js} +1 -1
  36. package/dist/assets/RewardsRoutes-B5hgkkv5.js +1 -0
  37. package/dist/assets/ScreenRoutes-Capq29v6.js +2 -0
  38. package/dist/assets/{SettingsRoutes-Bf46HJcH.js → SettingsRoutes-2UnfXGWw.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-DE1Mdjhy.js → SetupPagesScreen-CSEiZvDo.js} +5 -5
  40. package/dist/assets/SignInScreen-CRSyr-sR.js +1 -0
  41. package/dist/assets/SignOutScreen-DDguUbw1.js +9 -0
  42. package/dist/assets/{TaskListScreen-Cf5iv59C.js → TaskListScreen-CwZLrcJh.js} +2 -2
  43. package/dist/assets/TaskRoutes-gPAeHYb4.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-Cv9DmhGT.js → TransactionDetailRoutes-KHwSkMWo.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-CIFGLtuW.js → TransactionDetailScreen-EjPCKwQc.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-2qkBEL3R.js → TransactionListRoutes-BGRi67NF.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-Cun7cIJu.js +37 -0
  48. package/dist/assets/{VendorsRoutes-Ck9fOO3Y.js → VendorsRoutes-D2kooM2G.js} +27 -27
  49. package/dist/assets/WiseConfirmationScreen-BOfPIcqz.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-B_icMfds.js → ZeniAccountRoutes-BCzDkNgd.js} +11 -11
  51. package/dist/assets/ZeniAccountStatementScreen-DmPXkrSN.js +9 -0
  52. package/dist/assets/{accountMappingHelper-EVwRyhXo.js → accountMappingHelper-DP34_oVo.js} +1 -1
  53. package/dist/assets/{analytics-DyffXLrl.js → analytics-kuRARP-L.js} +1 -1
  54. package/dist/assets/{analyticsHelper-BjBUUOIH.js → analyticsHelper-DojlKZDc.js} +1 -1
  55. package/dist/assets/{core-DYij5xsh.js → core-r5mQR9TZ.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-CSUd4Wt5.js → decodeURIComponentSafe-Cj9PISMb.js} +1 -1
  57. package/dist/assets/{dnd-BU-7caEQ.js → dnd-DDJsx0NB.js} +1 -1
  58. package/dist/assets/{empty-Bz6RdLl6.js → empty-C7oiOVn1.js} +1 -1
  59. package/dist/assets/{empty-zLrsqSwy.js → empty-DzaiFamT.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-Cxq76LDO.js → emptyVideoElement-Dc3Z5fQ2.js} +1 -1
  61. package/dist/assets/epic-txtfG7Wc.js +2 -0
  62. package/dist/assets/getLocaleForTenant-DOneLAv7.js +1 -0
  63. package/dist/assets/{index-3OE7eXoF.js → index-1UV4MMXg.js} +1 -1
  64. package/dist/assets/{index-44V9br91.js → index-B4Setfuo.js} +1 -1
  65. package/dist/assets/{index-hKAQTJHr.js → index-B7hYa0nv.js} +1 -1
  66. package/dist/assets/{index-C2zxt7CG.js → index-BGRPzhmG.js} +1 -1
  67. package/dist/assets/{index-CPHDDMJD.js → index-BJKl78Nr.js} +13161 -13358
  68. package/dist/assets/{index-C90tJyPI.js → index-CYC7JL6T.js} +1 -1
  69. package/dist/assets/{index-BdURJOvl.js → index-K_-AH8Oz.js} +2 -2
  70. package/dist/assets/{index-CeyemrXI.js → index-Lvqs6gyM.js} +1 -1
  71. package/dist/assets/{lexical-eKqIIoQI.js → lexical-Cgnkx0ca.js} +1 -1
  72. package/dist/assets/{liveblocks-BiGkkGoP.js → liveblocks-BqBYCpDO.js} +1 -1
  73. package/dist/assets/{lottie-CCiYx5dW.js → lottie-C0ZKrLeQ.js} +1 -1
  74. package/dist/assets/{mui-CdvNR06J.js → mui-BOya5KC5.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DzYXGaMH.js → pathToGoBack-ChXz-wsR.js} +1 -1
  76. package/dist/assets/{pdf-05F57jtv.js → pdf-B1xdy5_9.js} +3 -3
  77. package/dist/assets/{pdf-lib-CUEF9aFq.js → pdf-lib-p4rDaah8.js} +1 -1
  78. package/dist/assets/{plaid-CsGNESZa.js → plaid-CbVh_Xmg.js} +1 -1
  79. package/dist/assets/{pusher-C7xS39FJ.js → pusher-DmGzlgPh.js} +1 -1
  80. package/dist/assets/{react-hPevf4CC.js → react-B6e4iCGm.js} +1 -1
  81. package/dist/assets/{react-CltIT5UZ.js → react-C4tdQB-d.js} +1 -1
  82. package/dist/assets/{react-Ce6YQI4l.js → react-CCV4IaFY.js} +1 -1
  83. package/dist/assets/{react-i6kyX3or.js → react-CWHwcQ3R.js} +1 -1
  84. package/dist/assets/{react-D3qjGIuX.js → react-CaSq6h7K.js} +1 -1
  85. package/dist/assets/{react-BcY5rxQv.js → react-Cc3_o3W5.js} +1 -1
  86. package/dist/assets/{recharts-D0oa1BQl.js → recharts-BFPpJ278.js} +1 -1
  87. package/dist/assets/{routePaths-BZSOS5PJ.js → routePaths-UaNYOkz2.js} +1 -1
  88. package/dist/assets/{sentry-DQGl2YSn.js → sentry-CDxqFZbe.js} +1 -1
  89. package/dist/assets/{url-DRf0E0e8.js → url-BQNxUbT3.js} +1 -1
  90. package/dist/assets/{url-DJZEEGtj.js → url-CuFpLP5d.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Cx4eHMO1.js → useAiCfoDashboardSuggestedQuestionsChips-R--C8uA4.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-CMXbmaYh.js +1 -0
  93. package/dist/assets/{useDeviceId-Dsh8klAH.js → useDeviceId-RFazXO8K.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-DhlqNdmZ.js → useInitialThreadRequest-B-46KSo3.js} +1 -1
  95. package/dist/assets/{utils-BCjesvPZ.js → utils-BMmLL9nY.js} +1 -1
  96. package/dist/assets/withTransactionSidePanel-ByoBtmM4.js +21 -0
  97. package/dist/assets/{zeni-epic-state-YenBAkdY.js → zeni-epic-state-CRBir-xp.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +6 -11
  100. package/dist/assets/AddressRoutes-BO7_ztL-.js +0 -1
  101. package/dist/assets/BillPayApprovalRoutes-CHbvFE3b.js +0 -1
  102. package/dist/assets/ChargeCardRoutes-Bsiqi1N3.js +0 -71
  103. package/dist/assets/ConnectionAuthScreen-oV9xidgd.js +0 -11
  104. package/dist/assets/CustomerOnboardingAuthScreen-CT6vX9lK.js +0 -1
  105. package/dist/assets/CustomerOnboardingRoutes-SknKGVun.js +0 -23
  106. package/dist/assets/DrawerScreen-BWhuJpJg.js +0 -1
  107. package/dist/assets/EntityDetailRoutes-CTTfstSP.js +0 -1
  108. package/dist/assets/ExpenseAutomationRoutes-CspHbytv.js +0 -25
  109. package/dist/assets/HubSpotOAuthCallbackScreen-DjPOIxHN.js +0 -1
  110. package/dist/assets/MagicLinkSignInScreen-m9ssOXwv.js +0 -12
  111. package/dist/assets/NotFoundScreen-CgebWRjN.js +0 -1
  112. package/dist/assets/NotificationRoutes-Cl7PLaOs.js +0 -1
  113. package/dist/assets/OAuthConsentScreen-qriEiLoe.js +0 -1
  114. package/dist/assets/PandLWithForecastRoutes-Cl99HhDr.js +0 -1
  115. package/dist/assets/PerformanceRoutes-CEO5F026.js +0 -1
  116. package/dist/assets/ReferralListScreen-CZNvkt7D.js +0 -5
  117. package/dist/assets/ReimbursementApprovalRoutes-BwzrkQxk.js +0 -1
  118. package/dist/assets/RewardsRoutes-30RCnxCS.js +0 -1
  119. package/dist/assets/ScreenRoutes-A_nicqZg.js +0 -2
  120. package/dist/assets/SignInScreen-C3IJUUVm.js +0 -1
  121. package/dist/assets/SignOutScreen-qEnjjx7M.js +0 -9
  122. package/dist/assets/TaskRoutes-Bguabkg5.js +0 -9
  123. package/dist/assets/TreasuryRoutes-Bs8jZ6mk.js +0 -37
  124. package/dist/assets/WiseConfirmationScreen-CSSSMXbe.js +0 -12
  125. package/dist/assets/ZeniAccountStatementScreen-CSKHvFWp.js +0 -9
  126. package/dist/assets/epic-knsZntkZ.js +0 -2
  127. package/dist/assets/getLocaleForTenant-DYNL1b9l.js +0 -1
  128. package/dist/assets/useAskAiCfoHostNavButtonProps-DEByTqFW.js +0 -1
  129. package/dist/assets/withTransactionSidePanel-CQ9Z6rVO.js +0 -21
@@ -1,25 +0,0 @@
1
- import{j as S}from"./liveblocks-BiGkkGoP.js";import Fn from"./NotFoundScreen-CgebWRjN.js";import{a,b as wt}from"./sentry-DQGl2YSn.js";import{n as Fe,S as Bn}from"./mui-CdvNR06J.js";import{u as de,h as Pt,g as qe,j as A,n as _n,i as rt,o as Vn,p as Le}from"./core-DYij5xsh.js";import{eQ as Re,Q8 as Mn,n5 as ke,fk as On,qT as jn,nn as xt,nI as Rt,Q9 as Dt,nS as Ln,Qa as Ut,ng as zn,qp as Qn,f4 as fe,Qb as De,sS as Ft,C3 as Bt,Qc as _t,Qd as $n,pZ as Ge,LH as dt,LJ as qn,jK as Gn,LK as Jn,jR as Nn,cV as Kn,tX as Je,nt as Vt,nX as Ue,Qe as Yn,KA as ut,Kz as we,Qf as mt,k6 as Hn,Qg as Zn,Qh as Wn,Qi as Xn,Qj as ea,nA as ta,nl as ue,n_ as Pe,Qk as na,Ql as aa,Qm as oa,o5 as sa,jV as ca,jM as ia,Qn as la,jU as ht,LR as ra,Qo as da,Qp as ua,pV as ma,px as ha,nY as le,pw as ze,Qq as pa,Qr as ga,Qs as Ca,lp as Sa,bq as Ia,lk as pt,l6 as fa,Qt as ka,gU as gt,fV as Ea,lh as va,vQ as ya,Qu as ba,ow as Aa,or as Ta,ov as wa,og as Pa,Qv as xa,f7 as Mt,nL as Ra,nw as Da,fl as Ct,o0 as Ua,Qw as Fa,Qx as Ba,nZ as Ot,Qy as _a,Qz as Va,QA as Ma,QB as Oa,QC as St,q5 as ja,pn as La,Ky as za,QD as Qa,QE as $a,jT as qa,QF as Ga,GB as Ja,jS as Na,jH as Ka,f6 as Ya,oX as jt,pf as Ha,nW as It,n$ as Za,bE as Wa,le as Xa,lb as eo,QG as to,of as ft,pd as kt,pb as no,p0 as ao,oH as oo,pe as so,QH as co,QI as io,oL as lo,QJ as ro,oB as uo,oK as mo,oI as ho,pi as po}from"./zeni-epic-state-YenBAkdY.js";import{n as Lt,c as re,d as L,r as H,W as zt,Z as Qt,cE as go,z as Be,cF as Co,at as xe,cG as So,aT as Et,B as $t,cH as Io,aq as Qe,D as fo,cI as ko,a2 as Eo,cJ as vo,T as yo,cK as bo,cL as Ao,v as To,A as wo,aN as Po,b7 as xo,y as Ro,cM as Do}from"./index-CPHDDMJD.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{c as vt,C as Uo}from"./TransactionDetailScreen-CIFGLtuW.js";import{w as Fo}from"./withTransactionSidePanel-CQ9Z6rVO.js";import{h as Bo,v as _o}from"./routePaths-BZSOS5PJ.js";import{g as $e}from"./accountMappingHelper-EVwRyhXo.js";import{D as Vo}from"./DrawerScreen-BWhuJpJg.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="55723cd3-1e2d-479c-907d-3148bd2b5aa9",t._sentryDebugIdIdentifier="sentry-dbid-55723cd3-1e2d-479c-907d-3148bd2b5aa9")}catch{}})();const Mo=()=>{const t=de(),i=Pt(),T=qe(),f=A(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(re.isRealtimeInsightsFeatureEnabled),u=A(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=A(d=>Mn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:C}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,D,K=!1)=>{t(ke({tenantId:D,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const D=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,D??null),t(On(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],_=a.useCallback(()=>{const d=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(T.state?.pathnameStackToGoBack,T.pathname),w=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(D=>D.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(jn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&_()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=T.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Oo,{children:S.jsx(go,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:w,onBackClick:()=>{i("../../dashboard")},onReload:_,isAiCfoAccessEnabled:v,onAskAiCfoClick:C})})},Oo=Fe.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- background-color: ${t=>t.theme.colors.grey4};
8
- `,jo=wt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:T,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=de(),u=Be.getSignedInUser(),o=A(e=>Re(e)),v=t.excludedAccountIDs,C=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,_=m[i],h=_?.accountReconEntity.statementMetaData?.statementUploadId,w=(e,n)=>{g(Qn(e,n.split(".")[0]))},I=e=>{h!=null&&g(zn({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},D=e=>{g(Ln({accountId:i,selectedPeriod:y,payload:e}))},K=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),V=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),U=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return _!=null?S.jsx(yt,{children:S.jsx(bt,{children:S.jsx(Co,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:_,monthYearPeriod:y,onDismissClick:T,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:w,onDeleteFile:I,onSelectSourceType:K,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:C,openFilePicker:r,onStatementUploadSuccess:D,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):U!=null?S.jsx(yt,{children:S.jsx(bt,{children:S.jsx(So,{excludedAccountReconciliation:U,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:V})})}):null}),yt=Fe.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,bt=Fe.div`
13
- flex: 1;
14
- min-height: 0;
15
- display: flex;
16
- flex-direction: column;
17
- box-sizing: border-box;
18
- min-width: 0;
19
- overflow-x: hidden;
20
- overflow-y: auto;
21
- `;function Lo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:T,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=A(u=>$n(u,t,E));return a.useEffect(()=>{f()},[]),S.jsx(S.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?S.jsx($t,{fetchState:"In-Progress"}):S.jsx(Io,{onCloseClick:i,addCustomerRequest:T,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const zo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Qo,comma:At,space:$o}},dateFormat:Gt}=fo.getLocalizedStrings(),Tt=po,qo=_n(function(t,i){const{uncategorizedAccounts:T,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,C=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:m??""},r=fe(t),{selectedTransactionCategorizationTab:_}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Eo}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:_,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:C,uncategorizedAccounts:T,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:T,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:C,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:_,handleEditClick:h,setActivityLogTransactionId:w}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:D}}=C,{accountSettingsView:K}=C.jeSchedules,te=Vt(I),V=Ue(te.start),U=Ue(te.end);return{onZeniLogoClick:()=>{T.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(I.month,I.year),t(La(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));vo(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(P=>{P!=null?t(ja(e,P)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Oa(e,n)),m!=null&&t(ke({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Ma(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?$o+Qo+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Va(e))},onUpdateMissingReceiptsUIState:e=>{t(_a(e))},onFetchMissingReceiptsList:()=>{U!=null&&V!=null&&t(Ot({start:V,end:U},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(ho(e))},onBulkUploadProgress:e=>{t(mo(e))},onBulkUploadSuccess:e=>{t(uo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(ro(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(lo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(io())},onSetBulkUploadResultsTab:e=>{t(co(e))},onSetBulkUploadCompletedSubTab:e=>{t(so(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(oo())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=C.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(ao(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(no())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Ba())},onSearchTextChanged:e=>{const n=C.currentSelectedView,s=C.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),U!=null&&V!=null&&t(le(s,{start:V,end:U},!0,!1,e,void 0,!0)))},onFiltersChange:e=>{const n=C.selectedTransactionCategorizationTab;t(Fa({filters:e,selectedTab:n}))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Ua(g))},onClose:()=>{d==="reconciliation"&&D!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&D!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Da(e))},onSaveReconciliationReview:e=>{t(Ra(e))},onUpdateStep:e=>{const{selectedPeriod:n}=C,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:C.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(K.prepaidExpensesAccountList,s.selectedOptions),b=$e(K.fixedAssetsAccountList,l.selectedOptions),P=$e(K.accruedExpensesAccountList,k.selectedOptions),M={selectedPrepaidExpensesAccountIds:p.map(x=>x.accountId),selectedFixedAssetsAccountIds:b.map(x=>x.accountId),selectedAccruedExpensesAccountIds:P.map(x=>x.accountId)};t(xa({data:M}))},onSaveJeAccountSettingsClick:()=>{t(Pa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:P,allClassList:M,allDepreciationAccountList:x}=C.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,ne={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},ae=p?.selectedOption!=null?P.find($=>$.qboId===p.selectedOption):void 0,Ee=k?.selectedOption!=null?M.find($=>$.classId===k.selectedOption):void 0,oe=l?.selectedOption!=null?x.find($=>$.qboId===l.selectedOption):void 0;t(wa({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:ae?.accountId,updatedClassId:Ee?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ne.id,name:ne.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ta(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Aa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ba())},handleJeScheduleClick:(e,n,s)=>{t(ya({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(va(e,m.companyId,m.tenantId))},onClickCustomerRequest:_,setActivityLogTransactionId:w,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ea())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ka(e))},onUpdateFileAttachment:e=>{t(fa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=C;m!=null&&l?.auditScorePercentage!=null&&(t(Sa(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,Ia().format(Gt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,P,M,x,Q,ne,ae)=>{t(Ca(e,n,s,l,y,k,p,b,P,M,x,Q,ne,ae))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),U!=null&&V!=null&&(t(le(e,{start:V,end:U},!1,!1)),t(ga(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{i.closeSidePanel?.(),U!=null&&V!=null&&(t(pa(e)),t(le("autoCategorized",{start:V,end:U},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),U!=null&&V!=null&&t(le(e,{start:V,end:U},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{U!=null&&V!=null&&t(le(e,{start:V,end:U},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,P)=>{t(ha(e,n,s,l,P??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(I.month,I.year,C.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(I.month,I.year,C.transactionView.totalCountByTab.review,n.length,!1,l??null),t(ma(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ua({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:M,lineIds:x}=n;p!=null&&t(ra({transactionId:P,customerUpdates:p})),t(da({selectedTab:l,transactionId:P.id,lineId:x[0],selectedTransaction:M,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:M,lineIds:x}=n;p!=null&&(t(ca({transactionId:P,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(ia({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:P.id,lineId:x[0],selectedTransaction:M,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))):t(la({selectedTab:l,transactionId:P.id,lineId:x[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Pe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Pe(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(sa(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(oa(e))},updateOperatingExpensesIdsForReview:e=>{t(aa({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=_o(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(na({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(Pe(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ue(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ue(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(ta({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(ea({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Xn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Wn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Hn(l)),t(Zn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,Ge("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Yn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,T)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=T;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,C,m,y,r)=>{u.onUploadTransactionReceipt(v,C,m,y,r,g.authParams)}}}(t,i,E)})(ko),Go=Fo(function(t){const i=t.displayName??t.name??"Component",T=wt.memo(t),f=E=>{const g=de(),u=function(){const w=de(),I=A(d=>fe(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{w(De({selectedDrawerAccountId:d}))},[w]),closePanel:a.useCallback(()=>{w(De({selectedDrawerAccountId:void 0}))},[w])}}(),o=A(w=>fe(w).reconciliation),v=A(w=>Re(w)),C=a.useCallback((w,I)=>{g(Ft("expense_automation_reconcile",w,I))},[g]),m=a.useCallback((w,I)=>{const d=v?.companyId;d!=null&&(g(Bt(w,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return S.jsx(jo,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:C,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,C,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),_=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:_,[u.isOpen,u.closePanel,u.selectedAccountId,_]);return S.jsx(Et.Provider,{value:h,children:S.jsx(T,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:T,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:C}=yo(),m=bo(),{isOpen:y}=Ao(),r=Pt(),_=qe(),h=de(),{isAiCfoAccessEnabled:w,onAskAiCfoClick:I}=qt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:D}=zt(),K=(()=>{const c=A(q=>fe(q)),j=qe(),{currentSelectedViewFetchState:N,currentSelectedView:O,selectedPeriod:B}=c,Ie=Qe(O),X=Qe(N.fetchState),be=a.useCallback(q=>{const Y=j.state?.referrer;O==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(B.month,B.year,c.transactionView.totalCountByTab.review,0,q,Y??null):L.trackTransactionsAutoCategorisedPage(B.month,B.year,c.transactionView.totalCountByTab.autoCategorized,0,q,Y??null)),O==="missing_receipts"&&L.trackMissingReceiptsPage(B.month,B.year,q,c.missingReceipts.transactions.length,Y??null),O==="je_schedules"&&L.trackMonthCloseScheduleListPage(B.month,B.year,q,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,Y??null),O==="flux_analysis"&&L.trackFluxAnalysisPage(B.month,B.year,q,zo(c.fluxAnalysis),Y??null),O==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(B.month,B.year,q,"draft",c.auditSummary.auditScorePercentage,null,Y??null)},[B,c]);return a.useEffect(()=>{X===N.fetchState&&O===Ie||N.fetchState!=="Completed"||be(!1)},[O,N.fetchState,Ie]),be})(),te=To(),[V,U]=a.useState(!1),e=A(c=>dt(c)),n=A(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,P]=a.useState([]),[M,x]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&C(!1),m(),d()),x(c)},[d,v,m,C]),ne=a.useCallback(()=>{m(),x(void 0),d(),I()},[d,I,m]),ae=a.useRef(v);a.useEffect(()=>{v===!0&&ae.current===!1&&(m(),x(void 0),d()),ae.current=v},[d,v,m]);const Ee=a.useRef(y);a.useEffect(()=>{y===!0&&Ee.current===!1&&(v&&C(!1),x(void 0),E===!0&&f!==!0&&t?.()),Ee.current=y},[t,y,v,C,f,E]);const oe=E===!0&&f!==!0,$=a.useRef(oe);a.useEffect(()=>{oe&&!$.current&&(v&&C(!1),m(),x(void 0)),$.current=oe},[v,oe,m,C]);const[Ne,Jt]=a.useState(!1),Ke=a.useRef(!1),{selectedTab:Ye}=rt(),{tenantEmailDomain:Nt}=rt(),[_e,He]=a.useState(_.state?.message==="comingFromTransactionDetail"),Ze=_.state?.message==="comingFromOverview",Kt=wo(),Ve=Be.getSignedInUser(),{useDynamicConfig:Yt,useFeatureGate:me}=Lt(),{configValue:Ht}=Yt(Po.enableUncategorizedExpenseCategory),Z=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=me(re.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=me(re.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=me(re.isTransactionActivityEnabled),{isFeatureEnabled:Zt}=me(re.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Wt}=me(re.isProjectsTransactionsEnabled),Xt=a.useCallback(c=>{const j=Ge(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),en=A(c=>za(c,"common")),z=A(c=>fe(c)),{categoryOptions:tn,paymentAccountNames:nn}=A(c=>Qa(c.accountState)),an=A(c=>$a(c.classState)),{monthEndCloseChecksView:J,currentSelectedView:R,selectedPeriod:F,selectedTransactionCategorizationTab:se,currentSelectedViewBackgroundRefreshFetchState:on,currentSelectedViewFetchState:W,jeSchedules:Me,reconciliation:sn}=z;a.useEffect(()=>{R==="transaction_categorization"&&E!==!0||Q(void 0)},[R,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==se&&(ve.current=se,R==="transaction_categorization"&&Q(void 0)):ve.current=se},[R,se,Q]);const cn=A(c=>M==null?void 0:qa(c.transactionState,M)),ce=cn?.qboId,ln=A(c=>ce==null?void 0:Ga(c,ce));a.useEffect(()=>{ce!=null&&h(Ja(ce))},[h,ce]);const{selectedAccountId:pe}=sn,et=Qe(Me.accountSettingsView.saveState.fetchState),rn=A(c=>Na(c.accountState,c.accountListState,"accountList")),dn=A(c=>Ka(c)),ge=Ye!=null?Ya(Ye):R,un=A(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Qt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(F),Ce=Ue(tt.start),Se=Ue(tt.end);if(Ce==null||Se==null)throw Error(`Invalid start - ${Ce} and end - ${Se} period from given ${F}`);const mn=a.useCallback(()=>{l(!1)},[]),hn=a.useCallback(()=>{p(!0)},[]),pn=a.useCallback(c=>{P(c),p(!1)},[]),gn=a.useCallback(()=>{P([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{he===!0&&R==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[he,R,ye,nt,h]);const at=Ve?.userId,Cn=F.month,Sn=F.year,ot=n?.tenantId;a.useEffect(()=>{R==="missing_receipts"&&he!==!1&&ye==="idle"&&at!=null&&ot!=null&&h(Ha())},[R,he,ye,at,ot,Cn,Sn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?U(!0):U(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{ge!=null&&R!==ge&&h(Mt(ge))},[ge]),a.useEffect(()=>{Ne!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!D||(Jt(!0),h(It(!1,!1,Z)))},[Ne,W,D,Z]),a.useEffect(()=>{!Ze&&D&&(h(It(!1,!1,Z)),h(ue(F,pe,!1,!1)))},[F.month,F.year,D,Z]);const st=a.useCallback((c=!1,j=!1)=>{const N={start:Ce,end:Se};switch(R){case"transaction_categorization":h(le(se,N,c,!_e,void 0,void 0,j,void 0,Z)),He(!1);break;case"flux_analysis":h(Pe(F,c,j,null));break;case"month_end_insights":if(j===!1){const O=new Date(F.year,F.month,0),B=Wa(O.toDateString()).format(Gt.analytics.YYYYDashMMDashDDFormat);h(Xa(!0,n.companyId,n.tenantId,B)),h(eo(n.companyId,n.tenantId))}break;case"je_schedules":h(Za(N,j));break;case"missing_receipts":h(Ot(N,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ue(F,pe,c,j))}},[R,Ce,Se,n.companyId,n.tenantId,se,F,pe,_e,He,Z]);a.useEffect(()=>{R===ge&&W.fetchState==="Not-Started"&&D&&st(!0)},[W,Ce,Se,n.companyId,n.tenantId,D]),a.useEffect(()=>{Ze||_e||Ke.current||on.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),a.useEffect(()=>{J.fetchState!=="In-Progress"&&J.fetchState!=="Completed"&&h(ke({tenantId:n.tenantId,period:F,refreshViewInBackground:!1}))},[J.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&D&&(h(ke({tenantId:n.tenantId,period:F,refreshViewInBackground:!0})),h(to({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,F,n.companyId,D]),a.useEffect(()=>{const c=setInterval(()=>{J.fetchState!=="In-Progress"&&J.fetchState==="Completed"&&h(ke({tenantId:n.tenantId,period:F,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[J.fetchState,n.tenantId,F,h]),a.useEffect(()=>{const c=setInterval(()=>{R==="reconciliation"&&pe==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ue(F,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[R,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,ue,pe,F]);const In=vt();a.useEffect(()=>{const c=(J.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;R!=="month_end_insights"||!c&&J.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[R,J.monthEndCloseChecks]);const fn=u===!0?g:T,kn=u===!0||E===!0,En=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Me.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Me.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:vn,onSaveSuccess:yn,onCancel:bn,vendorViewDetails:An}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:N})=>{const O=de();let B,Ie,X;const be=vt(),q=c.transactionView;let Y=()=>{};const{transactions:Tn,selectedTransactionId:ie,selectedTransactionLineId:Ae,transactionLocalData:wn}=q;if(N==="transaction_categorization"){const Oe=wn.find(ee=>ee.transactionId===ie),G=Tn.find(ee=>ee.id===ie),it=Ae!=null?Oe?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;Ie=it?.class?.classId,B=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const xn=Bo(ie,G?.typeOfTransaction);G!=null&&xn&&(X={id:ie,type:Ge(G.typeOfTransaction)}),Y=()=>{if(ie!=null&&Ae!=null&&G!=null){const ee=q.transactionLocalData.find(Te=>Te.transactionId===ie)?.transactionReviewLocalData;if(ee!=null&&G.lines!=null&&G.lines.length>0){const Te=ee.lineItemById[Ae];let je=ee.selectedEntity;if(Kn(G)||(je=Te.selectedEntityLine),je!=null){const Rn=je,Dn={transactionId:{id:G.id,type:G.type},transaction:G,lineIds:G.lines.map(Un=>Un.id)??[]};O(Je(Rn,Te.amount.amount,Dn,!1,!0,be))}}}}}const Pn=A(Oe=>dt(Oe,void 0,B,Ie));return{transactionId:X,onSaveVendor:()=>{O(Nn(X,void 0,!1,!0))},onSaveSuccess:Y,onCancel:()=>{X!=null&&O(qn({transactionId:X})),O(Gn()),O(Jn()),j()},vendorViewDetails:Pn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{U(!1)},currentSelectedView:R});return Kt?.loggedInUserRoleMap==null?J.fetchState==="Error"?S.jsx(xo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):S.jsx($t,{fetchState:"In-Progress"}):S.jsxs(S.Fragment,{children:[S.jsx(Vo,{isOpen:k,drawerLeftMargin:new Ro(0,0,300,650),onClose:()=>{p(!1)},children:S.jsx(Jo,{onClick:c=>c.stopPropagation(),children:S.jsx(Lo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:pn,resetCustomerRequest:gn})})}),ct!=null&&V&&S.jsx(Uo,{isOpen:V,transactionId:ct,onSaveVendor:vn,onSaveSuccess:yn,onCancel:bn,vendorViewDetails:An}),S.jsx(qo,{navigate:r,location:_,themeState:te,categoryOptions:tn,classesForFilters:an,accountsForFilters:nn,vendorSearchAutoCompleteData:{autoCompleteText:un,entityAutoCompleteView:en},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:Z,isAccountingClassesEnabled:dn,isProjectsTransactionsEnabled:Wt,isCOTEnabled:In,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:R==="transaction_categorization"?M:void 0,activityLogPanel:R==="transaction_categorization"&&Xe===!0&&M!=null?S.jsx(Do,{activityLogView:ln,qboId:ce,onClose:()=>Q(void 0),selectedTransactionId:M},String(M)):null,uncategorizedAccounts:rn,onClickCustomerRequest:hn,handleEditClick:mn,tenantEmailDomain:Nt,trackExpenseAutomationTabAnalytics:K,setActivityLogTransactionId:Q,closeSidePanel:En,openTransactionPanel:i,sidePanelIsOpen:kn,sidePanelIsFullView:u!==!0&&f,panelContent:fn,isAiCfoAccessEnabled:w,onAskAiCfoClick:ne,isExpenseAutomationCommentingEnabled:Zt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:u===!0?66:void 0})]})})),Jo=Fe(Bn)`
22
- display: flex;
23
- min-height: 100%;
24
- flex-direction: column;
25
- `;function Cs(){return S.jsxs(Vn,{children:[S.jsx(Le,{path:"*",element:S.jsx(Mo,{})}),S.jsx(Le,{path:"/:selectedTab/:selectedPeriod/*",element:S.jsx(Go,{})}),S.jsx(Le,{path:"*",element:S.jsx(Fn,{})})]})}export{Cs as default};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-DQGl2YSn.js";import{u as f,h as l,g as m}from"./core-DYij5xsh.js";import{gB as p,JN as g,JO as b}from"./zeni-epic-state-YenBAkdY.js";import{u as _,L as h,z as y}from"./index-CPHDDMJD.js";import"./liveblocks-BiGkkGoP.js";import"./recharts-D0oa1BQl.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="9f9bef73-359b-41f5-8e92-59c721cb1b6d",e._sentryDebugIdIdentifier="sentry-dbid-9f9bef73-359b-41f5-8e92-59c721cb1b6d")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),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"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);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}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
@@ -1,12 +0,0 @@
1
- import{j as u}from"./liveblocks-BiGkkGoP.js";import{a as f}from"./sentry-DQGl2YSn.js";import{u as U,g as M,h as O,s as _,j as l,N as D}from"./core-DYij5xsh.js";import{z as r,h as w,D as P,e as V,d as A,f as N,J as B,M as Q,g as R}from"./index-CPHDDMJD.js";import{eQ as W,Jr as X,JB as $,Js as q,eX as G,fo as H,Jx as K,fM as Y,cT as Z,JC as ee,JD as te}from"./zeni-epic-state-YenBAkdY.js";import{n as ne}from"./mui-CdvNR06J.js";import{u as se}from"./useDeviceId-Dsh8klAH.js";import{f as ie}from"./analyticsHelper-BjBUUOIH.js";import{t as ae}from"./getLocaleForTenant-DYNL1b9l.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="450bd111-1fef-49e6-861c-c3923e766031",t._sentryDebugIdIdentifier="sentry-dbid-450bd111-1fef-49e6-861c-c3923e766031")}catch{}})();const T=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function Te(){const t=U(),i=M(),m=O(),[y]=_(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:z}=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=>W(e)),k=l(e=>X(e)),E=r.getSignedInUser(),v=w().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&a!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t($(n,a,g)))},[n,p,t,a,g,s?.zeniSessionId]),f.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(q(k.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),P.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=R();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,b,s,o,k,v,i.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),F=f.useCallback(()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))},[a,d,t,c]),J=f.useCallback(e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))},[a,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(B,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:F,onVerifyOtp:J,onCancelVerifyDevice:j});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return u.jsx(D,{to:e,state:{...i.state,origin:""}})}if(!T(n,p)||g==null||I==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...i.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(Q,{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{Te as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-BiGkkGoP.js";import{h as r,n}from"./core-DYij5xsh.js";import{I as i}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="a91be54e-6c13-4a77-b876-d2a39d3636be",o._sentryDebugIdIdentifier="sentry-dbid-a91be54e-6c13-4a77-b876-d2a39d3636be")}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 +0,0 @@
1
- import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-BiGkkGoP.js";import lt from"./NotFoundScreen-CgebWRjN.js";import{a as k}from"./sentry-DQGl2YSn.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 H}from"./core-DYij5xsh.js";import{cr as St,f2 as K,eQ as Z,fg as bt,f9 as b,Q3 as O,fc as d,f1 as y,rb as M,wr as It,Q4 as Ct,f0 as Tt,fj as yt,rg as Et,Q5 as $,bq as F,gU as x,rk as J,Q6 as _t,cC as At,cw as Nt}from"./zeni-epic-state-YenBAkdY.js";import{W as Bt,z as wt,n as xt,c as Rt,Z as Ut,cB as Dt,r as N,a7 as vt,cC as Gt,a8 as Pt,p as $t}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="63130727-1220-4b37-8de6-e0336d87779e",t._sentryDebugIdIdentifier="sentry-dbid-63130727-1220-4b37-8de6-e0336d87779e")}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=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Z(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(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(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(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(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).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=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>K(e)),o=S(e=>Z(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Ut({isDataReady:!0});const X=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),U=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:E,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:Q,isLoading:W,fetchMore:q,isFetchingMore:z,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(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(E===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[E,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=E||v===!0||C!==!0||E||v===!0||C!==!0;k.useEffect(()=>{G&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&W===!1&&w!=null&&Q!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),_=p.map(f=>f.id),it=p.map(f=>{const P=Q.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||L===!0||q==null||q(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,v,z,C,L,W,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];U==="all"?_.push("read","unread"):U!=="mentions"&&_.push(U),s(M("task_manager",T,_,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:X,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return A.jsxs(gt,{children:[A.jsx(H,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(H,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-BiGkkGoP.js";import{a as r}from"./sentry-DQGl2YSn.js";import{u as A,g as j,j as o,N as C}from"./core-DYij5xsh.js";import{JQ as J,eQ as M,f8 as P,JR as R,JS as x,JT as z,JU as D,mX as k,IM as L}from"./zeni-epic-state-YenBAkdY.js";import{z as h,G as I}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="160ce3d7-e3f6-443e-810d-7e1dcf1dbf6c",n._sentryDebugIdIdentifier="sentry-dbid-160ce3d7-e3f6-443e-810d-7e1dcf1dbf6c")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo(()=>J(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>M(e)),l=o(e=>P(e)),d=o(e=>e.tenantState.fetchState),y=o(R),S=o(x),c=o(z),[v,b]=r.useState(null),[E,U]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(D())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const _=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:b,approveError:E??S,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{U("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-BiGkkGoP.js";import{h as z,u as Y,g as Z,i as Q,j as d,n as H,o as J,p as I}from"./core-DYij5xsh.js";import{eQ as U,q$ as R,qz as X,Km as v,qu as T,bt as ee,bn as ae,bT as te,qv as se,Kn as oe,K8 as C,dE as re,uo as ne,Ko as ce,uL as ie,e$ as le,eZ as de}from"./zeni-epic-state-YenBAkdY.js";import{z as me,W as fe,Z as pe,A as ue,n as $,c as q,x as he,d as w,ao as ge,r as Fe}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import be from"./NotFoundScreen-CgebWRjN.js";import{F as Ie}from"./FeaturePreviewScreen-cfOOP0Wo.js";import{a as g}from"./sentry-DQGl2YSn.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{u as Te}from"./useInitialThreadRequest-DhlqNdmZ.js";import{t as Se}from"./routePaths-BZSOS5PJ.js";import{M as ye}from"./MobileAppDrawer-BmawIQiO.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="2f1f3d8f-a1b0-4ec5-99cc-d3736cca8050",s._sentryDebugIdIdentifier="sentry-dbid-2f1f3d8f-a1b0-4ec5-99cc-d3736cca8050")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=H(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(ge);function O(){const s=z(),e=Y(),a=Z(),{forecastId:o,tenantEmailDomain:r}=Q(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>U(t)),M=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),A=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,j,P)=>j!=null?f.forecasts.findIndex(b=>b.id===j):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(i,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(v(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,T,F]);const D=ue(),W=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:_}=$(),{isFeatureEnabled:E}=_(q.isReportsCommentingEnabled),G=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[K,V]=g.useState(!1),L=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:K,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:M,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{L(!0)}})]})}function Ve(){const s=d(c=>U(c)),{useFeatureGate:e}=$(),{isFeatureEnabled:a}=e(q.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(J,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BiGkkGoP.js";import E from"./NotFoundScreen-CgebWRjN.js";import{a as r}from"./sentry-DQGl2YSn.js";import{h as _,g as v,j as p,i as U,u as M,N as P,n as z,o as O,p as b}from"./core-DYij5xsh.js";import{eQ as B,Q7 as h,bo as F,bn as N,ho as Q,gU as V}from"./zeni-epic-state-YenBAkdY.js";import{v as Z,z as I,Z as $,cD as q}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{M as H}from"./MobileAppDrawer-BmawIQiO.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="73beabab-7c66-4f6b-9d52-4836bad7c498",e._sentryDebugIdIdentifier="sentry-dbid-73beabab-7c66-4f6b-9d52-4836bad7c498")}catch{}})();const J=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(q),K=()=>{const e=_(),t=v(),c=Z(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>h(a)),{tenantEmailDomain:u}=U(),f=M(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),D=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(l),x=C||D||k,d=r.useCallback((a,i,T)=>{f(Q({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f(V({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const y=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:u,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${u}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(b,{path:"*",element:s.jsx(K,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1,5 +0,0 @@
1
- import{j as s}from"./liveblocks-BiGkkGoP.js";import{a as o}from"./sentry-DQGl2YSn.js";import{j as f,h as H,u as L,g as W,n as N}from"./core-DYij5xsh.js";import{h as V,k as F,z as R,b9 as _,y as U,W as $,Z as z,x as Q,d as l,f as Z,a7 as q,ba as G}from"./index-CPHDDMJD.js";import{f3 as J,eQ as K,MM as P,MN as X,ue as Y,u4 as g,f5 as ee,bO as ae,u9 as re,MO as ne}from"./zeni-epic-state-YenBAkdY.js";import{D as te,e as se,n as oe,S as ie}from"./mui-CdvNR06J.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{M as ce}from"./MobileAppDrawer-BmawIQiO.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]="af615082-95a2-455f-84c1-60cc66d2a351",e._sentryDebugIdIdentifier="sentry-dbid-af615082-95a2-455f-84c1-60cc66d2a351")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=V(),n=F();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>J(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(_,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,I="refer-and-earn-status-update",we=N(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(q(G));function Se({isReferralDrawerOpen:e}){const a=H(),r=L(),n=W(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,E]=o.useState(!1),[k,h]=o.useState(!1),w=R.getSignedInUser(),C=f(t=>K(t)),m=f(t=>P(t)),y=m.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),v=X([m,p]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(Y()),E(!0))},[]),o.useEffect(()=>{!i&&y==="Not-Started"&&d&&(u(!0),r(g(!0)))},[y,r,d]),o.useEffect(()=>{!c&&p.fetchState==="Not-Started"&&d&&(x(!0),r(ee(!0)))},[p,r,d]),o.useEffect(()=>{h(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),S=t=>{A(t)},{isAiCfoAccessEnabled:M,onAskAiCfoClick:O}=le({mobileExploreReferrer:"Rewards"});z({isDataReady:v===!0});const T={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,b,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(Q,{analytics:l,onLoad:t=>(b=>{w!=null&&b.trackPageLoaded(Z.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:S}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{h(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:M,onAskAiCfoClick:O,...T})]})}export{Se as R};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-BiGkkGoP.js";import x from"./NotFoundScreen-CgebWRjN.js";import{a as p}from"./sentry-DQGl2YSn.js";import{h as D,g as I,u as C,j as u,N as A,n as E,o as k,p as c}from"./core-DYij5xsh.js";import{eQ as T,NG as g,NW as S,Db as V,Ck as N,Da as d,D1 as U,Oa as _}from"./zeni-epic-state-YenBAkdY.js";import{h as O,z as W,B as $,a7 as B,bQ as Q,af as z}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.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]="84a98680-4ad8-40a7-ad8c-91ba612f196c",e._sentryDebugIdIdentifier="sentry-dbid-84a98680-4ad8-40a7-ad8c-91ba612f196c")}catch{}})();const m="reimbursement-approval-rule-update",G=E(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(d(s)),a(`./${s}/edit`)):(e(d()),a("./new"))}}})(B(Q)),P=()=>{const e=D(),r=I(),a=C(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>T(n)),w=O(),i=u(n=>g(n)),h=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(N(!0)))},[l,b,a]),W.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(A,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(G,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(c,{path:"/",element:t.jsx(P,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-BiGkkGoP.js";import{n as j,z as w,aN as b,x as I,d as p,f as F,cN as L,c as P}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import m from"./NotFoundScreen-CgebWRjN.js";import{a as u}from"./sentry-DQGl2YSn.js";import{u as T,j as y,h as V,g as A,n as Q,o as R,p as d}from"./core-DYij5xsh.js";import{eQ as U,QK as C,Nl as z,QL as N,ue as Y,f5 as G,QM as K,uc as M}from"./zeni-epic-state-YenBAkdY.js";import{R as x}from"./ReferralListScreen-CZNvkt7D.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import"./MobileAppDrawer-BmawIQiO.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]="aa837649-27be-427c-a771-9b5435a8475b",a._sentryDebugIdIdentifier="sentry-dbid-aa837649-27be-427c-a771-9b5435a8475b")}catch{}})();const O=Q(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(N()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(M())},onUpdateInviteFormLocalData:s=>{a(K({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(L),q=()=>{const a=T(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=y(o=>U(o)),c=V(),_=A(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=y(o=>C(o)),k=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:v}=g(b.zeniAccountsConfig),D=z(v);u.useEffect(()=>{a(N()),r?.rewardsLastViewedTime==null&&i===!1&&(a(Y()),s(!0))},[]),u.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(G(!0)))},[l.fetchState,a]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(O,{navigate:c,location:_,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function da(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(P.isReferralFeatureEnabled);return e.jsxs(R,{children:[e.jsx(d,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(d,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(d,{path:"refer/*",element:t?e.jsx(q,{}):e.jsx(m,{})}),e.jsx(d,{path:"*",element:e.jsx(m,{})})]})}export{da as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-e8rwyA4g.js","assets/sentry-DQGl2YSn.js","assets/core-DYij5xsh.js","assets/zeni-epic-state-YenBAkdY.js","assets/index-CPHDDMJD.js","assets/mui-CdvNR06J.js","assets/analytics-DyffXLrl.js","assets/utils-BCjesvPZ.js","assets/withTransactionSidePanel-CQ9Z6rVO.js","assets/useAskAiCfoHostNavButtonProps-DEByTqFW.js","assets/TransactionDetailScreen-CIFGLtuW.js","assets/decodeURIComponentSafe-CSUd4Wt5.js","assets/routePaths-BZSOS5PJ.js","assets/NotFoundScreen-CgebWRjN.js","assets/useInitialThreadRequest-DhlqNdmZ.js","assets/analyticsHelper-BjBUUOIH.js","assets/CompanyPassportScreen-CBnJsrN4.js","assets/MobileAppDrawer-BmawIQiO.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Cx4eHMO1.js","assets/FeaturePreviewScreen-cfOOP0Wo.js","assets/ReferralListScreen-CZNvkt7D.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-DtWSNOxA.js","assets/AddressScreen-qDs8FTIM.js","assets/DomesticWireDetailScreen-DBmeU2Lc.js","assets/DrawerScreen-BWhuJpJg.js","assets/SetupPagesScreen-DE1Mdjhy.js","assets/BusinessVerificationPageScreen-DmTGb48M.js","assets/BillPayApprovalRoutes-CHbvFE3b.js","assets/ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.js","assets/getLocaleForTenant-DYNL1b9l.js","assets/ReimbursementRoutes-BppSio00.js","assets/ReimbursementApprovalRoutes-BwzrkQxk.js","assets/TransactionListRoutes-2qkBEL3R.js","assets/ZeniAccountStatementScreen-CSKHvFWp.js","assets/SettingsRoutes-Bf46HJcH.js","assets/accountMappingHelper-EVwRyhXo.js","assets/QBOConnectionScreen-Jf2FDuvS.js","assets/empty-zLrsqSwy.js","assets/index-C2zxt7CG.js","assets/url-DRf0E0e8.js","assets/index-3OE7eXoF.js","assets/ReportsRoutes-CpXDACgQ.js","assets/ChargeCardRoutes-Bsiqi1N3.js","assets/PeopleRoutes-OPsUJqGZ.js","assets/ExpenseAutomationRoutes-CspHbytv.js","assets/TreasuryRoutes-Bs8jZ6mk.js","assets/VendorsRoutes-Ck9fOO3Y.js","assets/pathToGoBack-DzYXGaMH.js","assets/ZeniAccountRoutes-B_icMfds.js","assets/AddressRoutes-BO7_ztL-.js","assets/PandLWithForecastRoutes-Cl99HhDr.js","assets/CustomerOnboardingRoutes-SknKGVun.js","assets/TransactionDetailRoutes-Cv9DmhGT.js","assets/EntityDetailRoutes-CTTfstSP.js","assets/NotificationRoutes-Cl7PLaOs.js","assets/PerformanceRoutes-CEO5F026.js","assets/RewardsRoutes-30RCnxCS.js","assets/TaskRoutes-Bguabkg5.js","assets/TaskListScreen-Cf5iv59C.js","assets/AiCfoScreen-BdfrkE-x.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eQ as ls,e$ as cs,eZ as ds,e_ as ms,fI as us,eU as _s,cP as Ae,cx as As,ff as Es,cp as ps,bE as xs,bq as Is,fk as gs,v as Ts,Js as hs,bt as js,Jt as Us,bG as bs,fh as Hs,bF as Rs,bs as Ds,cl as fs,Ju as ys,Jv as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,mX as Ee,eX as pe,fS as Bs,fo as xe,fP as Ie,fQ as ge,fp as ks}from"./zeni-epic-state-YenBAkdY.js";import{j as e}from"./liveblocks-BiGkkGoP.js";import{a as v}from"./sentry-DQGl2YSn.js";import{u as Vs,h as Ss,i as Ns,g as Ms,j as G,l as Te,N as c,o as Zs,p as t}from"./core-DYij5xsh.js";import{h as ws,u as Gs,z as H,n as zs,a as $s,V as Js,c as L,A as Ys,L as B,D as he,t as _,P as qs,d as K,l}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{f as je}from"./analyticsHelper-BjBUUOIH.js";import{t as Ws}from"./getLocaleForTenant-DYNL1b9l.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="0f0a334d-859e-4e0b-90bf-fe4d28b827ad",i._sentryDebugIdIdentifier="sentry-dbid-0f0a334d-859e-4e0b-90bf-fe4d28b827ad")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-e8rwyA4g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-DtWSNOxA.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-BppSio00.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-2qkBEL3R.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-Bf46HJcH.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-CpXDACgQ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-Bsiqi1N3.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-OPsUJqGZ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CspHbytv.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-Bs8jZ6mk.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-Ck9fOO3Y.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-B_icMfds.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>n(()=>import("./ReportsRoutes-CpXDACgQ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-BO7_ztL-.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-OPsUJqGZ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-Cl99HhDr.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-SknKGVun.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-Ck9fOO3Y.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-Cv9DmhGT.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-CTTfstSP.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-e8rwyA4g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),be=l(()=>n(()=>import("./BillPayRoutes-DtWSNOxA.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ln=l(()=>n(()=>import("./SettingsRoutes-Bf46HJcH.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),He=l(()=>n(()=>import("./ReimbursementRoutes-BppSio00.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-B_icMfds.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-Bs8jZ6mk.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-2qkBEL3R.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-Bsiqi1N3.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-Cl7PLaOs.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),An=l(()=>n(()=>import("./PerformanceRoutes-CEO5F026.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),En=l(()=>n(()=>import("./ExpenseAutomationRoutes-CspHbytv.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-30RCnxCS.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),xn=l(()=>n(()=>import("./TaskRoutes-Bguabkg5.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),In=l(()=>n(()=>import("./AiCfoScreen-BdfrkE-x.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),f=l(()=>n(()=>import("./NotFoundScreen-CgebWRjN.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gn=l(()=>n(()=>import("./TaskListScreen-Cf5iv59C.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:y,clearAllLoading:O,clearLoading:Z}=Gs(),D=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),W=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),Q=$s(),fe=Js(),{isFeatureEnabled:ye}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||ye&&W,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),E=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),J=G(a=>us(a));if(o!=null){const a=H.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),A=Ys(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?Es(a,w.tenantId):void 0);v.useEffect(()=>{y(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&D!=null){const a=X.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=xs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(gs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,D]),v.useEffect(()=>{N||(De(!0),y(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&H.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(xe(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=H.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ws(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?K.identify(a.userId,{tenant_id:a.tenantId}):K.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(xe(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(q?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)));if(Y){K.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,D,h,y,U))},[D,E]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&J.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(J.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,J.tenantsBaseInOrder))},[J,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&y(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):E==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(a=Xs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(A?.loggedInUserRoleMap),me=Oe&&!C,Je=r.company!=null&&Hs(r.company),Ye=Pe&&Je===!0&&!C,qe=re&&Rs(A?.loggedInUserRoleMap),We=oe&&Ds(A?.loggedInUserRoleMap),Qe=me&&fs(A?.loggedInUserRoleMap),Xe=ys(A?.loggedInUserRoleMap),Ke=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),x=Os(A?.loggedInUserRoleMap),I=Ps(A?.loggedInUserRoleMap),g=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&g,_e=ce&&T,es=me&&p,ss=Ye&&x,ns=oe&&I,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Xe===!0||Ke===!0;return H.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||W&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||W?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Ks,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(gn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xn,{})}),e.jsx(t,{path:"address/*",element:qe||de||Qe||We?e.jsx(en,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(f,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(f,{})}),e.jsx(t,{path:"performance",element:fe?e.jsx(An,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(En,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(f,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(f,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(f,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(In,{isFileUploadEnabled:Ve}):e.jsx(f,{})}),e.jsx(t,{path:"*",element:e.jsx(f,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:y,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):y?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(bn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Hn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(f,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wn as default};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-BiGkkGoP.js";import{a as u,b as T,q as A}from"./sentry-DQGl2YSn.js";import{u as z,h as D,j as c,g as M,N as J,n as P}from"./core-DYij5xsh.js";import{u as j,z as s,h as F,d as E,D as O,e as _,f as B,K as N,g as V,R as $,i as v}from"./index-CPHDDMJD.js";import{eQ as q,Jr as K,Js as Q,eX as R,fo as W,Jx as H,fM as X,cT as G,Jy as b,Jz as Y,JA as Z,bT as y}from"./zeni-epic-state-YenBAkdY.js";import"./mui-CdvNR06J.js";import{u as ee}from"./useDeviceId-Dsh8klAH.js";import{f as te}from"./analyticsHelper-BjBUUOIH.js";import{t as ne}from"./getLocaleForTenant-DYNL1b9l.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="89ef3f14-0ecd-4a1b-baf4-38c91b26f173",t._sentryDebugIdIdentifier="sentry-dbid-89ef3f14-0ecd-4a1b-baf4-38c91b26f173")}catch{}})();const ie=P(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:x,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>q(e)),I=c(e=>K(e)),m=M(),w=F().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(Q(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),O.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),X().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",G(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(J,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-BiGkkGoP.js";import{a}from"./sentry-DQGl2YSn.js";import{u,g as m,h as p,N as g}from"./core-DYij5xsh.js";import{z as d,B as y,t as h,d as c,f as b}from"./index-CPHDDMJD.js";import{fR as x,fS as I,JP as j}from"./zeni-epic-state-YenBAkdY.js";import{n as w}from"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="ef5ed0c3-d878-414d-9e45-314d9bcac27c",e._sentryDebugIdIdentifier="sentry-dbid-ef5ed0c3-d878-414d-9e45-314d9bcac27c")}catch{}})();function $(){const e=u(),t=m(),i=p(),n=a.useRef(!1),f=d.isSignedIn(),r=t.state?.message==="logout",o=r||f;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),j(),h.reset(),c.trackLogout(b.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;export{$ as default};
@@ -1,9 +0,0 @@
1
- import{j as n}from"./liveblocks-BiGkkGoP.js";import se from"./NotFoundScreen-CgebWRjN.js";import{a as c}from"./sentry-DQGl2YSn.js";import{h as O,u as _,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-DYij5xsh.js";import{Fw as M,Fz as le,Ft as de,eQ as Z,QN as H,FN as Y,Fq as pe,Gh as ue,Ga as ke,QO as W,QP as q,Fm as me,Fj as fe,qp as ge,qd as he,kf as Se,FH as Ie,QQ as Te,FY as be,FV as Ee,FC as Ge,FS as Ce,FR as Fe}from"./zeni-epic-state-YenBAkdY.js";import{z as C,cO as De,v as xe,n as je,c as b,p as X,r as w,x as ye,d as z,f as we,cP as ve,i as V,at as Re}from"./index-CPHDDMJD.js";import{n as Pe}from"./mui-CdvNR06J.js";import{u as Be}from"./useInitialThreadRequest-DhlqNdmZ.js";import{M as Ue}from"./MobileAppDrawer-BmawIQiO.js";import Le from"./TaskListScreen-Cf5iv59C.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-DEByTqFW.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]="1071aa7d-3416-445e-b248-585ae1a6f1a8",e._sentryDebugIdIdentifier="sentry-dbid-1071aa7d-3416-445e-b248-585ae1a6f1a8")}catch{}})();function Ne(){const e=O(),t=_(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(M())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(De,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let Q,A=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?q(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:F}=d,E=r.recurringSourceTaskId,D=E!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==Q&&(Q=I,A=Object.values(I)),A),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:D,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>q(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(Fe({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Y(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=O(),t=_(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[P,ee]=c.useState(!1),[B,x]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(Y(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{P||L==="Completed"||(ee(!0),t(ue()))},[P,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return x(!1),void(T.current=!1);if(G==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const N=g(i=>W(i,r)),j=N.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ye,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(qe,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:E})]})]})}const qe=Pe.div`
2
- display: flex;
3
- min-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
- `,v=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(y,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(y,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(Ne,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(y,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1,37 +0,0 @@
1
- import{j as e}from"./liveblocks-BiGkkGoP.js";import{h as U,g as B,u as P,i as M,j as f,N as L,n as N,o as Te,p as k}from"./core-DYij5xsh.js";import{cm as V,eQ as v,NP as R,DV as ae,fi as q,DD as ne,NR as we,DY as Ie,NN as Ce,NO as se,O4 as ke,C3 as je,sS as be,NT as Ae,E7 as Ee,NQ as re,cO as H,w_ as oe,eZ as De,e$ as ve,O_ as Fe,O$ as Le,DE as Ue,P0 as Be,DF as Pe,DO as Re,bt as Oe,bF as Me,cx as Ne,bG as Ve,cl as _e,fh as $e,bs as ze,Jt as Ge,ck as Ze}from"./zeni-epic-state-YenBAkdY.js";import{A as _,aq as qe,z as A,x as $,d as j,c5 as He,c6 as We,c7 as Z,k as W,h as Ke,W as Qe,Z as Je,n as ie,c as D,y as Ye,B as Xe,c8 as et,at as K,r as tt,c9 as at,p as Q,ca as nt,M as Y,cb as st,a9 as rt}from"./index-CPHDDMJD.js";import{D as ot,n as O,S as it}from"./mui-CdvNR06J.js";import ct from"./NotFoundScreen-CgebWRjN.js";import{S as X}from"./SetupPagesScreen-DE1Mdjhy.js";import{a as d}from"./sentry-DQGl2YSn.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{u as ut}from"./useInitialThreadRequest-DhlqNdmZ.js";import{M as ce}from"./MobileAppDrawer-BmawIQiO.js";import{F as dt}from"./FeaturePreviewScreen-cfOOP0Wo.js";import{a as ee}from"./analyticsHelper-BjBUUOIH.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./routePaths-BZSOS5PJ.js";import"./BusinessVerificationPageScreen-DmTGb48M.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]="61b9a2af-a2b1-4a99-a3d0-6285c9e2cddc",t._sentryDebugIdIdentifier="sentry-dbid-61b9a2af-a2b1-4a99-a3d0-6285c9e2cddc")}catch{}})();const pt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(He);function mt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=M(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=qe(r),s=V(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,I]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>v(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=f(C=>R(C,y)),w=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||w!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,w,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(q()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(I(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(We),yt=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=M(),o=P(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>v(x)),T=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),w=f(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||T==null||(s(!0),o(ae(T,!0,!1)))},[m,u,T,o]),d.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(q()))},[l,c,T,o]),d.useEffect(()=>{g||h!=="Not-Started"||T==null||(I(!0),o(ne()))},[g,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:w,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=O.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${t=>t.theme.colors.grey4};
9
- `,ht={overlayWidth:new Ye(100,100,48)},St=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:l=>{let i="page-not-found";l==="editPortfolio"?i=xt(s):l==="statements"?i=Tt(s):l==="taxLetter"?i=wt(s):l==="settings"&&(i=It(s));const g=tt(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:g}})},onColumnSortConfigChanged:(l,i)=>{t(Fe({uiState:{sortKey:l,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(et);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),o=U(),p=P(),r=W(),m=Ke(),s=f(b=>v(b)),{tenantEmailDomain:l}=M(),i=s.companyId??A.getSignedInUserTenant(l)?.companyId,[g,I]=d.useState(!1),u=f(b=>re(b)),c=u.fetchState,h=u.accountSummary?.totalBalance?.amount,y=f(b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),T=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),w=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=H(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Qe();d.useEffect(()=>{c==="Not-Started"&&!g&&E&&(I(!0),p(oe(!0)))},[g,p,c,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const C=()=>{o("..")},[le,ue]=d.useState(!1),J=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Je({isDataReady:c==="Completed"});const{useFeatureGate:z}=ie(),{isFeatureEnabled:me}=z(D.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=z(D.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=z(D.isTreasuryCommentingEnabled),ge=ut(i,{clearParams:c==="Completed"&&y?.fetchState==="Completed"}),he=De(s),Se=ve(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(T){const b=y?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx($,{analytics:j,onLoad:()=>{}}):null,e.jsx(ot,{onClose:C,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:u.transactions.length===0||h===0}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(St,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:J,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!w&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(Xe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=O(it)`
10
- display: flex;
11
- min-height: 100%;
12
- flex-direction: column;
13
- `,kt=O.div`
14
- display: flex;
15
- height: 100vh;
16
- width: 100%;
17
- flex: 1 1 auto;
18
- flex-direction: column;
19
- align-items: center;
20
- background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=U(),a=P(),n=W(),o=B(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Le(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))},[r,s.fetchState,a]);const l=A.getSignedInUser(),i=f(c=>v(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(at,{currentTenantCompanyName:I,statementListView:s,isLoading:u,onBackClick:()=>{const c=Q(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const bt=O.div`
22
- display: flex;
23
- height: 100vh;
24
- width: 100%;
25
- flex: 1 1 auto;
26
- flex-direction: column;
27
- align-items: center;
28
- background-color: ${t=>t.theme.colors.grey4};
29
- `;function At(){const t=U(),a=W(),n=B(),o=P(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Be(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))},[r,s.fetchState,o]);const l=A.getSignedInUser(),i=f(c=>v(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(nt,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:u,onBackClick:()=>{const c=Q(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const Et=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(st),Dt=()=>{const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=M(),[p,r]=d.useState(!1),m=f(S=>v(S)),[s,l]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||g==null||(l(!0),n(q()))},[i,n]);const g=A.getSignedInUserTenant(o)?.companyId??m.companyId,I=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{r(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),y=V(h?.loggedInUserRoleMap),T=H(h?.loggedInUserRoleMap);if(u&&y)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&y||T)){if(a.state?.message==="activation"){const S=Q(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Y,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:j,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:c}),e.jsx(Et,{analytics:j,navigate:t,companyId:g,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(Y,{size:"ExtraLarge",start:!0})})},te=O.div`
30
- display: flex;
31
- width: 100%;
32
- height: 100%;
33
- flex-direction: row;
34
- justify-content: center;
35
- align-items: center;
36
- background-color: ${t=>t.theme.colors.grey5};
37
- `;function ea(){const t=B(),a=f(E=>v(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(D.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=H(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),i=Ne(r?.loggedInUserRoleMap),g=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(D.isDepositAccountsFeatureEnabled),u=I&&!s&&_e(r?.loggedInUserRoleMap),c=a.company!=null&&$e(a.company),h=o&&c===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:y}=n(D.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=n(D.isDebitCardFeatureEnabled),S=rt(a,y,T)&&!s&&ze(r?.loggedInUserRoleMap),w=Ge(r?.loggedInUserRoleMap),x=Ze(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Te,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):p&&h?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ea as default};
@@ -1,12 +0,0 @@
1
- import{j as o}from"./liveblocks-BiGkkGoP.js";import{a as c}from"./sentry-DQGl2YSn.js";import{s as u,u as h,j as b,N as y}from"./core-DYij5xsh.js";import{JM as I,eX as w,zL as j}from"./zeni-epic-state-YenBAkdY.js";import{z as l,B as x,F as S,U as D}from"./index-CPHDDMJD.js";import{n as f}from"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="01561278-1038-4cab-b78d-208c8c83bdc6",e._sentryDebugIdIdentifier="sentry-dbid-01561278-1038-4cab-b78d-208c8c83bdc6")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",p=e.get("profileId")??"",[n,g]=c.useState(!1),a=h(),s=b(m=>I(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(i);if(r==null||d==null)return o.jsx(y,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),c.useEffect(()=>{n||(g(!0),a(j(t,p,i)))},[n,a]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=f.div`
2
- display: flex;
3
- width: 100%;
4
- height: 100vh;
5
- flex-direction: row;
6
- justify-content: center;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey5};
9
- `,_=f(D.LargeRegular)`
10
- display: flex;
11
- color: ${S.important};
12
- `;export{W as default};
@@ -1,9 +0,0 @@
1
- import{j as i}from"./liveblocks-BiGkkGoP.js";import{a as f}from"./sentry-DQGl2YSn.js";import{h as x,u as j,g as B,i as $,j as p}from"./core-DYij5xsh.js";import{IJ as s,II as v,OY as C,eQ as T,OZ as z}from"./zeni-epic-state-YenBAkdY.js";import{k as D,at as g,h as E,z as L,B as P,c4 as N,p as U}from"./index-CPHDDMJD.js";import{n as _}from"./mui-CdvNR06J.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]="25cb0a3b-7438-4ad5-aba1-84db8d8d474f",e._sentryDebugIdIdentifier="sentry-dbid-25cb0a3b-7438-4ad5-aba1-84db8d8d474f")}catch{}})();const G=_.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;function V(){const e=x(),n=j(),d=D(),l=B();let{accountId:a}=$(),m=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,m=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[u,b]=f.useState(!1),y=E();f.useEffect(()=>{u||(b(!0),n(v(a??"",!1)))},[u,n]);const o=p(t=>C(t,a??"")),h=()=>{const t=U(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},r=L.getSignedInUser(),c=p(t=>T(t)),I={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId??""},k=z(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",w=c.company?.companyInfo.companyLegalName??c.companyName;if(r==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(P,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}}):i.jsx(G,{windowSize:d,children:i.jsx(N,{currentTenantCompanyName:w,statementListView:o,accountLast4:k,onBackClick:h,authParams:I,downloadEndPoint:m})})}export{V as Z};