@zeniai/web-app-ui 5.0.69-dev → 5.0.70-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 (142) hide show
  1. package/dist/assets/AddressRoutes-DlCSlbd0.js +1 -0
  2. package/dist/assets/AddressScreen-XB_ZjPeU.js +9 -0
  3. package/dist/assets/AiCfoScreen-B8_yJYPJ.js +11 -0
  4. package/dist/assets/BillPayApprovalRoutes-yRkPSfEx.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DeeO4ZWe.js → BillPayRoutes-WfAdwh9x.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-DmIGFdMu.js → BusinessVerificationPageScreen-Xyb_NZd3.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-Qt9_CQzn.js +71 -0
  8. package/dist/assets/CompanyPassportScreen-B_t_p_KG.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-B82KBg15.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-DC2Dvvw9.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-C2MSnlp9.js → CustomerOnboardingRoutes-BAGC5ov8.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-DXOW97ga.js → DashboardRoutes-CV-8n2GU.js} +3 -3
  13. package/dist/assets/DefaultTenantHome-XcgDXVme.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-Cl7PsZLY.js +18 -0
  15. package/dist/assets/DrawerScreen-DP7Vn6r6.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-DIQmP6iy.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-CYahmVcR.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-DRKlG39U.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-D5lipnI5.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-BTyKb1sS.js +12 -0
  21. package/dist/assets/MobileAppDrawer-DaqT822M.js +1 -0
  22. package/dist/assets/NotFoundScreen-BDKPLFTa.js +1 -0
  23. package/dist/assets/{NotificationRoutes-rIbfH4Eq.js → NotificationRoutes-CuXoF2x0.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-ClL92zg9.js +1 -0
  25. package/dist/assets/PeopleRoutes-08vh10kk.js +22 -0
  26. package/dist/assets/PerformanceRoutes-Pz6rRA7W.js +1 -0
  27. package/dist/assets/{Preview-BzKmpY8q.js → Preview-U4DL5ZS9.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-BpQWEam6.js → QBOConnectionScreen-x6tjrrIg.js} +1 -1
  29. package/dist/assets/ReferralListScreen-DhDrwEzT.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-0bhE_Zri.js +1 -0
  31. package/dist/assets/ReimbursementApprovalRuleDetailScreen-JzkjRFTG.js +1 -0
  32. package/dist/assets/{ReimbursementRoutes-uzEm2rRI.js → ReimbursementRoutes-CUPR5ILr.js} +8 -8
  33. package/dist/assets/ReportsRoutes-DpetzQNs.js +1 -0
  34. package/dist/assets/RewardsRoutes-S0H6QJ3v.js +1 -0
  35. package/dist/assets/ScreenRoutes-UcrsFuos.js +2 -0
  36. package/dist/assets/{SettingsRoutes-CAtKFbAK.js → SettingsRoutes-DUeCcXR7.js} +8 -8
  37. package/dist/assets/{SetupPagesScreen-avoeACM0.js → SetupPagesScreen-nZEMEtdS.js} +5 -5
  38. package/dist/assets/{SignInScreen-BeA2poV6.js → SignInScreen-Dy38xngK.js} +1 -1
  39. package/dist/assets/SignOutScreen-DXhkiyX5.js +9 -0
  40. package/dist/assets/TaskListScreen-mBG6_v8t.js +9 -0
  41. package/dist/assets/TaskRoutes-D_QMetT1.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-CfzZUIjn.js +1 -0
  43. package/dist/assets/TransactionDetailScreen-DaAril2H.js +5 -0
  44. package/dist/assets/TransactionListRoutes-C34xqhU8.js +1 -0
  45. package/dist/assets/{TreasuryRoutes-CPRvFoSD.js → TreasuryRoutes-CQzjvaSM.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-DRHG7hIp.js → VendorsRoutes-CyUSSDk9.js} +15 -15
  47. package/dist/assets/WiseConfirmationScreen-95ULZcWW.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-IBscHJwI.js → ZeniAccountRoutes-DFsLwfj0.js} +12 -12
  49. package/dist/assets/ZeniAccountStatementScreen-CbdNWEZb.js +9 -0
  50. package/dist/assets/{accountMappingHelper-CbeIjSvu.js → accountMappingHelper-2IdEENH2.js} +1 -1
  51. package/dist/assets/{analytics-CX30pJB4.js → analytics-V1YS35pn.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CSr8UgAP.js → analyticsHelper-obwcJcpn.js} +1 -1
  53. package/dist/assets/{core-Chn6k0lm.js → core-NoCUyAuu.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-B4WuQ5yM.js → decodeURIComponentSafe-IeC_6rCo.js} +1 -1
  55. package/dist/assets/{dnd-CKKgQZIG.js → dnd-2Bm_S1r8.js} +1 -1
  56. package/dist/assets/{empty-CM7hXaA6.js → empty-DVmULA-o.js} +1 -1
  57. package/dist/assets/empty-TxlW3k7v.js +1 -0
  58. package/dist/assets/{emptyVideoElement-BB3xSIc2.js → emptyVideoElement-Cq9wlCQc.js} +1 -1
  59. package/dist/assets/epic-DUX-Ktrr.js +2 -0
  60. package/dist/assets/getLocaleForTenant-Dk6x4jwy.js +1 -0
  61. package/dist/assets/{index-BOIvqKof.js → index-BNTBnc0z.js} +1 -1
  62. package/dist/assets/index-BTFMzEP8.js +1 -0
  63. package/dist/assets/index-CkWzriZE.js +1 -0
  64. package/dist/assets/{index-Cyof-eFv.js → index-CkgFiWcV.js} +1 -1
  65. package/dist/assets/{index-D-iEs16m.js → index-DmTCF5BO.js} +2 -2
  66. package/dist/assets/{index-Dswa3EzJ.js → index-YO_u-93m.js} +1 -1
  67. package/dist/assets/{index-BE6noM1i.js → index-mVr9MHWG.js} +15833 -17309
  68. package/dist/assets/{lexical-CMmB3hg4.js → lexical-BoUgtzeo.js} +1 -1
  69. package/dist/assets/{liveblocks-DuKOLlGn.js → liveblocks-CbC47GlV.js} +1 -1
  70. package/dist/assets/{lottie-BzC_z70r.js → lottie--rDKff4P.js} +1 -1
  71. package/dist/assets/{mui-BKTsYfTF.js → mui-C1QW6JZj.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DuG_pESe.js → pathToGoBack-B3yM30We.js} +1 -1
  73. package/dist/assets/{pdf-DKctSUPl.js → pdf-BjMhzBkq.js} +3 -3
  74. package/dist/assets/{pdf-lib-CFnSeXgz.js → pdf-lib-ChLV9-qh.js} +1 -1
  75. package/dist/assets/{plaid-BDw9fPCd.js → plaid-Btr1WMcy.js} +1 -1
  76. package/dist/assets/{pusher-C3OEsBE6.js → pusher-C82_OYc8.js} +1 -1
  77. package/dist/assets/{react-CyKriL-x.js → react-B2EFc6Nk.js} +1 -1
  78. package/dist/assets/{react-7DVU8bop.js → react-BWLkzb7Z.js} +1 -1
  79. package/dist/assets/{react-DX8ScWZU.js → react-CZ-gbHck.js} +1 -1
  80. package/dist/assets/{react-D6FwTuSW.js → react-Cudadujm.js} +1 -1
  81. package/dist/assets/{react-CJKpxSUM.js → react-MEPzxjnZ.js} +1 -1
  82. package/dist/assets/{react-w6DB2NS-.js → react-u8A54l_f.js} +1 -1
  83. package/dist/assets/{recharts-DDgm0ZY-.js → recharts-B4GkUz8L.js} +1 -1
  84. package/dist/assets/{routePaths-B0cKaBRs.js → routePaths-B7Yr12_-.js} +1 -1
  85. package/dist/assets/{sentry-8NyHUHYi.js → sentry-DmfLAvfK.js} +1 -1
  86. package/dist/assets/{url-Ch2k8kvj.js → url-C63pXd6b.js} +1 -1
  87. package/dist/assets/{url-KL9dl4eL.js → url-CjWTLNKA.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-CTWpW1MX.js +1 -0
  89. package/dist/assets/{useDeviceId-EvuyeVv7.js → useDeviceId-Di7uPlIl.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-ByxTwA6y.js +1 -0
  91. package/dist/assets/useInitialThreadRequest-DaVChqBu.js +1 -0
  92. package/dist/assets/{utils-BgDKBMSG.js → utils-BcpleYA-.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-6cjScU30.js → withTransactionSidePanel-CMPj9oDd.js} +2 -2
  94. package/dist/assets/zeni-epic-state-BP0hdV_v.js +14 -0
  95. package/dist/index.html +1 -1
  96. package/package.json +4 -4
  97. package/dist/assets/AddressRoutes-D6nIfQbe.js +0 -1
  98. package/dist/assets/AddressScreen-DYnlXA96.js +0 -9
  99. package/dist/assets/AiCfoScreen-DLuzOCqz.js +0 -11
  100. package/dist/assets/BillPayApprovalRoutes-CnE6-lp5.js +0 -1
  101. package/dist/assets/ChargeCardRoutes-2pujTgd3.js +0 -71
  102. package/dist/assets/CompanyPassportScreen-Cp__RuCu.js +0 -1
  103. package/dist/assets/ConnectionAuthScreen-DJYYskXU.js +0 -11
  104. package/dist/assets/CustomerOnboardingAuthScreen-Br1a45jj.js +0 -1
  105. package/dist/assets/DefaultTenantHome-DzJfMkOX.js +0 -1
  106. package/dist/assets/DomesticWireDetailScreen-4peFfKhl.js +0 -18
  107. package/dist/assets/DrawerScreen-BgL5v4H9.js +0 -1
  108. package/dist/assets/EntityDetailRoutes-UwPBeiZX.js +0 -1
  109. package/dist/assets/ExpenseAutomationRoutes-CseMz6AM.js +0 -25
  110. package/dist/assets/FeaturePreviewScreen-BO0xA8LU.js +0 -1
  111. package/dist/assets/MagicLinkRoutes-DgypaK7T.js +0 -72
  112. package/dist/assets/MagicLinkSignInScreen-CFu0Bjd3.js +0 -12
  113. package/dist/assets/MobileAppDrawer-dqAF6Rs-.js +0 -1
  114. package/dist/assets/NotFoundScreen-C1QW9enP.js +0 -1
  115. package/dist/assets/OAuthConsentScreen-lFH3qoNG.js +0 -1
  116. package/dist/assets/PandLWithForecastRoutes-Dbo1RP7Z.js +0 -1
  117. package/dist/assets/PeopleRoutes-DePi7D94.js +0 -22
  118. package/dist/assets/PerformanceRoutes-UWg9SMVf.js +0 -1
  119. package/dist/assets/ReferralListScreen-FQY6X6o6.js +0 -5
  120. package/dist/assets/ReimbursementApprovalRoutes-WR5eQMC3.js +0 -1
  121. package/dist/assets/ReimbursementApprovalRuleDetailScreen-Wcmde2Ow.js +0 -1
  122. package/dist/assets/ReportsRoutes-CiMHKwm5.js +0 -1
  123. package/dist/assets/RewardsRoutes-DWvoC1NH.js +0 -1
  124. package/dist/assets/ScreenRoutes-sleVcoq1.js +0 -2
  125. package/dist/assets/SignOutScreen-CPL-0JMJ.js +0 -9
  126. package/dist/assets/TaskListScreen-BqvuuEM9.js +0 -9
  127. package/dist/assets/TaskRoutes-BuCulDep.js +0 -9
  128. package/dist/assets/TransactionDetailRoutes-DgBRqLEY.js +0 -1
  129. package/dist/assets/TransactionDetailScreen-CT-HL5f8.js +0 -5
  130. package/dist/assets/TransactionListRoutes--4ofJMv3.js +0 -1
  131. package/dist/assets/WiseConfirmationScreen-ChwCryrH.js +0 -12
  132. package/dist/assets/ZeniAccountStatementScreen-nV69VGVr.js +0 -9
  133. package/dist/assets/empty-BOUM9tFw.js +0 -1
  134. package/dist/assets/epic-CWSv6htf.js +0 -2
  135. package/dist/assets/getLocaleForTenant-4dWo_3TV.js +0 -1
  136. package/dist/assets/index-CAPfyPqh.js +0 -2
  137. package/dist/assets/index-qc05mnSq.js +0 -1
  138. package/dist/assets/index-vkGyITuL.js +0 -1
  139. package/dist/assets/useAskAiCfoHostNavButtonProps-DiMxdW9u.js +0 -1
  140. package/dist/assets/useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js +0 -1
  141. package/dist/assets/useInitialThreadRequest-CXIwH-0N.js +0 -1
  142. package/dist/assets/zeni-epic-state-CrPv4S-z.js +0 -13
@@ -1,25 +0,0 @@
1
- import{j as C}from"./liveblocks-DuKOLlGn.js";import xn from"./NotFoundScreen-C1QW9enP.js";import{a,b as Tt}from"./sentry-8NyHUHYi.js";import{n as Fe,S as Rn}from"./mui-BKTsYfTF.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as ze}from"./core-Chn6k0lm.js";import{eO as Re,P5 as Fn,mw as Se,fe as Bn,q7 as _n,mO as xt,n7 as Rt,P6 as Dt,nh as Vn,P7 as Ut,mH as Mn,pF as On,eZ as pe,P8 as De,s6 as Ft,Bh as Bt,P9 as _t,Pa as jn,pk as Je,KP as dt,KR as zn,ju as Ln,KS as $n,jB as qn,cV as Gn,t9 as Ne,mU as Vt,nm as Ue,Pb as Jn,JI as ut,JH as Te,Pc as mt,jS as Nn,Pd as Kn,Pe as Yn,Pf as Hn,Pg as Xn,m$ as Qn,mM as ie,np as we,Ph as Wn,Pi as Zn,Pj as ea,nw as ta,jF as na,jw as aa,Pk as oa,jE as ht,KZ as sa,Pl as ca,Pm as ia,pg as la,oX as ra,nn as ge,oW as Le,Pn as da,Po as ua,l9 as ma,bq as ha,l4 as pt,kS as pa,Pp as ga,gD as gt,fQ as Ca,l1 as Sa,v2 as Ia,Pq as fa,nX as ka,nS as Ea,nW as va,nH as ya,Pr as Pa,f0 as Mt,na as ba,mX as Aa,ff as Ct,nr as Ta,Ps as wa,no as Ot,Pt as xa,Pu as Ra,Pv as Da,Pw as Ua,Px as St,ps as Fa,oN as Ba,JG as _a,jD as Va,Py as Ma,FP as Oa,jC as ja,jr as za,e$ as La,om as jt,oF as $a,nl as It,nq as qa,bD as Ga,k_ as Ja,kX as Na,Pz as Ka,nG as ft,oD as kt,oB as Ya,or as Ha,o6 as Xa,oE as Qa,PA as Wa,PB as Za,oa as eo,PC as to,o0 as no,o9 as ao,o7 as oo,oI as so}from"./zeni-epic-state-CrPv4S-z.js";import{C as zt,$ as Ce,c as z,s as X,U as Lt,cx as co,z as Be,cy as io,aq as xe,cz as lo,aQ as Et,B as $t,cA as ro,an as $e,D as uo,cB as mo,X as ho,cC as po,R as go,cD as Co,cE as So,H as Io,I as fo,aK as ko,b2 as Eo,A as vo,cF as yo}from"./index-BE6noM1i.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import{c as vt,C as Po}from"./TransactionDetailScreen-CT-HL5f8.js";import{w as bo}from"./withTransactionSidePanel-6cjScU30.js";import{h as Ao,v as To}from"./routePaths-B0cKaBRs.js";import{g as qe}from"./accountMappingHelper-CbeIjSvu.js";import{D as wo}from"./DrawerScreen-BgL5v4H9.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./decodeURIComponentSafe-B4WuQ5yM.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]="44dc11ae-6424-4df8-a03b-6fa42f41c7d7",t._sentryDebugIdIdentifier="sentry-dbid-44dc11ae-6424-4df8-a03b-6fa42f41c7d7")}catch{}})();const xo=()=>{const t=ce(),i=wt(),b=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=zt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,Y=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:Y}))},[]),y=a.useCallback(d=>{const R=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.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=X(b.state?.pathnameStackToGoBack,b.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.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}=Lt();return Gt({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(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=b.state?.referrer;z.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]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=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
- `,Do=Tt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:b,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=ce(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,A=(e,n)=>{g(On(e,n.split(".")[0]))},I=e=>{h!=null&&g(Mn({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Vn({accountId:i,selectedPeriod:y,payload:e}))},Y=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),O=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(io,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:y,onDismissClick:b,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:A,onDeleteFile:I,onSelectSourceType:Y,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(lo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:O})})}):null}),yt=Fe.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,Pt=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 Uo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:b,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>jn(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(ro,{onCloseClick:i,addCustomerRequest:b,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Bo,comma:bt,space:_o}},dateFormat:Jt}=uo.getLocalizedStrings(),At=so,Vo=Dn(function(t,i){const{uncategorizedAccounts:b,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=pe(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:b,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:b,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:A}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:Y}=S.jeSchedules,te=Vt(I),O=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{b.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(I.month,I.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const P=()=>t(St(e,n,{fetchState:"Error"}));po(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(T=>{T!=null?t(Fa(e,T)):P()}).catch(P)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=X(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Se({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Da(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+Bo+l+bt:bt}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&O!=null&&t(Ot({start:O,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(eo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Za())},onSetBulkUploadResultsTab:e=>{t(Wa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Qa(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Xa())},onSearchTransactionsForManualMatch:(e,n)=>{t(At(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(At(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ha(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ya())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Le({selectedTab:s,uiState:{searchString:e}})),_!=null&&O!=null&&t(ge(s,{start:O,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Ta(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Aa(e))},onSaveReconciliationReview:e=>{t(ba(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=X(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=X(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=qe(Y.prepaidExpensesAccountList,s.selectedOptions),P=qe(Y.fixedAssetsAccountList,l.selectedOptions),T=qe(Y.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:P.map(w=>w.accountId),selectedAccruedExpensesAccountIds:T.map(w=>w.accountId)};t(Pa({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:P}=n,{allAccountList:T,allClassList:V,allDepreciationAccountList:w}=S.jeSchedules,$=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find(q=>q.id===P?.selectedOption):void 0,Ie={id:$?.zeniId??P?.selectedOption??"",name:$?.name??P?.defaultOptions.find(q=>q.value===P?.selectedOption)?.label??"",logo:$?.logo},fe=p?.selectedOption!=null?T.find(q=>q.qboId===p.selectedOption):void 0,ke=k?.selectedOption!=null?V.find(q=>q.classId===k.selectedOption):void 0,ne=l?.selectedOption!=null?w.find(q=>q.qboId===l.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:fe?.accountId,updatedClassId:ke?.classId,updatedAccumulatedDepreciationCategoryID:ne?.accountId,updatedVendor:{id:Ie.id,name:Ie.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Te("common"))},onCancelAutoComplete:()=>{t(Te("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,s)=>{t(Ia({selectedJEScheduleKey:n}));const l=X(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:A,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({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}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=X(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,P,T,V,w,$)=>{t(ua(e,n,s,l,y,k,p,P,T,V,w,$,f))},onCancelAutoComplete:()=>{t(Te("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&O!=null&&(t(ge(e,{start:O,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n})),_!=null&&O!=null&&t(ge(e,{start:O,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,P)=>{_!=null&&O!=null&&t(ge(e,{start:O,end:_},!0,s,n,l,k,p,P))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,P,T)=>{t(ra(e,n,s,l,T??null,k,p,!1,P))},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"?z.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):z.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(la(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,P)=>{const{transactionId:T,transaction:V,lineIds:w}=n;p!=null&&t(sa({transactionId:T,customerUpdates:p})),t(ca({selectedTab:l,transactionId:T.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:P})),k!=null&&t(Ne(k,e,n,s,!0,E,P))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,P)=>{const{transactionId:T,transaction:V,lineIds:w}=n;p!=null&&(t(na({transactionId:T,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(aa({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:T.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:P})),k!=null&&t(Ne(k,e,n,s,!0,E,P))):t(oa({selectedTab:l,transactionId:T.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{z.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(ta(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Zn({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=To(e.id,e.qboId,i.tenantEmailDomain),s=X(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Wn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ie(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(ie(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Qn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Xn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Yn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Nn(l)),t(Kn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,Je("bill"));const n=X(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(Te("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,b)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=b;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(mo),Mo=bo(function(t){const i=t.displayName??t.name??"Component",b=Tt.memo(t),f=E=>{const g=ce(),u=function(){const A=ce(),I=U(d=>pe(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{A(De({selectedDrawerAccountId:d}))},[A]),closePanel:a.useCallback(()=>{A(De({selectedDrawerAccountId:void 0}))},[A])}}(),o=U(A=>pe(A).reconciliation),v=U(A=>Re(A)),S=a.useCallback((A,I)=>{g(Ft("expense_automation_reconcile",A,I))},[g]),m=a.useCallback((A,I)=>{const d=v?.companyId;d!=null&&(g(Bt(A,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 C.jsx(Do,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(b,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:b,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=go(),m=Co(),{isOpen:y}=So(),r=wt(),B=Ge(),h=ce(),{isAiCfoAccessEnabled:A,onAskAiCfoClick:I}=qt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=Lt(),Y=(()=>{const c=U(G=>pe(G)),j=Ge(),{currentSelectedViewFetchState:K,currentSelectedView:M,selectedPeriod:F}=c,he=$e(M),Z=$e(K.fetchState),Pe=a.useCallback(G=>{const H=j.state?.referrer;M==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,G,H??null):z.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,G,H??null)),M==="missing_receipts"&&z.trackMissingReceiptsPage(F.month,F.year,G,c.missingReceipts.transactions.length,H??null),M==="je_schedules"&&z.trackMonthCloseScheduleListPage(F.month,F.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,H??null),M==="flux_analysis"&&z.trackFluxAnalysisPage(F.month,F.year,G,Fo(c.fluxAnalysis),H??null),M==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(F.month,F.year,G,"draft",c.auditSummary.auditScorePercentage,null,H??null)},[F,c]);return a.useEffect(()=>{Z===K.fetchState&&M===he||K.fetchState!=="Completed"||Pe(!1)},[M,K.fetchState,he]),Pe})(),te=Io(),[O,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[P,T]=a.useState([]),[V,w]=a.useState(void 0),$=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),Ie=a.useCallback(()=>{m(),w(void 0),d(),I()},[d,I,m]),fe=a.useRef(v);a.useEffect(()=>{v===!0&&fe.current===!1&&(m(),w(void 0),d()),fe.current=v},[d,v,m]);const ke=a.useRef(y);a.useEffect(()=>{y===!0&&ke.current===!1&&(v&&S(!1),w(void 0),E===!0&&f!==!0&&t?.()),ke.current=y},[t,y,v,S,f,E]);const ne=E===!0&&f!==!0,q=a.useRef(ne);a.useEffect(()=>{ne&&!q.current&&(v&&S(!1),m(),w(void 0)),q.current=ne},[v,ne,m,S]);const[Ke,Nt]=a.useState(!1),Ye=a.useRef(!1),{selectedTab:He}=rt(),{tenantEmailDomain:Kt}=rt(),[_e,Xe]=a.useState(B.state?.message==="comingFromTransactionDetail"),Qe=B.state?.message==="comingFromOverview",Yt=fo(),Ve=Be.getSignedInUser(),{useDynamicConfig:Ht,useFeatureGate:Ee}=zt(),{configValue:Xt}=Ht(ko.enableUncategorizedExpenseCategory),Q=Xt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=Ee(Ce.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:le}=Ee(Ce.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Ze}=Ee(Ce.isTransactionActivityEnabled),{isFeatureEnabled:Qt}=Ee(Ce.isExpenseAutomationCommentingEnabled),Wt=a.useCallback(c=>{const j=Je(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),Zt=U(c=>_a(c,"common")),L=U(c=>pe(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ae,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:W,jeSchedules:Me,reconciliation:tn}=L;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||$(void 0)},[x,$,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==ae&&(ve.current=ae,x==="transaction_categorization"&&$(void 0)):ve.current=ae},[x,ae,$]);const nn=U(c=>V==null?void 0:Va(c.transactionState,V)),oe=nn?.qboId,an=U(c=>oe==null?void 0:Ma(c,oe));a.useEffect(()=>{oe!=null&&h(Oa(oe))},[h,oe]);const{selectedAccountId:re}=tn,et=$e(Me.accountSettingsView.saveState.fetchState),on=U(c=>ja(c.accountState,c.accountListState,"accountList")),sn=U(c=>za(c)),de=He!=null?La(He):x,cn=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ue=Ue(tt.start),me=Ue(tt.end);if(ue==null||me==null)throw Error(`Invalid start - ${ue} and end - ${me} period from given ${D}`);const ln=a.useCallback(()=>{l(!1)},[]),rn=a.useCallback(()=>{p(!0)},[]),dn=a.useCallback(c=>{T(c),p(!1)},[]),un=a.useCallback(()=>{T([])},[]),ye=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{le===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[le,x,ye,nt,h]);const at=Ve?.userId,mn=D.month,hn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&le!==!1&&ye==="idle"&&at!=null&&ot!=null&&h($a())},[x,le,ye,at,ot,mn,hn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{de!=null&&x!==de&&h(Mt(de))},[de]),a.useEffect(()=>{Ke!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!R||(Nt(!0),h(It(!1,!1,Q)))},[Ke,W,R,Q]),a.useEffect(()=>{!Qe&&R&&(h(It(!1,!1,Q)),h(ie(D,re,!1,!1)))},[D.month,D.year,R,Q]);const st=a.useCallback((c=!1,j=!1)=>{const K={start:ue,end:me};switch(x){case"transaction_categorization":h(ge(ae,K,c,!_e,void 0,void 0,j,void 0,Q)),Xe(!1);break;case"flux_analysis":h(we(D,c,j,null));break;case"month_end_insights":if(j===!1){const M=new Date(D.year,D.month,0),F=Ga(M.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);h(Ja(!0,n.companyId,n.tenantId,F)),h(Na(n.companyId,n.tenantId))}break;case"je_schedules":h(qa(K,j));break;case"missing_receipts":h(Ot(K,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ie(D,re,c,j))}},[x,ue,me,n.companyId,n.tenantId,ae,D,re,_e,Xe,Q]);a.useEffect(()=>{x===de&&W.fetchState==="Not-Started"&&R&&st(!0)},[W,ue,me,n.companyId,n.tenantId,R]),a.useEffect(()=>{Qe||_e||Ye.current||en.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Ye.current=!0,st(!0,!0))},[]),a.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,n.tenantId]),a.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Ka({companyId:n.companyId})),r("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&re==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ie(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ie,re,D]);const pn=vt();a.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,N.monthEndCloseChecks]);const gn=u===!0?g:b,Cn=u===!0||E===!0,Sn=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:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:K})=>{const M=ce();let F,he,Z;const Pe=vt(),G=c.transactionView;let H=()=>{};const{transactions:vn,selectedTransactionId:se,selectedTransactionLineId:be,transactionLocalData:yn}=G;if(K==="transaction_categorization"){const Oe=yn.find(ee=>ee.transactionId===se),J=vn.find(ee=>ee.id===se),it=be!=null?Oe?.transactionReviewLocalData?.lineItemById[be]:void 0,lt=it?.account;he=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const bn=Ao(se,J?.typeOfTransaction);J!=null&&bn&&(Z={id:se,type:Je(J.typeOfTransaction)}),H=()=>{if(se!=null&&be!=null&&J!=null){const ee=G.transactionLocalData.find(Ae=>Ae.transactionId===se)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const Ae=ee.lineItemById[be];let je=ee.selectedEntity;if(Gn(J)||(je=Ae.selectedEntityLine),je!=null){const An=je,Tn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(wn=>wn.id)??[]};M(Ne(An,Ae.amount.amount,Tn,!1,!0,Pe))}}}}}const Pn=U(Oe=>dt(Oe,void 0,F,he));return{transactionId:Z,onSaveVendor:()=>{M(qn(Z,void 0,!1,!0))},onSaveSuccess:H,onCancel:()=>{Z!=null&&M(zn({transactionId:Z})),M(Ln()),M($n()),j()},vendorViewDetails:Pn}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Yt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(Eo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(wo,{isOpen:k,drawerLeftMargin:new vo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Oo,{onClick:c=>c.stopPropagation(),children:C.jsx(Uo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&O&&C.jsx(Po,{isOpen:O,transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}),C.jsx(Vo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:Zt},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:le,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:P,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:Q,isAccountingClassesEnabled:sn,isCOTEnabled:pn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Ze,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Ze===!0&&V!=null?C.jsx(yo,{activityLogView:an,qboId:oe,onClose:()=>$(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:on,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Kt,trackExpenseAutomationTabAnalytics:Y,setActivityLogTransactionId:$,closeSidePanel:Sn,openTransactionPanel:i,sidePanelIsOpen:Cn,sidePanelIsFullView:u!==!0&&f,panelContent:gn,isAiCfoAccessEnabled:A,onAskAiCfoClick:Ie,isExpenseAutomationCommentingEnabled:Qt,onExpenseAutomationCommentingThreadClick:Wt,sidePanelListPercent:u===!0?66:void 0})]})})),Oo=Fe(Rn)`
22
- display: flex;
23
- min-height: 100%;
24
- flex-direction: column;
25
- `;function rs(){return C.jsxs(Un,{children:[C.jsx(ze,{path:"*",element:C.jsx(xo,{})}),C.jsx(ze,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Mo,{})}),C.jsx(ze,{path:"*",element:C.jsx(xn,{})})]})}export{rs as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DuKOLlGn.js";import{a as r}from"./sentry-8NyHUHYi.js";import{Y as i,_ as l,a0 as p,p as d}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import m from"./NotFoundScreen-C1QW9enP.js";import{j as u,u as b}from"./core-Chn6k0lm.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]="6cc6e893-8e4c-439b-a6ff-557044a4a5fa",e._sentryDebugIdIdentifier="sentry-dbid-6cc6e893-8e4c-439b-a6ff-557044a4a5fa")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
@@ -1,72 +0,0 @@
1
- import{j as a}from"./liveblocks-DuKOLlGn.js";import{l as y,k as x,j as C,u as S,h as ee,q as ae,g as E,N as te,n as ne,o as p}from"./core-Chn6k0lm.js";import{IP as k,IQ as v,IR as F,yU as B,yG as G,IS as D,IT as oe,IU as se,yK as ie,eP as j,yR as le,yO as re}from"./zeni-epic-state-CrPv4S-z.js";import{Z as g,d as r,n as de,c as I,i as H,E as ce,p as me,q as pe,s as K,C as ue,$ as he,v as xe,H as ge,m as fe,w as we,B as be,x as ye,k as Se,S as ke,y as ve,A as Ie,T as je}from"./index-BE6noM1i.js";import{n as m}from"./mui-BKTsYfTF.js";import f from"./NotFoundScreen-C1QW9enP.js";import{a as $}from"./sentry-8NyHUHYi.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="936b5834-35f7-410c-a898-6daea56dc0af",e._sentryDebugIdIdentifier="sentry-dbid-936b5834-35f7-410c-a898-6daea56dc0af")}catch{}})();const $e=m.div`
2
- display: flex;
3
- height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,Ce=x(function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{I.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(F({data:l}))}}})(de);function T(){const e=g(),{vendorId:t,billId:n}=y();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx($e,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const Be=m.div`
11
- display: flex;
12
- height: 100vh;
13
- width: 100%;
14
- flex: 1 1 auto;
15
- flex-direction: column;
16
- align-items: center;
17
- background-color: ${e=>e.theme.colors.grey4};
18
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,De=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:D(e),googleAPIKey:H.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function Ae({isSubPage:e}){const t=C(),n=S(),o=g();return a.jsx(a.Fragment,{children:a.jsx(Be,{windowSize:o,children:a.jsx(De,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:H.googleMapsAPIKey})})})}const Pe=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
20
- display: flex;
21
- height: 100%;
22
- width: 100%;
23
- flex: 1 1 auto;
24
- flex-direction: column;
25
- align-items: center;
26
- background-color: ${e=>e.theme.colors.grey4};
27
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=x(function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{I.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(F({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=K(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),t=S(),n=g(),{vendorId:o,billId:s}=y();return o==null||s==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Le,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:s})})})}const Te=m.div`
29
- display: flex;
30
- height: 100%;
31
- width: 100%;
32
- flex: 1 1 auto;
33
- flex-direction: column;
34
- align-items: center;
35
- background-color: ${e=>e.theme.colors.grey4};
36
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Fe=x(function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{I.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=K(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),t=S(),n=g(),{vendorId:o,billId:s}=y(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(f,{}):a.jsx(Te,{windowSize:n,children:a.jsx(Fe,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const He={containerWidth:new Ie(100,58)},Ke=m(ke)`
38
- width: ${r.sp4};
39
- height: ${r.sp4};
40
- margin-bottom: ${r.sp3};
41
- margin-top: ${r.sp3};
42
- margin-left: ${r.sp8};
43
- cursor: pointer;
44
- position: absolute;
45
- color: ${e=>e.theme.colors.brandColorJade};
46
- `,Me=m.div`
47
- display: flex;
48
- height: 100vh;
49
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
- width: 100vw;
51
- overflow-y: scroll;
52
- background-color: ${e=>e.theme.colors.grey4};
53
- `,Ue=m.div`
54
- display: flex;
55
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
- flex-direction: column;
57
- width: ${e=>`${He.containerWidth.value(e.windowSize)}%`};
58
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
- padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,Ve=m.div`
62
- display: flex;
63
- flex-direction: column;
64
- align-items: center;
65
- justify-content: center;
66
- padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
- height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
- overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
- width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
- background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
- margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,_e=x(function(e,t){return{file:t.file,type:t.type}})(ve);function h({appContent:e}){const t=ee(),n=S(),{tenantEmailDomain:o,vendorId:s,billId:l}=y(),[i]=ae(),d=i.get("token"),M=n.pathname.includes("address"),w=g(),U=ge(),A=fe(),b=we(),V=()=>{U.toggle()},_=E(u=>k(u)),W=E(u=>v(u)),{authParams:q,fetchState:c,billAttachment:J,billFetchState:P,companyName:O,currencySymbol:Q,amount:R}=_,{tenantId:z,userId:L,sessionId:N}=q,{fetchState:Z,internationalBankAccountCreateStatus:X}=W;return $.useEffect(()=>{j()},[]),$.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&t(le(s,o,d))},[b,c,s,o,d,t]),$.useEffect(()=>{b&&c==="Completed"&&(j(L,N,z),l!=null&&t(re(l)))},[c,b,L,N,z,l,t]),c==="Error"?a.jsx(f,{}):Z==="Completed"||X.fetchState==="Completed"?(j(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&P==="Completed"&&a.jsx(ye,{analytics:I,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",s??"",O,l??"",We(n.pathname),Q,R))(u)}),a.jsxs(Me,{windowSize:w,children:[w!=="small"?a.jsx(Ke,{onClick:V}):null,a.jsx(Ve,{windowSize:w,isAddressPage:M,children:P==="In-Progress"?a.jsx(Se,{size:"ExtraLarge",start:!0}):a.jsx(_e,{file:J,type:"bill"})}),a.jsx(Ue,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function qe(){return a.jsx(je,{})}function da(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(qe,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(T,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(T,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Ae,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Ge,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{da as default};
@@ -1,12 +0,0 @@
1
- import{j as u}from"./liveblocks-DuKOLlGn.js";import{a as g}from"./sentry-8NyHUHYi.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-Chn6k0lm.js";import{z as r,m as P,D as A,e as V,c as N,f as q,j as B,k as G,h as H}from"./index-BE6noM1i.js";import{eO as K,IA as R,IK as W,IB as $,eP as J,fi as Q,IG as X,fH as Y,cT as Z,IL as ee,IM as te}from"./zeni-epic-state-CrPv4S-z.js";import{n as ne}from"./mui-BKTsYfTF.js";import{u as se}from"./useDeviceId-EvuyeVv7.js";import{f as ie}from"./analyticsHelper-CSr8UgAP.js";import{t as ae}from"./getLocaleForTenant-4dWo_3TV.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="e1e28fd9-dd84-4900-b96c-9ec863bb9da4",t._sentryDebugIdIdentifier="sentry-dbid-e1e28fd9-dd84-4900-b96c-9ec863bb9da4")}catch{}})();const D=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function De(){const t=O(),i=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>K(e)),b=l(e=>R(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&a!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(W(n,a,f)))},[n,p,t,a,f,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants($(b.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),A.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=H();e!=null&&V(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,i.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),U=g.useCallback(()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))},[a,d,t,c]),F=g.useCallback(e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))},[a,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(B,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:U,onVerifyOtp:F,onCancelVerifyDevice:j});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return u.jsx(T,{to:e,state:{...i.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(G,{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{De as default};
@@ -1 +0,0 @@
1
- import{j as V}from"./liveblocks-DuKOLlGn.js";import{a as c}from"./sentry-8NyHUHYi.js";import{h as be,g as s,l as qe,u as Je,j as Ke,i as M}from"./core-Chn6k0lm.js";import{eO as he,eV as ea,eW as Se,eQ as aa,bn as ta,f3 as na,eX as sa,eY as oa,e_ as ia,f1 as ra,fb as da,f2 as g,f5 as la,f6 as ue,f9 as ca,f7 as ua,f8 as fa,fa as ma,cI as pa,fd as ba,cO as ha,bv as Sa,eN as ga,fi as Ea,fj as ka,fh as Ca}from"./zeni-epic-state-CrPv4S-z.js";import{a3 as Ia,a4 as ya,H as Ta,C as wa,z as k,a5 as _a,R as Aa,w as Fa,u as Da,$ as r,a6 as va,a7 as $a,I as Ba,a as Ga,a8 as xa,Y as Ma,a9 as Pa,aa as Na,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,c as P,s as _,af as N,ag as Ua}from"./index-BE6noM1i.js";import{D as Ra}from"./mui-BKTsYfTF.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="6f52100a-19cd-4f02-85c8-e8a3a72e5a9f",f._sentryDebugIdIdentifier="sentry-dbid-6f52100a-19cd-4f02-85c8-e8a3a72e5a9f")}catch{}})();const ja=Ia(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=qe(),t=Je(),C=Ta(),o=Ke(),O=aa(),m=be(),{useFeatureGate:i}=wa(),U=k.getSignedInUser(),A=ta(U),n=s(e=>he(e)),ge=_a(),Ee=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:ke}=Aa(),R=s(e=>na(e)),j=R.uiState.currentChatSessionId,I=Fa(),{setLoading:Ce}=Da(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,Y=M("/:tenantEmailDomain/reports")!==null,y=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),ye=va(n,Ie,H),{isFeatureEnabled:Te}=i(r.isSettingsFeatureEnabled),W=s(e=>sa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>oa(e));c.useEffect(()=>{I&&T&&!y&&v.fetchState==="Not-Started"&&m(ia(!0))},[I,T,v.fetchState,y]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?ra(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:_e}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ae}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Z}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Q}=i(r.isExpenseAutomationEnabledV2),X=Q||Z&&A,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Be}=i(r.isTreasuryEnabled),{isFeatureEnabled:Ge}=i(r.isTaskManagerCustomerUserAccessEnabled),xe=A||!A&&Ge,Me=n.company!=null&&da(n.company),w=Be&&Me,Pe=s(e=>g(e).totalUnreadCount),Ne=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ve=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Oe}=$a();c.useEffect(()=>{const e=setTimeout(()=>Oe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{I&&!y&&Ve.fetchState==="Not-Started"&&O.tenantId!=null&&m(la("task_manager","dashboard"))},[I,O.tenantId]),c.useEffect(()=>{y||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Ne,count:Pe},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ca(e,ne.tenantId):void 0),S=[];_e===!1&&S.push("accounts_payable_aging"),Ae===!1&&S.push("accounts_receivable_aging"),z===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),X===!1&&S.push("expense_automation_card");const Re=Ba(),oe=s(e=>ua(e,S,h,Q,Z,w).fetchState),ie=s(e=>fa(e).fetchState),je=D&&(oe==="Completed"||oe==="Error")||Y&&(ie==="Completed"||ie==="Error")||!D&&!Y?void 0:"disabled",Le=c.useMemo(()=>ma(n.userRole),[n.userRole]),Ye=pa(Le),ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&W.fetchState==="Completed"&&ba(W.notificationSettings,h.userEmail,H,n),re=Ga(),We=re&&xa(t),de=ha(Re?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Ma(t.pathname)!=="treasury",[w,de,le,t.pathname,a]),[Ze,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Xe=Pa(Qe);return V.jsx(Ra,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Na,{signedInUser:U,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:je,isSettings:me(t),isSettingsFeatureEnabled:Te,isVendorsTabVisible:Ye,isZeniAccountEnabled:z,isChargeCardEnabled:ye,isTreasuryEnabled:w,treasuryYieldPercentage:Xe,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:He,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:X&&Sa(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=_(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const p=_(t.state?.pathnameStackToGoBack,t.pathname);return P.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),Ee?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}}):void(ge?ke(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=_(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&P.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Ua(e.type);pe(e.type)?(j!=null&&m(Ca()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{Ce(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Ea(e.tenantId)),m(ka(h.userId,e.tenantId,h.zeniSessionId)));const p=e;P.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:R,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ga({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:xe,thanksGivingAnimationEnabled:De,christmasAnimationEnabled:ve,newYearAnimationEnabled:$e})})}),Qa=f=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ya(o)&&ea(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(ja,{...f,...t})};export{Qa as M};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-DuKOLlGn.js";import{j as r,k as i}from"./core-Chn6k0lm.js";import{O as n}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import"./sentry-8NyHUHYi.js";import"./zeni-epic-state-CrPv4S-z.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="6abb37d2-952f-4fd9-932f-e89903f793e2",o._sentryDebugIdIdentifier="sentry-dbid-6abb37d2-952f-4fd9-932f-e89903f793e2")}catch{}})();const f=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(f,{navigate:o})}export{h as default};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-DuKOLlGn.js";import{a as r}from"./sentry-8NyHUHYi.js";import{h as A,u as j,g as o,N as C}from"./core-Chn6k0lm.js";import{IX as P,eO as x,f1 as z,IY as D,IZ as M,I_ as R,I$ as L,mm as k,HV as N}from"./zeni-epic-state-CrPv4S-z.js";import{z as h,K as g}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="a7602632-3630-4f6e-ba8a-b2da9be48031",n._sentryDebugIdIdentifier="sentry-dbid-a7602632-3630-4f6e-ba8a-b2da9be48031")}catch{}})();function ee(){const n=A(),a=j(),{params:t,error:i}=r.useMemo(()=>P(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),m=h.isSignedIn(),s=h.getSignedInUser(),p=o(e=>x(e)),l=o(e=>z(e)),d=o(e=>e.tenantState.fetchState),b=o(D),y=o(M),u=o(R),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const I=r.useRef(!1);r.useEffect(()=>{m&&s!=null&&!I.current&&(d!=="Not-Started"&&d!=="Error"||(I.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))},[m,s,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=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]),c=v??U;return i!=null?f.jsx(g,{variant:"invalid_params",paramsError:i}):m?f.jsx(g,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(N(s.userId,s.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(C,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-DuKOLlGn.js";import{j as Y,h as Z,u as z,l as K,g as d,k as H,n as Q,o as I}from"./core-Chn6k0lm.js";import{eO as O,qf as R,pP as X,Ju as v,pK as S,bv as ee,bn as ae,bS as te,pL as se,Jv as oe,Jg as C,dC as re,tC as ne,Jw as ie,tZ as ce,eU as le,eS as de}from"./zeni-epic-state-CrPv4S-z.js";import{z as me,U as fe,I as pe,C as w,$ as M,x as ue,c as $,al as he,s as ge}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import Fe from"./NotFoundScreen-C1QW9enP.js";import{F as be}from"./FeaturePreviewScreen-BO0xA8LU.js";import{a as g}from"./sentry-8NyHUHYi.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import{c as Ce}from"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import{u as Se}from"./useInitialThreadRequest-CXIwH-0N.js";import{t as Te}from"./routePaths-B0cKaBRs.js";import{M as ye}from"./MobileAppDrawer-dqAF6Rs-.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="31a9f78e-1de9-43d0-be16-10bc894e2276",s._sentryDebugIdIdentifier="sentry-dbid-31a9f78e-1de9-43d0-be16-10bc894e2276")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=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:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(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,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function U(){const s=Y(),e=Z(),a=z(),{forecastId:o,tenantEmailDomain:r}=K(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),q=y.company?.companyInfo.firstMonthOfFY??1,c=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),x=d(t=>t.reportUIOptionsState.selectedForecast),A=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Ce({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,E,P)=>E!=null?f.forecasts.findIndex(b=>b.id===E):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(c,o,x?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=x?.index?(e(v(c.forecasts[t].id,t)),T(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!A(c.forecasts[t].id)&&F&&e(S(c.forecasts[t].id))}},[i,p,e,l,c,m,u,R,S,F]);const D=pe(),_=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:G}=w(),{isFeatureEnabled:L}=G(M.isReportsCommentingEnabled),J=Se(L?y?.companyId:void 0,{clearParams:l&&m}),[V,W]=g.useState(!1),j=t=>{W(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:q,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:A,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:_,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:J,onClickMenuIcon:()=>{j(!0)}})]})}function Ye(){const s=d(i=>O(i)),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -1,22 +0,0 @@
1
- import{j as a}from"./liveblocks-DuKOLlGn.js";import{Jp as te,eO as Q,jr as H,eU as Y,eS as ne,GS as q,J3 as oe,sK as Ee,Jq as N,sy as ke,sT as Ie,sN as ie,sC as re,sR as Pe,sO as je,Jr as le,uo as Te,Js as Le,fx as ve,Jt as J,sH as de,sF as ce,sW as Fe,c1 as Oe}from"./zeni-epic-state-CrPv4S-z.js";import{Z as pe,C as X,$ as E,z as K,a6 as ue,F as me,ah as ge,ai as Re,A as he,d as R,J as fe,D as Ce,aj as Ae,U as Ve,x as Ue,c as be,f as Ze,s as Be,ak as $e,I as Je}from"./index-BE6noM1i.js";import{D as ye,n as M,S as we}from"./mui-BKTsYfTF.js";import se from"./NotFoundScreen-C1QW9enP.js";import{a as r}from"./sentry-8NyHUHYi.js";import{h as ee,l as Ge,g as m,j as ze,u as He,k as Ke,n as ae,o as $}from"./core-Chn6k0lm.js";import{u as Me}from"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import{c as We}from"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import{M as _e}from"./MobileAppDrawer-dqAF6Rs-.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="182954f3-6ff3-47db-ab84-995482f2aa58",s._sentryDebugIdIdentifier="sentry-dbid-182954f3-6ff3-47db-ab84-995482f2aa58")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},G=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[A,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=Ge(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>H(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Y(k,u),L=ne(u),v=q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{A===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:O}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:O===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(s):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),a.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:a.jsxs(Ye,{onClick:e=>e.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(Se,{children:G.discardTitle}),descriptionComponent:a.jsx(De,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:i,isEditPopup:!0}):null,a.jsx(Re,{...b})]})})},Ye=M(we)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,Se=M(fe.H6Regular)`
6
- margin-top: ${R.sp7};
7
- padding-left: ${R.sp8};
8
- padding-right: ${R.sp8};
9
- color: ${s=>s.theme.colors.primary};
10
- word-break: break-word;
11
- `,De=M(fe.LargeRegularSp)`
12
- color: ${s=>s.theme.colors.hero};
13
- padding-left: ${R.sp8};
14
- padding-right: ${R.sp8};
15
- margin-bottom: 30px;
16
- margin-top: ${R.sp4};
17
- white-space: pre-line;
18
- `,qe={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[A,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>Q(i)),u=m(i=>H(i)),{useFeatureGate:D}=X(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=Y(f,d),P=ne(d),L=q(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,Z=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{A===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},B=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:O}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(s):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:O===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:Z};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),a.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(es,{onClick:i=>i.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(Se,{children:z.discardTitle}),descriptionComponent:a.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:F}):null,a.jsx(Ae,{...b})]})})},es=M(we)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,ss=Ke(function(s,t){const l=le(s),n=K.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:H(s),analytics:be}},function(s,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{s(re(o,y))},onResendInvite:o=>{s(Fe(o))},onReloadPeople:()=>{s(de()),s(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{s(J({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{s(J({searchText:o}))}}}})($e);function _({isInvitePeopleDrawerOpen:s,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=He(),{areTenantIdsInSync:o}=Ve(),y=K.getSignedInUser(),h=m(e=>Q(e)),{useFeatureGate:p}=X(),{isFeatureEnabled:A}=p(E.isDebitCardFeatureEnabled),V=m(e=>H(e)),I=!Y(A,h)&&V,w=q(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[Z,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:B}=Me({mobileExploreReferrer:"People"}),c=m(e=>le(e));We({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),O=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(J({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(s!=null&&s===!0),L(t!=null&&t===!0&&t)},[s,t]),r.useEffect(()=>{n(J({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return a.jsxs(a.Fragment,{children:[c.fetchState==="Completed"?a.jsx(Ue,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?a.jsx(Xe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:O,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?a.jsx(Qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:O,classListView:j,companyId:b,mode:c.uiState.mode}):null,a.jsx(_e,{isAppContentDrawerOpen:Z,handleDrawerToggle:C}),a.jsx(ss,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(J({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=Be(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:B})]})}function Ss(){const s=Je();return Oe(s?.loggedInUserRole??[])?a.jsxs(ae,{children:[a.jsx($,{path:"/",element:a.jsx(_,{})}),a.jsx($,{path:"new",element:a.jsx(_,{isInvitePeopleDrawerOpen:!0})}),a.jsx($,{path:":userId/edit",element:a.jsx(_,{isEditPeopleDrawerOpen:!0})}),a.jsx($,{path:"*",element:a.jsx(se,{})})]}):a.jsx(ae,{children:a.jsx($,{path:"*",element:a.jsx(se,{})})})}export{Ss as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DuKOLlGn.js";import E from"./NotFoundScreen-C1QW9enP.js";import{a as r}from"./sentry-8NyHUHYi.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-Chn6k0lm.js";import{eO as B,P4 as b,bo as F,bn as N,h7 as V,gD as H}from"./zeni-epic-state-CrPv4S-z.js";import{H as $,z as I,cw as q}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import{c as J}from"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import{M as K}from"./MobileAppDrawer-dqAF6Rs-.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="73131d1c-f51e-4648-a817-a39c73f95fac",e._sentryDebugIdIdentifier="sentry-dbid-73131d1c-f51e-4648-a817-a39c73f95fac")}catch{}})();const L=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(q),Q=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,D=N(d),x=S||k||D,l=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(H({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const y=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
@@ -1,5 +0,0 @@
1
- import{j as s}from"./liveblocks-DuKOLlGn.js";import{a as o}from"./sentry-8NyHUHYi.js";import{g as f,j as H,h as V,u as W,k as _}from"./core-Chn6k0lm.js";import{m as U,Z as F,z as R,b4 as N,A as M,U as $,x as z,c as l,f as Y,a3 as Q,b5 as Z}from"./index-BE6noM1i.js";import{eY as q,eO as G,LU as P,LV as J,ts as K,ti as g,e_ as X,bN as ee,tn as ae,LW as re}from"./zeni-epic-state-CrPv4S-z.js";import{D as ne,e as te,n as se,S as oe}from"./mui-BKTsYfTF.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import{M as ce}from"./MobileAppDrawer-dqAF6Rs-.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]="83564544-a70e-44e8-a17f-6a0985f16c0c",e._sentryDebugIdIdentifier="sentry-dbid-83564544-a70e-44e8-a17f-6a0985f16c0c")}catch{}})();const de={overlayWidth:new M(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=U(),n=F();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(ne,{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(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,I="refer-and-earn-status-update",pe=_(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ee([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(re({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(ae(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(Z));function be({isReferralDrawerOpen:e}){const a=H(),r=V(),n=W(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,E]=o.useState(!1),[k,m]=o.useState(!1),p=R.getSignedInUser(),C=f(t=>G(t)),h=f(t=>P(t)),y=h.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=J([h,w]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(K()),E(!0))},[]),o.useEffect(()=>{!i&&y==="Not-Started"&&d&&(u(!0),r(g(!0)))},[y,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(x(!0),r(X(!0)))},[w,r,d]),o.useEffect(()=>{m(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),S=t=>{A(t)},{isAiCfoAccessEnabled:L,onAskAiCfoClick:T}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:v===!0});const O={events:p?.userId!=null?[`private-encrypted-${p.userId}.${I}`]:[],eventCallback:(t,b,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(z,{analytics:l,onLoad:t=>(b=>{p!=null&&b.trackPageLoaded(Y.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:S}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{m(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:L,onAskAiCfoClick:T,...O})]})}export{be as R};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-DuKOLlGn.js";import x from"./NotFoundScreen-C1QW9enP.js";import{a as p}from"./sentry-8NyHUHYi.js";import{j as C,u as I,h as A,g as u,N as E,k,n as D,o as c}from"./core-Chn6k0lm.js";import{eO as T,MO as b,N2 as S,Cp as V,By as N,Co as m,Cf as O,Nh as U}from"./zeni-epic-state-CrPv4S-z.js";import{m as _,z as B,B as $,a3 as W,bK as z,ac as K}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import{R as g}from"./ReimbursementApprovalRuleDetailScreen-Wcmde2Ow.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]="cea33806-e397-46a9-9f2d-2089a7fa6f82",e._sentryDebugIdIdentifier="sentry-dbid-cea33806-e397-46a9-9f2d-2089a7fa6f82")}catch{}})();const f="reimbursement-approval-rule-update",M=k(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(f)&&e(U(!1))},onBackClick:()=>{K(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(O(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})(W(z)),P=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[d,y]=p.useState(!1),h=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>T(n)),w=_(),i=u(n=>b(n)),v=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&a(V())},[v]),p.useEffect(()=>{l||h!=="Not-Started"||(s(!0),a(N(!0)))},[l,h,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(m())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${f}`]:[],eventCallback:(n,q,R)=>{n.endsWith(f)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{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(M,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(P,{})}),t.jsx(c,{path:"/new",element:t.jsx(g,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(g,{})}),t.jsx(c,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +0,0 @@
1
- import{j as g}from"./liveblocks-DuKOLlGn.js";import{a as y}from"./sentry-8NyHUHYi.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-Chn6k0lm.js";import{N2 as R,MO as E,Ci as x,Cr as _,Cp as S,Cq as h,N3 as B}from"./zeni-epic-state-CrPv4S-z.js";import{z as k,m as V,B as N,bB as O,ac as j}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.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]="33ed4f87-75cb-4bc0-9f0e-362234c77f6f",e._sentryDebugIdIdentifier="sentry-dbid-33ed4f87-75cb-4bc0-9f0e-362234c77f6f")}catch{}})();function F(e){return B(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const f=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const m=!!F(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=D.concat(I);f.push({action:u.stepType.selectedOption,actors:v,operator:v.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(O);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(N,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,F as i};
@@ -1 +0,0 @@
1
- import{j as p}from"./liveblocks-DuKOLlGn.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-Chn6k0lm.js";import{eO as L,f8 as S,J1 as Ie,jr as W,J2 as X,pJ as k,jf as Re,ii as Te,t6 as K,pO as Oe,bv as ke,J3 as Ae,bn as Fe,u5 as De,J4 as je,J5 as Ee,s_ as Pe,J6 as H,J7 as Le,J8 as Me,J9 as Be,Ja as Je,Jb as w,Jc as A,Jd as F,Je as Y,Jf as D,Jg as j,dC as ve,tN as Ue,tB as N,tC as $,tT as Ve,tG as q,tZ as xe,Jh as ze,Ji as Ge,Jj as He,Jk as Ye,Jl as Ne,eU as $e,eS as qe}from"./zeni-epic-state-CrPv4S-z.js";import{Q as Ze,R as Qe,Z as We,C as ee,$ as E,z as ae,U as Xe,I as Ke,a as ea,x as aa,c as P,f as sa,s as se,V as ta,W as oa,X as na}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import ra from"./NotFoundScreen-C1QW9enP.js";import{F as ia}from"./FeaturePreviewScreen-BO0xA8LU.js";import{a as _}from"./sentry-8NyHUHYi.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import{u as fa}from"./useInitialThreadRequest-CXIwH-0N.js";import{t as Z,a as Q}from"./routePaths-B0cKaBRs.js";import{M as ma}from"./MobileAppDrawer-dqAF6Rs-.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="27467195-26b8-47e9-9ffa-3961ec37c4a8",e._sentryDebugIdIdentifier="sentry-dbid-27467195-26b8-47e9-9ffa-3961ec37c4a8")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},ha=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=S(e),r=Ae(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:W(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=We(),u=oa(f),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:m}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=fa(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>W(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),O=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(k(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(k(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,v,T]);const U=Ke(),ce=U?.loggedInUserRole!=null&&ke(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},fe=ea(),me=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=Ze(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(ma,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:me&&fe&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=$e(f,e),a=qe(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-DuKOLlGn.js";import{C as j,z as w,aK as y,x as I,c as p,f as F,cG as P,$ as L}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import l from"./NotFoundScreen-C1QW9enP.js";import{a as u}from"./sentry-8NyHUHYi.js";import{h as T,g as x,j as V,u as A,k as R,n as U,o as f}from"./core-Chn6k0lm.js";import{eO as z,PD as C,Mt as G,PE as _,ts as O,e_ as Y,PF as q,tq as K}from"./zeni-epic-state-CrPv4S-z.js";import{R as b}from"./ReferralListScreen-FQY6X6o6.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import"./MobileAppDrawer-dqAF6Rs-.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]="a1f85e83-3092-4466-86b2-8eea56e867f6",e._sentryDebugIdIdentifier="sentry-dbid-a1f85e83-3092-4466-86b2-8eea56e867f6")}catch{}})();const M=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(_()),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)}e(K())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),$=()=>{const e=T(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=x(o=>z(o)),c=V(),D=A(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=x(o=>C(o)),k=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),N=G(v);u.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(O()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))},[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:c,location:D,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(b,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(b,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx($,{}):a.jsx(l,{})}),a.jsx(f,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DXOW97ga.js","assets/sentry-8NyHUHYi.js","assets/core-Chn6k0lm.js","assets/zeni-epic-state-CrPv4S-z.js","assets/index-BE6noM1i.js","assets/mui-BKTsYfTF.js","assets/analytics-CX30pJB4.js","assets/utils-BgDKBMSG.js","assets/withTransactionSidePanel-6cjScU30.js","assets/useAskAiCfoHostNavButtonProps-DiMxdW9u.js","assets/useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js","assets/TransactionDetailScreen-CT-HL5f8.js","assets/decodeURIComponentSafe-B4WuQ5yM.js","assets/routePaths-B0cKaBRs.js","assets/NotFoundScreen-C1QW9enP.js","assets/analyticsHelper-CSr8UgAP.js","assets/CompanyPassportScreen-Cp__RuCu.js","assets/MobileAppDrawer-dqAF6Rs-.js","assets/FeaturePreviewScreen-BO0xA8LU.js","assets/ReferralListScreen-FQY6X6o6.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-DeeO4ZWe.js","assets/AddressScreen-DYnlXA96.js","assets/DomesticWireDetailScreen-4peFfKhl.js","assets/useInitialThreadRequest-CXIwH-0N.js","assets/DrawerScreen-BgL5v4H9.js","assets/SetupPagesScreen-avoeACM0.js","assets/BusinessVerificationPageScreen-DmIGFdMu.js","assets/BillPayApprovalRoutes-CnE6-lp5.js","assets/ReimbursementApprovalRuleDetailScreen-Wcmde2Ow.js","assets/getLocaleForTenant-4dWo_3TV.js","assets/ReimbursementRoutes-uzEm2rRI.js","assets/ReimbursementApprovalRoutes-WR5eQMC3.js","assets/TransactionListRoutes--4ofJMv3.js","assets/ZeniAccountStatementScreen-nV69VGVr.js","assets/SettingsRoutes-CAtKFbAK.js","assets/accountMappingHelper-CbeIjSvu.js","assets/QBOConnectionScreen-BpQWEam6.js","assets/empty-CM7hXaA6.js","assets/index-Cyof-eFv.js","assets/url-KL9dl4eL.js","assets/index-vkGyITuL.js","assets/ReportsRoutes-CiMHKwm5.js","assets/ChargeCardRoutes-2pujTgd3.js","assets/PeopleRoutes-DePi7D94.js","assets/ExpenseAutomationRoutes-CseMz6AM.js","assets/TreasuryRoutes-CPRvFoSD.js","assets/VendorsRoutes-DRHG7hIp.js","assets/pathToGoBack-DuG_pESe.js","assets/ZeniAccountRoutes-IBscHJwI.js","assets/AddressRoutes-D6nIfQbe.js","assets/PandLWithForecastRoutes-Dbo1RP7Z.js","assets/CustomerOnboardingRoutes-C2MSnlp9.js","assets/TransactionDetailRoutes-DgBRqLEY.js","assets/EntityDetailRoutes-UwPBeiZX.js","assets/NotificationRoutes-rIbfH4Eq.js","assets/PerformanceRoutes-UWg9SMVf.js","assets/RewardsRoutes-DWvoC1NH.js","assets/TaskRoutes-BuCulDep.js","assets/TaskListScreen-BqvuuEM9.js","assets/AiCfoScreen-DLuzOCqz.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eO as ls,eU as cs,eS as ds,eT as ms,fD as us,eQ as _s,cP as Ee,cw as Es,f9 as As,co as ps,bD as Is,bq as gs,fe as xs,v as Ts,IB as hs,bv as js,IC as Us,bF as Ds,fb as Hs,bE as bs,bs as Rs,ck as ys,ID as fs,IE as Cs,cM as vs,cO as Os,cN as Ps,cv as Fs,cB as Ls,mm as Ae,eP as pe,fN as Bs,fi as Ie,fK as ge,fL as xe,fj as ks}from"./zeni-epic-state-CrPv4S-z.js";import{j as e}from"./liveblocks-DuKOLlGn.js";import{a as v}from"./sentry-8NyHUHYi.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-Chn6k0lm.js";import{m as ws,u as zs,z as H,C as $s,a as Gs,o as Ys,$ as L,I as qs,L as B,D as he,t as _,P as Ws,c as X,l}from"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import{f as je}from"./analyticsHelper-CSr8UgAP.js";import{t as Ks}from"./getLocaleForTenant-4dWo_3TV.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="728c31a7-27bc-4c6e-9d50-67ef7fd9a727",i._sentryDebugIdIdentifier="sentry-dbid-728c31a7-27bc-4c6e-9d50-67ef7fd9a727")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-DXOW97ga.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-DeeO4ZWe.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-uzEm2rRI.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes--4ofJMv3.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-CAtKFbAK.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-CiMHKwm5.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-2pujTgd3.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-DePi7D94.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CseMz6AM.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-CPRvFoSD.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-DRHG7hIp.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-IBscHJwI.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-CiMHKwm5.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-D6nIfQbe.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-DePi7D94.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-Dbo1RP7Z.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-C2MSnlp9.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-DRHG7hIp.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-DgBRqLEY.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-UwPBeiZX.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-DXOW97ga.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),De=l(()=>n(()=>import("./BillPayRoutes-DeeO4ZWe.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-CAtKFbAK.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),He=l(()=>n(()=>import("./ReimbursementRoutes-uzEm2rRI.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-IBscHJwI.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-CPRvFoSD.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes--4ofJMv3.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-2pujTgd3.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-rIbfH4Eq.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),En=l(()=>n(()=>import("./PerformanceRoutes-UWg9SMVf.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-CseMz6AM.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-DWvoC1NH.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-BuCulDep.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-DLuzOCqz.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-C1QW9enP.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-BqvuuEM9.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),R=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),K=os(h),$=Ms(),[N,Re]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=$s(),Q=Gs(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),A=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,G=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!G||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=H.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:R,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,J=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(J!=null&&R!=null){const a=J.params.selectedPeriod;if(a!=null){const D=a.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(R,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,R]),v.useEffect(()=>{N||(Re(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,D,d,s){if(pe(D?.userId,D?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=H.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,D,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=H.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(D==="Completed"||D==="Error");a==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,R,h,f,U))},[R,A]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&R!=null?(O(),_.markActiveTenantFetchCompleted(R)):A==="Error"&&R!=null&&(_.markActiveTenantFetchFailed(R),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,R,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Js,D=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))},D)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,$e=Us(E?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Ds(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Hs(r.company),qe=Pe&&Ye===!0&&!C,We=re&&bs(E?.loggedInUserRoleMap),Ke=oe&&Rs(E?.loggedInUserRoleMap),Qe=me&&ys(E?.loggedInUserRoleMap),Je=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),I=Os(E?.loggedInUserRoleMap),g=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||$e===!0||Je===!0||Xe===!0;return H.isSignedIn()?R==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&Ge===!1&&u===!1&&G===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||K?N&&r?.userRole&&u!=null&&G!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:G})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Qe||Ke?e.jsx(en,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(De,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(De,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(gn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):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:{...$.state,message:"...",origin:$.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,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"}):f?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"}),b=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Dn,{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(y,{}),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`}),Dn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),be=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{b as FallBackRoute,wn as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-DuKOLlGn.js";import{a as n}from"./sentry-8NyHUHYi.js";import{h as u,u as m,j as p,N as g}from"./core-Chn6k0lm.js";import{z as f,B as b,t as y,c,f as h}from"./index-BE6noM1i.js";import{fM as I,fN as x,IW as j}from"./zeni-epic-state-CrPv4S-z.js";import{n as w}from"./mui-BKTsYfTF.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="b354cbd7-0302-4a59-8b6f-5ca4fa80abae",e._sentryDebugIdIdentifier="sentry-dbid-b354cbd7-0302-4a59-8b6f-5ca4fa80abae")}catch{}})();function W(){const e=u(),t=m(),a=p(),i=n.useRef(!1),d=f.isSignedIn(),r=t.state?.message==="logout",o=r||d;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{f.clearAll(),e(I()),e(x(!1)),j(),y.reset(),c.trackLogout(h.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{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{W as default};
@@ -1,9 +0,0 @@
1
- import{j as p}from"./liveblocks-DuKOLlGn.js";import{a as g}from"./sentry-8NyHUHYi.js";import{j as _,h as z,u as O,g as b,l as M,k as Q}from"./core-Chn6k0lm.js";import{z as P,C as V,$ as d,x as W,c as Z,f as q,cJ as J,s as f,p as H}from"./index-BE6noM1i.js";import{eO as X,PK as R,Fy as E,PL as x,PG as Y,E_ as S,PM as aa,F2 as I,Ex as ea,Fz as B,PN as F,gD as ta,Fp as sa,Fu as oa,Fh as na,Ff as w,Fv as ia,Fc as la,PO as ra,PP as ca,PQ as ka,PR as ua,PS as m,ea as pa,PT as da,PU as ma}from"./zeni-epic-state-CrPv4S-z.js";import{n as Ta}from"./mui-BKTsYfTF.js";import{u as ga}from"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import{c as fa}from"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import{M as ha}from"./MobileAppDrawer-dqAF6Rs-.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="10e56675-a14b-4c62-80a5-227e647e7678",e._sentryDebugIdIdentifier="sentry-dbid-10e56675-a14b-4c62-80a5-227e647e7678")}catch{}})();const Da=Ta.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
- `,Ga=Q(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,i=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,u=Y(e),n=P.isZeniUser();return{taskListView:i,tagListView:u,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:c,location:i,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:n}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(n,a),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(E(!0,u))},onTabChange:a=>{e(ua(a))},onParentTaskClick:a=>{const s=L(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(n,t.localData.defaultTaskGroupId),s=f(i.state?.pathnameStackToGoBack,i.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(F({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ca({searchText:a}))},onReloadCards:()=>{e(E(!0,u))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const a=H(i.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(ra({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(la(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,ia(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(na(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(S({taskDetailLocalData:s}));const k=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),h=f(i.state?.pathnameStackToGoBack,i.pathname);o(k,{state:{pathnameStackToGoBack:h,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(oa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(sa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(ta(a))},onGroupByFilterChange:a=>{e(F({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ea(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...aa,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(J);function Ka(){const e=_(),t=z(),o=O(),c=P.getSignedInUser(),i=b(r=>X(r)),{taskGroupId:u}=M(),{useFeatureGate:n}=V(),{isFeatureEnabled:l}=n(d.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(d.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(d.isTaskCategorizationEnabled),{isFeatureEnabled:k}=n(d.isTaskBulkResolutionEnabled),{isFeatureEnabled:h}=n(d.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=n(d.isTaskRecurringParentEnabled),[y,$]=g.useState(!1),[N,j]=g.useState(!1),D=b(r=>R(r,l)),G=b(r=>r.taskGroupState),T=D.fetchState,{isAiCfoAccessEnabled:v,onAskAiCfoClick:U}=ga({mobileExploreReferrer:"Task Checklist"});if(fa({isDataReady:T==="Completed"}),g.useEffect(()=>{y||($(!0),t(E(!1,l)))},[y,t]),g.useEffect(()=>{T==="Completed"&&t(x({taskGroupById:G.taskGroupById}))},[T,G.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return p.jsxs(p.Fragment,{children:[T==="Completed"?p.jsx(W,{analytics:Z,onLoad:r=>(K=>K.trackPageLoaded(q.Event.taskListPage))(r)}):null,p.jsxs(Da,{children:[p.jsx(ha,{isAppContentDrawerOpen:N,handleDrawerToggle:r=>{j(r)}}),p.jsx(Ga,{location:o,navigate:e,currentTenant:i,taskGroupId:u,taskGroupState:G,localData:D.localData,uiState:D.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:h,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:v,onAskAiCfoClick:U})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=pa(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=da(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=ma(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Ka as default};
@@ -1,9 +0,0 @@
1
- import{j as n}from"./liveblocks-DuKOLlGn.js";import se from"./NotFoundScreen-C1QW9enP.js";import{a as c}from"./sentry-8NyHUHYi.js";import{j as _,h as H,g,u as ne,l as oe,N as ie,k as re,n as ce,o as f}from"./core-Chn6k0lm.js";import{FC as M,FF as le,FI as de,eO as Z,PG as J,EW as W,EE as pe,Fm as ue,Ff as ke,PH as K,PI as z,EA as me,Ex as fe,pF as ge,pt as he,j$ as Se,EM as Ie,PJ as Ee,ER as Te,EO as be,EH as Ce,E$ as Ge,E_ as De}from"./zeni-epic-state-CrPv4S-z.js";import{z as G,cH as xe,H as je,C as ye,$ as T,p as X,s as F,x as Fe,c as A,f as we,cI as ve,i as O,aq as Re}from"./index-BE6noM1i.js";import{n as Pe}from"./mui-BKTsYfTF.js";import{u as Be}from"./useInitialThreadRequest-CXIwH-0N.js";import{M as Ue}from"./MobileAppDrawer-dqAF6Rs-.js";import Le from"./TaskListScreen-BqvuuEM9.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.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]="ea1b0d81-aded-41d6-a68e-3d720c1f0a5a",e._sentryDebugIdIdentifier="sentry-dbid-ea1b0d81-aded-41d6-a68e-3d720c1f0a5a")}catch{}})();function $e(){const e=_(),t=H(),s=G.getSignedInUser(),{cannedResponses:d,fetchState:r,saveFetchState:p}=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(xe,{cannedResponses:d,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:p==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let V,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:d}=t,r=K(e,t.taskId),p=Z(e),l=d!=null?z(e.taskGroupState,d):void 0,k=G.getSignedInUser(),a=p.tenantId,o={userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:a??""},h=J(e),{tenantEmailDomain:S}=p,b=r.recurringSourceTaskId,D=b!=null?`${O.appUrl}/${S}/tasks/${encodeURIComponent(b)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:o,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==V&&(V=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${O.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:D,tagListView:h,taskGroupName:d!=null&&l!=null&&l.isDefault===!1?l.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(u=>z(e.taskGroupState,u)).filter(u=>u!=null&&!u.isDeleted).map(u=>({id:u.id,name:u.name,isDefault:u.isDefault}))}},function(e,t){const{taskId:s,navigate:d,currentTenant:r,location:p,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(be(a,o))},onUnsnoozeTask:a=>{e(Te(a))},onDismissClick:()=>{if(p.state?.message==="triggerBackClick"){const a=X(p.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";d(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=w(k),o=F(p.state?.pathnameStackToGoBack,p.pathname);d(a,{state:{pathnameStackToGoBack:o}})}e(Ee({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(W(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{d(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=_(),t=H(),s=ne(),d=je(),{taskId:r,taskGroupId:p}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(T.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(T.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(T.isTaskCannedResponsesEnabled),{isFeatureEnabled:b}=a(T.isTaskRecurringParentEnabled),{isFeatureEnabled:D}=a(T.isTaskGroupAssigneesEnabled),[I,u]=c.useState(!1),[v,Y]=c.useState(!1),[R,Q]=c.useState(!1),[P,ee]=c.useState(!1),[B,x]=c.useState(!1),E=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{v||(Y(!0),t(W(!1,r)))},[v,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(Q(!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&&(E.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(B)if(C!=="In-Progress"){if(E.current){if(C==="Error")return x(!1),void(E.current=!1);if(C==="Completed"){x(!1),E.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=w(i);e(m,{state:{pathnameStackToGoBack:F(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else E.current=!0},[B,C,l,s,e]);const $=g(i=>K(i,r)),j=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=w(i),te=F(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(Fe,{analytics:A,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:I,handleDrawerToggle:i=>{u(i)}}),n.jsx(Ne,{analytics:A,currentTenant:l,handleZeniLogoClick:()=>{d.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:p,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:b,isTaskGroupAssigneesEnabled:D})]})]})}const ze=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
- `,w=e=>`/${e}/tasks`;function ra(){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($e,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(y,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ra as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-DuKOLlGn.js";import i from"./NotFoundScreen-C1QW9enP.js";import{T as r}from"./TransactionDetailScreen-CT-HL5f8.js";import"./sentry-8NyHUHYi.js";import{n as a,o}from"./core-Chn6k0lm.js";import"./zeni-epic-state-CrPv4S-z.js";import"./recharts-DDgm0ZY-.js";import"./index-BE6noM1i.js";import"./mui-BKTsYfTF.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./useAskAiCfoHostNavButtonProps-DiMxdW9u.js";import"./useFetchSuggestedQuestionsWhenReady-BVRUMI5f.js";import"./decodeURIComponentSafe-B4WuQ5yM.js";import"./routePaths-B0cKaBRs.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]="50e87735-4ba7-4a09-8438-0ea2bea3d928",e._sentryDebugIdIdentifier="sentry-dbid-50e87735-4ba7-4a09-8438-0ea2bea3d928")}catch{}})();function q(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{q as default};