@zeniai/web-app-ui 5.2.20-qa → 5.2.21-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/assets/AddressRoutes-DsPUKLM8.js +1 -0
  2. package/dist/assets/{AddressScreen-Gd3rLr7o.js → AddressScreen-CiaeHzMQ.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-GqFvcBB1.js → AiCfoScreen-Dkc2K8WZ.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CbPB6Cz2.js → BillPayApprovalRoutes-DLylp8D7.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DGiViCr3.js → BillPayRoutes-D1Tl6Jb1.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-W5WuCBLZ.js → BusinessVerificationPageScreen-JbVAjzAy.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-D_U3dSti.js → CardsAiCfoScreen-C8ZjNDac.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-B27ureXO.js → ChargeCardRoutes-DufcIszo.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-ErXIYp45.js → CompanyPassportScreen-CZIzscoH.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-DJjWE9Ho.js → ConnectionAuthScreen-CXkJEI26.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-BqWUOwu1.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-B98Qqcry.js → CustomerOnboardingRoutes-DyfzWNjv.js} +1 -1
  13. package/dist/assets/DashboardRoutes-CKOE1UKI.js +20 -0
  14. package/dist/assets/{DefaultTenantHome-d6BXVPTI.js → DefaultTenantHome-Dt-ZttGa.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-JSSitzK8.js → DomesticWireDetailScreen-ClCEmr89.js} +1 -1
  16. package/dist/assets/{DrawerScreen-DNRTfvlv.js → DrawerScreen-DqZSrPso.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-BkmcXMq3.js → EntityDetailRoutes-DTEEaVmJ.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-BrNpDBh0.js → ExpenseAutomationRoutes-Ct03OyXj.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-C_G_t4I9.js → FeaturePreviewScreen-RPVxMb0u.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-B7NyqTm6.js → HubSpotOAuthCallbackScreen-W5gYsSav.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-DDsl9O0f.js → MagicLinkRoutes-B3NpG1gq.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-Dry_XVDq.js → MagicLinkSignInScreen-C4xl9cY8.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-DHMYVxFj.js → MobileAppDrawer-CRLaoS9b.js} +1 -1
  24. package/dist/assets/NotFoundScreen-BEj9MjFe.js +1 -0
  25. package/dist/assets/{NotificationRoutes-oG7avNKP.js → NotificationRoutes-DvlspGFD.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-Dh63jZlt.js → OAuthConsentScreen-C_UXcpAq.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-BVXECLJI.js → PandLWithForecastRoutes-8rDjc2Vf.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-CQXZ97tH.js → PeopleRoutes-DXSlyB9m.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-Dioa22VE.js → PerformanceRoutes-CD2KNw8_.js} +1 -1
  30. package/dist/assets/{Preview-K7kVfJNZ.js → Preview-CRPYVI6t.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-8ZFrKnn9.js → QBOConnectionScreen--ycxEhUp.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-C8xbikTE.js → ReimbursementApprovalRoutes-DZL_z1mV.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DcC6kKsi.js → ReimbursementApprovalRuleDetailScreen-DG8xpE7m.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DiSJ1F-L.js → ReimbursementRoutes-Pd_j0Kuw.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-BPxWGssU.js → ReportsRoutes-BvbFxYaP.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-DqiMNP30.js → RewardsRoutes-ChEdfM4m.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-CBj7JgTH.js → ScreenRoutes-DBr3qw38.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-CXmkByZI.js → SettingsRoutes-BaiCSjlR.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-BaE6w_Lx.js → SetupPagesScreen-DifY7gaU.js} +1 -1
  40. package/dist/assets/{SignInScreen-CwKX1cxj.js → SignInScreen-DYd156jI.js} +1 -1
  41. package/dist/assets/{SignOutScreen-B9gpIBeY.js → SignOutScreen-DDruLQut.js} +1 -1
  42. package/dist/assets/{TaskListScreen-CM1HvPkl.js → TaskListScreen-BEqD4wPV.js} +1 -1
  43. package/dist/assets/{TaskRoutes-CeoNkmPK.js → TaskRoutes-GZWWcLPu.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-CF2S0_wV.js → TransactionDetailRoutes-C5Tj5i38.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-CSzx81zE.js → TransactionDetailScreen-CaupyqkA.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-D0BHQcx7.js → TransactionListRoutes-DCnjf_2j.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-BSGTUZAU.js → TreasuryRoutes-JnJmwKGX.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-D82zHUvQ.js → VendorsRoutes-B4Lj1jCG.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-C8a_Kzcy.js → WiseConfirmationScreen-juJTkPHv.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-C5ejtB2q.js → ZeniAccountRoutes-BZGxxall.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-B6jIO9ea.js → ZeniAccountStatementScreen-o2U5WdzW.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-gMZWceAt.js → accountMappingHelper-DXKNp4_g.js} +1 -1
  53. package/dist/assets/{analytics-BP5D4JyB.js → analytics-Det0UZFe.js} +1 -1
  54. package/dist/assets/{analyticsHelper-Ib8eUq2U.js → analyticsHelper-DyhEHOhh.js} +1 -1
  55. package/dist/assets/{core-BfWJ7zKT.js → core-DslHP-Nt.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-D2jiQ7Do.js → decodeURIComponentSafe-uhKYYVbR.js} +1 -1
  57. package/dist/assets/{dnd-tQgCG5z3.js → dnd-CQxwFT7m.js} +1 -1
  58. package/dist/assets/{empty-0zu7mfa-.js → empty-Wy9lgs00.js} +1 -1
  59. package/dist/assets/{empty-D4KL-CgN.js → empty-pFhUOX6X.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-D2WpBqYb.js → emptyVideoElement-w1_MywKD.js} +1 -1
  61. package/dist/assets/{epic-_aUX4Son.js → epic-DTnE0Nui.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-0y5Rz6LJ.js → getLocaleForTenant-CkKXTx9H.js} +1 -1
  63. package/dist/assets/{index-oBgu7-MV.js → index--54UVqXL.js} +2 -2
  64. package/dist/assets/{index-DpTDwQon.js → index-B3Qv-ngJ.js} +1 -1
  65. package/dist/assets/{index-zYcXrqlT.js → index-BSV1Wtow.js} +1 -1
  66. package/dist/assets/{index-edb9TugW.js → index-Cbw-Hudf.js} +1 -1
  67. package/dist/assets/{index-D9NLhglj.js → index-Cny4F3UP.js} +9953 -9953
  68. package/dist/assets/{index-BtVRjclm.js → index-D9jKQIPj.js} +1 -1
  69. package/dist/assets/{index-C2k_pBZi.js → index-DCO11L1y.js} +1 -1
  70. package/dist/assets/{index-CiS2dMrM.js → index-H3qfOHz1.js} +1 -1
  71. package/dist/assets/{lexical-Bg8ldM3i.js → lexical-DYyincEg.js} +1 -1
  72. package/dist/assets/{liveblocks-DJbBe3tc.js → liveblocks-Dge8uQhE.js} +1 -1
  73. package/dist/assets/{lottie-BaCgeYyk.js → lottie-JtX4it7w.js} +1 -1
  74. package/dist/assets/{mui-ts7KHm6i.js → mui-DskYaYyd.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DG10zCZ4.js → pathToGoBack-DPWssLbl.js} +1 -1
  76. package/dist/assets/{pdf-C9HGpLCu.js → pdf-8n9gC55d.js} +3 -3
  77. package/dist/assets/{pdf-lib-DX6kz8a9.js → pdf-lib-CuyyFcf5.js} +1 -1
  78. package/dist/assets/{plaid-Cv0mPYlm.js → plaid-ajCcP-UI.js} +1 -1
  79. package/dist/assets/{pusher-CgG6vGRj.js → pusher-gYNLjWxj.js} +1 -1
  80. package/dist/assets/{react-tqWON72J.js → react-B1cHKI31.js} +1 -1
  81. package/dist/assets/{react-r7Nkvi02.js → react-Cj6es5B3.js} +1 -1
  82. package/dist/assets/{react-Bu9a3mw7.js → react-D56X5BsD.js} +1 -1
  83. package/dist/assets/{react-LH5dN4Ph.js → react-D8SoUGP2.js} +1 -1
  84. package/dist/assets/{react-Dp-aIPjg.js → react-h386o274.js} +1 -1
  85. package/dist/assets/{react-CdB2kFeI.js → react-qy_mbxl-.js} +1 -1
  86. package/dist/assets/{recharts-DNnhB5R_.js → recharts-BV1Rao9g.js} +1 -1
  87. package/dist/assets/{routePaths-DxGoZobb.js → routePaths-BRZr86UY.js} +1 -1
  88. package/dist/assets/{sentry-C6T1HHHS.js → sentry-ConJlCAk.js} +1 -1
  89. package/dist/assets/{url-CJ3E3PSB.js → url-FGF171Cm.js} +1 -1
  90. package/dist/assets/{url-Xy6MI2YY.js → url-rW6Xsakn.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C2dvtIj1.js → useAiCfoDashboardSuggestedQuestionsChips-CNFp4dUE.js} +1 -1
  92. package/dist/assets/{useAskAiCfoHostNavButtonProps-D8n0-rNW.js → useAskAiCfoHostNavButtonProps-Dbk2QnY2.js} +1 -1
  93. package/dist/assets/{useCashManagementBanner-gOTcVHZg.js → useCashManagementBanner-B8l-9mNC.js} +1 -1
  94. package/dist/assets/{useChargeCardPusherEvents-D846Tvtv.js → useChargeCardPusherEvents-7z8f-VNH.js} +1 -1
  95. package/dist/assets/{useDeviceId-DNuYTM17.js → useDeviceId-DS-lzRmX.js} +1 -1
  96. package/dist/assets/{useEmailConnectResultRefresh-a9kkk9YH.js → useEmailConnectResultRefresh-Dd3ZNdiP.js} +1 -1
  97. package/dist/assets/{useInitialThreadRequest-BlvltKSe.js → useInitialThreadRequest-BP8PKnuv.js} +1 -1
  98. package/dist/assets/{utils-xWcqC4Wl.js → utils-KyL5SnF3.js} +1 -1
  99. package/dist/assets/{withTransactionSidePanel-QwShhfS-.js → withTransactionSidePanel-BWGtTu19.js} +1 -1
  100. package/dist/assets/{zeni-epic-state-kow6PLud.js → zeni-epic-state-COMt8QIe.js} +3 -3
  101. package/dist/index.html +1 -1
  102. package/package.json +3 -3
  103. package/dist/assets/AddressRoutes-DYJsnvRP.js +0 -1
  104. package/dist/assets/CustomerOnboardingAuthScreen-Dk9pmK5M.js +0 -1
  105. package/dist/assets/DashboardRoutes-5YFzvPKk.js +0 -20
  106. package/dist/assets/NotFoundScreen-DsR8VsQv.js +0 -1
@@ -0,0 +1,20 @@
1
+ import{j as d}from"./liveblocks-Dge8uQhE.js";import{i as K,j as k,g as H,u as $,h as W,n as ae,k as ia,o as Ct,p as F,N as Fn}from"./core-DslHP-Nt.js";import{e$ as U,NS as We,bE as ca,bo as Te,P7 as On,jd as Rn,P8 as qt,P9 as Bn,jg as St,Pa as Qe,Pb as jn,jl as Mn,Pc as Qt,Pd as Ln,jp as kt,Pe as Ze,Pf as Un,cr as At,Pg as Gn,Ph as Vn,Oa as Nn,kh as Yn,Pi as $n,bn as Xe,Pj as la,NG as le,bc as da,kv as ua,ov as ma,ke as pa,NI as de,NH as te,e_ as ha,fw as zn,g7 as _t,Pk as Kn,Pl as qn,Pm as fa,Pn as Fe,wf as Me,wg as Le,wD as we,wx as ue,wk as Ue,Po as Qn,Pp as Zn,Pq as Hn,Pr as ga,Ps as Oe,Pt as Wn,dL as Je,sz as ba,Pu as Xn,Pv as Jn,Pw as eo,Px as It,MY as vt,kL as xe,wL as Et,sH as to,Py as ao,wh as Zt,sC as Ee,sy as Ca,Pz as ge,PA as no,PB as Pt,MX as Tt,uG as Sa,PC as oo,PD as so,PE as ro,PF as wt,uW as io,PG as co,wj as Ht,uF as ka,PH as be,PI as lo,bs as _a,wP as ya,PJ as uo,PK as mo,PL as po,PM as xt,wK as ho,PN as fo,wi as Wt,wO as Aa,PO as Ce,PP as go,PQ as bo,PR as Ia,kA as va,os as Ea,kF as Pa,oq as Ta,op as wa,oo as xa,u2 as Co,PS as So,cV as ko,cW as _o,ol as yo,fW as Ao,oC as Io,H0 as dt,GU as vo,GY as Eo,PT as Po,PU as To,PV as wo,b5 as et,fO as xo,hS as Do,gp as Fo,ow as Oo,k7 as Ro,ot as Bo,or as jo,fI as Mo,fG as Lo}from"./zeni-epic-state-COMt8QIe.js";import{z as M,a4 as ne,v as w,f as P,a as q,a_ as Uo,a0 as Ge,A as Ve,a$ as Da,h as N,b0 as Go,D as ke,b1 as Fa,w as _e,i as B,E as Vo,b2 as No,b3 as Yo,W as Oa,J as Ra,c as Ba,Z as $o,b4 as zo,T as Ko,aS as ja,a1 as re,b5 as Ma,b6 as La,a3 as Ua,b7 as qo,b8 as Qo,Q as Zo,ar as Ho,s as Wo,X as Xo,b9 as Jo,ba as es,bb as ts,bc as as,bd as Se}from"./index-Cny4F3UP.js";import{n as Dt}from"./mui-DskYaYyd.js";import{a as b}from"./sentry-ConJlCAk.js";import{w as Ga}from"./withTransactionSidePanel-BWGtTu19.js";import{c as Va,t as De,f as me,a as Ft,v as ns}from"./routePaths-BRZr86UY.js";import{u as oe}from"./useAskAiCfoHostNavButtonProps-Dbk2QnY2.js";import je from"./NotFoundScreen-BEj9MjFe.js";import{u as Ot}from"./useInitialThreadRequest-BP8PKnuv.js";import{t as Na}from"./analyticsHelper-DyhEHOhh.js";import{C as os}from"./CompanyPassportScreen-CZIzscoH.js";import{u as ss}from"./useAiCfoDashboardSuggestedQuestionsChips-CNFp4dUE.js";import{F as rs}from"./FeaturePreviewScreen-RPVxMb0u.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.js";import"./TransactionDetailScreen-CaupyqkA.js";import"./decodeURIComponentSafe-uhKYYVbR.js";import"./MobileAppDrawer-CRLaoS9b.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]="10717b1d-4243-41a7-8c42-93f8849da4aa",e._sentryDebugIdIdentifier="sentry-dbid-10717b1d-4243-41a7-8c42-93f8849da4aa")}catch{}})();const is=Ga((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=k((v=>v.tenantState.currentTenantId)),c=k((v=>U(v))),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo((()=>({authParams:u,companyName:C,downloadEndPoint:`${ne}/agingDetailedReport`,timezone:We()})),[]),h=b.useMemo((()=>r!=null?ca(r):Te()),[r]),p=$(),f=W(),_=k((v=>On(v,h,o))),E=b.useCallback((()=>{o!=null&&_.fetchState!=="In-Progress"&&_.fetchState!=="Completed"&&p(Rn(o,h))}),[h]),A=b.useCallback((()=>{f("../../",{relative:"path"})}),[]),S=b.useCallback(((v,L)=>{p(qt({sortKey:v,sortOrder:L}))}),[]),T=b.useCallback((v=>{p(qt({downloadState:v}))}),[]),x=b.useCallback((v=>{if(e)e(v.transactionId,v.transactionType);else if(m!=null){const L=Va({id:v.transactionId,type:v.transactionType},m);f(L);const se=w(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:se}})}}),[m,e]),y=b.useCallback((()=>{_.vendor!=null&&P.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),_.vendor.id,_.vendor.name)}),[_.vendor,h]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{_.fetchState==="Completed"&&y()}),[y,_.fetchState]),d.jsx(Uo,{apAgingDetail:_,downloadParams:l,reportDate:h,analytics:P,onTransactionClick:x,onReload:E,onBackClick:A,onColumnSortConfigChanged:S,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),cs=()=>{const e=$(),a=W(),t=k((S=>Bn(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=oe({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=k((S=>S.tenantState.currentTenantId)),i=k((S=>U(S))),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo((()=>({authParams:m,companyName:c,downloadEndPoint:`${ne}/agingReport`,timezone:We()})),[]),C=t.apAgingUIState.selectedDate??Te(),u=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(C))}),[]);b.useEffect((()=>{u()}),[]);const l=b.useCallback((()=>{a("../",{relative:"path"})}),[]),h=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),p=b.useCallback(((S,T)=>{e(Qe({sortKey:T,sortOrder:S}))}),[]),f=b.useCallback((S=>{a(`./${S}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[C]),_=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),E=b.useCallback(((S,T)=>{}),[]),A=b.useCallback(((S,T)=>{e(Qe({selectedDate:S,agingDateSelectionType:T})),e(St(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:P,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Da,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:P,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:_,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ls=Ga((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=k((y=>U(y))),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo((()=>({authParams:C,companyName:g,downloadEndPoint:`${ne}/agingDetailedReport`,timezone:We()})),[]),l=b.useMemo((()=>r!=null?ca(r):Te()),[r]),h=$(),p=W(),f=k((y=>jn(y,l,o))),_=b.useCallback((()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(Mn(o,l))}),[l]),E=b.useCallback((()=>{p("../../",{relative:"path"})}),[]),A=b.useCallback(((y,v)=>{h(Qt({sortKey:y,sortOrder:v}))}),[]),S=b.useCallback((y=>{h(Qt({downloadState:y}))}),[]),T=b.useCallback((y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const v=Va({id:y.transactionId,type:y.transactionType},c);p(v);const L=w(m.state?.pathnameStackToGoBack,m.pathname);p(v,{state:{pathnameStackToGoBack:L}})}}),[c,e]),x=b.useCallback((()=>{f.customer!=null&&P.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)}),[f.customer,l]);return b.useEffect((()=>{_()}),[]),b.useEffect((()=>{f.fetchState==="Completed"&&x()}),[f.fetchState,x]),d.jsx(Go,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:P,onTransactionClick:T,onReload:_,onBackClick:E,onColumnSortConfigChanged:A,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ds=()=>{const e=$(),a=W(),t=k((A=>Ln(A))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=oe({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=k((A=>U(A))),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:c,companyName:i,downloadEndPoint:`${ne}/agingReport`,timezone:We()})),[]),g=t.arAgingUIState.selectedDate??Te(),C=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(g))}),[]);b.useEffect((()=>{C()}),[]);const u=b.useCallback((()=>{a("../",{relative:"path"})}),[]),l=b.useCallback((A=>{e(Ze({searchString:A}))}),[]),h=b.useCallback(((A,S)=>{e(Ze({sortKey:S,sortOrder:A}))}),[]),p=b.useCallback((A=>{a(`./${A}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[g]),f=b.useCallback((A=>{e(Ze({downloadState:A}))}),[]),_=b.useCallback(((A,S)=>{e(Ze({selectedDate:A,agingDateSelectionType:S})),e(kt(A))}),[]),E=b.useCallback(((A,S)=>{e(Un({nodeId:A,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:P,onLoad:A=>A.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Da,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:P,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:_,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function $a(e,a){const t=Nn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Yn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?P.trackZeniAccountsCashBalancePromoClicked("Move Money"):(P.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else P.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const us=ae((function(e){const a=Gn(e).accountsInOrder.map(((n,o)=>Ya(n,o))),t=Vn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:P}}),$a)(Fa),ms=ae((function(e){const a=$n(e).accountsInOrder.map(((o,r)=>Ya(o,r))),t=M.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:P}}),$a)(Fa);function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=ke(),o=k((s=>U(s).company?.companyInfo.firstMonthOfFY??1)),r=At(n?.loggedInUserRoleMap);return k((s=>s.cashBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function hs(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=ke(),o=At(n?.loggedInUserRoleMap),r=k((s=>U(s).company?.companyInfo.firstMonthOfFY??1));return k((s=>s.cardBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(ms,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const fs=Dt.div`
2
+ display: flex;
3
+ flex: 1 1 auto;
4
+ min-height: 100%;
5
+ flex-direction: column;
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,gs=Dt.div`
8
+ display: flex;
9
+ flex: 1 1 auto;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ background-color: ${e=>e.theme.colors.grey4};
13
+ `;function bs({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=W(),i=$(),c=H(),{tenantEmailDomain:m}=K(),g=Vo();return d.jsxs(fs,{children:[d.jsx(No,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:C=>{C.trim().length>=2?i(de({searchString:C,searchOrigin:"navbar"})):C.trim().length===0&&i(te("navbar"))},onAutoCompleteEntity:C=>{n!=null&&P?.trackSearch(N.Event.search,Cs(a),C.type,C.name,n);const u=me(C,m),l=w(c.state?.pathnameStackToGoBack,c.pathname);s(u,{state:{pathnameStackToGoBack:l}})}}},rightSideComponent:d.jsx(Yo,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(gs,{children:a==="cash_balance"?d.jsx(ps,{}):d.jsx(hs,{})})]})}function Xt(){const e=H(),a=$(),{useFeatureGate:t}=_e(),{isFeatureEnabled:n}=t(B.isDepositAccountsFeatureEnabled),o=k((p=>p.cashBalanceState.fetchState)),r=k((p=>p.cardBalanceState.fetchState)),s=M.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=la((p=>{const f=da(p,"/").split("/");return f[f.length-1]})(e.pathname));let c="Not-Started",m="";const g=q.getLocalizedStrings();switch(i){case"cash_balance":c=o,m=g.reportTitleById.cash_balance;break;case"card_balance":c=r,m=g.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:C,onAskAiCfoClick:u}=oe({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});Ge({isDataReady:c==="Completed"});const l=k((p=>p.entityAutoCompleteState.autoCompleteText.navbar)),h=k((p=>le(p,"navbar")));return b.useEffect((()=>{c==="Not-Started"&&(function(p,f,_){switch(f){case"card_balance":p(pa());break;case"cash_balance":p(ua()),_===!0&&p(ma());break;default:throw new Error(`balance report type ${f} is not yet supported`)}})(a,i,n)}),[s,a,c]),d.jsxs(d.Fragment,{children:[c==="Completed"?d.jsx(Ve,{analytics:P,onLoad:p=>((f,_)=>{switch(_){case"card_balance":f.trackPageLoaded(N.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(N.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${_}!`)}})(p,i)}):null,d.jsx(bs,{title:m,reportId:i,autoCompleteText:l,entityAutoCompleteView:h,isAiCfoAccessEnabled:C,onAskAiCfoClick:u})]})}const Cs=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Ss=[],Jt="insights_section";function Ne(e){const{mobileExploreReferrer:a}=e,t=$(),n=W(),o=H(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Oa(),c=Ra(),m=Ua(c),g=ia(),C=k((O=>O.tenantState.fetchState==="Completed"||O.tenantState.activeTenantFetchState.fetchState==="Completed"?U(O):void 0)),u=C?.masterTOSInfo?.isMasterTOSAccepted??!1,l=k((O=>ha(O))),h=l.uiState?.currentChatSessionId,p=l.allSessionsWithOrderedQuestionAnswers??Ss,f=M.getSignedInUser()?.userId,_=Ba(),E=$o()&&_&&r!=null,A=zo(),S=Ko(!0),T=k((O=>A!=null?zn(O,A):void 0)),{useDynamicConfig:x}=_e(),{configValue:y}=x(ja.aiCfoMessageDynamicConfig),v=b.useMemo((()=>Array.isArray(y.default_message_list)?y.default_message_list:[]),[y.default_message_list]),L=b.useMemo((()=>v.slice(0,2)),[v]),se=A!=null&&T!=null&&T.fetchState!=="Completed"&&T.fetchState!=="Error"&&(S||T.fetchState==="In-Progress"),$e=b.useMemo((()=>{if(A==null||T?.fetchState==="Error")return L;if(se)return[];const O=(T?.suggestedQuestions??[]).map((X=>X.trim())).filter((X=>X.length>0)).slice(0,2);return O.length===0?L:O}),[L,se,A,T?.fetchState,T?.suggestedQuestions]),pe=b.useCallback(((O,X)=>{if(f==null||O.trim()==="")return;if(!u)return void re({location:o,navigate:n,mergeState:{referrer:a,aiCfoInitialQuestion:O,aiCfoInitialSubmissionSource:Jt,aiCfoSuggestionIndex:X}});const Ke=Ma(g.getState());if(m){const qe=w(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:qe,referrer:a,aiCfoInitialQuestion:O,aiCfoShouldSubmit:!Ke}})}else{if(Ke)return t(_t(O)),void s(!0);i(O),s(!0),La(t,O,Jt,h,p,f,X,void 0)}}),[p,h,t,u,m,o,a,n,s,i,g,r,f]),ze=b.useCallback((()=>{if(u)if(m){const O=w(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:O,referrer:a}})}else s(!0);else re({location:o,navigate:n,mergeState:{referrer:a}})}),[u,m,o,a,n,s,r]);return b.useMemo((()=>{if(E)return{isSuggestedQuestionsLoading:se,onAskSomethingElseClick:ze,onSuggestedQuestionClick:pe,suggestedQuestions:$e}}),[E,se,ze,pe,$e])}const Ye=qo,ks=ae((function(e){const a=Kn(e),t=qn(e),n=fa(e),{scrollPosition:o,...r}=n,s=q.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=M.getSignedInUser(),c=e.tenantState.currentTenantId,m=U(e),g=m?.companyName??"",C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,l=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${ne}/statement`,authParams:C},analytics:P,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:l}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Qn(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Fe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(we("month")),e(ue(a.firstMonthOfFY,t)),e(Fe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Le(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onElementCollapseStateChanged:(t,n)=>{e(Fe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Fe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(te("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(Ye),_s=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=oe({mobileExploreReferrer:"DashboardCashInCashOut"}),s=Ne({mobileExploreReferrer:"DashboardCashInCashOut"}),i=k((c=>fa(c))).mode==="compare_mode";return d.jsx(ks,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},ys=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},As=ae((function(e){const a=Zn(e),t=Hn(e),n=ga(e),{scrollPosition:o,...r}=n,s=q.getLocalizedStrings().reportTitleById.cash_position,i=M.getSignedInUser(),c=e.tenantState.currentTenantId,m=U(e),g=m?.companyName??"",C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,l=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${ne}/statement`,authParams:C},analytics:P,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:l}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Wn(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Le(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=ys(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(te("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Oe({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}}))(Ye),Is=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=oe({mobileExploreReferrer:"DashboardCashPosition"}),s=Ne({mobileExploreReferrer:"DashboardCashPosition"}),i=k((c=>ga(c))).mode==="compare_mode";return d.jsx(As,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},Y=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function ut(){return d.jsxs(Ct,{children:[d.jsx(F,{path:"/",element:d.jsx(ie,{})}),d.jsx(F,{path:"/:forecastId",element:d.jsx(ie,{})}),d.jsx(F,{path:"/:forecastId/*",element:d.jsx(je,{})})]})}const vs=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Es=ae((function(e){const a=ba(e),t=Xn(e),n=Jn(e),o=eo(e),r=It(e),{scrollPosition:s,...i}=r,c=t.reportTitle,m=M.getSignedInUser(),g=e.tenantState.currentTenantId,C=U(e),u=C?.companyName??"",l={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,p=le(e,"navbar"),f=vt(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:c},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${ne}/statement`,authParams:l},analytics:P,isZeniUser:Xe(m),autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:p},isZeniCOAUsed:f,isAccountingClassesEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(no(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Le(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&Y(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=vs(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ft(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ge({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(te("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ee(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?Pe:Rt,n)),t==="forecast_mode"?(e(Zt({viewMode:"account_group"})),e(Ca(!1,n?.id)),n!=null&&Y(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):Y(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ge({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Zt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(ao({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(to())},onResyncReports:()=>{e(Et("net_burn_or_income_by_classes"))}}}))(Ye),Ps=e=>{const a=$(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),c=Ne({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=k((y=>It(y))),g=m.isForecastModeOn,C=m.timeframe,u=m.selectedForecast?.id,l=k((y=>Pt(y.forecastState,u??""))),h=k((y=>ba(y))),p=k((y=>Tt(y))),f=k((y=>xe(y))),_=m.mode==="compare_mode",E=h.dataAvailable;b.useEffect((()=>{if(u!=null&&g===!0&&(Y(g,r,u,o),l!=null)){const y=l?.forecastPeriod,v=E!=null&&y.endDate.isAfter(E?.endDate)===!0?E:y;a(ue(e.firstMonthOfFY,{startDate:v.endDate.startOf(C),endDate:v?.endDate}))}}),[u]);const A=ke(),{useFeatureGate:S}=_e(),{isFeatureEnabled:T}=S(B.isReportsCommentingEnabled),x=Ot(T?A?.currentTenant?.companyId:void 0,{clearParams:h.fetchState==="Completed"});return d.jsx(Es,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:_,navigate:o,analytics:P,reportsResyncFetchState:p.reportsResyncFetchState,insightsSectionAiCfoInfo:c,isAiCfoAccessEnabled:s,onAskAiCfoClick:i,initialOpenThreadRequest:x,isReportsCommentingEnabled:T})},Ts=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},ws=ae((function(e){const a=Sa(e),t=oo(e),n=so(e),o=ro(e),r=wt(e),{scrollPosition:s,...i}=r,c=q.getLocalizedStrings().reportTitleById.operating_expenses,m=M.getSignedInUser(),g=e.tenantState.currentTenantId,C=U(e),u=C?.companyName??"",l={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,p=le(e,"navbar"),f=vt(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:c},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${ne}/statement`,authParams:l},analytics:P,isZeniUser:Xe(m),autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:p},isZeniCOAUsed:f,isAccountingClassesEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(lo(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Le(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&Y(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Ts(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ft(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(be({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(te("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ee(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?Pe:Rt,n)),t=="forecast_mode"?(e(Ht({viewMode:"account_group"})),e(ka(!1,n?.id)),n!=null&&Y(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):Y(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(be({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ht({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(co({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(io())},onResyncReports:()=>{e(Et("operating_expenses_by_classes"))}}}))(Ye),xs=e=>{const a=$(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=oe({mobileExploreReferrer:"DashboardOpEx"}),c=Ne({mobileExploreReferrer:"DashboardOpEx"}),m=k((v=>wt(v))),g=m.isForecastModeOn,C=m.timeframe,u=m.selectedForecast?.id,l=k((v=>Pt(v.forecastState,u??""))),h=k((v=>Sa(v))),p=k((v=>Tt(v))),f=k((v=>xe(v))),_=m.mode==="compare_mode",E=h.dataAvailable;b.useEffect((()=>{if(u!=null&&g===!0&&(Y(g,r,u,o),l!=null)){const v=l?.forecastPeriod,L=E!=null&&v.endDate.isAfter(E?.endDate)===!0?E:v;a(ue(e.firstMonthOfFY,{startDate:L.endDate.startOf(C),endDate:L?.endDate}))}}),[u]);const A=ke(),S=A?.loggedInUserRole!=null&&_a(A?.loggedInUserRole)!==!0,{useFeatureGate:T}=_e(),{isFeatureEnabled:x}=T(B.isReportsCommentingEnabled),y=Ot(x?A?.currentTenant?.companyId:void 0,{clearParams:h.fetchState==="Completed"});return d.jsx(ws,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:_,navigate:o,forecastIdFromUrlPath:r,analytics:P,hasTransactionAccess:S,reportsResyncFetchState:p.reportsResyncFetchState,insightsSectionAiCfoInfo:c,isAiCfoAccessEnabled:s,onAskAiCfoClick:i,initialOpenThreadRequest:y,isReportsCommentingEnabled:x})},Ds=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Fs=ae((function(e){const a=ya(e),t=uo(e),n=mo(e),o=po(e),r=xt(e),{scrollPosition:s,...i}=r,c=q.getLocalizedStrings().reportTitleById.revenue,m=M.getSignedInUser(),g=e.tenantState.currentTenantId,C=U(e),u=C?.companyName??"",l={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,p=le(e,"navbar"),f=vt(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:c},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${ne}/statement`,authParams:l},analytics:P,isZeniUser:Xe(m),autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:p},isZeniCOAUsed:f,isAccountingClassesEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(go(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Le(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&Y(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Ds(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ft(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(Ce({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Ce({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(te("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ee(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?Pe:Rt,n)),t==="forecast_mode"?(e(Wt({viewMode:"account_group"})),e(Aa(!1,n?.id)),n!=null&&Y(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):Y(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(Ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Wt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(fo({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(ho())},onResyncReports:()=>{e(Et("revenue_by_classes"))}}}))(Ye),Os=e=>{const a=$(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=oe({mobileExploreReferrer:"DashboardRevenue"}),c=Ne({mobileExploreReferrer:"DashboardRevenue"}),m=k((y=>xt(y))),g=m.isForecastModeOn,C=m.timeframe,u=m.selectedForecast?.id,l=k((y=>Pt(y.forecastState,u??""))),h=k((y=>ya(y))),p=h.dataAvailable,f=m.mode==="compare_mode",_=k((y=>xe(y))),E=k((y=>Tt(y)));b.useEffect((()=>{if(u!=null&&g===!0&&(Y(g,r,u,o),l!=null)){const y=l?.forecastPeriod,v=p!=null&&y.endDate.isAfter(p?.endDate)===!0?p:y;a(ue(e.firstMonthOfFY,{startDate:v.endDate.startOf(C),endDate:v?.endDate}))}}),[u]);const A=ke(),{useFeatureGate:S}=_e(),{isFeatureEnabled:T}=S(B.isReportsCommentingEnabled),x=Ot(T?A?.currentTenant?.companyId:void 0,{clearParams:h.fetchState==="Completed"});return d.jsx(Fs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:_,isCompareModeOn:f,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:P,reportsResyncFetchState:E.reportsResyncFetchState,insightsSectionAiCfoInfo:c,isAiCfoAccessEnabled:s,onAskAiCfoClick:i,initialOpenThreadRequest:x,isReportsCommentingEnabled:T})},Rs=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Bs=ae((function(e){const a=bo(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=le(e,"navbar");return{report:a,analytics:P,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}}),(function(e,a){return{onTimeframeSelectionChanged:t=>{P.trackTimeframeSwitch(Na(t),"Top Expenses"),e(Ia(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Rs(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(te("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(Qo),js=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Bs,{tenantEmailDomain:a,location:t,navigate:n})},Ms=Dt.div`
14
+ display: flex;
15
+ flex: 1 1 auto;
16
+ min-height: 100%;
17
+ flex-direction: column;
18
+ background-color: ${e=>e.theme.colors.grey5};
19
+ align-items: center;
20
+ `,Pe=3,Rt=1;function Ls({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=W(),r=H(),{tenantEmailDomain:s}=K();let i;Ge({isDataReady:!0});const c={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(xs,{...c});break;case"revenue":i=d.jsx(Os,{...c});break;case"net_burn_or_income":i=d.jsx(Ps,{...c});break;case"cash_position":i=d.jsx(Is,{...c});break;case"top_expenses":i=d.jsx(js,{...c});break;case"cash_in_cash_out":i=d.jsx(_s,{...c});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(Ms,{children:i}):null}function ie(){const e=H(),a=$(),{forecastId:t}=K();let n="Not-Started";const o=k((l=>wt(l).fetchState)),r=k((l=>xt(l).fetchState)),s=k((l=>It(l).fetchState)),i=k((l=>l.cashPositionState.fetchState)),c=k((l=>l.topExState.fetchState)),m=k((l=>l.cashInCashOutState.fetchState));if(M.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k((l=>U(l))),C=g?.company?.companyInfo?.firstMonthOfFY??1,u=la((l=>{const h=da(l,"/").split("/");return t!=null?h[h.length-3]:h[h.length-1]})(e.pathname));switch(u){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=c;break;case"cash_in_cash_out":n=m;break;default:console.error(`${u} is not supported!`)}return b.useEffect((()=>{n==="Not-Started"&&(function(l,h,p,f){switch(h){case"operating_expenses":l(xa(!0)),f!=null&&(l(Ee(p,!0,Pe,{id:f,index:0})),l(ka(!1,f)));break;case"revenue":l(wa(!0)),f!=null&&(l(Ee(p,!0,Pe,{id:f,index:0})),l(Aa(!1,f)));break;case"net_burn_or_income":l(Ta(!0)),f!=null&&(l(Ee(p,!0,Pe,{id:f,index:0})),l(Ca(!1,f)));break;case"cash_position":l(Pa(!0));break;case"top_expenses":l(Ea());break;case"cash_in_cash_out":l(va());break;default:throw new Error(`report type ${h} is not yet supported`)}})(a,u,C,t)}),[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(Ve,{analytics:P,onLoad:l=>((h,p)=>{const f=e.state?.referrer;switch(p){case"operating_expenses":h.trackPageLoaded(N.Event.operatingExpenses,f);break;case"revenue":h.trackPageLoaded(N.Event.revenues,f);break;case"net_burn_or_income":h.trackPageLoaded(N.Event.burnRate,f);break;case"cash_position":h.trackPageLoaded(N.Event.cashPosition,f);break;case"top_expenses":h.trackPageLoaded(N.Event.topExpenses,f);break;case"cash_in_cash_out":h.trackPageLoaded(N.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${p}!`)}})(l,u)}):null,d.jsx(Ls,{firstMonthOfFY:C,fetchState:n,reportId:u,forecastId:t})]})}var mt=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function pt(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),(function(){t(window.event)}))}function za(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Ka(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Bt={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":mt?173:189,"=":mt?61:187,";":mt?59:186,"'":222,"[":219,"]":221,"\\":220},ce={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},yt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},j={16:!1,18:!1,17:!1,91:!1},R={},He=1;He<20;He++)Bt["f".concat(He)]=111+He;var D=[],ea=!1,qa="all",ta=[],tt=function(e){return Bt[e.toLowerCase()]||ce[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function aa(e){qa=e||"all"}function Be(){return qa||"all"}var ht=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ka(a).forEach((function(s){var i=s.split(r),c=i.length,m=i[c-1],g=m==="*"?"*":tt(m);if(R[g]){t||(t=Be());var C=c>1?za(ce,i):[];R[g]=R[g].filter((function(u){return!((!n||u.method===n)&&u.scope===t&&(function(l,h){for(var p=l.length>=h.length?l:h,f=l.length>=h.length?h:l,_=!0,E=0;E<p.length;E++)f.indexOf(p[E])===-1&&(_=!1);return _})(u.mods,C))}))}}))};function na(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,j)Object.prototype.hasOwnProperty.call(j,r)&&(!j[r]&&a.mods.indexOf(+r)>-1||j[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||j[16]||j[18]||j[17]||j[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function oa(e,a){var t=R["*"],n=e.keyCode||e.which||e.charCode;if(V.filter.call(this,e)){if(n!==93&&n!==224||(n=91),D.indexOf(n)===-1&&n!==229&&D.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(h){var p=yt[h];e[h]&&D.indexOf(p)===-1?D.push(p):!e[h]&&D.indexOf(p)>-1?D.splice(D.indexOf(p),1):h==="metaKey"&&e[h]&&D.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(D=D.slice(D.indexOf(p))))})),n in j){for(var o in j[n]=!0,ce)ce[o]===n&&(V[o]=!0);if(!t)return}for(var r in j)Object.prototype.hasOwnProperty.call(j,r)&&(j[r]=e[yt[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(D.indexOf(17)===-1&&D.push(17),D.indexOf(18)===-1&&D.push(18),j[17]=!0,j[18]=!0);var s=Be();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&na(e,t[i],s,a);if(n in R){for(var c=0;c<R[n].length;c++)if((e.type==="keydown"&&R[n][c].keydown||e.type==="keyup"&&R[n][c].keyup)&&R[n][c].key){for(var m=R[n][c],g=m.splitKey,C=m.key.split(g),u=[],l=0;l<C.length;l++)u.push(tt(C[l]));u.sort().join("")===D.sort().join("")&&na(e,m,s,a)}}}}function V(e,a,t){D=[];var n=Ka(e),o=[],r="all",s=document,i=0,c=!1,m=!0,g="+",C=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(c=a.keyup),a.keydown!==void 0&&(m=a.keydown),a.capture!==void 0&&(C=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=za(ce,e)),(e=(e=e[e.length-1])==="*"?"*":tt(e))in R||(R[e]=[]),R[e].push({keyup:c,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!(function(u){return ta.indexOf(u)>-1})(s)&&window&&(ta.push(s),pt(s,"keydown",(function(u){oa(u,s)}),C),ea||(ea=!0,pt(window,"focus",(function(){D=[]}),C)),pt(s,"keyup",(function(u){oa(u,s),(function(l){var h=l.keyCode||l.which||l.charCode,p=D.indexOf(h);if(p>=0&&D.splice(p,1),l.key&&l.key.toLowerCase()==="meta"&&D.splice(0,D.length),h!==93&&h!==224||(h=91),h in j)for(var f in j[h]=!1,ce)ce[f]===h&&(V[f]=!1)})(u)}),C))}var ft={setScope:aa,getScope:Be,deleteScope:function(e,a){var t,n;for(var o in e||(e=Be()),R)if(Object.prototype.hasOwnProperty.call(R,o))for(t=R[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Be()===e&&aa(a||"all")},getPressedKeyCodes:function(){return D.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=tt(e)),D.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(R).forEach((function(t){var n=R[t].find((function(o){return o.scope===a&&o.shortcut===e}));n&&n.method&&n.method()}))},unbind:function(e){if(e===void 0)Object.keys(R).forEach((function(s){return delete R[s]}));else if(Array.isArray(e))e.forEach((function(s){s.key&&ht(s)}));else if(typeof e=="object")e.key&&ht(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),ht({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Bt,modifier:ce,modifierMap:yt};for(var gt in ft)Object.prototype.hasOwnProperty.call(ft,gt)&&(V[gt]=ft[gt]);if(typeof window<"u"){var Us=window.hotkeys;V.noConflict=function(e){return e&&window.hotkeys===V&&(window.hotkeys=Us),V},window.hotkeys=V}V.filter=function(){return!0};var sa=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Gs(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,c=o.keydown,m=o.filterPreventDefault,g=m===void 0||m,C=o.enabled,u=C===void 0||C,l=o.enableOnContentEditable,h=l!==void 0&&l,p=b.useRef(null),f=b.useCallback((function(_,E){var A,S;return s&&!s(_)?!g:!!(sa(_,["INPUT","TEXTAREA","SELECT"])&&!sa(_,r)||(A=_.target)!=null&&A.isContentEditable&&!h)||!!(p.current===null||document.activeElement===p.current||(S=p.current)!=null&&S.contains(document.activeElement))&&(a(_,E),!0)}),n?[p,r,s].concat(n):[p,r,s]);return b.useEffect((function(){if(u)return i&&c!==!0&&(t.keydown=!1),V(e,t||{},f),function(){return V.unbind(e,f)};V.unbind(e,f)}),[f,e,u]),p}V.isPressed;const Vs=[],bt="dashboard_card",ee="ai_cfo_dashboard_card";function ra(e,a){return a?e.some((t=>String(t)===ee))?e.slice():[ee,...e]:e.filter((t=>String(t)!==ee))}const Ns=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],Ys=(e,a,t,n,o)=>({card:{dimension:et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),Re=(e,a,t,n,o)=>({card:{dimension:et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),$s=(e,a,t,n)=>Re(void 0,e,Se,a,t),zs=(e,a,t,n,o)=>({card:{dimension:et(Se),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1,spansFullDashboardWidth:!1},data:{funds:n,shouldShowTreasuryPromoIntroVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),Ks=e=>{const a=et(Se);return a.height=Se.height+10,{card:{dimension:a,cardType:ee,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},qs=ae((function(e,a){const t=Hs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:c,shouldShowTreasuryPromoIntroVideo:m,treasuryFetchState:g}=a;let C=n.map(((u,l)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return $s(t,u,l);if(u==="zeni_promo_card")return Re({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,Se,u,l);if(u==="treasury_promo_card")return zs(g,u,l,c,m);if(u==="information_card")return Re(void 0,"Completed",Se,u,l);if(u===ee)return Ks(l);{const h=o.find((p=>p?.reportId===u));return h?(function(p,f,_,E){const A=p.reportId;switch(A){case"card_balance":case"cash_balance":return[Ys(p,f,_,A,E)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[Re(p,f,_,A,E)];case"net_burn_or_income_story_card":return[Re(p,f,_,"net_burn_or_income_story_card",E)];default:return console.error(`card type ${A} not yet supported!`),[]}})(h,h.fetchState,Se,l):[]}})).flat();return a.isSummaryCardsFiltered===!0&&(C=C.filter((u=>Ns.includes(u.card.cardType)==0)).filter((u=>{const l=u.data?.availableNumberOfPeriods;return l!=null?l>0:u.card.cardType!="top_expenses"||u.data==null||(function(h){if(h==null||h.length===0)return!0;let p=!0;for(const f of h)if(f.balance.available.amount!==0){p=!1;break}return p})(u.data.topExpenses.accountsOrdered)===!1}))),{cardDataArray:C,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:le(e,"navbar")},analytics:P,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}}),(function(e,a){const t=a.tenantId,n=M.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)P.trackDashboardCardClicked("cards promo",2),P.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&P.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(P.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),(function(i,c,m,g){if(c!==ee)switch(c){case"card_balance":i(pa());break;case"cash_balance":i(ua());break;case"operating_expenses":i(xa(!0));break;case"revenue":i(wa(!0));break;case"net_burn_or_income":i(Ta(!0));break;case"net_burn_or_income_story_card":i(jo(!0));break;case"cash_position":i(Pa(!0));break;case"top_expenses":i(Ea());break;case"cash_in_cash_out":i(va());break;case"insights_dashboard":i(Bo());break;case"bill_pay_card":i(Ro());break;case"reimbursement_card":i(Oo());break;case"company_details":i(Fo(m));break;case"task_card":i(Do());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(St(Te()));break;case"accounts_receivable_aging":i(kt(Te()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(ma());break;case"rewards_card":g.includes("rewards_card")===!1&&i(xo(!0));break;default:throw new Error(`report type ${c} is not yet supported`)}})(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{P.trackTimeframeSwitch(Na(r),Zs(o),"Dashboard"),(function(s,i,c){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(we(c));break;case"top_expenses":s(Ia(c));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}})(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(wo(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){M.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(P.trackUpdateBurnRateCalculatorSettings(r,s,Po(s)),e(To(t,r,s)))},onVideoPlay:()=>{e(dt())},onRemindMeLaterClick:()=>{e(Eo())},onDontShowAgainClick:()=>{e(dt())},onIntroOutsideClick:()=>{a.isTreasuryPromoIntroClosedByOutsideClick===!0&&a.isTreasuryPromoVideoPlayed!==!0?e(dt()):e(vo())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(de({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(te("navbar"))},onCancelAutoComplete:()=>{e(te("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?me(o,a.tenantEmailDomain):ns(o.zeniId,o.qboId,a.tenantEmailDomain);const s=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}}))(as);function Qs(){const e=ia(),a=Ra(),t=Ua(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=Oa(),s=W(),i=$(),c=H(),m=M.getSignedInUser(),{useFeatureGate:g,useDynamicConfig:C}=_e(),[u,l]=b.useState(!1),[h,p]=b.useState(!1),f=Ba(),{tenantEmailDomain:_}=K(),{isAiCfoAccessEnabled:E,onAskAiCfoClick:A}=oe({mobileExploreReferrer:"Dashboard"}),S=k((I=>I.tenantState.fetchState==="Completed"||I.tenantState.activeTenantFetchState.fetchState==="Completed"?U(I):void 0)),T=S??M.getSignedInUserTenant(_),x=S?.masterTOSInfo?.isMasterTOSAccepted??!1,y=T.tenantId,v=T.companyId;b.useEffect((()=>{u===!1&&c.state?.message==="activation"&&(i(Co(v)),l(!0))}),[c.state,u,v,i]),b.useEffect((()=>{f&&!h&&c.state?.message==="open_ai_cfo_drawer"&&(p(!0),x?(o(!0),s({pathname:c.pathname,search:c.search,hash:c.hash},{replace:!0,state:{...c.state,message:void 0}})):re({location:c,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))}),[c,h,f,x,o,s]);const{isFeatureEnabled:L}=g(B.isApAgingFeatureEnabled),{isFeatureEnabled:se}=g(B.isExpenseAutomationEnabled),{isFeatureEnabled:$e}=g(B.isExpenseAutomationEnabledV2),pe=Zo(),{isFeatureEnabled:ze}=g(B.isTreasuryEnabled),O=Ho(pe),{isFeatureEnabled:X}=g(B.isArAgingFeatureEnabled),{isFeatureEnabled:Ke}=g(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:qe}=g(B.isReferralFeatureEnabled),{isFeatureEnabled:Qa}=g(B.isChargeCardFeatureEnabled),{isFeatureEnabled:Za}=g(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ha}=g(B.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Wa}=g(B.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Xa}=g(B.aiAuditScorePercentage),{configValue:jt}=C(ja.zeniCardsConfig),Ja=jt.charge_card_cashback_rate_per_transaction==null?.0175:jt.charge_card_cashback_rate_per_transaction;if(c.state?.message==="activation"){const I=Wo(c.state?.pathnameStackToGoBack);s(c.pathname,{state:{...c.state,message:void 0,pathnameStackToGoBack:I.newStack}})}const[Mt,en]=b.useState(!1),[at,tn]=b.useState(!1);Gs("command+p, Control+p",(I=>{tn(!at),I.preventDefault()}),{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[at]);const Lt=S?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const he=k((I=>U(I)?.excludedResources)),an=k((I=>I.expenseAutomationViewState.selectedPeriodByTenantId)),nn=!!S?.companyReimbursementInfo?.info?.isReimbursementEnabled,on=!!S?.companyBillPayInfo?.info?.isBillPayEnabled,sn=k((I=>I.treasurySetupViewState.treasuryFundsDetails)).fetchStatus.fetchState,rn=S?.company!=null&&So(S.company),cn=ze&&rn,nt=ke(),ln=At(nt?.loggedInUserRoleMap),z=[],Ut=he?.resources?.find((I=>I.resource==="/reports/top_expenses"))==null,dn=he?.resources?.find((I=>I.resource==="/reports/task_card"))==null,ot=S?.userRole!=null&&_a(S?.userRole),un=he?.resources?.find((I=>I.resource==="/bills"))==null&&!ot,mn=he?.resources?.find((I=>I.resource==="/reimbursements"))==null,pn=ko(nt?.loggedInUserRoleMap),hn=_o(nt?.loggedInUserRoleMap),fn=S?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,gn=S?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,bn=k((I=>I.treasurySetupViewState.treasuryFundsDetails)).fundsDetails;Ut===!1&&z.push("top_expenses"),dn===!1&&z.push("task_card"),un===!1&&z.push("bill_pay_card","bill_pay_promo_card"),L===!1&&z.push("accounts_payable_aging"),X===!1&&z.push("accounts_receivable_aging"),(pe===!1||ot)&&z.push("expense_automation_card"),mn===!1&&z.push("reimbursement_card","reimbursement_promo_card"),z.push("zeni_accounts_promo_card","treasury_promo_card"),qe===!1&&z.push("rewards_card");const{areTenantIdsInSync:Gt}=Xo();b.useLayoutEffect((()=>{Mt&&O===pe||Lt!==!0||!Gt||he?.fetchState!=="Completed"&&he?.fetchState!=="Error"||(en(!0),i(yo(m.userId,v,y,!0,!1,z)))}),[Mt,m,y,i,Ut,Lt,he?.fetchState,Gt]);const Cn=k((I=>I.reportUIOptionsState.forecastOnDashboard.isForecastModeOn)),Sn=k((I=>I.revenueState.uiState.selectedForecast?.id)),kn=k((I=>I.cardBalanceState.fetchState)),fe=k((I=>Ao(I,z,m,$e,se))),_n=fe.fetchState,yn=b.useMemo((()=>ra(fe.cardsOrdered,E)),[fe.cardsOrdered,E]),An=b.useMemo((()=>ra(fe.cardsForDashboardUI,E)),[fe.cardsForDashboardUI,E]);Ge({isDataReady:!0});const{isSuggestedQuestionsLoading:In,suggestedPromptQuestions:vn}=ss(),st=S?.isTreasuryPromoVideoPlayed===!0,Vt=S?.isTreasuryPromoVideoRemindMeLaterClicked===!0,Nt=S?.loginCounterForTreasuryPromoVideo??0,En=S?.isTreasuryPromoIntroClosedByOutsideClick===!0,Yt=k((I=>I.dashboardState.isTreasuryVideoClosed)),$t=b.useMemo((()=>Jo({isTreasuryPromoVideoRemindMeLaterClicked:Vt,isTreasuryPromoVideoPlayed:st,loginCounterForTreasuryPromoVideo:Nt,isTreasuryVideoClosed:Yt})),[Vt,st,Nt,Yt]),zt=k((I=>ha(I))),ye=zt.uiState?.currentChatSessionId,rt=zt.allSessionsWithOrderedQuestionAnswers??Vs,{currentSessionQuestionAnswers:Pn}=es(rt,ye),Kt=Pn.length===0,Tn=b.useCallback(((I,Q,J)=>{const Ae=m?.userId;if(Ae==null)return;const G=I.trim();if(G.length===0&&Q.length===0)return;if(!x)return void re({location:c,navigate:s,mergeState:{referrer:"Dashboard",...G.length>0?{aiCfoInitialQuestion:G,aiCfoInitialSubmissionSource:bt,...typeof J=="number"?{aiCfoSuggestionIndex:J}:{}}:{}}});const Z=Ma(e.getState()),Ie=()=>{const ve=w(c.state?.pathnameStackToGoBack,c.pathname);s(`/${_}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:ve,referrer:"Dashboard",aiCfoInitialQuestion:G,aiCfoShouldSubmit:!Z&&G.length>0,aiCfoInitialSubmissionSource:bt,...typeof J=="number"?{aiCfoSuggestionIndex:J}:{}}})};return t?Q.length>0?void o(!0):void Ie():Q.length>0?Z?(i(_t(G)),void o(!0)):(r(G.length>0?G:null),o(!0),void(G.length>0&&La(i,G,bt,ye,rt,Ae,J,Q.length>0?Q:void 0))):(Z&&i(_t(G)),void Ie())}),[rt,ye,i,x,t,c,s,r,o,m?.userId,e,_]),wn=b.useCallback((()=>{x?o(!0):re({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})}),[x,c,s,o]),xn=b.useCallback((()=>{if(!x)return void re({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});if(_==null)return;const I=w(c.state?.pathnameStackToGoBack,c.pathname);s(`/${_}/ai-cfo/explore`,{state:{pathnameStackToGoBack:I,referrer:"Dashboard"}})}),[x,c,s,_]),Dn=b.useCallback((()=>{if(x)if(t){if(_==null||S==null)return;const I=ye==null||Kt?`/${_}/ai-cfo/explore`:`/${_}/ai-cfo/${ye}`,Q=c.state?.pathnameStackToGoBack??[],J=w(Q,c.pathname);s(I,{state:{...c.state,pathnameStackToGoBack:J,[ts]:!0}})}else re({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});else re({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})}),[x,t,c,s,_,S,ye,Kt]);return d.jsxs(d.Fragment,{children:[_n==="Completed"?d.jsx(Ve,{analytics:P,onLoad:I=>{I.trackPageLoaded(N.Event.dashboard),cn&&$t===!0&&I.trackTreasuryPromoView("Dashboard Promo Video")}}):null,d.jsx(qs,{maxColumns:n?2:void 0,isAiCfoAccessEnabled:E,onAskAiCfoClick:A,onAiCfoDashboardOpenPanel:wn,onAiCfoDashboardOpenScopePage:Dn,isAiCfoFileUploadEnabled:Za===!0&&t===!1,onAiCfoDashboardPromptSubmit:Tn,onAiCfoDashboardExpandToFullPage:xn,aiCfoDashboardShouldClearPromptOnSubmit:x,aiCfoDashboardSuggestedPromptQuestions:vn,aiCfoDashboardSuggestedPromptQuestionsLoading:In,onDragAndDropCard:(I,Q)=>{if(I===ee||Q===ee)return;const J=(function(Z,Ie,ve){const it=ve.indexOf(Z),ct=ve.indexOf(Ie);if(it===-1||ct===-1||it===ct)return ve;const lt=[...ve];return lt.splice(it,1),lt.splice(ct,0,Z),lt})(I,Q,yn),Ae=J.filter((Z=>Z!==ee)),G=fe.cardsOrdered;(Ae.length!==G.length||Ae.some(((Z,Ie)=>Z!==G[Ie])))&&i(Io(Ae))},dashboardReport:fe,passedCardsOrdered:An,tenantId:y,companyId:v,tenantEmailDomain:_,location:c,navigate:s,isApAgingFeatureEnabled:L,isArAgingFeatureEnabled:X,isBillPayEnabled:on,isReimbursementEnabled:nn,isSummaryCardsFiltered:at,isForecastOn:Cn,selectedForecastOnDashboard:Sn,isVisitingFirstTime:u,isZeniAccountEnabled:Ke,isRewardsFeatureEnabled:qe,hasZeniAccountsAdminAccess:ln,isExpenseAutomationEnabledForUser:pe&&ot===!1,selectedPeriod:an[y],isChargeCardFeatureEnabled:Qa,isUserHasCardsAccess:pn,isUserHasTreasuryAccess:hn,cardsCreditLimit:fn,cashbackRate:Ja,isInterestedInChargeCard:gn,cardBalanceFetchState:kn,christmasAnimationEnabled:Ha,newYearAnimationEnabled:Wa,treasuryFundDetails:bn,shouldShowTreasuryPromoIntroVideo:$t,isTreasuryPromoVideoPlayed:st,isTreasuryPromoIntroClosedByOutsideClick:En,treasuryFetchState:sn,aiAuditScorePercentageEnabled:Xa})]})}const Zs=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},Hs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map((a=>a.fetchState)).reduce(((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t));function Ir(){const e=ke(),a=e?.excludedResources?.find((m=>m.resource==="/reports/top_expenses"))==null,{useFeatureGate:t}=_e(),{isFeatureEnabled:n}=t(B.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(B.isArAgingFeatureEnabled),r=k((m=>U(m))),{isFeatureEnabled:s}=t(B.isDebitCardFeatureEnabled),i=Mo(s,r),c=Lo(r);return i===!0||c===!0?d.jsx(Ct,{children:d.jsx(F,{path:"/*",element:d.jsx(rs,{})})}):d.jsxs(Ct,{children:[d.jsx(F,{path:"/",element:d.jsx(Qs,{})}),d.jsx(F,{path:"cash_balance/*",element:d.jsx(Xt,{})}),d.jsx(F,{path:"card_balance/*",element:d.jsx(Xt,{})}),d.jsx(F,{path:"operating_expenses/*",element:d.jsx(ie,{})}),d.jsx(F,{path:"operating_expenses/forecast/*",element:d.jsx(ut,{})}),d.jsx(F,{path:"revenue/forecast/*",element:d.jsx(ut,{})}),d.jsx(F,{path:"revenue/*",element:d.jsx(ie,{})}),d.jsx(F,{path:"net_burn_or_income/forecast/*",element:d.jsx(ut,{})}),d.jsx(F,{path:"net_burn_or_income/*",element:d.jsx(ie,{})}),n===!0&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_payable_aging/*",element:d.jsx(cs,{})}),d.jsx(F,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:d.jsx(is,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(ls,{})}),d.jsx(F,{path:"accounts_receivable_aging/*",element:d.jsx(ds,{})})]}),d.jsx(F,{path:"cash_position/*",element:d.jsx(ie,{})}),d.jsx(F,{path:"top_expenses/*",element:a===!0?d.jsx(ie,{}):d.jsx(je,{})}),d.jsx(F,{path:"cash_in_cash_out/*",element:d.jsx(ie,{})}),d.jsx(F,{path:"company_details",element:d.jsx(os,{})}),d.jsx(F,{path:"referrals/*",element:d.jsx(Fn,{to:"../../rewards/refer",replace:!0})}),d.jsx(F,{path:"*",element:d.jsx(je,{})})]})}export{Ir as default};
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-DJbBe3tc.js";import{a as u}from"./sentry-C6T1HHHS.js";import{u as y,j as b,n as w,g as A,N}from"./core-BfWJ7zKT.js";import{Mq as U,e$ as _,g5 as k,Mr as L,on as R,Ms as z}from"./zeni-epic-state-kow6PLud.js";import{u as $,z as f,L as T,t as I,a as j,b as O}from"./index-D9NLhglj.js";import"./mui-ts7KHm6i.js";import{t as P}from"./getLocaleForTenant-0y5Rz6LJ.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="2ca958f3-6c6f-4eba-8810-0d6389adef3a",t._sentryDebugIdIdentifier="sentry-dbid-2ca958f3-6c6f-4eba-8810-0d6389adef3a")}catch{}})();const q=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=O(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=$(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>U(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(q,{})}const M=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],Q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of M)if(t.toLocaleLowerCase().includes(s))return Q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-Dge8uQhE.js";import{a as u}from"./sentry-ConJlCAk.js";import{u as y,j as b,n as w,g as A,N}from"./core-DslHP-Nt.js";import{Mq as U,e$ as _,g5 as k,Mr as L,on as R,Ms as z}from"./zeni-epic-state-COMt8QIe.js";import{u as $,z as f,L as T,t as I,a as j,b as O}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import{t as P}from"./getLocaleForTenant-CkKXTx9H.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="2ca958f3-6c6f-4eba-8810-0d6389adef3a",t._sentryDebugIdIdentifier="sentry-dbid-2ca958f3-6c6f-4eba-8810-0d6389adef3a")}catch{}})();const q=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=O(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=$(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>U(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(q,{})}const M=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],Q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of M)if(t.toLocaleLowerCase().includes(s))return Q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-DJbBe3tc.js";import{h as w,g as C,j as f,n as A,i as P}from"./core-BfWJ7zKT.js";import{QA as k,QH as _,gn as J,gm as K,gl as W,jI as q,NH as L,rS as M,e$ as V,Q6 as D,jG as T,QB as S,QK as j,jE as F,j$ as G}from"./zeni-epic-state-kow6PLud.js";import{bz as X,J as N,w as R,z as U,E as H,s as p,i as v,B as Q,bA as Y,o as z,bB as ee,v as te}from"./index-D9NLhglj.js";import{n as O}from"./mui-ts7KHm6i.js";import"./sentry-C6T1HHHS.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]="3c357b94-7e0c-4689-9cdd-6e7c2e46d7ea",e._sentryDebugIdIdentifier="sentry-dbid-3c357b94-7e0c-4689-9cdd-6e7c2e46d7ea")}catch{}})();const ne=A(null,(function(e,t){return{onSaveVendor:n=>{e(q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(M(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=f((d=>k(d,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
1
+ import{j as l}from"./liveblocks-Dge8uQhE.js";import{h as w,g as C,j as f,n as A,i as P}from"./core-DslHP-Nt.js";import{QA as k,QH as _,gn as J,gm as K,gl as W,jI as q,NH as L,rS as M,e$ as V,Q6 as D,jG as T,QB as S,QK as j,jE as F,j$ as G}from"./zeni-epic-state-COMt8QIe.js";import{bz as X,J as N,w as R,z as U,E as H,s as p,i as v,B as Q,bA as Y,o as z,bB as ee,v as te}from"./index-Cny4F3UP.js";import{n as O}from"./mui-DskYaYyd.js";import"./sentry-ConJlCAk.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]="3c357b94-7e0c-4689-9cdd-6e7c2e46d7ea",e._sentryDebugIdIdentifier="sentry-dbid-3c357b94-7e0c-4689-9cdd-6e7c2e46d7ea")}catch{}})();const ne=A(null,(function(e,t){return{onSaveVendor:n=>{e(q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(M(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=f((d=>k(d,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-DJbBe3tc.js";import{J as f,F as l,E as c}from"./index-D9NLhglj.js";import{D as b}from"./mui-ts7KHm6i.js";import"./sentry-C6T1HHHS.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]="46e4a70d-33eb-4e06-84bf-5f6b73a31fe2",e._sentryDebugIdIdentifier="sentry-dbid-46e4a70d-33eb-4e06-84bf-5f6b73a31fe2")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=f(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
1
+ import{j as i}from"./liveblocks-Dge8uQhE.js";import{J as f,F as l,E as c}from"./index-Cny4F3UP.js";import{D as b}from"./mui-DskYaYyd.js";import"./sentry-ConJlCAk.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]="46e4a70d-33eb-4e06-84bf-5f6b73a31fe2",e._sentryDebugIdIdentifier="sentry-dbid-46e4a70d-33eb-4e06-84bf-5f6b73a31fe2")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=f(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DJbBe3tc.js";import{a as d}from"./sentry-C6T1HHHS.js";import{h as A,u as B,g as G,i as N,j as l,N as q,n as F,o as _,p as $}from"./core-BfWJ7zKT.js";import{OP as z,e$ as K,Ob as L,lL as M,KI as k,OU as R,NG as W,kL as Y,KJ as S,Og as H,Oh as J,NI as U,NH as V}from"./zeni-epic-state-kow6PLud.js";import{aX as X,f as Q,s as Z,v as tt}from"./index-D9NLhglj.js";import"./mui-ts7KHm6i.js";import{d as I}from"./decodeURIComponentSafe-D2jiQ7Do.js";import{w as et}from"./withTransactionSidePanel-QwShhfS-.js";import{f as at,c as nt}from"./routePaths-DxGoZobb.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";import"./useAskAiCfoHostNavButtonProps-D8n0-rNW.js";import"./TransactionDetailScreen-CSzx81zE.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="bc465697-4385-4c38-94d5-278f2486a3fb",a._sentryDebugIdIdentifier="sentry-dbid-bc465697-4385-4c38-94d5-278f2486a3fb")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=R(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:Q,isAccountingClassesEnabled:Y(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(U({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(V("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(X),it=et((function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,h]=d.useState(!1),[T,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:w,entityNameEncoded:x}=N(),r=I(w??""),p=I(x??""),f=rt(r,p),O=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l((n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),j=l((n=>K(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>L(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(h(!0),o(M(i)))}),[m,f,i]);const P=l((n=>n.trendState.fetchState)),E=u?.selectedPeriod?.timePeriod??D,v=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,D);return d.useEffect((()=>{m===!0&&T===!1&&P==="Completed"&&(g(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,T,P]),f?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{h(!1),g(!1)},...t}):s.jsx(q,{to:b(O.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(_,{children:s.jsx($,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-Dge8uQhE.js";import{a as d}from"./sentry-ConJlCAk.js";import{h as A,u as B,g as G,i as N,j as l,N as q,n as F,o as _,p as $}from"./core-DslHP-Nt.js";import{OP as z,e$ as K,Ob as L,lL as M,KI as k,OU as R,NG as W,kL as Y,KJ as S,Og as H,Oh as J,NI as U,NH as V}from"./zeni-epic-state-COMt8QIe.js";import{aX as X,f as Q,s as Z,v as tt}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import{d as I}from"./decodeURIComponentSafe-uhKYYVbR.js";import{w as et}from"./withTransactionSidePanel-BWGtTu19.js";import{f as at,c as nt}from"./routePaths-BRZr86UY.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.js";import"./useAskAiCfoHostNavButtonProps-Dbk2QnY2.js";import"./TransactionDetailScreen-CaupyqkA.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="bc465697-4385-4c38-94d5-278f2486a3fb",a._sentryDebugIdIdentifier="sentry-dbid-bc465697-4385-4c38-94d5-278f2486a3fb")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=R(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:Q,isAccountingClassesEnabled:Y(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(U({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(V("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(X),it=et((function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,h]=d.useState(!1),[T,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:w,entityNameEncoded:x}=N(),r=I(w??""),p=I(x??""),f=rt(r,p),O=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l((n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),j=l((n=>K(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>L(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(h(!0),o(M(i)))}),[m,f,i]);const P=l((n=>n.trendState.fetchState)),E=u?.selectedPeriod?.timePeriod??D,v=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,D);return d.useEffect((()=>{m===!0&&T===!1&&P==="Completed"&&(g(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,T,P]),f?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{h(!1),g(!1)},...t}):s.jsx(q,{to:b(O.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(_,{children:s.jsx($,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,4 +1,4 @@
1
- import{j as S}from"./liveblocks-DJbBe3tc.js";import ia from"./NotFoundScreen-DsR8VsQv.js";import{a,b as tn}from"./sentry-C6T1HHHS.js";import{n as Le,S as la}from"./mui-ts7KHm6i.js";import{u as Se,h as nn,g as tt,j as R,n as ra,i as Vt,o as da,p as Ke}from"./core-BfWJ7zKT.js";import{e$ as Oe,Ty as ua,ox as ve,g0 as ma,st as pa,Tz as We,fD as nt,TA as Ot,el as ha,fm as ga,TB as _t,TC as Be,pd as Ca,TD as Sa,pq as Ia,oO as an,gt as ue,gv as fa,TE as ka,p7 as on,pt as Ea,TF as sn,oI as ba,r$ as Ta,fN as ye,TG as _e,uz as cn,EV as ln,TH as rn,TI as ya,rz as at,OQ as zt,OS as va,kO as Aa,OT as Pa,kV as wa,c$ as Ra,vP as ot,oU as dn,py as ze,TJ as xa,NI as Mt,NH as Fe,TK as Lt,la as Da,TL as Ua,TM as Fa,TN as Ba,TO as Va,o$ as Oa,pB as Ve,TP as _a,TQ as za,TR as Ma,pI as La,kZ as ja,kQ as $a,TS as qa,kY as jt,P1 as Ga,TT as Na,TU as Ja,rv as Ya,r7 as Qa,pz as Ce,r6 as Ze,TV as Ha,TW as Ka,TX as Wa,mt as Za,bo as Xa,mo as $t,ma as eo,TY as to,gG as no,ml as ao,xI as oo,TZ as so,q7 as co,q2 as io,q6 as lo,pT as ro,T_ as uo,fQ as un,ph as mo,oX as po,g1 as qt,pD as ho,T$ as go,U0 as Co,pA as mn,U1 as So,U2 as Io,U3 as fo,U4 as ko,U5 as Gt,rH as Eo,q_ as bo,NG as To,U6 as yo,U7 as vo,kX as Ao,U8 as Po,JJ as wo,kW as Ro,kL as xo,fP as Do,qw as pn,qS as Uo,px as Nt,pC as Fo,bE as Bo,mi as Vo,mf as Oo,U9 as _o,pS as Jt,qO as Yt,qM as zo,Ua as Mo,qB as Lo,qh as jo,qP as $o,Ub as qo,Uc as Go,ql as No,Ud as Jo,qc as Yo,qk as Qo,qi as Ho,qV as Ko}from"./zeni-epic-state-kow6PLud.js";import{w as Me,i as Q,f as J,v as ie,X as hn,a0 as gn,cZ as Wo,z as je,c_ as Zo,c$ as Xo,d0 as es,au as Ae,d1 as ts,d2 as Qt,aZ as Ht,B as Cn,d3 as ns,ar as Xe,a as as,a9 as os,d4 as ss,a4 as cs,d5 as is,W as ls,d6 as rs,d7 as ds,x as us,D as ms,aS as ps,d8 as hs,d9 as gs,be as Cs,F as Ss,aV as Is}from"./index-D9NLhglj.js";import{u as Sn}from"./useAskAiCfoHostNavButtonProps-D8n0-rNW.js";import{f as Kt,a as fs,b as ks,g as Es,C as bs}from"./TransactionDetailScreen-CSzx81zE.js";import{w as Ts}from"./withTransactionSidePanel-QwShhfS-.js";import{h as ys,v as vs}from"./routePaths-DxGoZobb.js";import{g as et}from"./accountMappingHelper-gMZWceAt.js";import{D as As}from"./DrawerScreen-DNRTfvlv.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";import"./decodeURIComponentSafe-D2jiQ7Do.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d8703adb-9e59-4864-be37-8204e36956b7",t._sentryDebugIdIdentifier="sentry-dbid-d8703adb-9e59-4864-be37-8204e36956b7")}catch{}})();const Ps=()=>{const t=Se(),s=nn(),P=tt(),E=R((u=>Oe(u))),{useFeatureGate:T}=Me(),{isFeatureEnabled:i}=T(Q.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:m}=T(Q.aiAuditScorePercentage),I=R((u=>u.expenseAutomationViewState.selectedPeriodByTenantId)),c=R((u=>ua(u,E.tenantId))),{isAiCfoAccessEnabled:C,onAskAiCfoClick:h}=Sn({mobileExploreReferrer:"Month-End Close Overview"}),w=a.useCallback(((u,M,ae=!1)=>{t(ve({tenantId:M,period:{month:u.month,year:u.year},refreshViewInBackground:ae}))}),[]),v=a.useCallback((u=>{const M=P.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(u.month,u.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,M??null),t(ma(E.tenantId,u))}),[E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),r=I[E.tenantId],p=a.useCallback((()=>{const u=P.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(r.month,r.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,u??null),w(r,E.tenantId,!0)}),[w,r,E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),V=ie(P.state?.pathnameStackToGoBack,P.pathname),x=a.useCallback((()=>{if(c.monthEndCloseChecks!=null&&r!=null){const u=c.monthEndCloseChecks.monthEndCloseCheckList.find((M=>M.progress<100));if(u!=null)return void s(`./${u.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:V,message:"comingFromOverview"}});s(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:V,message:"comingFromOverview"}})}}),[c.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=hn();return gn({isDataReady:c.fetchState==="Completed"}),a.useEffect((()=>{r!=null&&c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&f&&w(r,E.tenantId)}),[w,r,c.fetchState,E.tenantId,f]),a.useEffect((()=>{r!=null&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(pa(r))}),[r,c.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect((()=>{const u=setInterval((()=>{c.fetchState!=="In-Progress"&&c.fetchState==="Completed"&&p()}),3e5);return()=>clearInterval(u)}),[c.fetchState]),a.useEffect((()=>{if(c.fetchState==="Completed"&&c.monthEndCloseChecks?.auditSummary!=null){const u=P.state?.referrer;J.trackMonthCloseAuditPage(c.selectedPeriod.month,c.selectedPeriod.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,u??null)}}),[c.fetchState,c.selectedPeriod,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(ws,{children:S.jsx(Wo,{monthEndCloseChecksView:c,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:u=>{s(`./${u}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:V,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:x,onBackClick:()=>{s("../../dashboard")},onReload:p,isAiCfoAccessEnabled:C,onAskAiCfoClick:h,aiAuditScorePercentageEnabled:m})})},ws=Le.div`
1
+ import{j as S}from"./liveblocks-Dge8uQhE.js";import ia from"./NotFoundScreen-BEj9MjFe.js";import{a,b as tn}from"./sentry-ConJlCAk.js";import{n as Le,S as la}from"./mui-DskYaYyd.js";import{u as Se,h as nn,g as tt,j as R,n as ra,i as Vt,o as da,p as Ke}from"./core-DslHP-Nt.js";import{e$ as Oe,Ty as ua,ox as ve,g0 as ma,st as pa,Tz as We,fD as nt,TA as Ot,el as ha,fm as ga,TB as _t,TC as Be,pd as Ca,TD as Sa,pq as Ia,oO as an,gt as ue,gv as fa,TE as ka,p7 as on,pt as Ea,TF as sn,oI as ba,r$ as Ta,fN as ye,TG as _e,uz as cn,EV as ln,TH as rn,TI as ya,rz as at,OQ as zt,OS as va,kO as Aa,OT as Pa,kV as wa,c$ as Ra,vP as ot,oU as dn,py as ze,TJ as xa,NI as Mt,NH as Fe,TK as Lt,la as Da,TL as Ua,TM as Fa,TN as Ba,TO as Va,o$ as Oa,pB as Ve,TP as _a,TQ as za,TR as Ma,pI as La,kZ as ja,kQ as $a,TS as qa,kY as jt,P1 as Ga,TT as Na,TU as Ja,rv as Ya,r7 as Qa,pz as Ce,r6 as Ze,TV as Ha,TW as Ka,TX as Wa,mt as Za,bo as Xa,mo as $t,ma as eo,TY as to,gG as no,ml as ao,xI as oo,TZ as so,q7 as co,q2 as io,q6 as lo,pT as ro,T_ as uo,fQ as un,ph as mo,oX as po,g1 as qt,pD as ho,T$ as go,U0 as Co,pA as mn,U1 as So,U2 as Io,U3 as fo,U4 as ko,U5 as Gt,rH as Eo,q_ as bo,NG as To,U6 as yo,U7 as vo,kX as Ao,U8 as Po,JJ as wo,kW as Ro,kL as xo,fP as Do,qw as pn,qS as Uo,px as Nt,pC as Fo,bE as Bo,mi as Vo,mf as Oo,U9 as _o,pS as Jt,qO as Yt,qM as zo,Ua as Mo,qB as Lo,qh as jo,qP as $o,Ub as qo,Uc as Go,ql as No,Ud as Jo,qc as Yo,qk as Qo,qi as Ho,qV as Ko}from"./zeni-epic-state-COMt8QIe.js";import{w as Me,i as Q,f as J,v as ie,X as hn,a0 as gn,cZ as Wo,z as je,c_ as Zo,c$ as Xo,d0 as es,au as Ae,d1 as ts,d2 as Qt,aZ as Ht,B as Cn,d3 as ns,ar as Xe,a as as,a9 as os,d4 as ss,a4 as cs,d5 as is,W as ls,d6 as rs,d7 as ds,x as us,D as ms,aS as ps,d8 as hs,d9 as gs,be as Cs,F as Ss,aV as Is}from"./index-Cny4F3UP.js";import{u as Sn}from"./useAskAiCfoHostNavButtonProps-Dbk2QnY2.js";import{f as Kt,a as fs,b as ks,g as Es,C as bs}from"./TransactionDetailScreen-CaupyqkA.js";import{w as Ts}from"./withTransactionSidePanel-BWGtTu19.js";import{h as ys,v as vs}from"./routePaths-BRZr86UY.js";import{g as et}from"./accountMappingHelper-DXKNp4_g.js";import{D as As}from"./DrawerScreen-DqZSrPso.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.js";import"./decodeURIComponentSafe-uhKYYVbR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d8703adb-9e59-4864-be37-8204e36956b7",t._sentryDebugIdIdentifier="sentry-dbid-d8703adb-9e59-4864-be37-8204e36956b7")}catch{}})();const Ps=()=>{const t=Se(),s=nn(),P=tt(),E=R((u=>Oe(u))),{useFeatureGate:T}=Me(),{isFeatureEnabled:i}=T(Q.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:m}=T(Q.aiAuditScorePercentage),I=R((u=>u.expenseAutomationViewState.selectedPeriodByTenantId)),c=R((u=>ua(u,E.tenantId))),{isAiCfoAccessEnabled:C,onAskAiCfoClick:h}=Sn({mobileExploreReferrer:"Month-End Close Overview"}),w=a.useCallback(((u,M,ae=!1)=>{t(ve({tenantId:M,period:{month:u.month,year:u.year},refreshViewInBackground:ae}))}),[]),v=a.useCallback((u=>{const M=P.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(u.month,u.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,M??null),t(ma(E.tenantId,u))}),[E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),r=I[E.tenantId],p=a.useCallback((()=>{const u=P.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(r.month,r.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,u??null),w(r,E.tenantId,!0)}),[w,r,E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),V=ie(P.state?.pathnameStackToGoBack,P.pathname),x=a.useCallback((()=>{if(c.monthEndCloseChecks!=null&&r!=null){const u=c.monthEndCloseChecks.monthEndCloseCheckList.find((M=>M.progress<100));if(u!=null)return void s(`./${u.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:V,message:"comingFromOverview"}});s(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:V,message:"comingFromOverview"}})}}),[c.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=hn();return gn({isDataReady:c.fetchState==="Completed"}),a.useEffect((()=>{r!=null&&c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&f&&w(r,E.tenantId)}),[w,r,c.fetchState,E.tenantId,f]),a.useEffect((()=>{r!=null&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(pa(r))}),[r,c.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect((()=>{const u=setInterval((()=>{c.fetchState!=="In-Progress"&&c.fetchState==="Completed"&&p()}),3e5);return()=>clearInterval(u)}),[c.fetchState]),a.useEffect((()=>{if(c.fetchState==="Completed"&&c.monthEndCloseChecks?.auditSummary!=null){const u=P.state?.referrer;J.trackMonthCloseAuditPage(c.selectedPeriod.month,c.selectedPeriod.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,u??null)}}),[c.fetchState,c.selectedPeriod,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(ws,{children:S.jsx(Wo,{monthEndCloseChecksView:c,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:u=>{s(`./${u}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:V,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:x,onBackClick:()=>{s("../../dashboard")},onReload:p,isAiCfoAccessEnabled:C,onAskAiCfoClick:h,aiAuditScorePercentageEnabled:m})})},ws=Le.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DJbBe3tc.js";import{a as r}from"./sentry-C6T1HHHS.js";import{a5 as i,a6 as l,a7 as p,s as d}from"./index-D9NLhglj.js";import"./mui-ts7KHm6i.js";import m from"./NotFoundScreen-DsR8VsQv.js";import{h as u,g as b}from"./core-BfWJ7zKT.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="6a5c7a1c-cf7f-40e6-99b9-63f1853bff19",e._sentryDebugIdIdentifier="sentry-dbid-6a5c7a1c-cf7f-40e6-99b9-63f1853bff19")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),f=r.useCallback((()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-Dge8uQhE.js";import{a as r}from"./sentry-ConJlCAk.js";import{a5 as i,a6 as l,a7 as p,s as d}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import m from"./NotFoundScreen-BEj9MjFe.js";import{h as u,g as b}from"./core-DslHP-Nt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="6a5c7a1c-cf7f-40e6-99b9-63f1853bff19",e._sentryDebugIdIdentifier="sentry-dbid-6a5c7a1c-cf7f-40e6-99b9-63f1853bff19")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),f=r.useCallback((()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-C6T1HHHS.js";import{u as f,h as l,g as m}from"./core-BfWJ7zKT.js";import{hC as p,MO as g,MP as b}from"./zeni-epic-state-kow6PLud.js";import{u as _,L as h,z as y}from"./index-D9NLhglj.js";import"./liveblocks-DJbBe3tc.js";import"./recharts-DNnhB5R_.js";import"./mui-ts7KHm6i.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.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]="01741b05-80b9-4544-88f8-dc62844efb5f",e._sentryDebugIdIdentifier="sentry-dbid-01741b05-80b9-4544-88f8-dc62844efb5f")}catch{}})();function P(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{P as default};
1
+ import{a as r}from"./sentry-ConJlCAk.js";import{u as f,h as l,g as m}from"./core-DslHP-Nt.js";import{hC as p,MO as g,MP as b}from"./zeni-epic-state-COMt8QIe.js";import{u as _,L as h,z as y}from"./index-Cny4F3UP.js";import"./liveblocks-Dge8uQhE.js";import"./recharts-BV1Rao9g.js";import"./mui-DskYaYyd.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.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]="01741b05-80b9-4544-88f8-dc62844efb5f",e._sentryDebugIdIdentifier="sentry-dbid-01741b05-80b9-4544-88f8-dc62844efb5f")}catch{}})();function P(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{P as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-DJbBe3tc.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as N,N as ae,o as ne,p}from"./core-BfWJ7zKT.js";import{MH as k,MI as v,MJ as F,BD as B,Bp as T,MK as D,ML as oe,MM as ie,Bt as se,fE as $,BA as le,Bx as re}from"./zeni-epic-state-kow6PLud.js";import{J as g,o as r,q as de,f as j,m as G,r as ce,s as me,U as pe,v as H,w as ue,i as he,G as xe,x as ge,E as fe,y as be,B as we,A as Se,n as ye,C as ke,O as ve,F as je,Y as $e}from"./index-D9NLhglj.js";import{n as m}from"./mui-ts7KHm6i.js";import f from"./NotFoundScreen-DsR8VsQv.js";import{a as I}from"./sentry-C6T1HHHS.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.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]="278ff846-12b1-4ab5-a1cb-b8609bcaed90",e._sentryDebugIdIdentifier="sentry-dbid-278ff846-12b1-4ab5-a1cb-b8609bcaed90")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-Dge8uQhE.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as N,N as ae,o as ne,p}from"./core-DslHP-Nt.js";import{MH as k,MI as v,MJ as F,BD as B,Bp as T,MK as D,ML as oe,MM as ie,Bt as se,fE as $,BA as le,Bx as re}from"./zeni-epic-state-COMt8QIe.js";import{J as g,o as r,q as de,f as j,m as G,r as ce,s as me,U as pe,v as H,w as ue,i as he,G as xe,x as ge,E as fe,y as be,B as we,A as Se,n as ye,C as ke,O as ve,F as je,Y as $e}from"./index-Cny4F3UP.js";import{n as m}from"./mui-DskYaYyd.js";import f from"./NotFoundScreen-BEj9MjFe.js";import{a as I}from"./sentry-ConJlCAk.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.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]="278ff846-12b1-4ab5-a1cb-b8609bcaed90",e._sentryDebugIdIdentifier="sentry-dbid-278ff846-12b1-4ab5-a1cb-b8609bcaed90")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DJbBe3tc.js";import{a as g}from"./sentry-C6T1HHHS.js";import{u as F,g as _,h as O,t as w,j as l,N as E}from"./core-BfWJ7zKT.js";import{z as r,E as P,a as V,g as A,f as N,h as $,S as R,n as W,j as q}from"./index-D9NLhglj.js";import{e$ as B,Ms as G,MC as H,Mt as J,fE as K,g4 as Q,My as X,gx as Y,c_ as Z,MD as ee,ME as te}from"./zeni-epic-state-kow6PLud.js";import{n as ne}from"./mui-ts7KHm6i.js";import{u as se}from"./useDeviceId-DNuYTM17.js";import{f as ae}from"./analyticsHelper-Ib8eUq2U.js";import{t as ie}from"./getLocaleForTenant-0y5Rz6LJ.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c2fd6b98-d82a-474c-931a-ea4dd904e2e6",t._sentryDebugIdIdentifier="sentry-dbid-c2fd6b98-d82a-474c-931a-ea4dd904e2e6")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=F(),a=_(),m=O(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:C,magicLinkEmail:c,verifyDeviceFetchState:D,resendVerifyDeviceOTPFetchState:M}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),b=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>B(e))),y=l((e=>G(e))),T=r.getSignedInUser(),v=P().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),g.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(y.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,y.tenantsInOrder),Y().then((()=>{const e=q();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[h,S,b,s,o,y,v,a.state,t]);const z=g.useCallback((()=>{m("/signin/auth")}),[m]),j=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),U=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:C,verifyOtpFetchState:D.fetchState,resendVerifyDeviceOTPFetchState:M,onResendOtp:j,onVerifyOtp:U,onCancelVerifyDevice:z});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||T!=null){const e=a.state?.origin??"/";return u.jsx(E,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(E,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-Dge8uQhE.js";import{a as g}from"./sentry-ConJlCAk.js";import{u as F,g as _,h as O,t as w,j as l,N as E}from"./core-DslHP-Nt.js";import{z as r,E as P,a as V,g as A,f as N,h as $,S as R,n as W,j as q}from"./index-Cny4F3UP.js";import{e$ as B,Ms as G,MC as H,Mt as J,fE as K,g4 as Q,My as X,gx as Y,c_ as Z,MD as ee,ME as te}from"./zeni-epic-state-COMt8QIe.js";import{n as ne}from"./mui-DskYaYyd.js";import{u as se}from"./useDeviceId-DS-lzRmX.js";import{f as ae}from"./analyticsHelper-DyhEHOhh.js";import{t as ie}from"./getLocaleForTenant-CkKXTx9H.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c2fd6b98-d82a-474c-931a-ea4dd904e2e6",t._sentryDebugIdIdentifier="sentry-dbid-c2fd6b98-d82a-474c-931a-ea4dd904e2e6")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=F(),a=_(),m=O(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:C,magicLinkEmail:c,verifyDeviceFetchState:D,resendVerifyDeviceOTPFetchState:M}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),b=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>B(e))),y=l((e=>G(e))),T=r.getSignedInUser(),v=P().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),g.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(y.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,y.tenantsInOrder),Y().then((()=>{const e=q();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[h,S,b,s,o,y,v,a.state,t]);const z=g.useCallback((()=>{m("/signin/auth")}),[m]),j=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),U=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:C,verifyOtpFetchState:D.fetchState,resendVerifyDeviceOTPFetchState:M,onResendOtp:j,onVerifyOtp:U,onCancelVerifyDevice:z});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||T!=null){const e=a.state?.origin??"/";return u.jsx(E,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(E,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1 +1 @@
1
- import{j as B}from"./liveblocks-DJbBe3tc.js";import{a as u}from"./sentry-C6T1HHHS.js";import{u as pe,j as n,i as We,g as He,h as Qe,l as P}from"./core-BfWJ7zKT.js";import{e$ as he,fJ as Je,fK as be,fv as Ke,bn as Xe,e_ as qe,fL as ea,fM as aa,fO as ta,fR as na,fS as E,fU as sa,fV as le,fY as oa,fW as ia,fX as ra,fZ as da,cQ as ca,f$ as la,cW as ua,fu as fa,g4 as ma,g5 as pa,g3 as ha}from"./zeni-epic-state-kow6PLud.js";import{a9 as ba,aa as Sa,x as ga,w as Ea,z as C,y as ka,u as Ca,i as r,d as ya,Q as Ia,ab as Ta,D as _a,c as wa,ac as Aa,a5 as Da,ad as Fa,ae as va,af as ue,ag as fe,L as $a,ah as xa,ai as me,f as R,a1 as Ma,v as w,aj as V,ak as Ga}from"./index-D9NLhglj.js";import{D as Pa}from"./mui-ts7KHm6i.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="11618c80-871e-4189-931c-cd2af39af133",m._sentryDebugIdIdentifier="sentry-dbid-11618c80-871e-4189-931c-cd2af39af133")}catch{}})();const Ra=ba((({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=He(),y=ga(),o=Qe(),N=Ke(),c=pe(),{useFeatureGate:i}=Ea(),U=C.getSignedInUser(),O=Xe(U),s=n((e=>he(e))),Se=s.masterTOSInfo?.isMasterTOSAccepted??!1,L=n((e=>qe(e))),j=L.uiState.currentChatSessionId,I=ka(),{setLoading:ge}=Ca(),[A,Z]=u.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,b=P("/:tenantEmailDomain/onboarding/*")!==null,Ee=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),Ce=ya(s,ke,Y),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),W=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),F=n((e=>aa(e)));u.useEffect((()=>{I&&T&&!b&&F.fetchState==="Not-Started"&&c(ta(!0))}),[I,T,F.fetchState,b]);const S=C.getSignedInUser(),v=n((e=>e.tenantState)),Ie=n((e=>v.fetchState==="Completed"?na(e):[])),k=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:_e}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Ae}=i(r.isExpenseAutomationEnabledV2),H=Ia(),{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarNewYearAnimationEnabled),$=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:xe}=i(r.isTaskManagerCustomerUserAccessEnabled),x=O||!O&&xe,Me=n((e=>E(e).totalUnreadCount)),Ge=n((e=>E(e).reducedFetchCountState)),Q=n((e=>E(e).notificationDetailsByTab.tasks.uiState.unreadCount)),J=n((e=>E(e).notificationDetailsByTab.comments.uiState.unreadCount)),K=n((e=>E(e).notificationDetailsByTab.tasks.fetchCountState)),_=n((e=>E(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:X,isLoading:q,isFetchingMore:ee,hasFetchedAll:ae,fetchMore:Pe}=Ta();u.useEffect((()=>{const e=setTimeout((()=>Pe?.()),0);return()=>clearTimeout(e)})),u.useEffect((()=>{if(q===!1&&ee===!1&&ae===!0)if(s?.companyId!=null&&X!=null){const e=`dashboard_${s.companyId}`;Z(X.filter((f=>f.roomId===e&&f.readAt==null)).length)}else Z(0)}),[q,ee,ae]),u.useEffect((()=>{I&&x&&!b&&K.fetchState==="Not-Started"&&N.tenantId!=null&&c(sa("task_manager","dashboard"))}),[I,x,b,K.fetchState,N.tenantId,c]),u.useEffect((()=>{b||_.fetchState!=="Not-Started"||c(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[b,_.fetchState,c]),u.useEffect((()=>{A!=null&&_.fetchState==="In-Progress"&&(c(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),c(be({unreadCount:A},"comments")))}),[A,_.fetchState]);const Re={fetchStatus:Ge,count:Me},te=t!=null?C.getSignedInUserTenant(t):null,ne=n((e=>te?.tenantId!=null?oa(e,te.tenantId):void 0)),g=[];Te===!1&&g.push("accounts_payable_aging"),_e===!1&&g.push("accounts_receivable_aging"),g.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&g.push("rewards_card"),H===!1&&g.push("expense_automation_card");const Ve=_a(),se=n((e=>ia(e,g,S,Ae,we).fetchState)),oe=n((e=>ra(e).fetchState)),Be=D&&(se==="Completed"||se==="Error")||z&&(oe==="Completed"||oe==="Error")||!D&&!z?void 0:"disabled",Ne=u.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=ca(Ne),Oe=s?.rewardsLastViewedTime==null,Le=S?.userEmail!=null&&W.fetchState==="Completed"&&la(W.notificationSettings,S.userEmail,Y,s),ie=wa(),je=ie&&Aa(a),re=ua(Ve?.loggedInUserRoleMap),de=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=u.useCallback((()=>$&&re&&!C.getTreasuryPopupSeen(t??"")&&de===!1&&Da(a.pathname)!=="treasury"),[$,re,de,a.pathname,t]),[Ze,ce]=u.useState(M);u.useEffect((()=>{ce(M())}),[M]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);return B.jsx(Pa,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:B.jsx(va,{signedInUser:U,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ie:ne!=null?[ne]:[],currentTenant:s,isTenantDropdownDisabled:Be,isSettings:fe(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:Ue,isZeniAccountEnabled:Ee,isChargeCardEnabled:Ce,isTreasuryEnabled:$,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:Le,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:H,selectedMenu:ue(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:F.rewardsPlan},isAiCfoAccessEnabled:ie,onNotificationIconClick:()=>{d(!1);let e=Q===0&&J>0?"notifications/comments":"notifications/tasks";fe(a)&&(e=Q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const f=w(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:f}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!Se)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const h=w(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:h,referrer:"Sidebar"}})}const f=w(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=V(l)&&l!=="command_center";if(V(e.type)&&k[s.tenantId]!=null&&R.trackMonthEndCloseClicked(k[s.tenantId].month,k[s.tenantId].year,"Sidebar"),p&&k[s.tenantId]!=null){const h=k[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}})}const G=Ga(e.type);me(e.type)?(j!=null&&c(ha()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:f.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${G}`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{ge($a.TENANT_SWITCHING),d(!1);const f=e.tenantEmailDomain,l=ue(a);let p=`/${encodeURIComponent(f)}/`;const G=V(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":xa(l)?p+="settings/my_profile":me(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":G?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),S!=null&&(c(ma(e.tenantId)),c(pa(S.userId,e.tenantId,S.zeniSessionId)));const h=e;R.trackCompanySwitch(h.companyId,h.companyName,h.userRole)},handlePopupClose:()=>{C.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{y.toggle()},isAiCfo:je,aiCfoView:L,isOnDashboard:D,updateCurrentChatSessionId:e=>{c(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:x,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:ve,newYearAnimationEnabled:$e})})})),ja=m=>{const d=pe(),t=n((y=>he(y))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(y,o)=>{Sa(o)&&Je(o.mode)==="dashboard"&&d(be({unreadCount:o.data.unread},"tasks"))}};return B.jsx(Ra,{...m,...a})};export{ja as M};
1
+ import{j as B}from"./liveblocks-Dge8uQhE.js";import{a as u}from"./sentry-ConJlCAk.js";import{u as pe,j as n,i as We,g as He,h as Qe,l as P}from"./core-DslHP-Nt.js";import{e$ as he,fJ as Je,fK as be,fv as Ke,bn as Xe,e_ as qe,fL as ea,fM as aa,fO as ta,fR as na,fS as E,fU as sa,fV as le,fY as oa,fW as ia,fX as ra,fZ as da,cQ as ca,f$ as la,cW as ua,fu as fa,g4 as ma,g5 as pa,g3 as ha}from"./zeni-epic-state-COMt8QIe.js";import{a9 as ba,aa as Sa,x as ga,w as Ea,z as C,y as ka,u as Ca,i as r,d as ya,Q as Ia,ab as Ta,D as _a,c as wa,ac as Aa,a5 as Da,ad as Fa,ae as va,af as ue,ag as fe,L as $a,ah as xa,ai as me,f as R,a1 as Ma,v as w,aj as V,ak as Ga}from"./index-Cny4F3UP.js";import{D as Pa}from"./mui-DskYaYyd.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="11618c80-871e-4189-931c-cd2af39af133",m._sentryDebugIdIdentifier="sentry-dbid-11618c80-871e-4189-931c-cd2af39af133")}catch{}})();const Ra=ba((({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=He(),y=ga(),o=Qe(),N=Ke(),c=pe(),{useFeatureGate:i}=Ea(),U=C.getSignedInUser(),O=Xe(U),s=n((e=>he(e))),Se=s.masterTOSInfo?.isMasterTOSAccepted??!1,L=n((e=>qe(e))),j=L.uiState.currentChatSessionId,I=ka(),{setLoading:ge}=Ca(),[A,Z]=u.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,b=P("/:tenantEmailDomain/onboarding/*")!==null,Ee=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),Ce=ya(s,ke,Y),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),W=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),F=n((e=>aa(e)));u.useEffect((()=>{I&&T&&!b&&F.fetchState==="Not-Started"&&c(ta(!0))}),[I,T,F.fetchState,b]);const S=C.getSignedInUser(),v=n((e=>e.tenantState)),Ie=n((e=>v.fetchState==="Completed"?na(e):[])),k=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:_e}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Ae}=i(r.isExpenseAutomationEnabledV2),H=Ia(),{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarNewYearAnimationEnabled),$=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:xe}=i(r.isTaskManagerCustomerUserAccessEnabled),x=O||!O&&xe,Me=n((e=>E(e).totalUnreadCount)),Ge=n((e=>E(e).reducedFetchCountState)),Q=n((e=>E(e).notificationDetailsByTab.tasks.uiState.unreadCount)),J=n((e=>E(e).notificationDetailsByTab.comments.uiState.unreadCount)),K=n((e=>E(e).notificationDetailsByTab.tasks.fetchCountState)),_=n((e=>E(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:X,isLoading:q,isFetchingMore:ee,hasFetchedAll:ae,fetchMore:Pe}=Ta();u.useEffect((()=>{const e=setTimeout((()=>Pe?.()),0);return()=>clearTimeout(e)})),u.useEffect((()=>{if(q===!1&&ee===!1&&ae===!0)if(s?.companyId!=null&&X!=null){const e=`dashboard_${s.companyId}`;Z(X.filter((f=>f.roomId===e&&f.readAt==null)).length)}else Z(0)}),[q,ee,ae]),u.useEffect((()=>{I&&x&&!b&&K.fetchState==="Not-Started"&&N.tenantId!=null&&c(sa("task_manager","dashboard"))}),[I,x,b,K.fetchState,N.tenantId,c]),u.useEffect((()=>{b||_.fetchState!=="Not-Started"||c(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[b,_.fetchState,c]),u.useEffect((()=>{A!=null&&_.fetchState==="In-Progress"&&(c(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),c(be({unreadCount:A},"comments")))}),[A,_.fetchState]);const Re={fetchStatus:Ge,count:Me},te=t!=null?C.getSignedInUserTenant(t):null,ne=n((e=>te?.tenantId!=null?oa(e,te.tenantId):void 0)),g=[];Te===!1&&g.push("accounts_payable_aging"),_e===!1&&g.push("accounts_receivable_aging"),g.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&g.push("rewards_card"),H===!1&&g.push("expense_automation_card");const Ve=_a(),se=n((e=>ia(e,g,S,Ae,we).fetchState)),oe=n((e=>ra(e).fetchState)),Be=D&&(se==="Completed"||se==="Error")||z&&(oe==="Completed"||oe==="Error")||!D&&!z?void 0:"disabled",Ne=u.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=ca(Ne),Oe=s?.rewardsLastViewedTime==null,Le=S?.userEmail!=null&&W.fetchState==="Completed"&&la(W.notificationSettings,S.userEmail,Y,s),ie=wa(),je=ie&&Aa(a),re=ua(Ve?.loggedInUserRoleMap),de=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=u.useCallback((()=>$&&re&&!C.getTreasuryPopupSeen(t??"")&&de===!1&&Da(a.pathname)!=="treasury"),[$,re,de,a.pathname,t]),[Ze,ce]=u.useState(M);u.useEffect((()=>{ce(M())}),[M]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);return B.jsx(Pa,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:B.jsx(va,{signedInUser:U,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ie:ne!=null?[ne]:[],currentTenant:s,isTenantDropdownDisabled:Be,isSettings:fe(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:Ue,isZeniAccountEnabled:Ee,isChargeCardEnabled:Ce,isTreasuryEnabled:$,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:Le,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:H,selectedMenu:ue(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:F.rewardsPlan},isAiCfoAccessEnabled:ie,onNotificationIconClick:()=>{d(!1);let e=Q===0&&J>0?"notifications/comments":"notifications/tasks";fe(a)&&(e=Q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const f=w(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:f}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!Se)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const h=w(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:h,referrer:"Sidebar"}})}const f=w(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=V(l)&&l!=="command_center";if(V(e.type)&&k[s.tenantId]!=null&&R.trackMonthEndCloseClicked(k[s.tenantId].month,k[s.tenantId].year,"Sidebar"),p&&k[s.tenantId]!=null){const h=k[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}})}const G=Ga(e.type);me(e.type)?(j!=null&&c(ha()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:f.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${G}`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{ge($a.TENANT_SWITCHING),d(!1);const f=e.tenantEmailDomain,l=ue(a);let p=`/${encodeURIComponent(f)}/`;const G=V(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":xa(l)?p+="settings/my_profile":me(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":G?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),S!=null&&(c(ma(e.tenantId)),c(pa(S.userId,e.tenantId,S.zeniSessionId)));const h=e;R.trackCompanySwitch(h.companyId,h.companyName,h.userRole)},handlePopupClose:()=>{C.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{y.toggle()},isAiCfo:je,aiCfoView:L,isOnDashboard:D,updateCurrentChatSessionId:e=>{c(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:x,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:ve,newYearAnimationEnabled:$e})})})),ja=m=>{const d=pe(),t=n((y=>he(y))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(y,o)=>{Sa(o)&&Je(o.mode)==="dashboard"&&d(be({unreadCount:o.data.unread},"tasks"))}};return B.jsx(Ra,{...m,...a})};export{ja as M};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-Dge8uQhE.js";import{h as r,n}from"./core-DslHP-Nt.js";import{N as i}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import"./sentry-ConJlCAk.js";import"./zeni-epic-state-COMt8QIe.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.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]="0d8bbeee-ef94-478e-b36a-0f30a9be8cda",e._sentryDebugIdIdentifier="sentry-dbid-0d8bbeee-ef94-478e-b36a-0f30a9be8cda")}catch{}})();const a=n(null,(function(e,o){return{onGoBack:()=>{o.navigate(-1)},onGoHome:()=>{o.navigate("/")}}}))(i);function _(){const e=r();return t.jsx(a,{navigate:e})}export{_ as default};
@@ -1 +1 @@
1
- import{m as ct,a as mt,n as dt,j as A}from"./liveblocks-DJbBe3tc.js";import lt from"./NotFoundScreen-DsR8VsQv.js";import{a as k}from"./sentry-C6T1HHHS.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as X}from"./core-BfWJ7zKT.js";import{cx as St,fL as z,e$ as H,fZ as bt,fS as b,Tt as O,fV as d,fK as y,sN as M,yj as It,Tu as Tt,fJ as Ct,f$ as yt,sS as Et,Tv as $,bo as F,fD as B,sW as Z,Tw as _t,cJ as At,cC as Nt}from"./zeni-epic-state-kow6PLud.js";import{X as wt,z as xt,w as Bt,i as vt,a0 as Dt,cW as Rt,v as N,a9 as Pt,cX as Ut,aa as Gt,s as $t}from"./index-D9NLhglj.js";import"./mui-ts7KHm6i.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-D8n0-rNW.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="0e937f34-1960-41e5-a3f5-df65747eaf0d",t._sentryDebugIdIdentifier="sentry-dbid-0e937f34-1960-41e5-a3f5-df65747eaf0d")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=z(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:w,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Z("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Z("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{m==="read"&&(w(r),t($([r],F())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,w).then((()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Pt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[w,v]=k.useState(!1),a=S((e=>z(e))),o=S((e=>H(e))),{useFeatureGate:m}=Bt(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Q=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),Y=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),R=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Rt().allUsers,{inboxNotifications:x,isLoading:E,hasFetchedAll:T,isFetchingMore:P,fetchMore:ot}=ct(),{threads:W,isLoading:L,fetchMore:J,isFetchingMore:q,hasFetchedAll:K}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&T===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter((C=>C.roomId===e&&C.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[E,T]),k.useEffect((()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const U=E||P===!0||T!==!0||E||P===!0||T!==!0;k.useEffect((()=>{U&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))}),[U,R]),k.useEffect((()=>{s(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(v(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&L===!1&&x!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=x.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),_=p.map((f=>f.id)),it=p.map((f=>{const G=W.find((rt=>rt.id===f.threadId));return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(q||K===!0||J==null||J(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[E,P,q,T,K,L,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),s(M("task_manager",C,_,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Q,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return A.jsxs(gt,{children:[A.jsx(X,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(X,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
1
+ import{m as ct,a as mt,n as dt,j as A}from"./liveblocks-Dge8uQhE.js";import lt from"./NotFoundScreen-BEj9MjFe.js";import{a as k}from"./sentry-ConJlCAk.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as X}from"./core-DslHP-Nt.js";import{cx as St,fL as z,e$ as H,fZ as bt,fS as b,Tt as O,fV as d,fK as y,sN as M,yj as It,Tu as Tt,fJ as Ct,f$ as yt,sS as Et,Tv as $,bo as F,fD as B,sW as Z,Tw as _t,cJ as At,cC as Nt}from"./zeni-epic-state-COMt8QIe.js";import{X as wt,z as xt,w as Bt,i as vt,a0 as Dt,cW as Rt,v as N,a9 as Pt,cX as Ut,aa as Gt,s as $t}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-Dbk2QnY2.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="0e937f34-1960-41e5-a3f5-df65747eaf0d",t._sentryDebugIdIdentifier="sentry-dbid-0e937f34-1960-41e5-a3f5-df65747eaf0d")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=z(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:w,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Z("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Z("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{m==="read"&&(w(r),t($([r],F())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,w).then((()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Pt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[w,v]=k.useState(!1),a=S((e=>z(e))),o=S((e=>H(e))),{useFeatureGate:m}=Bt(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Q=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),Y=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),R=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Rt().allUsers,{inboxNotifications:x,isLoading:E,hasFetchedAll:T,isFetchingMore:P,fetchMore:ot}=ct(),{threads:W,isLoading:L,fetchMore:J,isFetchingMore:q,hasFetchedAll:K}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&T===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter((C=>C.roomId===e&&C.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[E,T]),k.useEffect((()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const U=E||P===!0||T!==!0||E||P===!0||T!==!0;k.useEffect((()=>{U&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))}),[U,R]),k.useEffect((()=>{s(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(v(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&L===!1&&x!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=x.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),_=p.map((f=>f.id)),it=p.map((f=>{const G=W.find((rt=>rt.id===f.threadId));return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(q||K===!0||J==null||J(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[E,P,q,T,K,L,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),s(M("task_manager",C,_,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Q,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return A.jsxs(gt,{children:[A.jsx(X,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(X,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-DJbBe3tc.js";import{a as r}from"./sentry-C6T1HHHS.js";import{u as T,g as A,j as o,N as R}from"./core-BfWJ7zKT.js";import{MR as j,e$ as C,fR as P,MS as x,MT as z,MU as D,MV as L,on as k,LO as N}from"./zeni-epic-state-kow6PLud.js";import{z as h,_ as I}from"./index-D9NLhglj.js";import"./mui-ts7KHm6i.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="68c09476-3bc6-4ff1-ba49-f9ffdc6e10ba",n._sentryDebugIdIdentifier="sentry-dbid-68c09476-3bc6-4ff1-ba49-f9ffdc6e10ba")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo((()=>j(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o((e=>C(e))),l=o((e=>P(e))),d=o((e=>e.tenantState.fetchState)),b=o(x),y=o(z),c=o(D),[S,v]=r.useState(null),[E,_]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(L())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[f,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const U=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((M=>M.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),u=S??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:v,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(R,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-Dge8uQhE.js";import{a as r}from"./sentry-ConJlCAk.js";import{u as T,g as A,j as o,N as R}from"./core-DslHP-Nt.js";import{MR as j,e$ as C,fR as P,MS as x,MT as z,MU as D,MV as L,on as k,LO as N}from"./zeni-epic-state-COMt8QIe.js";import{z as h,_ as I}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="68c09476-3bc6-4ff1-ba49-f9ffdc6e10ba",n._sentryDebugIdIdentifier="sentry-dbid-68c09476-3bc6-4ff1-ba49-f9ffdc6e10ba")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo((()=>j(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o((e=>C(e))),l=o((e=>P(e))),d=o((e=>e.tenantState.fetchState)),b=o(x),y=o(z),c=o(D),[S,v]=r.useState(null),[E,_]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(L())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[f,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const U=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((M=>M.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),u=S??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:v,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(R,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-DJbBe3tc.js";import{h as z,u as Z,g as X,i as H,j as d,n as J,o as K,p as I}from"./core-BfWJ7zKT.js";import{e$ as U,sB as R,s9 as Q,Nm as v,s4 as S,bs as ee,bn as ae,bZ as te,s5 as se,Nn as oe,N9 as C,dL as re,wg as ne,No as ie,wD as ce,fI as le,fG as de}from"./zeni-epic-state-kow6PLud.js";import{z as me,X as fe,a0 as pe,D as ue,w,i as N,A as he,f as M,ap as ge,v as Fe}from"./index-D9NLhglj.js";import"./mui-ts7KHm6i.js";import be from"./NotFoundScreen-DsR8VsQv.js";import{F as Ie}from"./FeaturePreviewScreen-C_G_t4I9.js";import{a as g}from"./sentry-C6T1HHHS.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-D8n0-rNW.js";import{u as Se}from"./useInitialThreadRequest-BlvltKSe.js";import{t as Te}from"./routePaths-DxGoZobb.js";import{M as ye}from"./MobileAppDrawer-DHMYVxFj.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.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]="8edbf5e1-fdb7-44d5-b092-59e7223ae318",s._sentryDebugIdIdentifier="sentry-dbid-8edbf5e1-fdb7-44d5-b092-59e7223ae318")}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})}},Ae=J((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:M}}),(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=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ge);function O(){const s=z(),e=Z(),a=X(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d((t=>U(t))),$=y.company?.companyInfo.firstMonthOfFY??1,c=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),A=d((t=>t.profitAndLossState)),D=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:q}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!i&&F)p(!0),l||e(Q());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,D?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=D?.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&&!k(c.forecasts[t].id)&&F&&e(S(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,R,S,F]);const x=ue(),G=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=w(),{isFeatureEnabled:L}=_(N.isReportsCommentingEnabled),W=Se(L?y?.companyId:void 0,{clearParams:l&&m}),[Y,V]=g.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(Ae,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:k,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:G,isAiCfoAccessEnabled:B,onAskAiCfoClick:q,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d((i=>U(i))),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(N.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
1
+ import{j as n}from"./liveblocks-Dge8uQhE.js";import{h as z,u as Z,g as X,i as H,j as d,n as J,o as K,p as I}from"./core-DslHP-Nt.js";import{e$ as U,sB as R,s9 as Q,Nm as v,s4 as S,bs as ee,bn as ae,bZ as te,s5 as se,Nn as oe,N9 as C,dL as re,wg as ne,No as ie,wD as ce,fI as le,fG as de}from"./zeni-epic-state-COMt8QIe.js";import{z as me,X as fe,a0 as pe,D as ue,w,i as N,A as he,f as M,ap as ge,v as Fe}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import be from"./NotFoundScreen-BEj9MjFe.js";import{F as Ie}from"./FeaturePreviewScreen-RPVxMb0u.js";import{a as g}from"./sentry-ConJlCAk.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-Dbk2QnY2.js";import{u as Se}from"./useInitialThreadRequest-BP8PKnuv.js";import{t as Te}from"./routePaths-BRZr86UY.js";import{M as ye}from"./MobileAppDrawer-CRLaoS9b.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.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]="8edbf5e1-fdb7-44d5-b092-59e7223ae318",s._sentryDebugIdIdentifier="sentry-dbid-8edbf5e1-fdb7-44d5-b092-59e7223ae318")}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})}},Ae=J((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:M}}),(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=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ge);function O(){const s=z(),e=Z(),a=X(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d((t=>U(t))),$=y.company?.companyInfo.firstMonthOfFY??1,c=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),A=d((t=>t.profitAndLossState)),D=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:q}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!i&&F)p(!0),l||e(Q());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,D?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=D?.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&&!k(c.forecasts[t].id)&&F&&e(S(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,R,S,F]);const x=ue(),G=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=w(),{isFeatureEnabled:L}=_(N.isReportsCommentingEnabled),W=Se(L?y?.companyId:void 0,{clearParams:l&&m}),[Y,V]=g.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(Ae,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:k,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:G,isAiCfoAccessEnabled:B,onAskAiCfoClick:q,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d((i=>U(i))),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(N.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DJbBe3tc.js";import{Ni as oe,e$ as J,kL as G,fI as Y,fG as ie,KM as ee,MY as re,vd as ke,Nj as Q,v2 as ve,vn as Ee,vh as le,v6 as de,vl as Pe,vi as je,Nk as ce,x2 as Le,fs as Te,gk as Ae,Nl as H,va as pe,v9 as ue,vq as Fe,c7 as Re}from"./zeni-epic-state-kow6PLud.js";import{J as me,w as ae,i as _,z as K,d as ge,e as fe,H as he,al as Ce,am as Oe,F as ye,o as O,I as be,a as M,an as Ve,X as Ze,a0 as Be,A as Ue,f as Se,h as $e,v as ze,ao as He,D as _e}from"./index-D9NLhglj.js";import{D as we,n as N,S as xe}from"./mui-ts7KHm6i.js";import te from"./NotFoundScreen-DsR8VsQv.js";import{a as d}from"./sentry-C6T1HHHS.js";import{u as se,i as Ge,j as g,h as Ke,g as Me,n as Ne,o as ne,p as z}from"./core-BfWJ7zKT.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-D8n0-rNW.js";import{M as qe}from"./MobileAppDrawer-DHMYVxFj.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.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]="74b4e53f-1cd0-4586-8fa8-6b569921f82a",e._sentryDebugIdIdentifier="sentry-dbid-74b4e53f-1cd0-4586-8fa8-6b569921f82a")}catch{}})();const Xe={overlayWidth:new ye(100,100,48)},W=M.getLocalizedStrings().peoplePage.invitePage,Qe=M.getLocalizedStrings().common,Je=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ge(),r=g((l=>oe(l))),p=g((l=>J(l))),v=g((l=>G(l))),{useFeatureGate:D}=ae(),{isFeatureEnabled:I}=D(_.isDebitCardFeatureEnabled),E=Y(I,p),L=ie(p),T=ee(p),B=re(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!E&&v&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(Q()),b()},A=()=>{V===!0?S(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=D(_.isChargeCardFeatureEnabled),j=ge(p,P,I),{isCardsHidden:F}=fe(p?.tenantId),y=!j||F,R=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:v,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(de(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(le({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?ve(e):Ee(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Ye,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:Qe.no,action:o,isEditPopup:!0}):null,a.jsx(Oe,{...s})]})})},Ye=N(xe)`
1
+ import{j as a}from"./liveblocks-Dge8uQhE.js";import{Ni as oe,e$ as J,kL as G,fI as Y,fG as ie,KM as ee,MY as re,vd as ke,Nj as Q,v2 as ve,vn as Ee,vh as le,v6 as de,vl as Pe,vi as je,Nk as ce,x2 as Le,fs as Te,gk as Ae,Nl as H,va as pe,v9 as ue,vq as Fe,c7 as Re}from"./zeni-epic-state-COMt8QIe.js";import{J as me,w as ae,i as _,z as K,d as ge,e as fe,H as he,al as Ce,am as Oe,F as ye,o as O,I as be,a as M,an as Ve,X as Ze,a0 as Be,A as Ue,f as Se,h as $e,v as ze,ao as He,D as _e}from"./index-Cny4F3UP.js";import{D as we,n as N,S as xe}from"./mui-DskYaYyd.js";import te from"./NotFoundScreen-BEj9MjFe.js";import{a as d}from"./sentry-ConJlCAk.js";import{u as se,i as Ge,j as g,h as Ke,g as Me,n as Ne,o as ne,p as z}from"./core-DslHP-Nt.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-Dbk2QnY2.js";import{M as qe}from"./MobileAppDrawer-CRLaoS9b.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.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]="74b4e53f-1cd0-4586-8fa8-6b569921f82a",e._sentryDebugIdIdentifier="sentry-dbid-74b4e53f-1cd0-4586-8fa8-6b569921f82a")}catch{}})();const Xe={overlayWidth:new ye(100,100,48)},W=M.getLocalizedStrings().peoplePage.invitePage,Qe=M.getLocalizedStrings().common,Je=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ge(),r=g((l=>oe(l))),p=g((l=>J(l))),v=g((l=>G(l))),{useFeatureGate:D}=ae(),{isFeatureEnabled:I}=D(_.isDebitCardFeatureEnabled),E=Y(I,p),L=ie(p),T=ee(p),B=re(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!E&&v&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(Q()),b()},A=()=>{V===!0?S(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=D(_.isChargeCardFeatureEnabled),j=ge(p,P,I),{isCardsHidden:F}=fe(p?.tenantId),y=!j||F,R=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:v,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(de(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(le({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?ve(e):Ee(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Ye,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:Qe.no,action:o,isEditPopup:!0}):null,a.jsx(Oe,{...s})]})})},Ye=N(xe)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DJbBe3tc.js";import E from"./NotFoundScreen-DsR8VsQv.js";import{a as r}from"./sentry-C6T1HHHS.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as O,p as h}from"./core-BfWJ7zKT.js";import{e$ as B,Tx as b,bq as F,bn as N,ip as V,fD as $}from"./zeni-epic-state-kow6PLud.js";import{x as q,z as I,a0 as Y,cY as G}from"./index-D9NLhglj.js";import"./mui-ts7KHm6i.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-D8n0-rNW.js";import{M as J}from"./MobileAppDrawer-DHMYVxFj.js";import"./recharts-DNnhB5R_.js";import"./analytics-BP5D4JyB.js";import"./plaid-Cv0mPYlm.js";import"./dnd-tQgCG5z3.js";import"./stripe-cKAAJElX.js";import"./lottie-BaCgeYyk.js";import"./lexical-Bg8ldM3i.js";import"./pdf-C9HGpLCu.js";import"./utils-xWcqC4Wl.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]="edeb52c7-cc81-4a77-9823-ccd3f9e9600e",e._sentryDebugIdIdentifier="sentry-dbid-edeb52c7-cc81-4a77-9823-ccd3f9e9600e")}catch{}})();const K=z((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)}}}))(G),L=()=>{const e=_(),t=v(),c=q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),D=C||k||x,d=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=H({mobileExploreReferrer:"Performance"});return Y({isDataReady:n?.fetchState==="Completed"}),D?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-Dge8uQhE.js";import E from"./NotFoundScreen-BEj9MjFe.js";import{a as r}from"./sentry-ConJlCAk.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as O,p as h}from"./core-DslHP-Nt.js";import{e$ as B,Tx as b,bq as F,bn as N,ip as V,fD as $}from"./zeni-epic-state-COMt8QIe.js";import{x as q,z as I,a0 as Y,cY as G}from"./index-Cny4F3UP.js";import"./mui-DskYaYyd.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-Dbk2QnY2.js";import{M as J}from"./MobileAppDrawer-CRLaoS9b.js";import"./recharts-BV1Rao9g.js";import"./analytics-Det0UZFe.js";import"./plaid-ajCcP-UI.js";import"./dnd-CQxwFT7m.js";import"./stripe-cKAAJElX.js";import"./lottie-JtX4it7w.js";import"./lexical-DYyincEg.js";import"./pdf-8n9gC55d.js";import"./utils-KyL5SnF3.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]="edeb52c7-cc81-4a77-9823-ccd3f9e9600e",e._sentryDebugIdIdentifier="sentry-dbid-edeb52c7-cc81-4a77-9823-ccd3f9e9600e")}catch{}})();const K=z((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)}}}))(G),L=()=>{const e=_(),t=v(),c=q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),D=C||k||x,d=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=H({mobileExploreReferrer:"Performance"});return Y({isDataReady:n?.fetchState==="Completed"}),D?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};