@zeniai/web-app-ui 5.4.17-dev → 5.4.18-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-DIZ1qWql.js → AccountMappingScreen-4Zeu95kU.js} +1 -1
- package/dist/assets/{ActualMatchingMatchDetailScreen-C6MMW6xe.js → ActualMatchingMatchDetailScreen-B6pl-MVl.js} +1 -1
- package/dist/assets/AddressRoutes-zjWkB0xf.js +1 -0
- package/dist/assets/{AddressScreen-CxRV-hrD.js → AddressScreen-Czlolp2X.js} +1 -1
- package/dist/assets/{AiCfoScreen-Ct8ctLoM.js → AiCfoScreen-BhfmD__h.js} +1 -1
- package/dist/assets/{AppDrawer-DDlKiLbC.js → AppDrawer-B7GEeTxi.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-WPV-16X0.js → BillPayApprovalRoutes-B4dh4WxY.js} +1 -1
- package/dist/assets/{BillPayRoutes-PQbxiOB3.js → BillPayRoutes-DZx-x_-P.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DaAqJAwC.js → BusinessVerificationPageScreen-je1np7-9.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-CVenT1_U.js → CardsAiCfoScreen-abedaxWu.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-uCAqAWIA.js → ChargeCardRoutes-Db9V9An_.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-DtXzsb3x.js → CompanyPassportScreen-Db20J8Yl.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BC1VQ6tg.js → ConnectionAuthScreen-BmJpUHtJ.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-Deo-LVYJ.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-B6np-cNh.js → CustomerOnboardingRoutes-De4sHn4O.js} +3 -3
- package/dist/assets/{DashboardRoutes-9dawbCei.js → DashboardRoutes-CCGs4e1_.js} +3 -3
- package/dist/assets/{DefaultTenantHome-BgSSAKid.js → DefaultTenantHome-BN__AQ5l.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-u2HKaCWA.js → DomesticWireDetailScreen-6W-Er5_q.js} +3 -3
- package/dist/assets/{DrawerScreen-BmZb1i83.js → DrawerScreen-DUhkZI2Z.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-DV-gNWAZ.js → EntityDetailRoutes-BrJAd36h.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DJyIDCG4.js → ExpenseAutomationRoutes-DcjeaHHd.js} +1 -1
- package/dist/assets/{FallBackRoute--cXyuVDR.js → FallBackRoute-orqRsHMl.js} +2 -2
- package/dist/assets/{FeaturePreviewScreen-DjPPDYKv.js → FeaturePreviewScreen-Dcu53_tf.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-DL6_G6pe.js → HubSpotOAuthCallbackScreen-ClZsPGpZ.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-Daf1RQwd.js → InboxNotificationsProvider-DiTDJFwP.js} +1 -1
- package/dist/assets/{InvoicingRoutes-DKlu_pXq.js → InvoicingRoutes-BTvzZ8JV.js} +2 -2
- package/dist/assets/{MagicLinkRoutes-BkZcOPcj.js → MagicLinkRoutes-V1DxaNiW.js} +5 -5
- package/dist/assets/{MagicLinkSignInScreen-CmIZfa-U.js → MagicLinkSignInScreen-DnCx8Y6G.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DTqKEh3f.js → MobileAppDrawer-Bql3K6nh.js} +1 -1
- package/dist/assets/NotFoundScreen-CTik05r2.js +1 -0
- package/dist/assets/{NotificationRoutes-BwTXq37O.js → NotificationRoutes-wSm6mA8N.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-NPetpQky.js → OAuthConsentScreen-BELrcqAy.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-eI5sgFXq.js → PandLWithForecastRoutes-Dpao8SIb.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-C3fxjzB1.js → PaymentLinkScreen-vbM_NtP3.js} +1 -1
- package/dist/assets/{PeopleRoutes-B4kdNKMm.js → PeopleRoutes-CJeBX2Ca.js} +1 -1
- package/dist/assets/PerformanceRoutes-W4NxEUmH.js +1 -0
- package/dist/assets/{Preview-Cr2n9zp9.js → Preview-Db0nRlxD.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BLLJy6Ug.js → QBOConnectionScreen-BEn_CddB.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DX03V50m.js → ReimbursementApprovalRoutes-CSZJghRB.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-y6N7Iuxh.js → ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-50C6Ebhr.js → ReimbursementRoutes-BUZKWvJ7.js} +1 -1
- package/dist/assets/{ReportsRoutes-CPbwIPP-.js → ReportsRoutes-BUZ4r7hx.js} +1 -1
- package/dist/assets/{RewardsRoutes-cADkol8X.js → RewardsRoutes-DuYZ4TXP.js} +1 -1
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-Bb90T06-.js → ScheduleDetailsPrepaidExpensesScreen-DN2DZsFw.js} +4 -4
- package/dist/assets/{ScreenRoutes-BOM6GDiC.js → ScreenRoutes-CxP9HSCe.js} +2 -2
- package/dist/assets/{SettingsRoutes-Dd8PYfpt.js → SettingsRoutes-CCWla9X1.js} +6 -6
- package/dist/assets/{SetupPagesScreen-BY0N32JD.js → SetupPagesScreen-C5PRNruc.js} +1 -1
- package/dist/assets/{SignInScreen-DGgeSRO8.js → SignInScreen-BScZ138a.js} +1 -1
- package/dist/assets/{SignOutScreen-DPsA_-Qd.js → SignOutScreen-Bk-Y8Sbv.js} +1 -1
- package/dist/assets/{TaskListScreen-yze1VNuP.js → TaskListScreen-C7smUYFP.js} +2 -2
- package/dist/assets/{TaskRoutes-B5s7sZXk.js → TaskRoutes-DPcu4NRR.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-D5llvRhv.js → TransactionDetailRoutes-yEwix446.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-CebcYk9B.js → TransactionDetailScreen-CHzsnTr9.js} +1 -1
- package/dist/assets/{TransactionListRoutes-PnEvh6qc.js → TransactionListRoutes-ChJOrV96.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DbBm2doo.js → TreasuryRoutes-C24SAGLB.js} +1 -1
- package/dist/assets/{VendorsRoutes-CQjAHjxC.js → VendorsRoutes-CVu8jS5h.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-d0_FJyyD.js → WiseConfirmationScreen-Dt6hB5m-.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-CrROItmj.js → ZeniAccountRoutes-D3ONSR9y.js} +7 -7
- package/dist/assets/{ZeniAccountStatementScreen-DiwM8zAQ.js → ZeniAccountStatementScreen-CmfHt6Wr.js} +1 -1
- package/dist/assets/{accountMappingHelper-DHkHknqJ.js → accountMappingHelper-CHQgwqfy.js} +1 -1
- package/dist/assets/{analytics-CabaUa1L.js → analytics-D051O7ML.js} +1 -1
- package/dist/assets/{analyticsHelper-BOs1nNPv.js → analyticsHelper-DkNc3mKz.js} +1 -1
- package/dist/assets/{core-BQ6YlWys.js → core-BBlQ3ArL.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-D_MvDEMm.js → decodeURIComponentSafe-YbpxzvKa.js} +1 -1
- package/dist/assets/{dnd-DL41lZFs.js → dnd-CU3yeazS.js} +1 -1
- package/dist/assets/{empty-CmBSqEpE.js → empty-B3C-udVF.js} +1 -1
- package/dist/assets/{empty-mwfdcHvm.js → empty-BiAWzWBi.js} +1 -1
- package/dist/assets/{emptyVideoElement-BIOkPHF6.js → emptyVideoElement-CRPwTqUS.js} +1 -1
- package/dist/assets/{epic-PdviWWJR.js → epic-DwBfFPJQ.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-Bn2j121J.js → expenseAutomationHelper-SA0jUIyg.js} +1 -1
- package/dist/assets/{getLocaleForTenant-jg4r2V28.js → getLocaleForTenant-DTPcYF0O.js} +1 -1
- package/dist/assets/{index-Bfsx1pdD.js → index--CQENyaz.js} +1 -1
- package/dist/assets/{index-BNuLRh9K.js → index-CaztP9tz.js} +1 -1
- package/dist/assets/{index-DZBfE5XI.js → index-ClwW47Zs.js} +899 -904
- package/dist/assets/{index-Du1SP9oT.js → index-MRZKoeCT.js} +2 -2
- package/dist/assets/{index-B7zYAj-7.js → index-ae04Qn4V.js} +1 -1
- package/dist/assets/{index-CamOdFyi.js → index-fVadamkP.js} +1 -1
- package/dist/assets/{index-Deo5Hnb2.js → index-jomr_c-N.js} +1 -1
- package/dist/assets/{index-BiyVMPcR.js → index-s4pcd-16.js} +1 -1
- package/dist/assets/{lexical-BmxGnuDE.js → lexical-DVH-xgq1.js} +1 -1
- package/dist/assets/{liveblocks-UAxYbctH.js → liveblocks-CuUK5O_2.js} +1 -1
- package/dist/assets/{lottie-BPF4ysWw.js → lottie-Du4lbH8J.js} +1 -1
- package/dist/assets/{mui-DYo6Z7Si.js → mui--aGBnNu2.js} +1 -1
- package/dist/assets/{pathToGoBack-CxX9ql3A.js → pathToGoBack-DOePc_e5.js} +1 -1
- package/dist/assets/{pdf-CHT1_0Mk.js → pdf-CrvsvvW3.js} +3 -3
- package/dist/assets/{pdf-lib-BMce44-8.js → pdf-lib-Cvsvldn7.js} +1 -1
- package/dist/assets/{plaid-BNcFec4W.js → plaid-7P9b69CP.js} +1 -1
- package/dist/assets/{pusher-C1AzfTgV.js → pusher-DdvpIMG0.js} +1 -1
- package/dist/assets/{react-DZjZzXEf.js → react-B8GJK4jq.js} +1 -1
- package/dist/assets/{react-CT8AAIAI.js → react-Bz6aBujY.js} +1 -1
- package/dist/assets/{react-BnffftLd.js → react-CUlf2ISA.js} +1 -1
- package/dist/assets/{react-CSOME4pA.js → react-CjVSd3S9.js} +1 -1
- package/dist/assets/{react-B13-Yejj.js → react-D-JjM7p6.js} +1 -1
- package/dist/assets/{react-CjoLUzLz.js → react-DoYRVAKa.js} +1 -1
- package/dist/assets/{recharts-VJtr9O-6.js → recharts-CkREU3LH.js} +1 -1
- package/dist/assets/{reportTimeframe-D2vFkQK6.js → reportTimeframe-ChAOzqo_.js} +1 -1
- package/dist/assets/{routePaths-CaZTJQOM.js → routePaths-D0jOibXk.js} +1 -1
- package/dist/assets/{sentry-CQfqw6mU.js → sentry-D0lP5-8e.js} +1 -1
- package/dist/assets/{stripSplatSuffix-TzoGXcwz.js → stripSplatSuffix-CFosfir7.js} +1 -1
- package/dist/assets/{url-dVvWrnA9.js → url-GwD82u5j.js} +1 -1
- package/dist/assets/{url-OL55dppf.js → url-nN4BnP9N.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-nJ3hpXEY.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B4OxQoVy.js → useAiCfoDashboardSuggestedQuestionsChips-usJW6KKQ.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CWWQxV2L.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-Gp7Qmy_v.js → useChargeCardPusherEvents-DPfHk-vM.js} +1 -1
- package/dist/assets/{useDeviceId-B6KB8W5T.js → useDeviceId-pp3Grc-z.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DJgvOf06.js → useEmailConnectResultRefresh-B6j7j1rG.js} +1 -1
- package/dist/assets/{useEnsureVendorListLoaded-BbjOUcqm.js → useEnsureVendorListLoaded-COBYTL2U.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BpNcTGLt.js → useInitialThreadRequest-DmfmyzKI.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-CP331xWN.js → useTaskManagerAccess-DrmpkeUw.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-BmjCwNse.js → useTaskManagerPusherEvents-CHhZ2DRZ.js} +1 -1
- package/dist/assets/{utils-BpLD-La5.js → utils-Ctp9Zfhk.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-7NlWHlVm.js → withTransactionSidePanel-CKC1_4cy.js} +1 -1
- package/dist/assets/{zeni-epic-state-j9Po26Lg.js → zeni-epic-state-aUBx6G2Q.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-DneYortX.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DGFpytn-.js +0 -1
- package/dist/assets/NotFoundScreen-CY-XFa3a.js +0 -1
- package/dist/assets/PerformanceRoutes-CT8b6LEZ.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-DglThU_y.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DV6iNvbF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-UAxYbctH.js";import{i as Q,j as S,g as J,u as K,h as ee,l as se,k as fa,n as _t,o as F,N as On}from"./core-BQ6YlWys.js";import{fI as L,Vt as at,bE as q,bv as xe,Vu as Tn,kl as wn,Vv as Zt,Vw as xn,ko as kt,Vx as Je,Vy as Pn,kt as Fn,Vz as Xt,VA as Rn,kx as yt,VB as et,VC as Bn,VD as jn,VE as Mn,lz as Vn,VF as Ln,bm as nt,VG as ha,VH as he,bc as ga,lN as Ca,lw as ba,VI as ge,VJ as oe,fH as Sa,gd as Un,gt as At,VK as Yn,VL as Gn,VM as _a,l$ as It,VN as Le,d0 as Ue,EH as Nn,VO as De,EA as Ye,EB as Ge,E_ as Pe,EU as Ce,EF as Ne,VP as Wn,d$ as We,VQ as zn,VR as qn,VS as ka,m4 as vt,EI as Kn,VT as Oe,VU as $n,ei as ot,AH as ya,VV as Qn,VW as Aa,VX as Hn,VY as Zn,VZ as Xn,V_ as Dt,V$ as Ot,ur as Fe,ma as Re,q7 as Tt,EL as Jn,W0 as le,F8 as wt,AO as eo,AV as to,W1 as ao,W2 as no,EC as Jt,W3 as oo,AK as Te,AF as Ea,W4 as ea,W5 as so,W6 as xt,W7 as Pt,CR as Ia,W8 as ro,W9 as va,Wa as io,Wb as co,Wc as lo,Wd as Ft,q5 as Rt,EK as uo,We as de,D4 as mo,Db as po,Wf as fo,Wg as ho,EE as ta,Wh as go,CP as Da,Wi as aa,Wj as Co,bp as Oa,Fd as Ta,Wk as bo,Wl as wa,Wm as So,Wn as _o,Wo as ko,Wp as Bt,q6 as jt,EJ as yo,Wq as ue,F5 as Ao,F7 as Eo,Wr as Io,Ws as vo,ED as na,Wt as Do,Fb as xa,Wu as oa,Wv as Oo,Ww as To,Wx as Pa,q9 as Fa,Cc as wo,ed as xo,q3 as Po,V2 as Fo,qj as Ro,Wy as Bo,Wz as jo,WA as Mo,b5 as Mt,qd as Vo,ip as Lo,gL as Uo,qc as Yo,lp as Go,qa as No,q8 as Wo,eq as zo,ep as qo}from"./zeni-epic-state-j9Po26Lg.js";import{z as U,aj as re,s as R,d as O,G as H,ak as Ko,al as ze,a9 as qe,am as Ra,U as W,an as $o,ao as Ba,ap as Qo,aq as Ho,h as ja,a2 as Ma,a as Va,ar as Zo,as as Xo,at as Jo,p as be,au as La,I as me,av as Ua,aw as Ya,ax as Ga,ay as es,az as Ke,N as M,V as $e,aA as ts,L as as,aB as ns,f as os,q as ss,a5 as rs,aC as is,aD as cs,aE as ls,aF as ds,aG as we}from"./index-DZBfE5XI.js";import{u as us,n as Vt}from"./mui-DYo6Z7Si.js";import{a as C}from"./sentry-CQfqw6mU.js";import{w as Na}from"./withTransactionSidePanel-7NlWHlVm.js";import{t as Wa,a as Be,e as Se,b as Lt,c as Ut,v as ms}from"./routePaths-CaZTJQOM.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-DV6iNvbF.js";import Ve from"./NotFoundScreen-CY-XFa3a.js";import{t as st}from"./reportTimeframe-D2vFkQK6.js";import{u as Yt}from"./useInitialThreadRequest-BpNcTGLt.js";import{t as za}from"./analyticsHelper-BOs1nNPv.js";import{C as ps}from"./CompanyPassportScreen-DtXzsb3x.js";import{u as fs}from"./useAiCfoDashboardSuggestedQuestionsChips-B4OxQoVy.js";import{F as hs}from"./FeaturePreviewScreen-DjPPDYKv.js";import"./recharts-VJtr9O-6.js";import"./analytics-CabaUa1L.js";import"./plaid-BNcFec4W.js";import"./dnd-DL41lZFs.js";import"./stripe-cKAAJElX.js";import"./lottie-BPF4ysWw.js";import"./lexical-BmxGnuDE.js";import"./pdf-CHT1_0Mk.js";import"./utils-BpLD-La5.js";import"./TransactionDetailScreen-CebcYk9B.js";import"./decodeURIComponentSafe-D_MvDEMm.js";import"./expenseAutomationHelper-Bn2j121J.js";import"./stripSplatSuffix-TzoGXcwz.js";import"./MobileAppDrawer-DTqKEh3f.js";import"./InboxNotificationsProvider-Daf1RQwd.js";import"./useTaskManagerAccess-CP331xWN.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]="9b251c83-6739-4e1f-897a-9b780db428c8",e._sentryDebugIdIdentifier="sentry-dbid-9b251c83-6739-4e1f-897a-9b780db428c8")}catch{}})();const gs=Na((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=Q(),s=U.getSignedInUser(),i=S((D=>D.tenantState.currentTenantId)),c=S((D=>L(D))),{tenantEmailDomain:m}=Q(),u=J(),p=c?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=C.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${re}/agingDetailedReport`,timezone:at()})),[]),f=C.useMemo((()=>r!=null?q(r):xe()),[r]),b=K(),g=ee(),k=S((D=>Tn(D,f,o))),I=C.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&b(wn(o,f))}),[f]),A=C.useCallback((()=>{g("../../",{relative:"path"})}),[]),_=C.useCallback(((D,w)=>{b(Zt({sortKey:D,sortOrder:w}))}),[]),x=C.useCallback((D=>{b(Zt({downloadState:D}))}),[]),Y=C.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(m!=null){const w=Wa({id:D.transactionId,type:D.transactionType},m);g(w);const y=R(u.state?.pathnameStackToGoBack,u.pathname);g(w,{state:{pathnameStackToGoBack:y}})}}),[m,e]),v=C.useCallback((()=>{k.vendor!=null&&O.trackApAgingDetail("AP Aging",f.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,f]);return C.useEffect((()=>{I()}),[]),C.useEffect((()=>{k.fetchState==="Completed"&&v()}),[v,k.fetchState]),d.jsx(Ko,{apAgingDetail:k,downloadParams:l,reportDate:f,analytics:O,onTransactionClick:Y,onReload:I,onBackClick:A,onColumnSortConfigChanged:_,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),Cs=()=>{const e=K(),a=ee(),t=S((_=>xn(_))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ie({mobileExploreReferrer:"AP Aging"});ze({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=S((_=>_.tenantState.currentTenantId)),i=S((_=>L(_))),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},u=C.useMemo((()=>({authParams:m,companyName:c,downloadEndPoint:`${re}/agingReport`,timezone:at()})),[]),p=t.apAgingUIState.selectedDate??xe(),h=C.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(p))}),[]);C.useEffect((()=>{h()}),[]);const l=C.useCallback((()=>{a("../",{relative:"path"})}),[]),f=C.useCallback((_=>{e(Je({searchString:_}))}),[]),b=C.useCallback(((_,x)=>{e(Je({sortKey:x,sortOrder:_}))}),[]),g=C.useCallback((_=>{a(`./${_}/${p.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),k=C.useCallback((_=>{e(Je({downloadState:_}))}),[]),I=C.useCallback(((_,x)=>{}),[]),A=C.useCallback(((_,x)=>{e(Je({selectedDate:_,agingDateSelectionType:x})),e(kt(_))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(qe,{analytics:O,onLoad:_=>_.trackPageLoaded(W.Event.agingReport,"AP Aging")}):null,d.jsx(Ra,{uiState:t.apAgingUIState,report:t,downloadParams:u,analytics:O,onReloadReport:h,onBackClick:l,onSearchTextChange:f,onSortOrderChange:b,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},bs=Na((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=Q(),s=U.getSignedInUser(),i=S((v=>L(v))),{tenantEmailDomain:c}=Q(),m=J(),u=i.companyName,p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},h=C.useMemo((()=>({authParams:p,companyName:u,downloadEndPoint:`${re}/agingDetailedReport`,timezone:at()})),[]),l=C.useMemo((()=>r!=null?q(r):xe()),[r]),f=K(),b=ee(),g=S((v=>Pn(v,l,o))),k=C.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&f(Fn(o,l))}),[l]),I=C.useCallback((()=>{b("../../",{relative:"path"})}),[]),A=C.useCallback(((v,D)=>{f(Xt({sortKey:v,sortOrder:D}))}),[]),_=C.useCallback((v=>{f(Xt({downloadState:v}))}),[]),x=C.useCallback((v=>{if(e)e(v.transactionId,v.transactionType);else if(c!=null){const D=Wa({id:v.transactionId,type:v.transactionType},c);b(D);const w=R(m.state?.pathnameStackToGoBack,m.pathname);b(D,{state:{pathnameStackToGoBack:w}})}}),[c,e]),Y=C.useCallback((()=>{g.customer!=null&&O.trackArAgingDetail("AR Aging",l.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,l]);return C.useEffect((()=>{k()}),[]),C.useEffect((()=>{g.fetchState==="Completed"&&Y()}),[g.fetchState,Y]),d.jsx($o,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:O,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:A,updateDownloadStateHandler:_,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),Ss=()=>{const e=K(),a=ee(),t=S((A=>Rn(A))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ie({mobileExploreReferrer:"AR Aging"});ze({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=S((A=>L(A))),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=C.useMemo((()=>({authParams:c,companyName:i,downloadEndPoint:`${re}/agingReport`,timezone:at()})),[]),u=t.arAgingUIState.selectedDate??xe(),p=C.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(yt(u))}),[]);C.useEffect((()=>{p()}),[]);const h=C.useCallback((()=>{a("../",{relative:"path"})}),[]),l=C.useCallback((A=>{e(et({searchString:A}))}),[]),f=C.useCallback(((A,_)=>{e(et({sortKey:_,sortOrder:A}))}),[]),b=C.useCallback((A=>{a(`./${A}/${u.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[u]),g=C.useCallback((A=>{e(et({downloadState:A}))}),[]),k=C.useCallback(((A,_)=>{e(et({selectedDate:A,agingDateSelectionType:_})),e(yt(A))}),[]),I=C.useCallback(((A,_)=>{e(Bn({nodeId:A,isCollapsed:_}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(qe,{analytics:O,onLoad:A=>A.trackPageLoaded(W.Event.agingReport,"AR Aging")}):null,d.jsx(Ra,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:O,onReloadReport:p,onBackClick:h,onSearchTextChange:l,onSortOrderChange:f,onEntityNameClick:b,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},qa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ka(e,a){const t=Mn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Vn(n,o))}}}const _s=se((function(e){const a=jn(e).accountsInOrder.map(((t,n)=>qa(t,n)));return{sectionTitle:H.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:O}}),Ka)(Ba),ks=se((function(e){const a=Ln(e).accountsInOrder.map(((o,r)=>qa(o,r))),t=U.getSignedInUser(),n=nt(t);return{sectionTitle:H.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:O}}),Ka)(Ba);function ys(){const e=ee(),a=J(),{tenantEmailDomain:t}=Q(),n=S((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Ve,{}):d.jsx(_s,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function As(){const e=ee(),a=J(),{tenantEmailDomain:t}=Q(),n=S((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Ve,{}):d.jsx(ks,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const Es=Vt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-CuUK5O_2.js";import{i as Q,j as S,g as J,u as K,h as ee,l as se,k as fa,n as _t,o as F,N as On}from"./core-BBlQ3ArL.js";import{fI as L,Vt as at,bE as q,bv as we,Vu as Tn,kl as xn,Vv as Zt,Vw as wn,ko as kt,Vx as Je,Vy as Pn,kt as Fn,Vz as Xt,VA as Rn,kx as yt,VB as et,VC as Bn,VD as jn,VE as Mn,lz as Vn,VF as Ln,bm as nt,VG as ha,VH as he,bc as ga,lN as Ca,lw as ba,VI as ge,VJ as oe,fH as Sa,gd as Un,gt as At,VK as Yn,VL as Gn,VM as _a,l$ as It,VN as Le,d0 as Ue,EH as Nn,VO as De,EA as Ye,EB as Ge,E_ as Pe,EU as Ce,EF as Ne,VP as Wn,d$ as We,VQ as zn,VR as qn,VS as ka,m4 as vt,EI as Kn,VT as Oe,VU as $n,ei as ot,AH as ya,VV as Qn,VW as Aa,VX as Hn,VY as Zn,VZ as Xn,V_ as Dt,V$ as Ot,ur as Fe,ma as Re,q7 as Tt,EL as Jn,W0 as le,F8 as xt,AO as eo,AV as to,W1 as ao,W2 as no,EC as Jt,W3 as oo,AK as Te,AF as Ea,W4 as ea,W5 as so,W6 as wt,W7 as Pt,CR as Ia,W8 as ro,W9 as va,Wa as io,Wb as co,Wc as lo,Wd as Ft,q5 as Rt,EK as uo,We as de,D4 as mo,Db as po,Wf as fo,Wg as ho,EE as ta,Wh as go,CP as Da,Wi as aa,Wj as Co,bp as Oa,Fd as Ta,Wk as bo,Wl as xa,Wm as So,Wn as _o,Wo as ko,Wp as Bt,q6 as jt,EJ as yo,Wq as ue,F5 as Ao,F7 as Eo,Wr as Io,Ws as vo,ED as na,Wt as Do,Fb as wa,Wu as oa,Wv as Oo,Ww as To,Wx as Pa,q9 as Fa,Cc as xo,ed as wo,q3 as Po,V2 as Fo,qj as Ro,Wy as Bo,Wz as jo,WA as Mo,b5 as Mt,qd as Vo,ip as Lo,gL as Uo,qc as Yo,lp as Go,qa as No,q8 as Wo,eq as zo,ep as qo}from"./zeni-epic-state-aUBx6G2Q.js";import{z as U,aj as re,q as R,d as O,G as H,ak as Ko,al as ze,a9 as qe,am as Ra,U as W,an as $o,ao as Ba,ap as Qo,aq as Ho,g as ja,a2 as Ma,a as Va,ar as Zo,as as Xo,at as Jo,p as be,au as La,I as me,av as Ua,aw as Ya,ax as Ga,ay as es,az as Ke,N as M,V as $e,aA as ts,L as as,aB as ns,x as os,m as ss,a5 as rs,aC as is,aD as cs,aE as ls,aF as ds,aG as xe}from"./index-ClwW47Zs.js";import{u as us,n as Vt}from"./mui--aGBnNu2.js";import{a as C}from"./sentry-D0lP5-8e.js";import{w as Na}from"./withTransactionSidePanel-CKC1_4cy.js";import{t as Wa,a as Be,e as Se,b as Lt,c as Ut,v as ms}from"./routePaths-D0jOibXk.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-CWWQxV2L.js";import Ve from"./NotFoundScreen-CTik05r2.js";import{t as st}from"./reportTimeframe-ChAOzqo_.js";import{u as Yt}from"./useInitialThreadRequest-DmfmyzKI.js";import{t as za}from"./analyticsHelper-DkNc3mKz.js";import{C as ps}from"./CompanyPassportScreen-Db20J8Yl.js";import{u as fs}from"./useAiCfoDashboardSuggestedQuestionsChips-usJW6KKQ.js";import{F as hs}from"./FeaturePreviewScreen-Dcu53_tf.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.js";import"./TransactionDetailScreen-CHzsnTr9.js";import"./decodeURIComponentSafe-YbpxzvKa.js";import"./expenseAutomationHelper-SA0jUIyg.js";import"./stripSplatSuffix-CFosfir7.js";import"./MobileAppDrawer-Bql3K6nh.js";import"./InboxNotificationsProvider-DiTDJFwP.js";import"./useTaskManagerAccess-DrmpkeUw.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]="4ff2b574-0013-426e-bede-6d4423a4e8c5",e._sentryDebugIdIdentifier="sentry-dbid-4ff2b574-0013-426e-bede-6d4423a4e8c5")}catch{}})();const gs=Na((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=Q(),s=U.getSignedInUser(),i=S((D=>D.tenantState.currentTenantId)),c=S((D=>L(D))),{tenantEmailDomain:m}=Q(),u=J(),p=c?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=C.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${re}/agingDetailedReport`,timezone:at()})),[]),f=C.useMemo((()=>r!=null?q(r):we()),[r]),b=K(),g=ee(),k=S((D=>Tn(D,f,o))),I=C.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&b(xn(o,f))}),[f]),A=C.useCallback((()=>{g("../../",{relative:"path"})}),[]),_=C.useCallback(((D,x)=>{b(Zt({sortKey:D,sortOrder:x}))}),[]),w=C.useCallback((D=>{b(Zt({downloadState:D}))}),[]),Y=C.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(m!=null){const x=Wa({id:D.transactionId,type:D.transactionType},m);g(x);const y=R(u.state?.pathnameStackToGoBack,u.pathname);g(x,{state:{pathnameStackToGoBack:y}})}}),[m,e]),v=C.useCallback((()=>{k.vendor!=null&&O.trackApAgingDetail("AP Aging",f.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,f]);return C.useEffect((()=>{I()}),[]),C.useEffect((()=>{k.fetchState==="Completed"&&v()}),[v,k.fetchState]),d.jsx(Ko,{apAgingDetail:k,downloadParams:l,reportDate:f,analytics:O,onTransactionClick:Y,onReload:I,onBackClick:A,onColumnSortConfigChanged:_,updateDownloadStateHandler:w,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),Cs=()=>{const e=K(),a=ee(),t=S((_=>wn(_))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ie({mobileExploreReferrer:"AP Aging"});ze({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=S((_=>_.tenantState.currentTenantId)),i=S((_=>L(_))),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},u=C.useMemo((()=>({authParams:m,companyName:c,downloadEndPoint:`${re}/agingReport`,timezone:at()})),[]),p=t.apAgingUIState.selectedDate??we(),h=C.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(p))}),[]);C.useEffect((()=>{h()}),[]);const l=C.useCallback((()=>{a("../",{relative:"path"})}),[]),f=C.useCallback((_=>{e(Je({searchString:_}))}),[]),b=C.useCallback(((_,w)=>{e(Je({sortKey:w,sortOrder:_}))}),[]),g=C.useCallback((_=>{a(`./${_}/${p.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),k=C.useCallback((_=>{e(Je({downloadState:_}))}),[]),I=C.useCallback(((_,w)=>{}),[]),A=C.useCallback(((_,w)=>{e(Je({selectedDate:_,agingDateSelectionType:w})),e(kt(_))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(qe,{analytics:O,onLoad:_=>_.trackPageLoaded(W.Event.agingReport,"AP Aging")}):null,d.jsx(Ra,{uiState:t.apAgingUIState,report:t,downloadParams:u,analytics:O,onReloadReport:h,onBackClick:l,onSearchTextChange:f,onSortOrderChange:b,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},bs=Na((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=Q(),s=U.getSignedInUser(),i=S((v=>L(v))),{tenantEmailDomain:c}=Q(),m=J(),u=i.companyName,p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},h=C.useMemo((()=>({authParams:p,companyName:u,downloadEndPoint:`${re}/agingDetailedReport`,timezone:at()})),[]),l=C.useMemo((()=>r!=null?q(r):we()),[r]),f=K(),b=ee(),g=S((v=>Pn(v,l,o))),k=C.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&f(Fn(o,l))}),[l]),I=C.useCallback((()=>{b("../../",{relative:"path"})}),[]),A=C.useCallback(((v,D)=>{f(Xt({sortKey:v,sortOrder:D}))}),[]),_=C.useCallback((v=>{f(Xt({downloadState:v}))}),[]),w=C.useCallback((v=>{if(e)e(v.transactionId,v.transactionType);else if(c!=null){const D=Wa({id:v.transactionId,type:v.transactionType},c);b(D);const x=R(m.state?.pathnameStackToGoBack,m.pathname);b(D,{state:{pathnameStackToGoBack:x}})}}),[c,e]),Y=C.useCallback((()=>{g.customer!=null&&O.trackArAgingDetail("AR Aging",l.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,l]);return C.useEffect((()=>{k()}),[]),C.useEffect((()=>{g.fetchState==="Completed"&&Y()}),[g.fetchState,Y]),d.jsx($o,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:O,onTransactionClick:w,onReload:k,onBackClick:I,onColumnSortConfigChanged:A,updateDownloadStateHandler:_,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),Ss=()=>{const e=K(),a=ee(),t=S((A=>Rn(A))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ie({mobileExploreReferrer:"AR Aging"});ze({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=S((A=>L(A))),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=C.useMemo((()=>({authParams:c,companyName:i,downloadEndPoint:`${re}/agingReport`,timezone:at()})),[]),u=t.arAgingUIState.selectedDate??we(),p=C.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(yt(u))}),[]);C.useEffect((()=>{p()}),[]);const h=C.useCallback((()=>{a("../",{relative:"path"})}),[]),l=C.useCallback((A=>{e(et({searchString:A}))}),[]),f=C.useCallback(((A,_)=>{e(et({sortKey:_,sortOrder:A}))}),[]),b=C.useCallback((A=>{a(`./${A}/${u.format(H.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[u]),g=C.useCallback((A=>{e(et({downloadState:A}))}),[]),k=C.useCallback(((A,_)=>{e(et({selectedDate:A,agingDateSelectionType:_})),e(yt(A))}),[]),I=C.useCallback(((A,_)=>{e(Bn({nodeId:A,isCollapsed:_}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(qe,{analytics:O,onLoad:A=>A.trackPageLoaded(W.Event.agingReport,"AR Aging")}):null,d.jsx(Ra,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:O,onReloadReport:p,onBackClick:h,onSearchTextChange:l,onSortOrderChange:f,onEntityNameClick:b,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},qa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ka(e,a){const t=Mn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Vn(n,o))}}}const _s=se((function(e){const a=jn(e).accountsInOrder.map(((t,n)=>qa(t,n)));return{sectionTitle:H.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:O}}),Ka)(Ba),ks=se((function(e){const a=Ln(e).accountsInOrder.map(((o,r)=>qa(o,r))),t=U.getSignedInUser(),n=nt(t);return{sectionTitle:H.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:O}}),Ka)(Ba);function ys(){const e=ee(),a=J(),{tenantEmailDomain:t}=Q(),n=S((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Ve,{}):d.jsx(_s,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function As(){const e=ee(),a=J(),{tenantEmailDomain:t}=Q(),n=S((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Ve,{}):d.jsx(ks,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const Es=Vt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -10,11 +10,11 @@ import{j as d}from"./liveblocks-UAxYbctH.js";import{i as Q,j as S,g as J,u as K,
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: center;
|
|
12
12
|
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
-
`;function vs({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=ee(),i=K(),c=J(),{tenantEmailDomain:m}=Q(),u=us();return d.jsxs(Es,{children:[d.jsx(Qo,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:u.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:p=>{p.trim().length>=2?i(ge({searchString:p,searchOrigin:"navbar"})):p.trim().length===0&&i(oe("navbar"))},onAutoCompleteEntity:p=>{n!=null&&O?.trackSearch(W.Event.search,Ds(a),p.type,p.name,n);const h=Se(p,m),l=R(c.state?.pathnameStackToGoBack,c.pathname);s(h,{state:{pathnameStackToGoBack:l}})}}},rightSideComponent:d.jsx(Ho,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(Is,{children:a==="cash_balance"?d.jsx(ys,{}):d.jsx(As,{})})]})}function sa(){const e=J(),a=K(),t=S((l=>l.cashBalanceState.fetchState)),n=S((l=>l.cardBalanceState.fetchState)),o=U.getSignedInUser();if(o==null)throw Error("Can't access dashboard detail without signing in...");const r=ha((l=>{const f=ga(l,"/").split("/");return f[f.length-1]})(e.pathname));let s="Not-Started",i="";const c=H.getLocalizedStrings();switch(r){case"cash_balance":s=t,i=c.common.texts.cashBalance;break;case"card_balance":s=n,i=c.reportTitleById.card_balance;break;default:console.error(`${r} is not supported!`)}const{isAiCfoAccessEnabled:m,onAskAiCfoClick:u}=ie({mobileExploreReferrer:r==="card_balance"?"Card Balance":"Cash Balance"});ze({isDataReady:s==="Completed"});const p=S((l=>l.entityAutoCompleteState.autoCompleteText.navbar)),h=S((l=>he(l,"navbar")));return C.useEffect((()=>{s==="Not-Started"&&(function(l,f){switch(f){case"card_balance":l(ba());break;case"cash_balance":l(Ca());break;default:throw new Error(`balance report type ${f} is not yet supported`)}})(a,r)}),[o,a,s]),d.jsxs(d.Fragment,{children:[s==="Completed"?d.jsx(qe,{analytics:O,onLoad:l=>((f,b)=>{switch(b){case"card_balance":f.trackPageLoaded(W.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(W.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${b}!`)}})(l,r)}):null,d.jsx(vs,{title:i,reportId:r,autoCompleteText:p,entityAutoCompleteView:h,isAiCfoAccessEnabled:m,onAskAiCfoClick:u})]})}const Ds=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Os=[],ra="insights_section";function Qe(e){const{mobileExploreReferrer:a}=e,t=K(),n=ee(),o=J(),{tenantEmailDomain:r}=Q(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=ja(),c=Ma(),m=Ga(c),u=fa(),p=S((B=>B.tenantState.fetchState==="Completed"||B.tenantState.activeTenantFetchState.fetchState==="Completed"?L(B):void 0)),h=p?.masterTOSInfo?.isMasterTOSAccepted??!1,l=S((B=>Sa(B))),f=l.uiState?.currentChatSessionId,b=l.allSessionsWithOrderedQuestionAnswers??Os,g=U.getSignedInUser()?.userId,k=Va(),I=Zo()&&k&&r!=null,A=Xo(),_=Jo(!0),x=S((B=>A!=null?Un(B,A):void 0)),{useDynamicConfig:Y}=be(),{configValue:v}=Y(La.aiCfoMessageDynamicConfig),D=C.useMemo((()=>Array.isArray(v.default_message_list)?v.default_message_list:[]),[v.default_message_list]),w=C.useMemo((()=>D.slice(0,2)),[D]),y=A!=null&&x!=null&&x.fetchState!=="Completed"&&x.fetchState!=="Error"&&(_||x.fetchState==="In-Progress"),T=C.useMemo((()=>{if(A==null||x?.fetchState==="Error")return w;if(y)return[];const B=(x?.suggestedQuestions??[]).map((te=>te.trim())).filter((te=>te.length>0)).slice(0,2);return B.length===0?w:B}),[w,y,A,x?.fetchState,x?.suggestedQuestions]),ce=C.useCallback(((B,te)=>{if(g==null||B.trim()==="")return;if(!h)return void me({location:o,navigate:n,mergeState:{referrer:a,aiCfoInitialQuestion:B,aiCfoInitialSubmissionSource:ra,aiCfoSuggestionIndex:te}});const Ze=Ua(u.getState());if(m){const Xe=R(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Xe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!Ze}})}else{if(Ze)return t(At(B)),void s(!0);i(B),s(!0),Ya(t,B,ra,f,b,g,te,void 0)}}),[b,f,t,h,m,o,a,n,s,i,u,r,g]),ye=C.useCallback((()=>{if(h)if(m){const B=R(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0);else me({location:o,navigate:n,mergeState:{referrer:a}})}),[h,m,o,a,n,s,r]);return C.useMemo((()=>{if(I)return{isSuggestedQuestionsLoading:y,onAskSomethingElseClick:ye,onSuggestedQuestionClick:ce,suggestedQuestions:T}}),[I,y,ye,ce,T])}const He=es,Ts=se((function(e){const a=Yn(e),t=Gn(e),n=_a(e),{scrollPosition:o,...r}=n,s=H.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=U.getSignedInUser(),c=e.tenantState.currentTenantId,m=L(e),u=m?.companyName??"",p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,l=he(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${re}/statement`,authParams:p},analytics:O,autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:l}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Wn(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(De({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Pe("month")),e(Ce(a.firstMonthOfFY,t)),e(De({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(De({resetLeftScroll:!0}))),50)},onElementCollapseStateChanged:(t,n)=>{e(De({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(De({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")},onCustomDateRangeChanged:(t,n)=>{e(It(t,n));const o=q(t),r=q(n),s=Le(a.firstMonthOfFY,"month",{startDate:o,endDate:r})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:i,endOfTimeframeFY:c}=Ue(r,a.firstMonthOfFY,"month"),m={numberOfPeriods:s,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:i,endDate:c}};e(Nn({selectedCOABalancesRange:m,highlightedCOABalancesRange:m,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(De({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),ws=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ke(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=ie({mobileExploreReferrer:"DashboardCashInCashOut"}),i=Qe({mobileExploreReferrer:"DashboardCashInCashOut"}),c=S((h=>_a(h))),m=c.mode==="compare_mode",{useFeatureGate:u}=be(),{isFeatureEnabled:p}=u(M.isReportsCustomDateRangeEnabled);return d.jsx(Ts,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:m,isCustomDateRangeEnabled:p,selectedCOABalancesRange:c.selectedCOABalancesRange,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:We(o("dashboard_report_filters"))})},xs=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Ps=se((function(e){const a=zn(e),t=qn(e),n=ka(e),{scrollPosition:o,...r}=n,s=H.getLocalizedStrings().reportTitleById.cash_position,i=U.getSignedInUser(),c=e.tenantState.currentTenantId,m=L(e),u=m?.companyName??"",p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,l=he(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${re}/statement`,authParams:p},analytics:O,autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:l}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e($n(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(Oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(Oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ge(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}=xs(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Oe({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")},onCustomDateRangeChanged:(t,n,o)=>{e(vt(!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(Kn({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(Oe({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),Fs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ke(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=ie({mobileExploreReferrer:"DashboardCashPosition"}),i=Qe({mobileExploreReferrer:"DashboardCashPosition"}),c=S((h=>ka(h))),m=c.mode==="compare_mode",{useFeatureGate:u}=be(),{isFeatureEnabled:p}=u(M.isReportsCustomDateRangeEnabled);return d.jsx(Ps,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:m,isCustomDateRangeEnabled:p,timeframe:c.timeframe,selectedCOABalancesRange:c.selectedCOABalancesRange,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:We(o("dashboard_report_filters"))})},z=(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}))},Rs=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Bs=se((function(e){const a=ya(e),t=Qn(e),n=Aa(e),o=Hn(e),r=Zn(e),s=Xn(e),i=Dt(e),{scrollPosition:c,...m}=i,u=t.reportTitle,p=U.getSignedInUser(),h=e.tenantState.currentTenantId,l=L(e),f=l?.companyName??"",b={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:h??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=he(e,"navbar"),I=Ot(l);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:c,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:f,statementEndPoint:`${re}/statement`,authParams:b},analytics:O,isZeniUser:nt(p),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:Re(e),isAccountingProjectsEnabled:Fe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(so(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(le({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(le({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(le({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&z(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(le({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Rs(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Lt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ut(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(le({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(ea({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(le({scrollPosition:t})):e(ea({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(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(Te(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Jt({viewMode:"account_group"})),e(Ea(!1,n?.id)),n!=null&&z(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):z(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(le({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Burn Rate"),e(Jt({viewMode:t})),e(oo({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(no({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(ao({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(eo()),a.isAccountingProjectsEnabled&&e(to())},onResyncReports:()=>{e(wt(a.accountViewMode==="project"?"net_burn_or_income_by_projects":"net_burn_or_income_by_classes"))},onCustomDateRangeChanged:(t,n,o)=>{e(Tt(!0,a.selectedForecastId||void 0,!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(Jn({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(le({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),js=e=>{const a=K(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ke(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:c}=ie({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=Qe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),u=S((y=>Dt(y))),p=u.isForecastModeOn,h=u.timeframe,l=u.selectedForecast?.id,f=S((y=>xt(y.forecastState,l??""))),b=S((y=>ya(y))),g=S((y=>Pt(y))),k=S((y=>Re(y))),I=S((y=>Fe(y))),A=S((y=>Aa(y).uiState.accountViewMode)),_=u.mode==="compare_mode",{useFeatureGate:x}=be(),{isFeatureEnabled:Y}=x(M.isReportsCustomDateRangeEnabled),v=b.dataAvailable;C.useEffect((()=>{if(l!=null&&p===!0&&(z(p,r,l,o),f!=null)){const y=f?.forecastPeriod,T=v!=null&&y.endDate.isAfter(v?.endDate)===!0?v:y;a(Ce(e.firstMonthOfFY,{startDate:T.endDate.startOf(h),endDate:T?.endDate}))}}),[l]);const D=$e(),w=Yt(D?.currentTenant?.companyId,{clearParams:b.fetchState==="Completed"});return d.jsx(Bs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:k,isAccountingProjectsEnabled:I,accountViewMode:A,isCompareModeOn:_,isCustomDateRangeEnabled:Y,timeframe:u.timeframe,selectedCOABalancesRange:u.selectedCOABalancesRange,navigate:o,analytics:O,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:c,initialOpenThreadRequest:w,meetingUrl:We(s("dashboard_report_filters"))})},Ms=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Vs=se((function(e){const a=Ia(e),t=ro(e),n=va(e),o=io(e),r=co(e),s=lo(e),i=Ft(e),{scrollPosition:c,...m}=i,u=H.getLocalizedStrings().common.texts.operatingExpenses,p=U.getSignedInUser(),h=e.tenantState.currentTenantId,l=L(e),f=l?.companyName??"",b={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:h??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=he(e,"navbar"),I=Ot(l);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:c,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:f,statementEndPoint:`${re}/statement`,authParams:b},analytics:O,isZeniUser:nt(p),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:Re(e),isAccountingProjectsEnabled:Fe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Co(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(de({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(de({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(de({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&z(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(de({resetLeftScroll:!0}))),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Ms(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Lt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ut(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(de({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(aa({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(de({scrollPosition:t})):e(aa({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(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(Te(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t=="forecast_mode"?(e(ta({viewMode:"account_group"})),e(Da(!1,n?.id)),n!=null&&z(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):z(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(de({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Operating Expenses"),e(ta({viewMode:t})),e(go({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(ho({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(fo({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(mo()),a.isAccountingProjectsEnabled&&e(po())},onResyncReports:()=>{e(wt(a.accountViewMode==="project"?"operating_expenses_by_projects":"operating_expenses_by_classes"))},onCustomDateRangeChanged:(t,n,o)=>{e(Rt(!0,a.selectedForecastId||void 0,!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(uo({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(de({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),Ls=e=>{const a=K(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ke(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:c}=ie({mobileExploreReferrer:"DashboardOpEx"}),m=Qe({mobileExploreReferrer:"DashboardOpEx"}),u=S((T=>Ft(T))),p=u.isForecastModeOn,h=u.timeframe,l=u.selectedForecast?.id,f=S((T=>xt(T.forecastState,l??""))),b=S((T=>Ia(T))),g=S((T=>Pt(T))),k=S((T=>Re(T))),I=S((T=>Fe(T))),A=S((T=>va(T).uiState.accountViewMode)),_=u.mode==="compare_mode",{useFeatureGate:x}=be(),{isFeatureEnabled:Y}=x(M.isReportsCustomDateRangeEnabled),v=b.dataAvailable;C.useEffect((()=>{if(l!=null&&p===!0&&(z(p,r,l,o),f!=null)){const T=f?.forecastPeriod,ce=v!=null&&T.endDate.isAfter(v?.endDate)===!0?v:T;a(Ce(e.firstMonthOfFY,{startDate:ce.endDate.startOf(h),endDate:ce?.endDate}))}}),[l]);const D=$e(),w=D?.loggedInUserRole!=null&&Oa(D?.loggedInUserRole)!==!0,y=Yt(D?.currentTenant?.companyId,{clearParams:b.fetchState==="Completed"});return d.jsx(Vs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:k,isAccountingProjectsEnabled:I,accountViewMode:A,isCompareModeOn:_,isCustomDateRangeEnabled:Y,timeframe:u.timeframe,selectedCOABalancesRange:u.selectedCOABalancesRange,navigate:o,forecastIdFromUrlPath:r,analytics:O,hasTransactionAccess:w,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:c,initialOpenThreadRequest:y,meetingUrl:We(s("dashboard_report_filters"))})},Us=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Ys=se((function(e){const a=Ta(e),t=bo(e),n=wa(e),o=So(e),r=_o(e),s=ko(e),i=Bt(e),{scrollPosition:c,...m}=i,u=H.getLocalizedStrings().common.texts.revenue,p=U.getSignedInUser(),h=e.tenantState.currentTenantId,l=L(e),f=l?.companyName??"",b={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:h??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=he(e,"navbar"),I=Ot(l);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:c,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:f,statementEndPoint:`${re}/statement`,authParams:b},analytics:O,isZeniUser:nt(p),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:Re(e),isAccountingProjectsEnabled:Fe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Oo(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(ue({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(ue({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(ue({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&z(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(ue({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Us(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Lt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ut(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(ue({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(oa({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(ue({scrollPosition:t})):e(oa({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(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(Te(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(na({viewMode:"account_group"})),e(xa(!1,n?.id)),n!=null&&z(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):z(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ue({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Revenues"),e(na({viewMode:t})),e(Do({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vo({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(Io({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Ao()),a.isAccountingProjectsEnabled&&e(Eo())},onResyncReports:()=>{e(wt(a.accountViewMode==="project"?"revenue_by_projects":"revenue_by_classes"))},onCustomDateRangeChanged:(t,n,o)=>{e(jt(!0,a.selectedForecastId||void 0,!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(yo({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(ue({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),Gs=e=>{const a=K(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ke(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:c}=ie({mobileExploreReferrer:"DashboardRevenue"}),m=Qe({mobileExploreReferrer:"DashboardRevenue"}),u=S((y=>Bt(y))),p=u.isForecastModeOn,h=u.timeframe,l=u.selectedForecast?.id,f=S((y=>xt(y.forecastState,l??""))),b=S((y=>Ta(y))),g=b.dataAvailable,k=u.mode==="compare_mode",{useFeatureGate:I}=be(),{isFeatureEnabled:A}=I(M.isReportsCustomDateRangeEnabled),_=S((y=>Re(y))),x=S((y=>Fe(y))),Y=S((y=>wa(y).uiState.accountViewMode)),v=S((y=>Pt(y)));C.useEffect((()=>{if(l!=null&&p===!0&&(z(p,r,l,o),f!=null)){const y=f?.forecastPeriod,T=g!=null&&y.endDate.isAfter(g?.endDate)===!0?g:y;a(Ce(e.firstMonthOfFY,{startDate:T.endDate.startOf(h),endDate:T?.endDate}))}}),[l]);const D=$e(),w=Yt(D?.currentTenant?.companyId,{clearParams:b.fetchState==="Completed"});return d.jsx(Ys,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:_,isAccountingProjectsEnabled:x,accountViewMode:Y,isCompareModeOn:k,isCustomDateRangeEnabled:A,timeframe:u.timeframe,selectedCOABalancesRange:u.selectedCOABalancesRange,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:O,reportsResyncFetchState:v.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:c,initialOpenThreadRequest:w,meetingUrl:We(s("dashboard_report_filters"))})},Ns=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}},Ws=se((function(e){const a=To(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=he(e,"navbar");return{report:a,analytics:O,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}}),(function(e,a){return{onTimeframeSelectionChanged:t=>{O.trackTimeframeSwitch(za(t),"Top Expenses"),e(Pa(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Ns(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(ts),zs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Ws,{tenantEmailDomain:a,location:t,navigate:n})},qs=Vt.div`
|
|
13
|
+
`;function vs({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=ee(),i=K(),c=J(),{tenantEmailDomain:m}=Q(),u=us();return d.jsxs(Es,{children:[d.jsx(Qo,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:u.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:p=>{p.trim().length>=2?i(ge({searchString:p,searchOrigin:"navbar"})):p.trim().length===0&&i(oe("navbar"))},onAutoCompleteEntity:p=>{n!=null&&O?.trackSearch(W.Event.search,Ds(a),p.type,p.name,n);const h=Se(p,m),l=R(c.state?.pathnameStackToGoBack,c.pathname);s(h,{state:{pathnameStackToGoBack:l}})}}},rightSideComponent:d.jsx(Ho,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(Is,{children:a==="cash_balance"?d.jsx(ys,{}):d.jsx(As,{})})]})}function sa(){const e=J(),a=K(),t=S((l=>l.cashBalanceState.fetchState)),n=S((l=>l.cardBalanceState.fetchState)),o=U.getSignedInUser();if(o==null)throw Error("Can't access dashboard detail without signing in...");const r=ha((l=>{const f=ga(l,"/").split("/");return f[f.length-1]})(e.pathname));let s="Not-Started",i="";const c=H.getLocalizedStrings();switch(r){case"cash_balance":s=t,i=c.common.texts.cashBalance;break;case"card_balance":s=n,i=c.reportTitleById.card_balance;break;default:console.error(`${r} is not supported!`)}const{isAiCfoAccessEnabled:m,onAskAiCfoClick:u}=ie({mobileExploreReferrer:r==="card_balance"?"Card Balance":"Cash Balance"});ze({isDataReady:s==="Completed"});const p=S((l=>l.entityAutoCompleteState.autoCompleteText.navbar)),h=S((l=>he(l,"navbar")));return C.useEffect((()=>{s==="Not-Started"&&(function(l,f){switch(f){case"card_balance":l(ba());break;case"cash_balance":l(Ca());break;default:throw new Error(`balance report type ${f} is not yet supported`)}})(a,r)}),[o,a,s]),d.jsxs(d.Fragment,{children:[s==="Completed"?d.jsx(qe,{analytics:O,onLoad:l=>((f,b)=>{switch(b){case"card_balance":f.trackPageLoaded(W.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(W.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${b}!`)}})(l,r)}):null,d.jsx(vs,{title:i,reportId:r,autoCompleteText:p,entityAutoCompleteView:h,isAiCfoAccessEnabled:m,onAskAiCfoClick:u})]})}const Ds=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Os=[],ra="insights_section";function Qe(e){const{mobileExploreReferrer:a}=e,t=K(),n=ee(),o=J(),{tenantEmailDomain:r}=Q(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=ja(),c=Ma(),m=Ga(c),u=fa(),p=S((B=>B.tenantState.fetchState==="Completed"||B.tenantState.activeTenantFetchState.fetchState==="Completed"?L(B):void 0)),h=p?.masterTOSInfo?.isMasterTOSAccepted??!1,l=S((B=>Sa(B))),f=l.uiState?.currentChatSessionId,b=l.allSessionsWithOrderedQuestionAnswers??Os,g=U.getSignedInUser()?.userId,k=Va(),I=Zo()&&k&&r!=null,A=Xo(),_=Jo(!0),w=S((B=>A!=null?Un(B,A):void 0)),{useDynamicConfig:Y}=be(),{configValue:v}=Y(La.aiCfoMessageDynamicConfig),D=C.useMemo((()=>Array.isArray(v.default_message_list)?v.default_message_list:[]),[v.default_message_list]),x=C.useMemo((()=>D.slice(0,2)),[D]),y=A!=null&&w!=null&&w.fetchState!=="Completed"&&w.fetchState!=="Error"&&(_||w.fetchState==="In-Progress"),T=C.useMemo((()=>{if(A==null||w?.fetchState==="Error")return x;if(y)return[];const B=(w?.suggestedQuestions??[]).map((te=>te.trim())).filter((te=>te.length>0)).slice(0,2);return B.length===0?x:B}),[x,y,A,w?.fetchState,w?.suggestedQuestions]),ce=C.useCallback(((B,te)=>{if(g==null||B.trim()==="")return;if(!h)return void me({location:o,navigate:n,mergeState:{referrer:a,aiCfoInitialQuestion:B,aiCfoInitialSubmissionSource:ra,aiCfoSuggestionIndex:te}});const Ze=Ua(u.getState());if(m){const Xe=R(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Xe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!Ze}})}else{if(Ze)return t(At(B)),void s(!0);i(B),s(!0),Ya(t,B,ra,f,b,g,te,void 0)}}),[b,f,t,h,m,o,a,n,s,i,u,r,g]),ye=C.useCallback((()=>{if(h)if(m){const B=R(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0);else me({location:o,navigate:n,mergeState:{referrer:a}})}),[h,m,o,a,n,s,r]);return C.useMemo((()=>{if(I)return{isSuggestedQuestionsLoading:y,onAskSomethingElseClick:ye,onSuggestedQuestionClick:ce,suggestedQuestions:T}}),[I,y,ye,ce,T])}const He=es,Ts=se((function(e){const a=Yn(e),t=Gn(e),n=_a(e),{scrollPosition:o,...r}=n,s=H.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=U.getSignedInUser(),c=e.tenantState.currentTenantId,m=L(e),u=m?.companyName??"",p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,l=he(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${re}/statement`,authParams:p},analytics:O,autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:l}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Wn(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(De({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Pe("month")),e(Ce(a.firstMonthOfFY,t)),e(De({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(De({resetLeftScroll:!0}))),50)},onElementCollapseStateChanged:(t,n)=>{e(De({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(De({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")},onCustomDateRangeChanged:(t,n)=>{e(It(t,n));const o=q(t),r=q(n),s=Le(a.firstMonthOfFY,"month",{startDate:o,endDate:r})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:i,endOfTimeframeFY:c}=Ue(r,a.firstMonthOfFY,"month"),m={numberOfPeriods:s,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:i,endDate:c}};e(Nn({selectedCOABalancesRange:m,highlightedCOABalancesRange:m,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(De({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),xs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ke(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=ie({mobileExploreReferrer:"DashboardCashInCashOut"}),i=Qe({mobileExploreReferrer:"DashboardCashInCashOut"}),c=S((h=>_a(h))),m=c.mode==="compare_mode",{useFeatureGate:u}=be(),{isFeatureEnabled:p}=u(M.isReportsCustomDateRangeEnabled);return d.jsx(Ts,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:m,isCustomDateRangeEnabled:p,selectedCOABalancesRange:c.selectedCOABalancesRange,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:We(o("dashboard_report_filters"))})},ws=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Ps=se((function(e){const a=zn(e),t=qn(e),n=ka(e),{scrollPosition:o,...r}=n,s=H.getLocalizedStrings().reportTitleById.cash_position,i=U.getSignedInUser(),c=e.tenantState.currentTenantId,m=L(e),u=m?.companyName??"",p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,l=he(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${re}/statement`,authParams:p},analytics:O,autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:l}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e($n(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(Oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(Oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ge(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}=ws(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Oe({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")},onCustomDateRangeChanged:(t,n,o)=>{e(vt(!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(Kn({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(Oe({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),Fs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ke(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=ie({mobileExploreReferrer:"DashboardCashPosition"}),i=Qe({mobileExploreReferrer:"DashboardCashPosition"}),c=S((h=>ka(h))),m=c.mode==="compare_mode",{useFeatureGate:u}=be(),{isFeatureEnabled:p}=u(M.isReportsCustomDateRangeEnabled);return d.jsx(Ps,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:m,isCustomDateRangeEnabled:p,timeframe:c.timeframe,selectedCOABalancesRange:c.selectedCOABalancesRange,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:We(o("dashboard_report_filters"))})},z=(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}))},Rs=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Bs=se((function(e){const a=ya(e),t=Qn(e),n=Aa(e),o=Hn(e),r=Zn(e),s=Xn(e),i=Dt(e),{scrollPosition:c,...m}=i,u=t.reportTitle,p=U.getSignedInUser(),h=e.tenantState.currentTenantId,l=L(e),f=l?.companyName??"",b={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:h??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=he(e,"navbar"),I=Ot(l);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:c,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:f,statementEndPoint:`${re}/statement`,authParams:b},analytics:O,isZeniUser:nt(p),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:Re(e),isAccountingProjectsEnabled:Fe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(so(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(le({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(le({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(le({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&z(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(le({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Rs(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Lt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ut(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(le({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(ea({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(le({scrollPosition:t})):e(ea({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(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(Te(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Jt({viewMode:"account_group"})),e(Ea(!1,n?.id)),n!=null&&z(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):z(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(le({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Burn Rate"),e(Jt({viewMode:t})),e(oo({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(no({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(ao({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(eo()),a.isAccountingProjectsEnabled&&e(to())},onResyncReports:()=>{e(xt(a.accountViewMode==="project"?"net_burn_or_income_by_projects":"net_burn_or_income_by_classes"))},onCustomDateRangeChanged:(t,n,o)=>{e(Tt(!0,a.selectedForecastId||void 0,!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(Jn({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(le({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),js=e=>{const a=K(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ke(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:c}=ie({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=Qe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),u=S((y=>Dt(y))),p=u.isForecastModeOn,h=u.timeframe,l=u.selectedForecast?.id,f=S((y=>wt(y.forecastState,l??""))),b=S((y=>ya(y))),g=S((y=>Pt(y))),k=S((y=>Re(y))),I=S((y=>Fe(y))),A=S((y=>Aa(y).uiState.accountViewMode)),_=u.mode==="compare_mode",{useFeatureGate:w}=be(),{isFeatureEnabled:Y}=w(M.isReportsCustomDateRangeEnabled),v=b.dataAvailable;C.useEffect((()=>{if(l!=null&&p===!0&&(z(p,r,l,o),f!=null)){const y=f?.forecastPeriod,T=v!=null&&y.endDate.isAfter(v?.endDate)===!0?v:y;a(Ce(e.firstMonthOfFY,{startDate:T.endDate.startOf(h),endDate:T?.endDate}))}}),[l]);const D=$e(),x=Yt(D?.currentTenant?.companyId,{clearParams:b.fetchState==="Completed"});return d.jsx(Bs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:k,isAccountingProjectsEnabled:I,accountViewMode:A,isCompareModeOn:_,isCustomDateRangeEnabled:Y,timeframe:u.timeframe,selectedCOABalancesRange:u.selectedCOABalancesRange,navigate:o,analytics:O,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:c,initialOpenThreadRequest:x,meetingUrl:We(s("dashboard_report_filters"))})},Ms=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Vs=se((function(e){const a=Ia(e),t=ro(e),n=va(e),o=io(e),r=co(e),s=lo(e),i=Ft(e),{scrollPosition:c,...m}=i,u=H.getLocalizedStrings().common.texts.operatingExpenses,p=U.getSignedInUser(),h=e.tenantState.currentTenantId,l=L(e),f=l?.companyName??"",b={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:h??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=he(e,"navbar"),I=Ot(l);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:c,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:f,statementEndPoint:`${re}/statement`,authParams:b},analytics:O,isZeniUser:nt(p),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:Re(e),isAccountingProjectsEnabled:Fe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Co(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(de({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(de({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(de({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&z(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(de({resetLeftScroll:!0}))),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Ms(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Lt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ut(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(de({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(aa({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(de({scrollPosition:t})):e(aa({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(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(Te(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t=="forecast_mode"?(e(ta({viewMode:"account_group"})),e(Da(!1,n?.id)),n!=null&&z(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):z(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(de({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Operating Expenses"),e(ta({viewMode:t})),e(go({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(ho({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(fo({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(mo()),a.isAccountingProjectsEnabled&&e(po())},onResyncReports:()=>{e(xt(a.accountViewMode==="project"?"operating_expenses_by_projects":"operating_expenses_by_classes"))},onCustomDateRangeChanged:(t,n,o)=>{e(Rt(!0,a.selectedForecastId||void 0,!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(uo({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(de({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),Ls=e=>{const a=K(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ke(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:c}=ie({mobileExploreReferrer:"DashboardOpEx"}),m=Qe({mobileExploreReferrer:"DashboardOpEx"}),u=S((T=>Ft(T))),p=u.isForecastModeOn,h=u.timeframe,l=u.selectedForecast?.id,f=S((T=>wt(T.forecastState,l??""))),b=S((T=>Ia(T))),g=S((T=>Pt(T))),k=S((T=>Re(T))),I=S((T=>Fe(T))),A=S((T=>va(T).uiState.accountViewMode)),_=u.mode==="compare_mode",{useFeatureGate:w}=be(),{isFeatureEnabled:Y}=w(M.isReportsCustomDateRangeEnabled),v=b.dataAvailable;C.useEffect((()=>{if(l!=null&&p===!0&&(z(p,r,l,o),f!=null)){const T=f?.forecastPeriod,ce=v!=null&&T.endDate.isAfter(v?.endDate)===!0?v:T;a(Ce(e.firstMonthOfFY,{startDate:ce.endDate.startOf(h),endDate:ce?.endDate}))}}),[l]);const D=$e(),x=D?.loggedInUserRole!=null&&Oa(D?.loggedInUserRole)!==!0,y=Yt(D?.currentTenant?.companyId,{clearParams:b.fetchState==="Completed"});return d.jsx(Vs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:k,isAccountingProjectsEnabled:I,accountViewMode:A,isCompareModeOn:_,isCustomDateRangeEnabled:Y,timeframe:u.timeframe,selectedCOABalancesRange:u.selectedCOABalancesRange,navigate:o,forecastIdFromUrlPath:r,analytics:O,hasTransactionAccess:x,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:c,initialOpenThreadRequest:y,meetingUrl:We(s("dashboard_report_filters"))})},Us=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=ot(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}},Ys=se((function(e){const a=Ta(e),t=bo(e),n=xa(e),o=So(e),r=_o(e),s=ko(e),i=Bt(e),{scrollPosition:c,...m}=i,u=H.getLocalizedStrings().common.texts.revenue,p=U.getSignedInUser(),h=e.tenantState.currentTenantId,l=L(e),f=l?.companyName??"",b={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:h??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=he(e,"navbar"),I=Ot(l);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:c,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:f,statementEndPoint:`${re}/statement`,authParams:b},analytics:O,isZeniUser:nt(p),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:Re(e),isAccountingProjectsEnabled:Fe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Oo(t))},onTimeframeSelectionChanged:t=>{e(Pe(t)),setTimeout((()=>e(ue({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(ue({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Ce(a.firstMonthOfFY,t)),e(ue({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ge(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&z(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(ue({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Us(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Lt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ut(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(ue({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(oa({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(ue({scrollPosition:t})):e(oa({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(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(Te(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(na({viewMode:"account_group"})),e(wa(!1,n?.id)),n!=null&&z(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):z(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ue({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Revenues"),e(na({viewMode:t})),e(Do({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vo({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(Io({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Ao()),a.isAccountingProjectsEnabled&&e(Eo())},onResyncReports:()=>{e(xt(a.accountViewMode==="project"?"revenue_by_projects":"revenue_by_classes"))},onCustomDateRangeChanged:(t,n,o)=>{e(jt(!0,a.selectedForecastId||void 0,!0,t,n));const r=q(t),s=q(n),i=st(o??a.timeframe),c=Le(a.firstMonthOfFY,i,{startDate:r,endDate:s})??a.selectedCOABalancesRange.numberOfPeriods,{startOfTimeframeFY:m,endOfTimeframeFY:u}=Ue(s,a.firstMonthOfFY,i),p={numberOfPeriods:c,orderBy:a.selectedCOABalancesRange.orderBy,thisPeriod:{startDate:m,endDate:u}};e(yo({selectedCOABalancesRange:p,highlightedCOABalancesRange:p,isCustomDateRange:!0,customStartDate:t,customEndDate:n})),e(ue({resetLeftScroll:!0}))},onInitialDateRangeAvailable:()=>{}}}))(He),Gs=e=>{const a=K(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ke(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:c}=ie({mobileExploreReferrer:"DashboardRevenue"}),m=Qe({mobileExploreReferrer:"DashboardRevenue"}),u=S((y=>Bt(y))),p=u.isForecastModeOn,h=u.timeframe,l=u.selectedForecast?.id,f=S((y=>wt(y.forecastState,l??""))),b=S((y=>Ta(y))),g=b.dataAvailable,k=u.mode==="compare_mode",{useFeatureGate:I}=be(),{isFeatureEnabled:A}=I(M.isReportsCustomDateRangeEnabled),_=S((y=>Re(y))),w=S((y=>Fe(y))),Y=S((y=>xa(y).uiState.accountViewMode)),v=S((y=>Pt(y)));C.useEffect((()=>{if(l!=null&&p===!0&&(z(p,r,l,o),f!=null)){const y=f?.forecastPeriod,T=g!=null&&y.endDate.isAfter(g?.endDate)===!0?g:y;a(Ce(e.firstMonthOfFY,{startDate:T.endDate.startOf(h),endDate:T?.endDate}))}}),[l]);const D=$e(),x=Yt(D?.currentTenant?.companyId,{clearParams:b.fetchState==="Completed"});return d.jsx(Ys,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:_,isAccountingProjectsEnabled:w,accountViewMode:Y,isCompareModeOn:k,isCustomDateRangeEnabled:A,timeframe:u.timeframe,selectedCOABalancesRange:u.selectedCOABalancesRange,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:O,reportsResyncFetchState:v.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:c,initialOpenThreadRequest:x,meetingUrl:We(s("dashboard_report_filters"))})},Ns=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}},Ws=se((function(e){const a=To(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=he(e,"navbar");return{report:a,analytics:O,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}}),(function(e,a){return{onTimeframeSelectionChanged:t=>{O.trackTimeframeSwitch(za(t),"Top Expenses"),e(Pa(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Ns(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ge({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(oe("navbar"))},onAutoCompleteEntity:t=>{const n=Se(t,a.tenantEmailDomain),o=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(ts),zs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Ws,{tenantEmailDomain:a,location:t,navigate:n})},qs=Vt.div`
|
|
14
14
|
display: flex;
|
|
15
15
|
flex: 1 1 auto;
|
|
16
16
|
min-height: 100%;
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
background-color: ${e=>e.theme.colors.grey5};
|
|
19
19
|
align-items: center;
|
|
20
|
-
`;function Ks({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=ee(),r=J(),{tenantEmailDomain:s}=Q();let i;ze({isDataReady:!0});const c={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(Ls,{...c});break;case"revenue":i=d.jsx(Gs,{...c});break;case"net_burn_or_income":i=d.jsx(js,{...c});break;case"cash_position":i=d.jsx(Fs,{...c});break;case"top_expenses":i=d.jsx(zs,{...c});break;case"cash_in_cash_out":i=d.jsx(ws,{...c});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(qs,{children:i}):null}function pe(){const e=J(),a=K(),{forecastId:t}=Q();let n="Not-Started";const o=S((l=>Ft(l).fetchState)),r=S((l=>Bt(l).fetchState)),s=S((l=>Dt(l).fetchState)),i=S((l=>l.cashPositionState.fetchState)),c=S((l=>l.topExState.fetchState)),m=S((l=>l.cashInCashOutState.fetchState));if(U.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const u=S((l=>L(l))),p=u?.company?.companyInfo?.firstMonthOfFY??1,h=ha((l=>{const f=ga(l,"/").split("/");return t!=null?f[f.length-3]:f[f.length-1]})(e.pathname));switch(h){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(`${h} is not supported!`)}return C.useEffect((()=>{n==="Not-Started"&&(function(l,f,b,g){switch(f){case"operating_expenses":l(Rt(!0)),g!=null&&(l(Te(b,!0,3,{id:g,index:0})),l(Da(!1,g)));break;case"revenue":l(jt(!0)),g!=null&&(l(Te(b,!0,3,{id:g,index:0})),l(xa(!1,g)));break;case"net_burn_or_income":l(Tt(!0)),g!=null&&(l(Te(b,!0,3,{id:g,index:0})),l(Ea(!1,g)));break;case"cash_position":l(vt(!0));break;case"top_expenses":l(Fa());break;case"cash_in_cash_out":l(It());break;default:throw new Error(`report type ${f} is not yet supported`)}})(a,h,p,t)}),[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(qe,{analytics:O,onLoad:l=>((f,b)=>{const g=e.state?.referrer;switch(b){case"operating_expenses":f.trackPageLoaded(W.Event.operatingExpenses,g);break;case"revenue":f.trackPageLoaded(W.Event.revenues,g);break;case"net_burn_or_income":f.trackPageLoaded(W.Event.burnRate,g);break;case"cash_position":f.trackPageLoaded(W.Event.cashPosition,g);break;case"top_expenses":f.trackPageLoaded(W.Event.topExpenses,g);break;case"cash_in_cash_out":f.trackPageLoaded(W.Event.cashInCashOut,g);break;default:console.error(`Analytics: Not tracking Page Loaded for ${b}!`)}})(l,h)}):null,d.jsx(Ks,{firstMonthOfFY:p,fetchState:n,reportId:h,forecastId:t})]})}var pt=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function ft(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),(function(){t(window.event)}))}function $a(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 Qa(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 Gt={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,"-":pt?173:189,"=":pt?61:187,";":pt?59:186,"'":222,"[":219,"]":221,"\\":220},fe={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Et={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},V={16:!1,18:!1,17:!1,91:!1},j={},tt=1;tt<20;tt++)Gt["f".concat(tt)]=111+tt;var P=[],ia=!1,Ha="all",ca=[],rt=function(e){return Gt[e.toLowerCase()]||fe[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function la(e){Ha=e||"all"}function Me(){return Ha||"all"}var ht=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Qa(a).forEach((function(s){var i=s.split(r),c=i.length,m=i[c-1],u=m==="*"?"*":rt(m);if(j[u]){t||(t=Me());var p=c>1?$a(fe,i):[];j[u]=j[u].filter((function(h){return!((!n||h.method===n)&&h.scope===t&&(function(l,f){for(var b=l.length>=f.length?l:f,g=l.length>=f.length?f:l,k=!0,I=0;I<b.length;I++)g.indexOf(b[I])===-1&&(k=!1);return k})(h.mods,p))}))}}))};function da(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,V)Object.prototype.hasOwnProperty.call(V,r)&&(!V[r]&&a.mods.indexOf(+r)>-1||V[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||V[16]||V[18]||V[17]||V[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 ua(e,a){var t=j["*"],n=e.keyCode||e.which||e.charCode;if(N.filter.call(this,e)){if(n!==93&&n!==224||(n=91),P.indexOf(n)===-1&&n!==229&&P.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(f){var b=Et[f];e[f]&&P.indexOf(b)===-1?P.push(b):!e[f]&&P.indexOf(b)>-1?P.splice(P.indexOf(b),1):f==="metaKey"&&e[f]&&P.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(P=P.slice(P.indexOf(b))))})),n in V){for(var o in V[n]=!0,fe)fe[o]===n&&(N[o]=!0);if(!t)return}for(var r in V)Object.prototype.hasOwnProperty.call(V,r)&&(V[r]=e[Et[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(P.indexOf(17)===-1&&P.push(17),P.indexOf(18)===-1&&P.push(18),V[17]=!0,V[18]=!0);var s=Me();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)&&da(e,t[i],s,a);if(n in j){for(var c=0;c<j[n].length;c++)if((e.type==="keydown"&&j[n][c].keydown||e.type==="keyup"&&j[n][c].keyup)&&j[n][c].key){for(var m=j[n][c],u=m.splitKey,p=m.key.split(u),h=[],l=0;l<p.length;l++)h.push(rt(p[l]));h.sort().join("")===P.sort().join("")&&da(e,m,s,a)}}}}function N(e,a,t){P=[];var n=Qa(e),o=[],r="all",s=document,i=0,c=!1,m=!0,u="+",p=!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&&(p=a.capture),typeof a.splitKey=="string"&&(u=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(u)).length>1&&(o=$a(fe,e)),(e=(e=e[e.length-1])==="*"?"*":rt(e))in j||(j[e]=[]),j[e].push({keyup:c,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:u,element:s});s!==void 0&&!(function(h){return ca.indexOf(h)>-1})(s)&&window&&(ca.push(s),ft(s,"keydown",(function(h){ua(h,s)}),p),ia||(ia=!0,ft(window,"focus",(function(){P=[]}),p)),ft(s,"keyup",(function(h){ua(h,s),(function(l){var f=l.keyCode||l.which||l.charCode,b=P.indexOf(f);if(b>=0&&P.splice(b,1),l.key&&l.key.toLowerCase()==="meta"&&P.splice(0,P.length),f!==93&&f!==224||(f=91),f in V)for(var g in V[f]=!1,fe)fe[g]===f&&(N[g]=!1)})(h)}),p))}var gt={setScope:la,getScope:Me,deleteScope:function(e,a){var t,n;for(var o in e||(e=Me()),j)if(Object.prototype.hasOwnProperty.call(j,o))for(t=j[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Me()===e&&la(a||"all")},getPressedKeyCodes:function(){return P.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=rt(e)),P.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(j).forEach((function(t){var n=j[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(j).forEach((function(s){return delete j[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:Gt,modifier:fe,modifierMap:Et};for(var Ct in gt)Object.prototype.hasOwnProperty.call(gt,Ct)&&(N[Ct]=gt[Ct]);if(typeof window<"u"){var $s=window.hotkeys;N.noConflict=function(e){return e&&window.hotkeys===N&&(window.hotkeys=$s),N},window.hotkeys=N}N.filter=function(){return!0};var ma=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Qs(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,u=m===void 0||m,p=o.enabled,h=p===void 0||p,l=o.enableOnContentEditable,f=l!==void 0&&l,b=C.useRef(null),g=C.useCallback((function(k,I){var A,_;return s&&!s(k)?!u:!!(ma(k,["INPUT","TEXTAREA","SELECT"])&&!ma(k,r)||(A=k.target)!=null&&A.isContentEditable&&!f)||!!(b.current===null||document.activeElement===b.current||(_=b.current)!=null&&_.contains(document.activeElement))&&(a(k,I),!0)}),n?[b,r,s].concat(n):[b,r,s]);return C.useEffect((function(){if(h)return i&&c!==!0&&(t.keydown=!1),N(e,t||{},g),function(){return N.unbind(e,g)};N.unbind(e,g)}),[g,e,h]),b}N.isPressed;const Hs=[],bt="dashboard_card",ne="ai_cfo_dashboard_card";function pa(e,a){return a?e.some((t=>String(t)===ne))?e.slice():[ne,...e]:e.filter((t=>String(t)!==ne))}const Zs=["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","rewards_card"],Xs=(e,a,t,n,o)=>({card:{dimension:Mt(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}),je=(e,a,t,n,o)=>({card:{dimension:Mt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),Js=(e,a,t,n)=>je(void 0,e,we,a,t),er=e=>{const a=Mt(we);return a.height=we.height+10,{card:{dimension:a,cardType:ne,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},tr=se((function(e,a){const t=or(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i}=a;let c=n.map(((m,u)=>{if(m==="reimbursement_promo_card"||m==="bill_pay_promo_card")return Js(t,m,u);if(m==="zeni_promo_card")return je({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,we,m,u);if(m==="information_card")return je(void 0,"Completed",we,m,u);if(m===ne)return er(u);{const p=o.find((h=>h?.reportId===m));return p?(function(h,l,f,b){const g=h.reportId;switch(g){case"card_balance":case"cash_balance":return[Xs(h,l,f,g,b)];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"rewards_card":return[je(h,l,f,g,b)];case"net_burn_or_income_story_card":return[je(h,l,f,"net_burn_or_income_story_card",b)];default:return console.error(`card type ${g} not yet supported!`),[]}})(p,p.fetchState,we,u):[]}})).flat();return a.isSummaryCardsFiltered===!0&&(c=c.filter((m=>Zs.includes(m.card.cardType)==0)).filter((m=>{const u=m.data?.availableNumberOfPeriods;return u!=null?u>0:m.card.cardType!="top_expenses"||m.data==null||(function(p){if(p==null||p.length===0)return!0;let h=!0;for(const l of p)if(l.balance.available.amount!==0){h=!1;break}return h})(m.data.topExpenses.accountsOrdered)===!1}))),{cardDataArray:c,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:he(e,"navbar")},analytics:O,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}}),(function(e,a){const t=a.tenantId,n=U.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)O.trackDashboardCardClicked("cards promo",2),O.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&&O.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(O.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.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),(function(i,c,m,u){if(c!==ne)switch(c){case"card_balance":i(ba());break;case"cash_balance":i(Ca());break;case"operating_expenses":i(Rt(!0));break;case"revenue":i(jt(!0));break;case"net_burn_or_income":i(Tt(!0));break;case"net_burn_or_income_story_card":i(Wo(!0));break;case"cash_position":i(vt(!0));break;case"top_expenses":i(Fa());break;case"cash_in_cash_out":i(It());break;case"insights_dashboard":i(No());break;case"bill_pay_card":i(Go());break;case"reimbursement_card":i(Yo());break;case"company_details":i(Uo(m));break;case"task_card":i(Lo());break;case"accounts_payable_aging":u.includes("accounts_payable_aging")===!1&&i(kt(xe()));break;case"accounts_receivable_aging":i(yt(xe()));break;case"rewards_card":u.includes("rewards_card")===!1&&i(Vo(!0));break;default:throw new Error(`report type ${c} is not yet supported`)}})(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{O.trackTimeframeSwitch(za(r),nr(o),"Dashboard"),(function(s,i,c){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(Pe(c));break;case"top_expenses":s(Pa(c));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}})(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Mo(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=>{if(o==="bill_pay_promo_card"){const r="../bills",s=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}else if(o==="reimbursement_promo_card"){const r="../reimbursements",s=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(O.trackUpdateBurnRateCalculatorSettings(r,s,Bo(s)),e(jo(t,r,s)))}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ge({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(oe("navbar"))},onCancelAutoComplete:()=>{e(oe("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?Se(o,a.tenantEmailDomain):ms(o.zeniId,o.qboId,a.tenantEmailDomain);const s=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}}))(ds);function ar(){const e=fa(),a=Ma(),t=Ga(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=ja(),s=ee(),i=K(),c=J(),m=U.getSignedInUser(),{useFeatureGate:u,useDynamicConfig:p}=be(),[h,l]=C.useState(!1),[f,b]=C.useState(!1),g=Va(),{tenantEmailDomain:k}=Q(),{isAiCfoAccessEnabled:I,onAskAiCfoClick:A}=ie({mobileExploreReferrer:"Dashboard"}),_=S((E=>E.tenantState.fetchState==="Completed"||E.tenantState.activeTenantFetchState.fetchState==="Completed"?L(E):void 0)),x=_??U.getSignedInUserTenant(k),{isCardsShuttingDown:Y,shutdownContent:v}=as(x?.tenantId,_?.company?.managementInfo?.receiverEmails),D=C.useMemo((()=>Y===!0&&v!=null?d.jsx(ns,{shutdownContent:v}):null),[Y,v]),w=_?.masterTOSInfo?.isMasterTOSAccepted??!1,y=x.tenantId,T=x.companyId;C.useEffect((()=>{h===!1&&c.state?.message==="activation"&&(i(wo(T)),l(!0))}),[c.state,h,T,i]),C.useEffect((()=>{g&&!f&&c.state?.message==="open_ai_cfo_drawer"&&(b(!0),w?(o(!0),s({pathname:c.pathname,search:c.search,hash:c.hash},{replace:!0,state:{...c.state,message:void 0}})):me({location:c,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))}),[c,f,g,w,o,s]);const{isFeatureEnabled:ce}=u(M.isApAgingFeatureEnabled),ye=os(),B=ss(ye),{isFeatureEnabled:te}=u(M.isArAgingFeatureEnabled),{isFeatureEnabled:Ze}=u(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Xe}=u(M.isReferralFeatureEnabled),{isFeatureEnabled:Za}=u(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Xa}=u(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ja}=u(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:en}=u(M.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:tn}=u(M.aiAuditScorePercentage),{configValue:Nt}=p(La.zeniCardsConfig),an=Nt.charge_card_cashback_rate_per_transaction==null?.0175:Nt.charge_card_cashback_rate_per_transaction;if(c.state?.message==="activation"){const E=rs(c.state?.pathnameStackToGoBack);s(c.pathname,{state:{...c.state,message:void 0,pathnameStackToGoBack:E.newStack}})}const[Wt,nn]=C.useState(!1),[it,on]=C.useState(!1);Qs("command+p, Control+p",(E=>{on(!it),E.preventDefault()}),{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[it]);const zt=_?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const _e=S((E=>L(E)?.excludedResources)),sn=S((E=>E.expenseAutomationViewState.selectedPeriodByTenantId)),rn=!!_?.companyReimbursementInfo?.info?.isReimbursementEnabled,cn=!!_?.companyBillPayInfo?.info?.isBillPayEnabled,ln=$e(),$=[],qt=_e?.resources?.find((E=>E.resource==="/reports/top_expenses"))==null,dn=_e?.resources?.find((E=>E.resource==="/reports/task_card"))==null,Kt=_?.userRole!=null&&Oa(_?.userRole),un=_e?.resources?.find((E=>E.resource==="/bills"))==null&&!Kt,mn=_e?.resources?.find((E=>E.resource==="/reimbursements"))==null,pn=xo(ln?.loggedInUserRoleMap),fn=_?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,hn=_?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1;qt===!1&&$.push("top_expenses"),dn===!1&&$.push("task_card"),un===!1&&$.push("bill_pay_card","bill_pay_promo_card"),ce===!1&&$.push("accounts_payable_aging"),te===!1&&$.push("accounts_receivable_aging"),(ye===!1||Kt)&&$.push("expense_automation_card"),mn===!1&&$.push("reimbursement_card","reimbursement_promo_card"),$.push("zeni_accounts_promo_card","treasury_promo_card"),Xe===!1&&$.push("rewards_card");const{areTenantIdsInSync:$t}=is();C.useLayoutEffect((()=>{Wt&&B===ye||zt!==!0||!$t||_e?.fetchState!=="Completed"&&_e?.fetchState!=="Error"||(nn(!0),i(Po(m.userId,T,y,!0,!1,$)))}),[Wt,m,y,i,qt,zt,_e?.fetchState,$t]);const gn=S((E=>E.reportUIOptionsState.forecastOnDashboard.isForecastModeOn)),Cn=S((E=>E.revenueState.uiState.selectedForecast?.id)),bn=S((E=>E.cardBalanceState.fetchState)),ke=S((E=>Fo(E,$))),ct=ke.fetchState;C.useEffect((()=>{ct==="Completed"&&performance.mark("zeni:boot_dashboard_data")}),[ct]);const Sn=C.useMemo((()=>pa(ke.cardsOrdered,I)),[ke.cardsOrdered,I]),_n=C.useMemo((()=>pa(ke.cardsForDashboardUI,I)),[ke.cardsForDashboardUI,I]);ze({isDataReady:!0});const{isSuggestedQuestionsLoading:kn,suggestedPromptQuestions:yn}=fs(),Qt=S((E=>Sa(E))),Ae=Qt.uiState?.currentChatSessionId,lt=Qt.allSessionsWithOrderedQuestionAnswers??Hs,{currentSessionQuestionAnswers:An}=cs(lt,Ae),Ht=An.length===0,En=C.useCallback(((E,Z,ae)=>{const Ee=m?.userId;if(Ee==null)return;const G=E.trim();if(G.length===0&&Z.length===0)return;if(!w)return void me({location:c,navigate:s,mergeState:{referrer:"Dashboard",...G.length>0?{aiCfoInitialQuestion:G,aiCfoInitialSubmissionSource:bt,...typeof ae=="number"?{aiCfoSuggestionIndex:ae}:{}}:{}}});const X=Ua(e.getState()),Ie=()=>{const ve=R(c.state?.pathnameStackToGoBack,c.pathname);s(`/${k}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:ve,referrer:"Dashboard",aiCfoInitialQuestion:G,aiCfoShouldSubmit:!X&&G.length>0,aiCfoInitialSubmissionSource:bt,...typeof ae=="number"?{aiCfoSuggestionIndex:ae}:{}}})};return t?Z.length>0?void o(!0):void Ie():Z.length>0?X?(i(At(G)),void o(!0)):(r(G.length>0?G:null),o(!0),void(G.length>0&&Ya(i,G,bt,Ae,lt,Ee,ae,Z.length>0?Z:void 0))):(X&&i(At(G)),void Ie())}),[lt,Ae,i,w,t,c,s,r,o,m?.userId,e,k]),In=C.useCallback((()=>{w?o(!0):me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})}),[w,c,s,o]),vn=C.useCallback((()=>{if(!w)return void me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});if(k==null)return;const E=R(c.state?.pathnameStackToGoBack,c.pathname);s(`/${k}/ai-cfo/explore`,{state:{pathnameStackToGoBack:E,referrer:"Dashboard"}})}),[w,c,s,k]),Dn=C.useCallback((()=>{if(w)if(t){if(k==null||_==null)return;const E=Ae==null||Ht?`/${k}/ai-cfo/explore`:`/${k}/ai-cfo/${Ae}`,Z=c.state?.pathnameStackToGoBack??[],ae=R(Z,c.pathname);s(E,{state:{...c.state,pathnameStackToGoBack:ae,[ls]:!0}})}else me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});else me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})}),[w,t,c,s,k,_,Ae,Ht]);return d.jsxs(d.Fragment,{children:[ct==="Completed"?d.jsx(qe,{analytics:O,onLoad:E=>{E.trackPageLoaded(W.Event.dashboard)}}):null,d.jsx(tr,{cardsShutdownBanner:D,maxColumns:n?2:void 0,isAiCfoAccessEnabled:I,onAskAiCfoClick:A,onAiCfoDashboardOpenPanel:In,onAiCfoDashboardOpenScopePage:Dn,isAiCfoFileUploadEnabled:Xa===!0&&t===!1,onAiCfoDashboardPromptSubmit:En,onAiCfoDashboardExpandToFullPage:vn,aiCfoDashboardShouldClearPromptOnSubmit:w,aiCfoDashboardSuggestedPromptQuestions:yn,aiCfoDashboardSuggestedPromptQuestionsLoading:kn,onDragAndDropCard:(E,Z)=>{if(E===ne||Z===ne)return;const ae=(function(X,Ie,ve){const dt=ve.indexOf(X),ut=ve.indexOf(Ie);if(dt===-1||ut===-1||dt===ut)return ve;const mt=[...ve];return mt.splice(dt,1),mt.splice(ut,0,X),mt})(E,Z,Sn),Ee=ae.filter((X=>X!==ne)),G=ke.cardsOrdered;(Ee.length!==G.length||Ee.some(((X,Ie)=>X!==G[Ie])))&&i(Ro(Ee))},dashboardReport:ke,passedCardsOrdered:_n,tenantId:y,companyId:T,tenantEmailDomain:k,location:c,navigate:s,isApAgingFeatureEnabled:ce,isArAgingFeatureEnabled:te,isBillPayEnabled:cn,isReimbursementEnabled:rn,isSummaryCardsFiltered:it,isForecastOn:gn,selectedForecastOnDashboard:Cn,isVisitingFirstTime:h,isZeniAccountEnabled:Ze,isRewardsFeatureEnabled:Xe,selectedPeriod:sn[y],isChargeCardFeatureEnabled:Za,isUserHasCardsAccess:pn,cardsCreditLimit:fn,cashbackRate:an,isInterestedInChargeCard:hn,cardBalanceFetchState:bn,christmasAnimationEnabled:Ja,newYearAnimationEnabled:en,aiAuditScorePercentageEnabled:tn})]})}const nr=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"},or=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map((a=>a.fetchState)).reduce(((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t));function St(){return d.jsxs(_t,{children:[d.jsx(F,{path:"/",element:d.jsx(pe,{})}),d.jsx(F,{path:"/:forecastId",element:d.jsx(pe,{})}),d.jsx(F,{path:"/:forecastId/*",element:d.jsx(Ve,{})})]})}function Mr(){const e=$e(),a=e?.excludedResources?.find((m=>m.resource==="/reports/top_expenses"))==null,{useFeatureGate:t}=be(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=S((m=>L(m))),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=zo(s,r),c=qo(r);return i===!0||c===!0?d.jsx(_t,{children:d.jsx(F,{path:"/*",element:d.jsx(hs,{})})}):d.jsxs(_t,{children:[d.jsx(F,{path:"/",element:d.jsx(ar,{})}),d.jsx(F,{path:"cash_balance/*",element:d.jsx(sa,{})}),d.jsx(F,{path:"card_balance/*",element:d.jsx(sa,{})}),d.jsx(F,{path:"operating_expenses/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"operating_expenses/forecast/*",element:d.jsx(St,{})}),d.jsx(F,{path:"revenue/forecast/*",element:d.jsx(St,{})}),d.jsx(F,{path:"revenue/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"net_burn_or_income/forecast/*",element:d.jsx(St,{})}),d.jsx(F,{path:"net_burn_or_income/*",element:d.jsx(pe,{})}),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(gs,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(bs,{})}),d.jsx(F,{path:"accounts_receivable_aging/*",element:d.jsx(Ss,{})})]}),d.jsx(F,{path:"cash_position/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"top_expenses/*",element:a===!0?d.jsx(pe,{}):d.jsx(Ve,{})}),d.jsx(F,{path:"cash_in_cash_out/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"company_details",element:d.jsx(ps,{})}),d.jsx(F,{path:"referrals/*",element:d.jsx(On,{to:"../../rewards/refer",replace:!0})}),d.jsx(F,{path:"*",element:d.jsx(Ve,{})})]})}export{Mr as default};
|
|
20
|
+
`;function Ks({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=ee(),r=J(),{tenantEmailDomain:s}=Q();let i;ze({isDataReady:!0});const c={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(Ls,{...c});break;case"revenue":i=d.jsx(Gs,{...c});break;case"net_burn_or_income":i=d.jsx(js,{...c});break;case"cash_position":i=d.jsx(Fs,{...c});break;case"top_expenses":i=d.jsx(zs,{...c});break;case"cash_in_cash_out":i=d.jsx(xs,{...c});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(qs,{children:i}):null}function pe(){const e=J(),a=K(),{forecastId:t}=Q();let n="Not-Started";const o=S((l=>Ft(l).fetchState)),r=S((l=>Bt(l).fetchState)),s=S((l=>Dt(l).fetchState)),i=S((l=>l.cashPositionState.fetchState)),c=S((l=>l.topExState.fetchState)),m=S((l=>l.cashInCashOutState.fetchState));if(U.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const u=S((l=>L(l))),p=u?.company?.companyInfo?.firstMonthOfFY??1,h=ha((l=>{const f=ga(l,"/").split("/");return t!=null?f[f.length-3]:f[f.length-1]})(e.pathname));switch(h){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(`${h} is not supported!`)}return C.useEffect((()=>{n==="Not-Started"&&(function(l,f,b,g){switch(f){case"operating_expenses":l(Rt(!0)),g!=null&&(l(Te(b,!0,3,{id:g,index:0})),l(Da(!1,g)));break;case"revenue":l(jt(!0)),g!=null&&(l(Te(b,!0,3,{id:g,index:0})),l(wa(!1,g)));break;case"net_burn_or_income":l(Tt(!0)),g!=null&&(l(Te(b,!0,3,{id:g,index:0})),l(Ea(!1,g)));break;case"cash_position":l(vt(!0));break;case"top_expenses":l(Fa());break;case"cash_in_cash_out":l(It());break;default:throw new Error(`report type ${f} is not yet supported`)}})(a,h,p,t)}),[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(qe,{analytics:O,onLoad:l=>((f,b)=>{const g=e.state?.referrer;switch(b){case"operating_expenses":f.trackPageLoaded(W.Event.operatingExpenses,g);break;case"revenue":f.trackPageLoaded(W.Event.revenues,g);break;case"net_burn_or_income":f.trackPageLoaded(W.Event.burnRate,g);break;case"cash_position":f.trackPageLoaded(W.Event.cashPosition,g);break;case"top_expenses":f.trackPageLoaded(W.Event.topExpenses,g);break;case"cash_in_cash_out":f.trackPageLoaded(W.Event.cashInCashOut,g);break;default:console.error(`Analytics: Not tracking Page Loaded for ${b}!`)}})(l,h)}):null,d.jsx(Ks,{firstMonthOfFY:p,fetchState:n,reportId:h,forecastId:t})]})}var pt=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function ft(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),(function(){t(window.event)}))}function $a(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 Qa(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 Gt={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,"-":pt?173:189,"=":pt?61:187,";":pt?59:186,"'":222,"[":219,"]":221,"\\":220},fe={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Et={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},V={16:!1,18:!1,17:!1,91:!1},j={},tt=1;tt<20;tt++)Gt["f".concat(tt)]=111+tt;var P=[],ia=!1,Ha="all",ca=[],rt=function(e){return Gt[e.toLowerCase()]||fe[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function la(e){Ha=e||"all"}function Me(){return Ha||"all"}var ht=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Qa(a).forEach((function(s){var i=s.split(r),c=i.length,m=i[c-1],u=m==="*"?"*":rt(m);if(j[u]){t||(t=Me());var p=c>1?$a(fe,i):[];j[u]=j[u].filter((function(h){return!((!n||h.method===n)&&h.scope===t&&(function(l,f){for(var b=l.length>=f.length?l:f,g=l.length>=f.length?f:l,k=!0,I=0;I<b.length;I++)g.indexOf(b[I])===-1&&(k=!1);return k})(h.mods,p))}))}}))};function da(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,V)Object.prototype.hasOwnProperty.call(V,r)&&(!V[r]&&a.mods.indexOf(+r)>-1||V[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||V[16]||V[18]||V[17]||V[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 ua(e,a){var t=j["*"],n=e.keyCode||e.which||e.charCode;if(N.filter.call(this,e)){if(n!==93&&n!==224||(n=91),P.indexOf(n)===-1&&n!==229&&P.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(f){var b=Et[f];e[f]&&P.indexOf(b)===-1?P.push(b):!e[f]&&P.indexOf(b)>-1?P.splice(P.indexOf(b),1):f==="metaKey"&&e[f]&&P.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(P=P.slice(P.indexOf(b))))})),n in V){for(var o in V[n]=!0,fe)fe[o]===n&&(N[o]=!0);if(!t)return}for(var r in V)Object.prototype.hasOwnProperty.call(V,r)&&(V[r]=e[Et[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(P.indexOf(17)===-1&&P.push(17),P.indexOf(18)===-1&&P.push(18),V[17]=!0,V[18]=!0);var s=Me();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)&&da(e,t[i],s,a);if(n in j){for(var c=0;c<j[n].length;c++)if((e.type==="keydown"&&j[n][c].keydown||e.type==="keyup"&&j[n][c].keyup)&&j[n][c].key){for(var m=j[n][c],u=m.splitKey,p=m.key.split(u),h=[],l=0;l<p.length;l++)h.push(rt(p[l]));h.sort().join("")===P.sort().join("")&&da(e,m,s,a)}}}}function N(e,a,t){P=[];var n=Qa(e),o=[],r="all",s=document,i=0,c=!1,m=!0,u="+",p=!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&&(p=a.capture),typeof a.splitKey=="string"&&(u=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(u)).length>1&&(o=$a(fe,e)),(e=(e=e[e.length-1])==="*"?"*":rt(e))in j||(j[e]=[]),j[e].push({keyup:c,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:u,element:s});s!==void 0&&!(function(h){return ca.indexOf(h)>-1})(s)&&window&&(ca.push(s),ft(s,"keydown",(function(h){ua(h,s)}),p),ia||(ia=!0,ft(window,"focus",(function(){P=[]}),p)),ft(s,"keyup",(function(h){ua(h,s),(function(l){var f=l.keyCode||l.which||l.charCode,b=P.indexOf(f);if(b>=0&&P.splice(b,1),l.key&&l.key.toLowerCase()==="meta"&&P.splice(0,P.length),f!==93&&f!==224||(f=91),f in V)for(var g in V[f]=!1,fe)fe[g]===f&&(N[g]=!1)})(h)}),p))}var gt={setScope:la,getScope:Me,deleteScope:function(e,a){var t,n;for(var o in e||(e=Me()),j)if(Object.prototype.hasOwnProperty.call(j,o))for(t=j[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Me()===e&&la(a||"all")},getPressedKeyCodes:function(){return P.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=rt(e)),P.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(j).forEach((function(t){var n=j[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(j).forEach((function(s){return delete j[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:Gt,modifier:fe,modifierMap:Et};for(var Ct in gt)Object.prototype.hasOwnProperty.call(gt,Ct)&&(N[Ct]=gt[Ct]);if(typeof window<"u"){var $s=window.hotkeys;N.noConflict=function(e){return e&&window.hotkeys===N&&(window.hotkeys=$s),N},window.hotkeys=N}N.filter=function(){return!0};var ma=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Qs(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,u=m===void 0||m,p=o.enabled,h=p===void 0||p,l=o.enableOnContentEditable,f=l!==void 0&&l,b=C.useRef(null),g=C.useCallback((function(k,I){var A,_;return s&&!s(k)?!u:!!(ma(k,["INPUT","TEXTAREA","SELECT"])&&!ma(k,r)||(A=k.target)!=null&&A.isContentEditable&&!f)||!!(b.current===null||document.activeElement===b.current||(_=b.current)!=null&&_.contains(document.activeElement))&&(a(k,I),!0)}),n?[b,r,s].concat(n):[b,r,s]);return C.useEffect((function(){if(h)return i&&c!==!0&&(t.keydown=!1),N(e,t||{},g),function(){return N.unbind(e,g)};N.unbind(e,g)}),[g,e,h]),b}N.isPressed;const Hs=[],bt="dashboard_card",ne="ai_cfo_dashboard_card";function pa(e,a){return a?e.some((t=>String(t)===ne))?e.slice():[ne,...e]:e.filter((t=>String(t)!==ne))}const Zs=["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","rewards_card"],Xs=(e,a,t,n,o)=>({card:{dimension:Mt(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}),je=(e,a,t,n,o)=>({card:{dimension:Mt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),Js=(e,a,t,n)=>je(void 0,e,xe,a,t),er=e=>{const a=Mt(xe);return a.height=xe.height+10,{card:{dimension:a,cardType:ne,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},tr=se((function(e,a){const t=or(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i}=a;let c=n.map(((m,u)=>{if(m==="reimbursement_promo_card"||m==="bill_pay_promo_card")return Js(t,m,u);if(m==="zeni_promo_card")return je({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,xe,m,u);if(m==="information_card")return je(void 0,"Completed",xe,m,u);if(m===ne)return er(u);{const p=o.find((h=>h?.reportId===m));return p?(function(h,l,f,b){const g=h.reportId;switch(g){case"card_balance":case"cash_balance":return[Xs(h,l,f,g,b)];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"rewards_card":return[je(h,l,f,g,b)];case"net_burn_or_income_story_card":return[je(h,l,f,"net_burn_or_income_story_card",b)];default:return console.error(`card type ${g} not yet supported!`),[]}})(p,p.fetchState,xe,u):[]}})).flat();return a.isSummaryCardsFiltered===!0&&(c=c.filter((m=>Zs.includes(m.card.cardType)==0)).filter((m=>{const u=m.data?.availableNumberOfPeriods;return u!=null?u>0:m.card.cardType!="top_expenses"||m.data==null||(function(p){if(p==null||p.length===0)return!0;let h=!0;for(const l of p)if(l.balance.available.amount!==0){h=!1;break}return h})(m.data.topExpenses.accountsOrdered)===!1}))),{cardDataArray:c,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:he(e,"navbar")},analytics:O,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}}),(function(e,a){const t=a.tenantId,n=U.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)O.trackDashboardCardClicked("cards promo",2),O.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&&O.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(O.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.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),(function(i,c,m,u){if(c!==ne)switch(c){case"card_balance":i(ba());break;case"cash_balance":i(Ca());break;case"operating_expenses":i(Rt(!0));break;case"revenue":i(jt(!0));break;case"net_burn_or_income":i(Tt(!0));break;case"net_burn_or_income_story_card":i(Wo(!0));break;case"cash_position":i(vt(!0));break;case"top_expenses":i(Fa());break;case"cash_in_cash_out":i(It());break;case"insights_dashboard":i(No());break;case"bill_pay_card":i(Go());break;case"reimbursement_card":i(Yo());break;case"company_details":i(Uo(m));break;case"task_card":i(Lo());break;case"accounts_payable_aging":u.includes("accounts_payable_aging")===!1&&i(kt(we()));break;case"accounts_receivable_aging":i(yt(we()));break;case"rewards_card":u.includes("rewards_card")===!1&&i(Vo(!0));break;default:throw new Error(`report type ${c} is not yet supported`)}})(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{O.trackTimeframeSwitch(za(r),nr(o),"Dashboard"),(function(s,i,c){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(Pe(c));break;case"top_expenses":s(Pa(c));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}})(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Mo(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=>{if(o==="bill_pay_promo_card"){const r="../bills",s=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}else if(o==="reimbursement_promo_card"){const r="../reimbursements",s=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(O.trackUpdateBurnRateCalculatorSettings(r,s,Bo(s)),e(jo(t,r,s)))}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ge({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(oe("navbar"))},onCancelAutoComplete:()=>{e(oe("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?Se(o,a.tenantEmailDomain):ms(o.zeniId,o.qboId,a.tenantEmailDomain);const s=R(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}}))(ds);function ar(){const e=fa(),a=Ma(),t=Ga(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=ja(),s=ee(),i=K(),c=J(),m=U.getSignedInUser(),{useFeatureGate:u,useDynamicConfig:p}=be(),[h,l]=C.useState(!1),[f,b]=C.useState(!1),g=Va(),{tenantEmailDomain:k}=Q(),{isAiCfoAccessEnabled:I,onAskAiCfoClick:A}=ie({mobileExploreReferrer:"Dashboard"}),_=S((E=>E.tenantState.fetchState==="Completed"||E.tenantState.activeTenantFetchState.fetchState==="Completed"?L(E):void 0)),w=_??U.getSignedInUserTenant(k),{isCardsShuttingDown:Y,shutdownContent:v}=as(w?.tenantId,_?.company?.managementInfo?.receiverEmails),D=C.useMemo((()=>Y===!0&&v!=null?d.jsx(ns,{shutdownContent:v}):null),[Y,v]),x=_?.masterTOSInfo?.isMasterTOSAccepted??!1,y=w.tenantId,T=w.companyId;C.useEffect((()=>{h===!1&&c.state?.message==="activation"&&(i(xo(T)),l(!0))}),[c.state,h,T,i]),C.useEffect((()=>{g&&!f&&c.state?.message==="open_ai_cfo_drawer"&&(b(!0),x?(o(!0),s({pathname:c.pathname,search:c.search,hash:c.hash},{replace:!0,state:{...c.state,message:void 0}})):me({location:c,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))}),[c,f,g,x,o,s]);const{isFeatureEnabled:ce}=u(M.isApAgingFeatureEnabled),ye=os(),B=ss(ye),{isFeatureEnabled:te}=u(M.isArAgingFeatureEnabled),{isFeatureEnabled:Ze}=u(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Xe}=u(M.isReferralFeatureEnabled),{isFeatureEnabled:Za}=u(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Xa}=u(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ja}=u(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:en}=u(M.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:tn}=u(M.aiAuditScorePercentage),{configValue:Nt}=p(La.zeniCardsConfig),an=Nt.charge_card_cashback_rate_per_transaction==null?.0175:Nt.charge_card_cashback_rate_per_transaction;if(c.state?.message==="activation"){const E=rs(c.state?.pathnameStackToGoBack);s(c.pathname,{state:{...c.state,message:void 0,pathnameStackToGoBack:E.newStack}})}const[Wt,nn]=C.useState(!1),[it,on]=C.useState(!1);Qs("command+p, Control+p",(E=>{on(!it),E.preventDefault()}),{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[it]);const zt=_?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const _e=S((E=>L(E)?.excludedResources)),sn=S((E=>E.expenseAutomationViewState.selectedPeriodByTenantId)),rn=!!_?.companyReimbursementInfo?.info?.isReimbursementEnabled,cn=!!_?.companyBillPayInfo?.info?.isBillPayEnabled,ln=$e(),$=[],qt=_e?.resources?.find((E=>E.resource==="/reports/top_expenses"))==null,dn=_e?.resources?.find((E=>E.resource==="/reports/task_card"))==null,Kt=_?.userRole!=null&&Oa(_?.userRole),un=_e?.resources?.find((E=>E.resource==="/bills"))==null&&!Kt,mn=_e?.resources?.find((E=>E.resource==="/reimbursements"))==null,pn=wo(ln?.loggedInUserRoleMap),fn=_?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,hn=_?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1;qt===!1&&$.push("top_expenses"),dn===!1&&$.push("task_card"),un===!1&&$.push("bill_pay_card","bill_pay_promo_card"),ce===!1&&$.push("accounts_payable_aging"),te===!1&&$.push("accounts_receivable_aging"),(ye===!1||Kt)&&$.push("expense_automation_card"),mn===!1&&$.push("reimbursement_card","reimbursement_promo_card"),$.push("zeni_accounts_promo_card","treasury_promo_card"),Xe===!1&&$.push("rewards_card");const{areTenantIdsInSync:$t}=is();C.useLayoutEffect((()=>{Wt&&B===ye||zt!==!0||!$t||_e?.fetchState!=="Completed"&&_e?.fetchState!=="Error"||(nn(!0),i(Po(m.userId,T,y,!0,!1,$)))}),[Wt,m,y,i,qt,zt,_e?.fetchState,$t]);const gn=S((E=>E.reportUIOptionsState.forecastOnDashboard.isForecastModeOn)),Cn=S((E=>E.revenueState.uiState.selectedForecast?.id)),bn=S((E=>E.cardBalanceState.fetchState)),ke=S((E=>Fo(E,$))),ct=ke.fetchState;C.useEffect((()=>{ct==="Completed"&&performance.mark("zeni:boot_dashboard_data")}),[ct]);const Sn=C.useMemo((()=>pa(ke.cardsOrdered,I)),[ke.cardsOrdered,I]),_n=C.useMemo((()=>pa(ke.cardsForDashboardUI,I)),[ke.cardsForDashboardUI,I]);ze({isDataReady:!0});const{isSuggestedQuestionsLoading:kn,suggestedPromptQuestions:yn}=fs(),Qt=S((E=>Sa(E))),Ae=Qt.uiState?.currentChatSessionId,lt=Qt.allSessionsWithOrderedQuestionAnswers??Hs,{currentSessionQuestionAnswers:An}=cs(lt,Ae),Ht=An.length===0,En=C.useCallback(((E,Z,ae)=>{const Ee=m?.userId;if(Ee==null)return;const G=E.trim();if(G.length===0&&Z.length===0)return;if(!x)return void me({location:c,navigate:s,mergeState:{referrer:"Dashboard",...G.length>0?{aiCfoInitialQuestion:G,aiCfoInitialSubmissionSource:bt,...typeof ae=="number"?{aiCfoSuggestionIndex:ae}:{}}:{}}});const X=Ua(e.getState()),Ie=()=>{const ve=R(c.state?.pathnameStackToGoBack,c.pathname);s(`/${k}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:ve,referrer:"Dashboard",aiCfoInitialQuestion:G,aiCfoShouldSubmit:!X&&G.length>0,aiCfoInitialSubmissionSource:bt,...typeof ae=="number"?{aiCfoSuggestionIndex:ae}:{}}})};return t?Z.length>0?void o(!0):void Ie():Z.length>0?X?(i(At(G)),void o(!0)):(r(G.length>0?G:null),o(!0),void(G.length>0&&Ya(i,G,bt,Ae,lt,Ee,ae,Z.length>0?Z:void 0))):(X&&i(At(G)),void Ie())}),[lt,Ae,i,x,t,c,s,r,o,m?.userId,e,k]),In=C.useCallback((()=>{x?o(!0):me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})}),[x,c,s,o]),vn=C.useCallback((()=>{if(!x)return void me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});if(k==null)return;const E=R(c.state?.pathnameStackToGoBack,c.pathname);s(`/${k}/ai-cfo/explore`,{state:{pathnameStackToGoBack:E,referrer:"Dashboard"}})}),[x,c,s,k]),Dn=C.useCallback((()=>{if(x)if(t){if(k==null||_==null)return;const E=Ae==null||Ht?`/${k}/ai-cfo/explore`:`/${k}/ai-cfo/${Ae}`,Z=c.state?.pathnameStackToGoBack??[],ae=R(Z,c.pathname);s(E,{state:{...c.state,pathnameStackToGoBack:ae,[ls]:!0}})}else me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});else me({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})}),[x,t,c,s,k,_,Ae,Ht]);return d.jsxs(d.Fragment,{children:[ct==="Completed"?d.jsx(qe,{analytics:O,onLoad:E=>{E.trackPageLoaded(W.Event.dashboard)}}):null,d.jsx(tr,{cardsShutdownBanner:D,maxColumns:n?2:void 0,isAiCfoAccessEnabled:I,onAskAiCfoClick:A,onAiCfoDashboardOpenPanel:In,onAiCfoDashboardOpenScopePage:Dn,isAiCfoFileUploadEnabled:Xa===!0&&t===!1,onAiCfoDashboardPromptSubmit:En,onAiCfoDashboardExpandToFullPage:vn,aiCfoDashboardShouldClearPromptOnSubmit:x,aiCfoDashboardSuggestedPromptQuestions:yn,aiCfoDashboardSuggestedPromptQuestionsLoading:kn,onDragAndDropCard:(E,Z)=>{if(E===ne||Z===ne)return;const ae=(function(X,Ie,ve){const dt=ve.indexOf(X),ut=ve.indexOf(Ie);if(dt===-1||ut===-1||dt===ut)return ve;const mt=[...ve];return mt.splice(dt,1),mt.splice(ut,0,X),mt})(E,Z,Sn),Ee=ae.filter((X=>X!==ne)),G=ke.cardsOrdered;(Ee.length!==G.length||Ee.some(((X,Ie)=>X!==G[Ie])))&&i(Ro(Ee))},dashboardReport:ke,passedCardsOrdered:_n,tenantId:y,companyId:T,tenantEmailDomain:k,location:c,navigate:s,isApAgingFeatureEnabled:ce,isArAgingFeatureEnabled:te,isBillPayEnabled:cn,isReimbursementEnabled:rn,isSummaryCardsFiltered:it,isForecastOn:gn,selectedForecastOnDashboard:Cn,isVisitingFirstTime:h,isZeniAccountEnabled:Ze,isRewardsFeatureEnabled:Xe,selectedPeriod:sn[y],isChargeCardFeatureEnabled:Za,isUserHasCardsAccess:pn,cardsCreditLimit:fn,cashbackRate:an,isInterestedInChargeCard:hn,cardBalanceFetchState:bn,christmasAnimationEnabled:Ja,newYearAnimationEnabled:en,aiAuditScorePercentageEnabled:tn})]})}const nr=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"},or=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map((a=>a.fetchState)).reduce(((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t));function St(){return d.jsxs(_t,{children:[d.jsx(F,{path:"/",element:d.jsx(pe,{})}),d.jsx(F,{path:"/:forecastId",element:d.jsx(pe,{})}),d.jsx(F,{path:"/:forecastId/*",element:d.jsx(Ve,{})})]})}function Mr(){const e=$e(),a=e?.excludedResources?.find((m=>m.resource==="/reports/top_expenses"))==null,{useFeatureGate:t}=be(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=S((m=>L(m))),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=zo(s,r),c=qo(r);return i===!0||c===!0?d.jsx(_t,{children:d.jsx(F,{path:"/*",element:d.jsx(hs,{})})}):d.jsxs(_t,{children:[d.jsx(F,{path:"/",element:d.jsx(ar,{})}),d.jsx(F,{path:"cash_balance/*",element:d.jsx(sa,{})}),d.jsx(F,{path:"card_balance/*",element:d.jsx(sa,{})}),d.jsx(F,{path:"operating_expenses/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"operating_expenses/forecast/*",element:d.jsx(St,{})}),d.jsx(F,{path:"revenue/forecast/*",element:d.jsx(St,{})}),d.jsx(F,{path:"revenue/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"net_burn_or_income/forecast/*",element:d.jsx(St,{})}),d.jsx(F,{path:"net_burn_or_income/*",element:d.jsx(pe,{})}),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(gs,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(bs,{})}),d.jsx(F,{path:"accounts_receivable_aging/*",element:d.jsx(Ss,{})})]}),d.jsx(F,{path:"cash_position/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"top_expenses/*",element:a===!0?d.jsx(pe,{}):d.jsx(Ve,{})}),d.jsx(F,{path:"cash_in_cash_out/*",element:d.jsx(pe,{})}),d.jsx(F,{path:"company_details",element:d.jsx(ps,{})}),d.jsx(F,{path:"referrals/*",element:d.jsx(On,{to:"../../rewards/refer",replace:!0})}),d.jsx(F,{path:"*",element:d.jsx(Ve,{})})]})}export{Mr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-CuUK5O_2.js";import{a as u}from"./sentry-D0lP5-8e.js";import{u as y,j as b,l as U,g as w,N as A}from"./core-BBlQ3ArL.js";import{UN as N,fI as _,go as k,UO as R,hd as z,UP as L}from"./zeni-epic-state-aUBx6G2Q.js";import{u as O,z as f,b as T,t as I,G as j,e as $}from"./index-ClwW47Zs.js";import"./mui--aGBnNu2.js";import{t as P}from"./getLocaleForTenant-DTPcYF0O.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.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]="d3d23b52-3c48-4dd8-b932-353552b08ea8",t._sentryDebugIdIdentifier="sentry-dbid-d3d23b52-3c48-4dd8-b932-353552b08ea8")}catch{}})();const G=U((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:L(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(A,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>N(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(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"&&!R(i))&&t(z(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(G,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-u2HKaCWA.js → DomesticWireDetailScreen-6W-Er5_q.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-CuUK5O_2.js";import{h as w,g as C,j as h,l as E,i as P}from"./core-BBlQ3ArL.js";import{Xc as k,Xj as Z,gJ as z,gI as J,gH as q,k_ as L,VJ as Y,v3 as K,fI as B,WL as D,kY as T,Xd as v,Xu as F,kW as G,lh as j}from"./zeni-epic-state-aUBx6G2Q.js";import{cV as M,a2 as R,p as N,z as U,a5 as p,N as S,a8 as X,cW as Q,R as _,cX as ee,q as te}from"./index-ClwW47Zs.js";import{u as H,n as O}from"./mui--aGBnNu2.js";import"./sentry-D0lP5-8e.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]="4c5df0f2-4e4c-45b6-830d-ce5096192eb7",e._sentryDebugIdIdentifier="sentry-dbid-4c5df0f2-4e4c-45b6-830d-ce5096192eb7")}catch{}})();const ne=E(null,(function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(Y("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(z(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(Z(n,a,o))}}}))(M);function W({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((d=>k(d,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-UAxYbctH.js";import{h as w,g as C,j as h,l as E,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,oe=E((function(e,t){const{vendorId:
|
|
9
|
+
`,oe=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??V();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??V(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}}))(Q);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=P(),i=e??s,{useFeatureGate:c}=N(),r=U.getSignedInUser(),b=h((u=>B(u))),g=H(),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(X,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(W,{vendorId:i,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const V=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},A=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return A(e,"ach",t,n)}function Se(e,t,n){return A(e,"domestic",t,n)}function ge(e,t,n){return A(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=O.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100vh;
|
|
12
12
|
width: 100%;
|
|
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-UAxYbctH.js";import{h as w,g as C,j as h,l as E,
|
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
17
|
box-shadow: ${e=>`0px 2px ${_.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
-
`,de=E((function(e,t){const{vendorId:
|
|
18
|
+
`,de=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:i}=d;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(G(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:r}=c;e(F({data:r}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),r=c.poppedPathname??$();a(r,{state:{pathnameStackToGoBack:c.newStack}})})(),e(v())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const r=se(i,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(r,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),r=c.poppedPathname??$(0);t.navigate(r,{state:{pathnameStackToGoBack:c.newStack}})}e(v())}}}))(ee);function Ie({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=P(),i=e??s,c=U.getSignedInUser(),{useFeatureGate:r}=N(),b=H(),g=h((u=>B(u))),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(X,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${_.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(W,{vendorId:i,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,Ie as D,W as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-
|
|
1
|
+
import{j as c}from"./liveblocks-CuUK5O_2.js";import{a2 as i,ac as l}from"./index-ClwW47Zs.js";import{u as f,D as p}from"./mui--aGBnNu2.js";import"./sentry-D0lP5-8e.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]="cd7757c9-311c-4b96-86e7-ddf3c130c0ba",e._sentryDebugIdIdentifier="sentry-dbid-cd7757c9-311c-4b96-86e7-ddf3c130c0ba")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=i(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return c.jsx(p,{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-
|
|
1
|
+
import{j as s}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8e.js";import{h as q,u as A,g as G,i as F,j as l,N,l as V,n as _,o as O}from"./core-BBlQ3ArL.js";import{a1j as z,fI as H,a03 as M,na as R,T4 as I,a1l as W,VH as Y,ma as $,T5 as S,a07 as J,a08 as K,VI as L,VJ as Q}from"./zeni-epic-state-aUBx6G2Q.js";import{dt as U,d as X,a5 as Z,q as tt}from"./index-ClwW47Zs.js";import"./mui--aGBnNu2.js";import{d as b}from"./decodeURIComponentSafe-YbpxzvKa.js";import{w as et}from"./withTransactionSidePanel-CKC1_4cy.js";import{e as at,t as nt}from"./routePaths-D0jOibXk.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.js";import"./useAskAiCfoHostNavButtonProps-CWWQxV2L.js";import"./TransactionDetailScreen-CHzsnTr9.js";import"./useInitialThreadRequest-DmfmyzKI.js";import"./expenseAutomationHelper-SA0jUIyg.js";import"./stripSplatSuffix-CFosfir7.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]="fd64d06c-1fd8-49b4-a700-e7acb576b07e",a._sentryDebugIdIdentifier="sentry-dbid-fd64d06c-1fd8-49b4-a700-e7acb576b07e")}catch{}})();const ot=V((function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(J()),a(K()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??k();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(U),it=et((function({entityType:a,...t}){const e=q(),o=A(),c=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=F(),r=b(j??""),p=b(x??""),f=rt(r,p),v=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),w=l((n=>H(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(R(i)))}),[m,f,i]);const E=l((n=>n.trendState.fetchState)),P=u?.selectedPeriod?.timePeriod??g,B=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:B,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:k(v.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,k=(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(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-DJyIDCG4.js → ExpenseAutomationRoutes-DcjeaHHd.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-CuUK5O_2.js";import{u as Ie,h as Me,g as ge,j as M,i as Ae,s as po,t as Hn,l as ho,n as So,o as Je,N as fo}from"./core-BBlQ3ArL.js";import{fI as xe,_p as Kn,qe as Be,h8 as Rt,AA as Io,_q as go,_r as Co,_s as ko,_t as yt,_u as ct,gk as wt,_v as bn,eH as bo,g3 as To,_w as Tn,_x as it,r5 as yo,v6 as Po,gW as vo,gU as Eo,_y as Ao,ri as xo,rr as Ro,qp as wo,qD as Wn,gT as me,gV as Do,_z as _o,qZ as Zn,rs as Fo,qA as Bo,qv as Mo,vc as Oo,gS as Ee,_A as dt,CJ as Qn,Nd as Xn,_B as ea,_C as Uo,G8 as ta,_D as $o,e$ as Vo,f1 as jo,t7 as Dt,_E as yn,_F as zo,md as Lo,_G as Go,mk as No,d5 as qo,E0 as _t,_H as Jo,_I as Yo,_J as Ho,_K as Ko,fp as Ft,sX as Pn,_L as Wo,VH as Zo,_M as Qo,_N as Xo,mm as es,_O as ts,RV as ns,ml as as,ma as os,qS as na,rx as ut,tK as aa,u4 as ss,UW as oa,rw as vn,rz as sa,rB as cs,bE as is,nJ as ls,nG as rs,rA as lt,ry as ve,_P as ds,rS as En,_Q as us,_R as ms,s$ as ps,t0 as hs,_S as Ss,Vt as ca,ZT as fs,_T as Is,VI as An,VJ as st,_U as xn,mB as gs,_V as Cs,_W as ks,_X as bs,_Y as Ts,qN as ys,_Z as Ps,__ as vs,_$ as Es,rI as As,mo as xs,mf as Rs,$0 as ws,mn as Rn,$1 as Ds,$2 as _s,$3 as Fs,uJ as Bs,uk as Ms,uj as Pt,$4 as Os,$5 as Us,$6 as $s,$7 as Vs,nU as js,bv as ia,nP as wn,nB as zs,$8 as Ls,h3 as Gs,nM as Ns,t9 as qs,tb as Js,sU as Ys,$9 as Hs,$a as Ks,FC as Ws,FB as Zs,FS as Qs,$b as Dn,s_ as Xs,sv as ec,$c as tc,sb as nc,sg as ac,sr as oc,se as sc,$d as cc,s7 as ic,sq as lc,t4 as rc,$e as dc,th as uc,sO as mc,tn as pc,sT as hc,rT as Sc,$f as fc,r9 as Ic,qJ as gc,qQ as _n,rD as Cc,$g as kc,$h as bc,$i as Tc,$j as yc,$k as Pc,$l as vc,$m as Ec,tr as Ac,$n as xc,$o as Rc,$p as Fn,uU as wc,ub as Dc,u0 as Bn,t_ as _c,$q as Fc,tP as Bc,tu as Mc,u1 as Oc,$r as Uc,$s as $c,tA as Vc,$t as jc,tv as zc,tz as Lc,tx as Gc,u7 as Nc,$u as Mn,qi as vt,$v as qc,Ec as On,cp as Jc,qE as Yc,$w as Hc}from"./zeni-epic-state-aUBx6G2Q.js";import Ut from"./NotFoundScreen-CTik05r2.js";import{a as o,R as la}from"./sentry-D0lP5-8e.js";import{n as Oe,S as Kc}from"./mui--aGBnNu2.js";import{p as mt,N as X,d as te,q as ee,aC as ra,al as da,c0 as Wc,c1 as Zc,z as He,c2 as Bt,c3 as Qc,c4 as Xc,af as Ye,c5 as ei,c6 as Un,c7 as $n,c8 as ti,c9 as ni,a8 as ua,ca as ai,m as rt,g as oi,cb as si,cc as ci,h as ii,V as li,cd as ri,ce as di,cf as ui,cg as mi,aZ as pi,ac as hi,ch as Si,ci as fi,cj as Ii,G as ma,w as gi,ck as Ci,aj as Mt,cl as ki,a5 as bi,cm as Ti,cn as yi}from"./index-ClwW47Zs.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-CWWQxV2L.js";import{u as Vn,a as Pi,b as vi,d as Ei,c as Ai,e as xi,r as Ri,C as wi}from"./TransactionDetailScreen-CHzsnTr9.js";import{u as Di,a as _i,b as Fi}from"./useActualMatchingMatchDetail-nJ3hpXEY.js";import{d as Bi}from"./decodeURIComponentSafe-YbpxzvKa.js";import{m as Vt,a as pa,b as ha,i as Ot}from"./expenseAutomationHelper-SA0jUIyg.js";import{u as Sa,a as fa,w as Mi}from"./withTransactionSidePanel-CKC1_4cy.js";import{S as Oi,a as Ui,b as $i,J as Vi}from"./ScheduleDetailsPrepaidExpensesScreen-DN2DZsFw.js";import{s as jn,i as Ia,h as ji,f as zi,v as Li,t as Gi}from"./routePaths-D0jOibXk.js";import{a as Et}from"./accountMappingHelper-CHQgwqfy.js";import{D as Ni}from"./DrawerScreen-DUhkZI2Z.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.js";import"./useInitialThreadRequest-DmfmyzKI.js";import"./stripSplatSuffix-CFosfir7.js";import"./pathToGoBack-DOePc_e5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="1fbbbfdf-cd22-4be0-9661-d02058bcfb4e",t._sentryDebugIdIdentifier="sentry-dbid-1fbbbfdf-cd22-4be0-9661-d02058bcfb4e")}catch{}})();const qi=()=>{const t=Ie(),n=Me(),h=ge(),p=M((m=>xe(m))),{useFeatureGate:S}=mt(),{isFeatureEnabled:i}=S(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=S(X.aiAuditScorePercentage),R=M((m=>m.expenseAutomationViewState.selectedPeriodByTenantId)),l=M((m=>Kn(m,p.tenantId))),{isAiCfoAccessEnabled:b,onAskAiCfoClick:f}=$t({mobileExploreReferrer:"Month-End Close Overview"}),v=o.useCallback(((m,d,g=!1)=>{t(Be({tenantId:d,period:{month:m.month,year:m.year},refreshViewInBackground:g}))}),[]),E=o.useCallback((m=>{const d=h.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&te.trackMonthCloseAuditPage(m.month,m.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null),t(Rt(p.tenantId,m))}),[p.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),C=R[p.tenantId],O=o.useCallback((()=>{const m=h.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&te.trackMonthCloseAuditPage(C.month,C.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,m??null),v(C,p.tenantId,!0)}),[v,C,p.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),_=ee(h.state?.pathnameStackToGoBack,h.pathname),Y=o.useCallback((()=>{if(l.monthEndCloseChecks!=null&&C!=null){const m=l.monthEndCloseChecks.monthEndCloseCheckList.find((d=>d.progress<100));if(m!=null)return void n(`./${m.id}/${C.month}-${C.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}});n(`./month_end_insights/${C.month}-${C.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,C]),{areTenantIdsInSync:w}=ra();return da({isDataReady:l.fetchState==="Completed"}),o.useEffect((()=>{C!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&w&&v(C,p.tenantId)}),[v,C,l.fetchState,p.tenantId,w]),o.useEffect((()=>{C!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&w&&t(Io(C))}),[C,l.monthClosePerformanceTrendFetchStatus.fetchState,w]),o.useEffect((()=>{const m=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&O()}),3e5);return()=>clearInterval(m)}),[l.fetchState]),o.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const m=h.state?.referrer;te.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,m??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),k.jsx(Ji,{children:k.jsx(Wc,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:m=>{n(`./${m}/${C.month}-${C.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:E,handleReviewButtonClick:Y,onBackClick:()=>{n("../../dashboard")},onReload:O,isAiCfoAccessEnabled:b,onAskAiCfoClick:f,aiAuditScorePercentageEnabled:r})})},Ji=Oe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-
|
|
2
|
-
import{_ as u}from"./zeni-epic-state-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-CTik05r2.js","assets/sentry-D0lP5-8e.js","assets/core-BBlQ3ArL.js","assets/zeni-epic-state-aUBx6G2Q.js","assets/index-ClwW47Zs.js","assets/mui--aGBnNu2.js","assets/analytics-D051O7ML.js","assets/utils-Ctp9Zfhk.js","assets/index-BQ3cXEYt.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as u}from"./zeni-epic-state-aUBx6G2Q.js";import{j as a}from"./liveblocks-CuUK5O_2.js";import{l as c}from"./index-ClwW47Zs.js";import"./sentry-D0lP5-8e.js";import{N as e}from"./core-BBlQ3ArL.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new n.Error().stack;i&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[i]="664578a5-3bc1-4f45-ae26-42636c83b65d",n._sentryDebugIdIdentifier="sentry-dbid-664578a5-3bc1-4f45-ae26-42636c83b65d")}catch{}})();const E=c((()=>u((()=>import("./NotFoundScreen-CTik05r2.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),b=({tenantEmailDomain:n})=>a.jsx(e,{to:`/${n}/reimbursements`}),j=({tenantEmailDomain:n})=>a.jsx(e,{to:`/${n}/bills`}),m=({tenantEmailDomain:n})=>a.jsx(e,{to:`/${n}/treasury`}),l=({tenantEmailDomain:n})=>a.jsx(e,{to:`/${n}/checking`}),d=({tenantEmailDomain:n})=>a.jsx(e,{to:`/${n}/cards`}),_=({showZeniAccountRoute:n,isUserHasBillPayAccess:i,isUserHasReimbursementAccess:s,showTreasuryRoute:o,isTenantBankingOnly:f,showChargeCardRoute:r,tenantEmailDomain:t})=>{if(f===!0){if(n)return a.jsx(l,{tenantEmailDomain:t});if(o)return a.jsx(m,{tenantEmailDomain:t});if(r)return a.jsx(d,{tenantEmailDomain:t})}return n?a.jsx(l,{tenantEmailDomain:t}):o?a.jsx(m,{tenantEmailDomain:t}):r?a.jsx(d,{tenantEmailDomain:t}):i?a.jsx(j,{tenantEmailDomain:t}):s?a.jsx(b,{tenantEmailDomain:t}):a.jsx(E,{})};export{_ as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CuUK5O_2.js";import{a as r}from"./sentry-D0lP5-8e.js";import{d7 as f,d8 as c,D as l,a5 as p}from"./index-ClwW47Zs.js";import"./mui--aGBnNu2.js";import b from"./NotFoundScreen-CTik05r2.js";import{h as m,g as u}from"./core-BBlQ3ArL.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]="aa33f082-c2de-4fb2-9467-b46db35cbe5a",e._sentryDebugIdIdentifier="sentry-dbid-aa33f082-c2de-4fb2-9467-b46db35cbe5a")}catch{}})();const _=()=>{const e=m(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(a.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:t,onGoBack:d}):s.jsx(b,{})},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 i}from"./sentry-
|
|
1
|
+
import{a as i}from"./sentry-D0lP5-8e.js";import{u as l,h as d,g as m}from"./core-BBlQ3ArL.js";import{i7 as p,Vl as g,Vm as _}from"./zeni-epic-state-aUBx6G2Q.js";import{u as b,b as h,z as y}from"./index-ClwW47Zs.js";import"./liveblocks-CuUK5O_2.js";import"./recharts-CkREU3LH.js";import"./mui--aGBnNu2.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.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]="ff0b4c8f-9028-4f03-a66c-0f2308a0a694",e._sentryDebugIdIdentifier="sentry-dbid-ff0b4c8f-9028-4f03-a66c-0f2308a0a694")}catch{}})();function V(){const e=l(),n=d(),r=m(),{setLoading:o,clearAllLoading:u}=b(),a=i.useRef(!1);return i.useLayoutEffect((()=>{o(h.CONNECTION_AUTH)}),[o]),i.useEffect((()=>{if(a.current)return;a.current=!0;const s=new URLSearchParams(r.search).get("code"),f=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),s!=null&&f!=null){const t=JSON.parse(f);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:s,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{V as default};
|