@zeniai/web-app-ui 5.0.56-qa → 5.0.57-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-Bag7m6qW.js +1 -0
- package/dist/assets/AddressScreen-Ca2p0J93.js +9 -0
- package/dist/assets/{AiCfoScreen-O3ZQKZZv.js → AiCfoScreen-Cln5kFvq.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-BR7zuPpx.js → BillPayApprovalRoutes-BkiWlWG1.js} +1 -1
- package/dist/assets/{BillPayRoutes-BEElHUA2.js → BillPayRoutes-BUnKFudo.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-rFNtUgWM.js → BusinessVerificationPageScreen-CETF7Xs2.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-DmaCLBqf.js → ChargeCardRoutes-DyrY3AOh.js} +7 -7
- package/dist/assets/CompanyPassportScreen-CEn8Hq_N.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-HA-Pe0hW.js → ConnectionAuthScreen-DIDoz4Y4.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-sEtdhf6t.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-WWiZNAQF.js → CustomerOnboardingRoutes-C6aBtTbj.js} +1 -1
- package/dist/assets/{DashboardRoutes-CYUHs4DQ.js → DashboardRoutes-ibMx9tJv.js} +3 -3
- package/dist/assets/{DefaultTenantHome-DLHNOHLk.js → DefaultTenantHome-DrSW3qnP.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-_XVPNAtR.js → DomesticWireDetailScreen-DqS4Tcvr.js} +3 -3
- package/dist/assets/DrawerScreen-CZjhB4M8.js +1 -0
- package/dist/assets/{EntityDetailRoutes-ekN9KSvw.js → EntityDetailRoutes-uteOKaRW.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BWA0VeqR.js → ExpenseAutomationRoutes-vN-ZEfGB.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-Bb7LAhIT.js +1 -0
- package/dist/assets/MagicLinkRoutes-CrxYhL_N.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DMujXaBO.js +12 -0
- package/dist/assets/MobileAppDrawer-CsFu1SGJ.js +1 -0
- package/dist/assets/NotFoundScreen-DYeXrX7_.js +1 -0
- package/dist/assets/{NotificationRoutes-Y7mMfA0c.js → NotificationRoutes-KbJh7WKb.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-DXlZi8qW.js +1 -0
- package/dist/assets/{PeopleRoutes-BvoQnuNu.js → PeopleRoutes-Dfo2HPQ8.js} +9 -9
- package/dist/assets/PerformanceRoutes-CtfzaZEr.js +1 -0
- package/dist/assets/{Preview-CktKjgWY.js → Preview-DPJ5uAOV.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DJquJzTz.js → QBOConnectionScreen-ZbQqcTvr.js} +1 -1
- package/dist/assets/ReferralListScreen-CJVut1-a.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-qRkSf3Jp.js → ReimbursementApprovalRoutes-DbWpAe_W.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-cDRgJHyb.js → ReimbursementApprovalRuleDetailScreen-B4Iu7nC0.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CilgOLR3.js → ReimbursementRoutes-DE6qZeFt.js} +4 -4
- package/dist/assets/{ReportsRoutes-BYbURSgw.js → ReportsRoutes-D-5WE4O3.js} +1 -1
- package/dist/assets/RewardsRoutes-Bse1jH88.js +1 -0
- package/dist/assets/{ScreenRoutes-DabvobX8.js → ScreenRoutes-DAtAgM93.js} +2 -2
- package/dist/assets/{SettingsRoutes-OqTPOlbr.js → SettingsRoutes-DiqY7ZzG.js} +6 -6
- package/dist/assets/{SetupPagesScreen-DbbCxfjw.js → SetupPagesScreen-5gu402_s.js} +5 -5
- package/dist/assets/{SignInScreen-jrrIh9b0.js → SignInScreen-Bv_CmdB4.js} +1 -1
- package/dist/assets/{SignOutScreen-DJFswWiT.js → SignOutScreen-Bg5nBSS2.js} +1 -1
- package/dist/assets/{TaskListScreen-Bzrucczg.js → TaskListScreen-CeAHUBwa.js} +2 -2
- package/dist/assets/TaskRoutes-XLr0JwdP.js +9 -0
- package/dist/assets/TransactionDetailRoutes-W70apOcQ.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BzK7FXm-.js → TransactionDetailScreen-DwslT8ci.js} +2 -2
- package/dist/assets/{TransactionListRoutes-4Rg7SF_b.js → TransactionListRoutes-CPz2tIys.js} +1 -1
- package/dist/assets/{TreasuryRoutes-C1PdE97m.js → TreasuryRoutes-CLsQ2k2B.js} +6 -6
- package/dist/assets/{VendorsRoutes-5lt5Cpm-.js → VendorsRoutes-DBHqiibW.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-CUSz1saI.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DG2kQIui.js → ZeniAccountRoutes-D7qmRpeW.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-YO51ZD4a.js +9 -0
- package/dist/assets/{accountMappingHelper-BOSY12FJ.js → accountMappingHelper-DXLz-vZu.js} +1 -1
- package/dist/assets/{analytics-CcGmsyc8.js → analytics-C7fHeQaW.js} +1 -1
- package/dist/assets/{analyticsHelper-wMrdFRpH.js → analyticsHelper-BI0zNJMo.js} +1 -1
- package/dist/assets/{core-DkPdadc6.js → core-BojUR2ky.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-h3wJzOm1.js → decodeURIComponentSafe-Cj7RmfYA.js} +1 -1
- package/dist/assets/{dnd-D-YvLFfj.js → dnd-CxlDz5d0.js} +1 -1
- package/dist/assets/{empty-ohi5JxHm.js → empty-BfK9KfwA.js} +1 -1
- package/dist/assets/{empty-C7PzWdR6.js → empty-U91QAR9K.js} +1 -1
- package/dist/assets/{emptyVideoElement-B09QwhYv.js → emptyVideoElement-CycntGaA.js} +1 -1
- package/dist/assets/{epic-DC-PDk7m.js → epic-C89Urkp1.js} +1 -1
- package/dist/assets/getLocaleForTenant-DXctzPv_.js +1 -0
- package/dist/assets/{index-BVoPsTXN.js → index-BFSmByg_.js} +1 -1
- package/dist/assets/{index-ufE2I9Jb.js → index-Bl7KFfTZ.js} +1 -1
- package/dist/assets/{index-BIUa1dNl.js → index-C30E8A69.js} +2 -2
- package/dist/assets/{index-DHz0Faq_.js → index-CJekYpNM.js} +1 -1
- package/dist/assets/{index-CxVN3Ojx.js → index-DlIWyK0U.js} +1 -1
- package/dist/assets/{index-B5LlGXSS.js → index-Dw0sYJvv.js} +14405 -14465
- package/dist/assets/{index-8VSOxL6k.js → index-LcueFkuq.js} +1 -1
- package/dist/assets/{lexical-Sc7rk4Y7.js → lexical-BsuE2Lsd.js} +1 -1
- package/dist/assets/{liveblocks-tcXs1fes.js → liveblocks-BJogRArg.js} +1 -1
- package/dist/assets/{lottie-CwApzZxI.js → lottie-Cn4ueTxI.js} +1 -1
- package/dist/assets/{mui-DbdGpDJj.js → mui-Bg09VkiQ.js} +1 -1
- package/dist/assets/{pathToGoBack-D9y2NyzP.js → pathToGoBack-DkMRBkCy.js} +1 -1
- package/dist/assets/{pdf-lib-fmjHY_Su.js → pdf-lib-CayRdH4_.js} +1 -1
- package/dist/assets/{pdf-DG2fyOfp.js → pdf-unrI9041.js} +4 -4
- package/dist/assets/{plaid-UeHpA8su.js → plaid-DLEkn0-3.js} +1 -1
- package/dist/assets/{pusher-CH-5kFcN.js → pusher-0TzEhQ4N.js} +1 -1
- package/dist/assets/{react-P8ikJhK3.js → react-DE-H5XLs.js} +1 -1
- package/dist/assets/{react-D3qpynvt.js → react-DqIU-sTG.js} +1 -1
- package/dist/assets/{react-BTMxDr8F.js → react-DrHghgwg.js} +1 -1
- package/dist/assets/{react-CFEMacjg.js → react-DroQkqxO.js} +1 -1
- package/dist/assets/{react-CjW2GUTT.js → react-OJ3jwYUc.js} +1 -1
- package/dist/assets/{react-CAp_bFar.js → react-PyBVK2LU.js} +1 -1
- package/dist/assets/{recharts-D0a4NFa9.js → recharts-CYOGURoz.js} +1 -1
- package/dist/assets/{routePaths-DLaKTtZ1.js → routePaths-DriCJPaW.js} +1 -1
- package/dist/assets/{sentry-DNuKG-9f.js → sentry-WdXgkw90.js} +1 -1
- package/dist/assets/{url-Bxb4Dr7g.js → url-BxFmO3XK.js} +1 -1
- package/dist/assets/{url-EFuL_PC5.js → url-DF46HIMu.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C3l35BIu.js +1 -0
- package/dist/assets/{useDeviceId-DoEHbao8.js → useDeviceId-CYsEMtI-.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js +1 -0
- package/dist/assets/useInitialThreadRequest-DBmAMV6A.js +1 -0
- package/dist/assets/{utils-BmJyX3cx.js → utils-CJNmQJBz.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-D6IjOlY9.js → withTransactionSidePanel-DUWL7sXt.js} +2 -2
- package/dist/assets/{zeni-epic-state-CSoWjbAn.js → zeni-epic-state-BJsXImBw.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-Ct22cch9.js +0 -1
- package/dist/assets/AddressScreen-BZLn4WXp.js +0 -9
- package/dist/assets/CompanyPassportScreen-CPhtVigG.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DccrP6Ii.js +0 -1
- package/dist/assets/DrawerScreen-Lpd7yHHT.js +0 -1
- package/dist/assets/FeaturePreviewScreen-CXPzFCOG.js +0 -1
- package/dist/assets/MagicLinkRoutes-BM5EBV4g.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CUpAMwgA.js +0 -12
- package/dist/assets/MobileAppDrawer-4e3Dnoyk.js +0 -1
- package/dist/assets/NotFoundScreen-D9IauLgD.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Oi34FulL.js +0 -1
- package/dist/assets/PerformanceRoutes-BF5xhlzy.js +0 -1
- package/dist/assets/ReferralListScreen-CdcLyZxu.js +0 -5
- package/dist/assets/RewardsRoutes-B01_JIOc.js +0 -1
- package/dist/assets/TaskRoutes-BQtLZoYh.js +0 -9
- package/dist/assets/TransactionDetailRoutes-oxE-1NtY.js +0 -1
- package/dist/assets/WiseConfirmationScreen-BnyC9-LE.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-3oBNuFw5.js +0 -9
- package/dist/assets/getLocaleForTenant-U9nBzLWh.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CPSMuZiJ.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Btx9ztNW.js +0 -1
- package/dist/assets/useInitialThreadRequest-BgK6IHKx.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-tcXs1fes.js";import{l as K,g as k,u as z,h as N,j as q,k as H,s as $a,n as nt,o as D}from"./core-DkPdadc6.js";import{eN as L,Jv as Me,bC as Yt,bq as de,KI as za,hS as qa,KJ as wt,KK as Za,hV as ot,KL as Re,KM as Ha,h_ as Ja,KN as xt,KO as Qa,i2 as st,KP as je,KQ as Xa,cj as it,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as ye,KU as Vt,Jj as W,bc as Gt,ja as Nt,mt as Kt,iV as $t,Jl as ee,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as zt,KY as ge,tA as ve,tB as Ie,tY as ue,tS as te,tF as Ae,KZ as ln,K_ as dn,K$ as un,L0 as qt,L1 as be,L2 as mn,dB as Ue,qc as Zt,L3 as pn,L4 as hn,L5 as fn,L6 as ct,IH as lt,jq as me,u4 as dt,qk as gn,L7 as bn,tC as Dt,qf as ce,qb as Ht,L8 as oe,L9 as Cn,La as ut,IF as mt,sc as Jt,Lb as _n,Lc as kn,Ld as Sn,Le as pt,sp as yn,Lf as vn,tE as Ot,sb as Qt,Lg as se,Lh as In,bv as Xt,u8 as Wt,Li as An,Lj as En,Lk as Tn,Ll as ht,u3 as wn,Lm as xn,tD as Ft,u7 as ea,Ln as re,Lo as Dn,Lp as On,Lq as ta,jf as aa,mq as na,jk as oa,mo as sa,mn as ra,mm as ia,rA as Fn,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Gn,Lu as Nn,b5 as ft,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-CSoWjbAn.js";import{z as j,U as J,r as O,d as A,D as $,aQ as Wn,M as Ee,x as Te,aR as ca,f as V,aS as eo,j as we,aT as la,a as Ye,p as M,h as to,aU as ao,aV as no,q as oo,c as da,a0 as so,aW as ro,aJ as ua,aX as io,aY as co,T as lo,aZ as xe,a_ as uo,am as mo,m as po,Q as ho,a$ as fo,b0 as _e}from"./index-B5LlGXSS.js";import{n as gt}from"./mui-DbdGpDJj.js";import{a as _}from"./sentry-DNuKG-9f.js";import{w as ma}from"./withTransactionSidePanel-D6IjOlY9.js";import{b as pa,t as pe,e as ae,a as bt,v as go}from"./routePaths-DLaKTtZ1.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-CPSMuZiJ.js";import{c as De,b as bo}from"./useFetchSuggestedQuestionsWhenReady-Btx9ztNW.js";import Se from"./NotFoundScreen-D9IauLgD.js";import{t as ha}from"./analyticsHelper-wMrdFRpH.js";import{C as Co}from"./CompanyPassportScreen-CPhtVigG.js";import{F as _o}from"./FeaturePreviewScreen-CXPzFCOG.js";import{R as ko}from"./ReferralListScreen-CdcLyZxu.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./TransactionDetailScreen-BzK7FXm-.js";import"./decodeURIComponentSafe-h3wJzOm1.js";import"./MobileAppDrawer-4e3Dnoyk.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]="5ae22baa-9201-41b4-82cd-1e2003088de4",e._sentryDebugIdIdentifier="sentry-dbid-5ae22baa-9201-41b4-82cd-1e2003088de4")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),u=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=u?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=_.useMemo(()=>r!=null?Yt(r):de(),[r]),C=N(),d=q(),h=k(T=>za(T,m,o)),S=_.useCallback(()=>{o!=null&&h.fetchState!=="In-Progress"&&h.fetchState!=="Completed"&&C(qa(o,m))},[m]),y=_.useCallback(()=>{d("../../",{relative:"path"})},[]),F=_.useCallback((T,B)=>{C(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{C(wt({downloadState:T}))},[]),v=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);d(B);const he=O(g.state?.pathnameStackToGoBack,g.pathname);d(B,{state:{pathnameStackToGoBack:he}})}},[f,e]),w=_.useCallback(()=>{h.vendor!=null&&A.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),h.vendor.id,h.vendor.name)},[h.vendor,m]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{h.fetchState==="Completed"&&w()},[w,h.fetchState]),l.jsx(Wn,{apAgingDetail:h,downloadParams:c,reportDate:m,analytics:A,onTransactionClick:v,onReload:S,onBackClick:y,onColumnSortConfigChanged:F,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=N(),n=q(),o=k(v=>Za(v)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(v=>v.tenantState.currentTenantId),f=k(v=>L(v)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),c=o.apAgingUIState.selectedDate??de(),m=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(c))},[]);_.useEffect(()=>{m()},[]);const C=_.useCallback(()=>{n("../",{relative:"path"})},[]),d=_.useCallback(v=>{t(Re({searchString:v}))},[]),h=_.useCallback((v,w)=>{t(Re({sortKey:w,sortOrder:v}))},[]),S=_.useCallback(v=>{n(`./${v}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),y=_.useCallback(v=>{t(Re({downloadState:v}))},[]),F=_.useCallback((v,w)=>{},[]),E=_.useCallback((v,w)=>{t(Re({selectedDate:v,agingDateSelectionType:w})),t(ot(v))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:v=>v.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:A,onReloadReport:m,onBackClick:C,onSearchTextChange:d,onSortOrderChange:h,onEntityNameClick:S,updateDownloadStateHandler:y,onSelectedDateChanged:E,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:u}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),m=N(),C=q(),d=k(w=>Ha(w,c,o)),h=_.useCallback(()=>{o!=null&&d.fetchState!=="In-Progress"&&d.fetchState!=="Completed"&&m(Ja(o,c))},[c]),S=_.useCallback(()=>{C("../../",{relative:"path"})},[]),y=_.useCallback((w,T)=>{m(xt({sortKey:w,sortOrder:T}))},[]),F=_.useCallback(w=>{m(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(u!=null){const T=pa({id:w.transactionId,type:w.transactionType},u);C(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);C(T,{state:{pathnameStackToGoBack:B}})}},[u,e]),v=_.useCallback(()=>{d.customer!=null&&A.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),d.customer.id,d.customer.name)},[d.customer,c]);return _.useEffect(()=>{h()},[]),_.useEffect(()=>{d.fetchState==="Completed"&&v()},[d.fetchState,v]),l.jsx(eo,{arAgingDetail:d,downloadParams:p,reportDate:c,analytics:A,onTransactionClick:E,onReload:h,onBackClick:S,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=N(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(E=>L(E)),f=u.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(st(p))},[]);_.useEffect(()=>{c()},[]);const m=_.useCallback(()=>{n("../",{relative:"path"})},[]),C=_.useCallback(E=>{t(je({searchString:E}))},[]),d=_.useCallback((E,v)=>{t(je({sortKey:v,sortOrder:E}))},[]),h=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(je({downloadState:E}))},[]),y=_.useCallback((E,v)=>{t(je({selectedDate:E,agingDateSelectionType:v})),t(st(E))},[]),F=_.useCallback((E,v)=>{t(Xa({nodeId:E,isCollapsed:v}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:E=>E.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:A,onReloadReport:c,onBackClick:m,onSearchTextChange:C,onSortOrderChange:d,onEntityNameClick:h,updateDownloadStateHandler:S,onSelectedDateChanged:y,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?A.trackZeniAccountsCashBalancePromoClicked("Move Money"):(A.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else A.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:A}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=ye(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:A}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=it(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=it(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
|
|
1
|
+
import{j as l}from"./liveblocks-BJogRArg.js";import{l as K,g as k,u as z,h as G,j as q,k as H,s as $a,n as nt,o as D}from"./core-BojUR2ky.js";import{eN as L,Jv as Me,bC as Yt,bq as de,KI as za,hS as qa,KJ as wt,KK as Za,hV as ot,KL as Re,KM as Ha,h_ as Ja,KN as xt,KO as Qa,i2 as st,KP as je,KQ as Xa,cj as it,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as ye,KU as Vt,Jj as W,bc as Nt,ja as Gt,mt as Kt,iV as $t,Jl as ee,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as zt,KY as ge,tA as ve,tB as Ie,tY as ue,tS as te,tF as Ae,KZ as ln,K_ as dn,K$ as un,L0 as qt,L1 as be,L2 as mn,dB as Ue,qc as Zt,L3 as pn,L4 as hn,L5 as fn,L6 as ct,IH as lt,jq as me,u4 as dt,qk as gn,L7 as bn,tC as Dt,qf as ce,qb as Ht,L8 as oe,L9 as Cn,La as ut,IF as mt,sc as Jt,Lb as _n,Lc as kn,Ld as Sn,Le as pt,sp as yn,Lf as vn,tE as Ot,sb as Qt,Lg as se,Lh as In,bv as Xt,u8 as Wt,Li as An,Lj as En,Lk as Tn,Ll as ht,u3 as wn,Lm as xn,tD as Ft,u7 as ea,Ln as re,Lo as Dn,Lp as On,Lq as ta,jf as aa,mq as na,jk as oa,mo as sa,mn as ra,mm as ia,rA as Fn,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Nn,Lu as Gn,b5 as ft,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-BJsXImBw.js";import{z as j,O as J,x as O,d as A,D as $,aQ as Wn,J as Ee,A as Te,aR as ca,f as V,aS as eo,j as we,aT as la,a as Ye,p as M,h as to,aU as ao,aV as no,q as oo,c as da,_ as so,aW as ro,aJ as ua,aX as io,aY as co,N as lo,aZ as xe,a_ as uo,am as mo,v as po,K as ho,a$ as fo,b0 as _e}from"./index-Dw0sYJvv.js";import{n as gt}from"./mui-Bg09VkiQ.js";import{a as _}from"./sentry-WdXgkw90.js";import{w as ma}from"./withTransactionSidePanel-DUWL7sXt.js";import{b as pa,t as pe,e as ae,a as bt,v as go}from"./routePaths-DriCJPaW.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as De,b as bo}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import Se from"./NotFoundScreen-DYeXrX7_.js";import{t as ha}from"./analyticsHelper-BI0zNJMo.js";import{C as Co}from"./CompanyPassportScreen-CEn8Hq_N.js";import{F as _o}from"./FeaturePreviewScreen-Bb7LAhIT.js";import{R as ko}from"./ReferralListScreen-CJVut1-a.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./TransactionDetailScreen-DwslT8ci.js";import"./decodeURIComponentSafe-Cj7RmfYA.js";import"./MobileAppDrawer-CsFu1SGJ.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]="d774842e-15f3-4fb1-bff2-54658f78ee5c",e._sentryDebugIdIdentifier="sentry-dbid-d774842e-15f3-4fb1-bff2-54658f78ee5c")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),u=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=u?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=_.useMemo(()=>r!=null?Yt(r):de(),[r]),C=G(),d=q(),h=k(T=>za(T,m,o)),S=_.useCallback(()=>{o!=null&&h.fetchState!=="In-Progress"&&h.fetchState!=="Completed"&&C(qa(o,m))},[m]),y=_.useCallback(()=>{d("../../",{relative:"path"})},[]),F=_.useCallback((T,B)=>{C(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{C(wt({downloadState:T}))},[]),v=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);d(B);const he=O(g.state?.pathnameStackToGoBack,g.pathname);d(B,{state:{pathnameStackToGoBack:he}})}},[f,e]),w=_.useCallback(()=>{h.vendor!=null&&A.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),h.vendor.id,h.vendor.name)},[h.vendor,m]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{h.fetchState==="Completed"&&w()},[w,h.fetchState]),l.jsx(Wn,{apAgingDetail:h,downloadParams:c,reportDate:m,analytics:A,onTransactionClick:v,onReload:S,onBackClick:y,onColumnSortConfigChanged:F,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(v=>Za(v)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(v=>v.tenantState.currentTenantId),f=k(v=>L(v)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),c=o.apAgingUIState.selectedDate??de(),m=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(c))},[]);_.useEffect(()=>{m()},[]);const C=_.useCallback(()=>{n("../",{relative:"path"})},[]),d=_.useCallback(v=>{t(Re({searchString:v}))},[]),h=_.useCallback((v,w)=>{t(Re({sortKey:w,sortOrder:v}))},[]),S=_.useCallback(v=>{n(`./${v}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),y=_.useCallback(v=>{t(Re({downloadState:v}))},[]),F=_.useCallback((v,w)=>{},[]),E=_.useCallback((v,w)=>{t(Re({selectedDate:v,agingDateSelectionType:w})),t(ot(v))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:v=>v.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:A,onReloadReport:m,onBackClick:C,onSearchTextChange:d,onSortOrderChange:h,onEntityNameClick:S,updateDownloadStateHandler:y,onSelectedDateChanged:E,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:u}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),m=G(),C=q(),d=k(w=>Ha(w,c,o)),h=_.useCallback(()=>{o!=null&&d.fetchState!=="In-Progress"&&d.fetchState!=="Completed"&&m(Ja(o,c))},[c]),S=_.useCallback(()=>{C("../../",{relative:"path"})},[]),y=_.useCallback((w,T)=>{m(xt({sortKey:w,sortOrder:T}))},[]),F=_.useCallback(w=>{m(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(u!=null){const T=pa({id:w.transactionId,type:w.transactionType},u);C(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);C(T,{state:{pathnameStackToGoBack:B}})}},[u,e]),v=_.useCallback(()=>{d.customer!=null&&A.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),d.customer.id,d.customer.name)},[d.customer,c]);return _.useEffect(()=>{h()},[]),_.useEffect(()=>{d.fetchState==="Completed"&&v()},[d.fetchState,v]),l.jsx(eo,{arAgingDetail:d,downloadParams:p,reportDate:c,analytics:A,onTransactionClick:E,onReload:h,onBackClick:S,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(E=>L(E)),f=u.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(st(p))},[]);_.useEffect(()=>{c()},[]);const m=_.useCallback(()=>{n("../",{relative:"path"})},[]),C=_.useCallback(E=>{t(je({searchString:E}))},[]),d=_.useCallback((E,v)=>{t(je({sortKey:v,sortOrder:E}))},[]),h=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(je({downloadState:E}))},[]),y=_.useCallback((E,v)=>{t(je({selectedDate:E,agingDateSelectionType:v})),t(st(E))},[]),F=_.useCallback((E,v)=>{t(Xa({nodeId:E,isCollapsed:v}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:E=>E.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:A,onReloadReport:c,onBackClick:m,onSearchTextChange:C,onSortOrderChange:d,onEntityNameClick:h,updateDownloadStateHandler:S,onSelectedDateChanged:y,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?A.trackZeniAccountsCashBalancePromoClicked("Move Money"):(A.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else A.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:A}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=ye(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:A}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=it(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=it(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -10,11 +10,11 @@ import{j as l}from"./liveblocks-tcXs1fes.js";import{l as K,g as k,u as z,h as N,
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: center;
|
|
12
12
|
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
-
`;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=N(),u=z(),{tenantEmailDomain:f}=K(),g=to();return l.jsxs(xo,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:b=>{b.trim().length>=2?i(ee({searchString:b,searchOrigin:"navbar"})):b.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:b=>{n!=null&&A?.trackSearch(V.Event.search,Fo(a),b.type,b.name,n);const p=ae(b,f),c=O(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:o===!0&&r!=null?l.jsx(no,{onClick:r}):null}),l.jsx(Do,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Pt(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=z(),n=N(),{useFeatureGate:o}=Ye(),{isFeatureEnabled:r}=o(M.isDepositAccountsFeatureEnabled),s=k(h=>h.cashBalanceState.fetchState),i=k(h=>h.cardBalanceState.fetchState),u=j.getSignedInUser();if(u==null)throw Error("Can't access dashboard detail without signing in...");const f=Vt((h=>{const S=Gt(h,"/").split("/");return S[S.length-1]})(t.pathname));let g="Not-Started",b="";const p=$.getLocalizedStrings();switch(f){case"cash_balance":g=s,b=p.reportTitleById.cash_balance;break;case"card_balance":g=i,b=p.reportTitleById.card_balance;break;default:console.error(`${f} is not supported!`)}const{isAiCfoAccessEnabled:c,onAskAiCfoClick:m}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:f==="card_balance"?"Card Balance":"Cash Balance"});De({isDataReady:g==="Completed"});const C=k(h=>h.entityAutoCompleteState.autoCompleteText.navbar),d=k(h=>W(h,"navbar"));return _.useEffect(()=>{g==="Not-Started"&&function(h,S,y){switch(S){case"card_balance":h($t());break;case"cash_balance":h(Nt()),y===!0&&h(Kt());break;default:throw new Error(`balance report type ${S} is not yet supported`)}}(n,f,r)},[u,n,g]),l.jsxs(l.Fragment,{children:[g==="Completed"?l.jsx(Te,{analytics:A,onLoad:h=>((S,y)=>{switch(y){case"card_balance":S.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${y}!`)}})(h,f)}):null,l.jsx(Oo,{title:b,reportId:f,autoCompleteText:C,entityAutoCompleteView:d,isAiCfoAccessEnabled:c,onAskAiCfoClick:m})]})}const Fo=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Po=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=N(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Ee(),u=oo(),f=lo(u),g=$a(),b=k(B=>on(B)),p=b.uiState?.currentChatSessionId,c=b.allSessionsWithOrderedQuestionAnswers??Po,m=j.getSignedInUser()?.userId,C=da(),d=bo()&&C&&r!=null,h=so(),S=ro(h),{useDynamicConfig:y}=Ye(),{configValue:F}=y(ua.aiCfoMessageDynamicConfig),E=_.useMemo(()=>Array.isArray(F.default_message_list)?F.default_message_list:[],[F.default_message_list]),v=_.useMemo(()=>(S!=null&&S.length>0?S:E).slice(0,2),[E,S]),w=_.useCallback((B,he)=>{if(m==null||B.trim()==="")return;const fe=io(g.getState());if(f){const Fe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Fe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!fe}})}else{if(fe)return t(sn(B)),void s(!0);i(B),s(!0),co(t,B,"insights_section",p,c,m,he,void 0)}},[c,p,t,f,o.pathname,o.state,a,n,s,i,g,r,m]),T=_.useCallback(()=>{if(f){const B=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0)},[f,o.pathname,o.state,a,n,s,r]);return _.useMemo(()=>{if(d)return{onAskSomethingElseClick:T,onSuggestedQuestionClick:w,suggestedQuestions:v}},[d,T,w,v])}const Bo=H(function(e){const a=rn(e),t=cn(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue("month")),e(te(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ge({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(xe),Ro=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),r=k(s=>zt(s)).mode==="compare_mode";return l.jsx(Bo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},Lo=H(function(e){const a=dn(e),t=un(e),n=qt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(be({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(xe),Mo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashPosition"}),r=k(s=>qt(s)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},G=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Qe(){return l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId/*",element:l.jsx(Se,{})})]})}const Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},Yo=H(function(e){const a=Zt(e),t=pn(e),n=hn(e),o=fn(e),r=ct(e),{scrollPosition:s,...i}=r,u=t.reportTitle,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(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(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Ht(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(oe({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(gn())},onResyncReports:()=>{e(dt("net_burn_or_income_by_classes"))}}})(xe),Vo=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),i=k(h=>ct(h)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(h=>ut(h.forecastState,g??"")),p=k(h=>Zt(h)),c=k(h=>mt(h)),m=k(h=>me(h)),C=i.mode==="compare_mode",d=p.dataAvailable;return _.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const h=b?.forecastPeriod,S=d!=null&&h.endDate.isAfter(d?.endDate)===!0?d:h;a(te(e.firstMonthOfFY,{startDate:S.endDate.startOf(f),endDate:S?.endDate}))}},[g]),l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,analytics:A,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Go=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},No=H(function(e){const a=Jt(e),t=_n(e),n=kn(e),o=Sn(e),r=pt(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.operating_expenses,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Go(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(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(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Qt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(yn())},onResyncReports:()=>{e(dt("operating_expenses_by_classes"))}}})(xe),Ko=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardOpEx"}),i=k(y=>pt(y)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(y=>ut(y.forecastState,g??"")),p=k(y=>Jt(y)),c=k(y=>mt(y)),m=k(y=>me(y)),C=i.mode==="compare_mode",d=p.dataAvailable;_.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const y=b?.forecastPeriod,F=d!=null&&y.endDate.isAfter(d?.endDate)===!0?d:y;a(te(e.firstMonthOfFY,{startDate:F.endDate.startOf(f),endDate:F?.endDate}))}},[g]);const h=we(),S=h?.loggedInUserRole!=null&&Xt(h?.loggedInUserRole)!==!0;return l.jsx(No,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,forecastIdFromUrlPath:r,analytics:A,hasTransactionAccess:S,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},$o=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},zo=H(function(e){const a=Wt(e),t=An(e),n=En(e),o=Tn(e),r=ht(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.revenue,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=$o(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(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(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(ea(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(xn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(wn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(xe),qo=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardRevenue"}),i=k(d=>ht(d)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(d=>ut(d.forecastState,g??"")),p=k(d=>Wt(d)).dataAvailable,c=i.mode==="compare_mode",m=k(d=>me(d)),C=k(d=>mt(d));return _.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const d=b?.forecastPeriod,h=p!=null&&d.endDate.isAfter(p?.endDate)===!0?p:d;a(te(e.firstMonthOfFY,{startDate:h.endDate.startOf(f),endDate:h?.endDate}))}},[g]),l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:m,isCompareModeOn:c,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:A,reportsResyncFetchState:C.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Zo=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}},Ho=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=W(e,"navbar");return{report:a,analytics:A,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{A.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ta(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(uo),Jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Ho,{tenantEmailDomain:a,location:t,navigate:n})},Qo=gt.div`
|
|
13
|
+
`;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=G(),u=z(),{tenantEmailDomain:f}=K(),g=to();return l.jsxs(xo,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:b=>{b.trim().length>=2?i(ee({searchString:b,searchOrigin:"navbar"})):b.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:b=>{n!=null&&A?.trackSearch(V.Event.search,Fo(a),b.type,b.name,n);const p=ae(b,f),c=O(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:o===!0&&r!=null?l.jsx(no,{onClick:r}):null}),l.jsx(Do,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Pt(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=z(),n=G(),{useFeatureGate:o}=Ye(),{isFeatureEnabled:r}=o(M.isDepositAccountsFeatureEnabled),s=k(h=>h.cashBalanceState.fetchState),i=k(h=>h.cardBalanceState.fetchState),u=j.getSignedInUser();if(u==null)throw Error("Can't access dashboard detail without signing in...");const f=Vt((h=>{const S=Nt(h,"/").split("/");return S[S.length-1]})(t.pathname));let g="Not-Started",b="";const p=$.getLocalizedStrings();switch(f){case"cash_balance":g=s,b=p.reportTitleById.cash_balance;break;case"card_balance":g=i,b=p.reportTitleById.card_balance;break;default:console.error(`${f} is not supported!`)}const{isAiCfoAccessEnabled:c,onAskAiCfoClick:m}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:f==="card_balance"?"Card Balance":"Cash Balance"});De({isDataReady:g==="Completed"});const C=k(h=>h.entityAutoCompleteState.autoCompleteText.navbar),d=k(h=>W(h,"navbar"));return _.useEffect(()=>{g==="Not-Started"&&function(h,S,y){switch(S){case"card_balance":h($t());break;case"cash_balance":h(Gt()),y===!0&&h(Kt());break;default:throw new Error(`balance report type ${S} is not yet supported`)}}(n,f,r)},[u,n,g]),l.jsxs(l.Fragment,{children:[g==="Completed"?l.jsx(Te,{analytics:A,onLoad:h=>((S,y)=>{switch(y){case"card_balance":S.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${y}!`)}})(h,f)}):null,l.jsx(Oo,{title:b,reportId:f,autoCompleteText:C,entityAutoCompleteView:d,isAiCfoAccessEnabled:c,onAskAiCfoClick:m})]})}const Fo=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Po=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=G(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Ee(),u=oo(),f=lo(u),g=$a(),b=k(B=>on(B)),p=b.uiState?.currentChatSessionId,c=b.allSessionsWithOrderedQuestionAnswers??Po,m=j.getSignedInUser()?.userId,C=da(),d=bo()&&C&&r!=null,h=so(),S=ro(h),{useDynamicConfig:y}=Ye(),{configValue:F}=y(ua.aiCfoMessageDynamicConfig),E=_.useMemo(()=>Array.isArray(F.default_message_list)?F.default_message_list:[],[F.default_message_list]),v=_.useMemo(()=>(S!=null&&S.length>0?S:E).slice(0,2),[E,S]),w=_.useCallback((B,he)=>{if(m==null||B.trim()==="")return;const fe=io(g.getState());if(f){const Fe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Fe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!fe}})}else{if(fe)return t(sn(B)),void s(!0);i(B),s(!0),co(t,B,"insights_section",p,c,m,he,void 0)}},[c,p,t,f,o.pathname,o.state,a,n,s,i,g,r,m]),T=_.useCallback(()=>{if(f){const B=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0)},[f,o.pathname,o.state,a,n,s,r]);return _.useMemo(()=>{if(d)return{onAskSomethingElseClick:T,onSuggestedQuestionClick:w,suggestedQuestions:v}},[d,T,w,v])}const Bo=H(function(e){const a=rn(e),t=cn(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue("month")),e(te(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ge({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(xe),Ro=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),r=k(s=>zt(s)).mode==="compare_mode";return l.jsx(Bo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},Lo=H(function(e){const a=dn(e),t=un(e),n=qt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(be({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(xe),Mo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashPosition"}),r=k(s=>qt(s)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},N=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Qe(){return l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId/*",element:l.jsx(Se,{})})]})}const Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},Yo=H(function(e){const a=Zt(e),t=pn(e),n=hn(e),o=fn(e),r=ct(e),{scrollPosition:s,...i}=r,u=t.reportTitle,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(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(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Ht(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(oe({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(gn())},onResyncReports:()=>{e(dt("net_burn_or_income_by_classes"))}}})(xe),Vo=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),i=k(h=>ct(h)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(h=>ut(h.forecastState,g??"")),p=k(h=>Zt(h)),c=k(h=>mt(h)),m=k(h=>me(h)),C=i.mode==="compare_mode",d=p.dataAvailable;return _.useEffect(()=>{if(g!=null&&u===!0&&(N(u,r,g,o),b!=null)){const h=b?.forecastPeriod,S=d!=null&&h.endDate.isAfter(d?.endDate)===!0?d:h;a(te(e.firstMonthOfFY,{startDate:S.endDate.startOf(f),endDate:S?.endDate}))}},[g]),l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,analytics:A,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},No=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},Go=H(function(e){const a=Jt(e),t=_n(e),n=kn(e),o=Sn(e),r=pt(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.operating_expenses,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=No(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(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(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Qt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(yn())},onResyncReports:()=>{e(dt("operating_expenses_by_classes"))}}})(xe),Ko=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardOpEx"}),i=k(y=>pt(y)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(y=>ut(y.forecastState,g??"")),p=k(y=>Jt(y)),c=k(y=>mt(y)),m=k(y=>me(y)),C=i.mode==="compare_mode",d=p.dataAvailable;_.useEffect(()=>{if(g!=null&&u===!0&&(N(u,r,g,o),b!=null)){const y=b?.forecastPeriod,F=d!=null&&y.endDate.isAfter(d?.endDate)===!0?d:y;a(te(e.firstMonthOfFY,{startDate:F.endDate.startOf(f),endDate:F?.endDate}))}},[g]);const h=we(),S=h?.loggedInUserRole!=null&&Xt(h?.loggedInUserRole)!==!0;return l.jsx(Go,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,forecastIdFromUrlPath:r,analytics:A,hasTransactionAccess:S,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},$o=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(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}},zo=H(function(e){const a=Wt(e),t=An(e),n=En(e),o=Tn(e),r=ht(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.revenue,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=$o(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(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(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(ea(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(xn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(wn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(xe),qo=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardRevenue"}),i=k(d=>ht(d)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(d=>ut(d.forecastState,g??"")),p=k(d=>Wt(d)).dataAvailable,c=i.mode==="compare_mode",m=k(d=>me(d)),C=k(d=>mt(d));return _.useEffect(()=>{if(g!=null&&u===!0&&(N(u,r,g,o),b!=null)){const d=b?.forecastPeriod,h=p!=null&&d.endDate.isAfter(p?.endDate)===!0?p:d;a(te(e.firstMonthOfFY,{startDate:h.endDate.startOf(f),endDate:h?.endDate}))}},[g]),l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:m,isCompareModeOn:c,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:A,reportsResyncFetchState:C.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Zo=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}},Ho=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=W(e,"navbar");return{report:a,analytics:A,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{A.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ta(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(uo),Jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Ho,{tenantEmailDomain:a,location:t,navigate:n})},Qo=gt.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
|
-
`,le=3,Ct=1;function Xo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;De({isDataReady:!0});const u={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...u});break;case"revenue":i=l.jsx(qo,{...u});break;case"net_burn_or_income":i=l.jsx(Vo,{...u});break;case"cash_position":i=l.jsx(Mo,{...u});break;case"top_expenses":i=l.jsx(Jo,{...u});break;case"cash_in_cash_out":i=l.jsx(Ro,{...u});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Qo,{children:i}):null}function Q(){const e=z(),a=N(),{forecastId:t}=K();let n="Not-Started";const o=k(c=>pt(c).fetchState),r=k(c=>ht(c).fetchState),s=k(c=>ct(c).fetchState),i=k(c=>c.cashPositionState.fetchState),u=k(c=>c.topExState.fetchState),f=k(c=>c.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k(c=>L(c)),b=g?.company?.companyInfo?.firstMonthOfFY??1,p=Vt((c=>{const m=Gt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(p){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=u;break;case"cash_in_cash_out":n=f;break;default:console.error(`${p} is not supported!`)}return _.useEffect(()=>{n==="Not-Started"&&function(c,m,C,d){switch(m){case"operating_expenses":c(ia(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Qt(!1,d)));break;case"revenue":c(ra(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(ea(!1,d)));break;case"net_burn_or_income":c(sa(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Ht(!1,d)));break;case"cash_position":c(oa(!0));break;case"top_expenses":c(na());break;case"cash_in_cash_out":c(aa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,p,b,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(Te,{analytics:A,onLoad:c=>((m,C)=>{const d=e.state?.referrer;switch(C){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,d);break;case"revenue":m.trackPageLoaded(V.Event.revenues,d);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,d);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,d);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,d);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,d);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,p)}):null,l.jsx(Xo,{firstMonthOfFY:b,fetchState:n,reportId:p,forecastId:t})]})}var Xe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(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 Ca(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 _t={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,"-":Xe?173:189,"=":Xe?61:187,";":Xe?59:186,"'":222,"[":219,"]":221,"\\":220},X={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},rt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},R={16:!1,18:!1,17:!1,91:!1},P={},Le=1;Le<20;Le++)_t["f".concat(Le)]=111+Le;var x=[],Bt=!1,_a="all",Rt=[],Ge=function(e){return _t[e.toLowerCase()]||X[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function jt(e){_a=e||"all"}function ke(){return _a||"all"}var et=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),u=i.length,f=i[u-1],g=f==="*"?"*":Ge(f);if(P[g]){t||(t=ke());var b=u>1?ba(X,i):[];P[g]=P[g].filter(function(p){return!((!n||p.method===n)&&p.scope===t&&function(c,m){for(var C=c.length>=m.length?c:m,d=c.length>=m.length?m:c,h=!0,S=0;S<C.length;S++)d.indexOf(C[S])===-1&&(h=!1);return h}(p.mods,b))})}})};function Lt(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,R)Object.prototype.hasOwnProperty.call(R,r)&&(!R[r]&&a.mods.indexOf(+r)>-1||R[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||R[16]||R[18]||R[17]||R[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 Mt(e,a){var t=P["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),x.indexOf(n)===-1&&n!==229&&x.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var C=rt[m];e[m]&&x.indexOf(C)===-1?x.push(C):!e[m]&&x.indexOf(C)>-1?x.splice(x.indexOf(C),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(C))))}),n in R){for(var o in R[n]=!0,X)X[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[rt[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(x.indexOf(17)===-1&&x.push(17),x.indexOf(18)===-1&&x.push(18),R[17]=!0,R[18]=!0);var s=ke();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)&&Lt(e,t[i],s,a);if(n in P){for(var u=0;u<P[n].length;u++)if((e.type==="keydown"&&P[n][u].keydown||e.type==="keyup"&&P[n][u].keyup)&&P[n][u].key){for(var f=P[n][u],g=f.splitKey,b=f.key.split(g),p=[],c=0;c<b.length;c++)p.push(Ge(b[c]));p.sort().join("")===x.sort().join("")&&Lt(e,f,s,a)}}}}function U(e,a,t){x=[];var n=Ca(e),o=[],r="all",s=document,i=0,u=!1,f=!0,g="+",b=!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&&(u=a.keyup),a.keydown!==void 0&&(f=a.keydown),a.capture!==void 0&&(b=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=ba(X,e)),(e=(e=e[e.length-1])==="*"?"*":Ge(e))in P||(P[e]=[]),P[e].push({keyup:u,keydown:f,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(p){return Rt.indexOf(p)>-1}(s)&&window&&(Rt.push(s),We(s,"keydown",function(p){Mt(p,s)},b),Bt||(Bt=!0,We(window,"focus",function(){x=[]},b)),We(s,"keyup",function(p){Mt(p,s),function(c){var m=c.keyCode||c.which||c.charCode,C=x.indexOf(m);if(C>=0&&x.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var d in R[m]=!1,X)X[d]===m&&(U[d]=!1)}(p)},b))}var tt={setScope:jt,getScope:ke,deleteScope:function(e,a){var t,n;for(var o in e||(e=ke()),P)if(Object.prototype.hasOwnProperty.call(P,o))for(t=P[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;ke()===e&&jt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ge(e)),x.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(P).forEach(function(t){var n=P[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(P).forEach(function(s){return delete P[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&et(s)});else if(typeof e=="object")e.key&&et(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=""),et({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:_t,modifier:X,modifierMap:rt};for(var at in tt)Object.prototype.hasOwnProperty.call(tt,at)&&(U[at]=tt[at]);if(typeof window<"u"){var Wo=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=Wo),U},window.hotkeys=U}U.filter=function(){return!0};var Ut=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function es(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,u=o.keydown,f=o.filterPreventDefault,g=f===void 0||f,b=o.enabled,p=b===void 0||b,c=o.enableOnContentEditable,m=c!==void 0&&c,C=_.useRef(null),d=_.useCallback(function(h,S){var y,F;return s&&!s(h)?!g:!!(Ut(h,["INPUT","TEXTAREA","SELECT"])&&!Ut(h,r)||(y=h.target)!=null&&y.isContentEditable&&!m)||!!(C.current===null||document.activeElement===C.current||(F=C.current)!=null&&F.contains(document.activeElement))&&(a(h,S),!0)},n?[C,r,s].concat(n):[C,r,s]);return _.useEffect(function(){if(p)return i&&u!==!0&&(t.keydown=!1),U(e,t||{},d),function(){return U.unbind(e,d)};U.unbind(e,d)},[d,e,p]),C}U.isPressed;const ts=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],as=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!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}),Ce=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ns=(e,a,t,n)=>Ce(void 0,e,_e,a,t),os=(e,a,t,n,o)=>({card:{dimension:ft(_e),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),ss=H(function(e,a){const t=cs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:u,hasUserSeenTreasuryVideo:f,treasuryFetchState:g}=a;let b=n.map((p,c)=>{if(p==="reimbursement_promo_card"||p==="bill_pay_promo_card")return ns(t,p,c);if(p==="zeni_promo_card")return Ce({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,_e,p,c);if(p==="treasury_promo_card")return os(g,p,c,u,f);if(p==="information_card")return Ce(void 0,"Completed",_e,p,c);{const m=o.find(C=>C?.reportId===p);return m?function(C,d,h,S){const y=C.reportId;switch(y){case"card_balance":case"cash_balance":return[as(C,d,h,y,S)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[Ce(C,d,h,y,S)];case"net_burn_or_income_story_card":return[Ce(C,d,h,"net_burn_or_income_story_card",S)];default:return console.error(`card type ${y} not yet supported!`),[]}}(m,m.fetchState,_e,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(b=b.filter(p=>ts.includes(p.card.cardType)==0).filter(p=>{const c=p.data?.availableNumberOfPeriods;return c!=null?c>0:p.card.cardType!="top_expenses"||p.data==null||function(m){if(m==null||m.length===0)return!0;let C=!0;for(const d of m)if(d.balance.available.amount!==0){C=!1;break}return C}(p.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:b,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:W(e,"navbar")},analytics:A,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)A.trackDashboardCardClicked("cards promo",2),A.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&&A.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(A.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,u,f,g){switch(u){case"card_balance":i($t());break;case"cash_balance":i(Nt());break;case"operating_expenses":i(ia(!0));break;case"revenue":i(ra(!0));break;case"net_burn_or_income":i(sa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(oa(!0));break;case"top_expenses":i(na());break;case"cash_in_cash_out":i(aa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(f));break;case"task_card":i($n());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(ot(de()));break;case"accounts_receivable_aging":i(st(de()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${u} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{A.trackTimeframeSwitch(ha(r),is(o),"Dashboard"),function(s,i,u){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(ue(u));break;case"top_expenses":s(ta(u));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Nn(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(A.trackUpdateBurnRateCalculatorSettings(r,s,Vn(s)),e(Gn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ee({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ae(o,a.tenantEmailDomain):go(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(fo);function rs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=q(),n=N(),o=z(),r=j.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ye(),u=ye(r),[f,g]=_.useState(!1),[b,p]=_.useState(!1),c=da(),{tenantEmailDomain:m}=K(),{isAiCfoAccessEnabled:C,onAskAiCfoClick:d}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"Dashboard"}),h=k(I=>I.tenantState.fetchState==="Completed"||I.tenantState.activeTenantFetchState.fetchState==="Completed"?L(I):void 0),S=h??j.getSignedInUserTenant(m),y=S.tenantId,F=S.companyId;_.useEffect(()=>{f===!1&&o.state?.message==="activation"&&(n(Fn(F)),g(!0))},[o.state,f,F,n]),_.useEffect(()=>{c&&!b&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),p(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,b,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(M.isApAgingFeatureEnabled),{isFeatureEnabled:v}=s(M.isExpenseAutomationEnabled),{isFeatureEnabled:w}=s(M.isExpenseAutomationEnabledV2),T=w||v&&u,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),he=mo(T),{isFeatureEnabled:fe}=s(M.isArAgingFeatureEnabled),{isFeatureEnabled:Fe}=s(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:kt}=s(M.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(M.isDashboardSidebarNewYearAnimationEnabled),{configValue:St}=i(ua.zeniCardsConfig),va=St.charge_card_cashback_rate_per_transaction==null?.0175:St.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const I=po(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:I.newStack}})}const[yt,Ia]=_.useState(!1),[Ne,Aa]=_.useState(!1);es("command+p, Control+p",I=>{Aa(!Ne),I.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ne]);const vt=h?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const ne=k(I=>L(I)?.excludedResources),Ea=k(I=>I.expenseAutomationViewState.selectedPeriodByTenantId),Ta=!!h?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!h?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=h?.company!=null&&Pn(h.company),Ke=B&&Da,$e=we(),Oa=it($e?.loggedInUserRoleMap),Y=[],It=ne?.resources?.find(I=>I.resource==="/reports/top_expenses")==null,Fa=ne?.resources?.find(I=>I.resource==="/reports/task_card")==null,ze=h?.userRole!=null&&Xt(h?.userRole),Pa=ne?.resources?.find(I=>I.resource==="/bills")==null&&!ze,Ba=ne?.resources?.find(I=>I.resource==="/reimbursements")==null,Ra=Bn($e?.loggedInUserRoleMap),ja=Rn($e?.loggedInUserRoleMap),La=h?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=h?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fundsDetails;It===!1&&Y.push("top_expenses"),Fa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),fe===!1&&Y.push("accounts_receivable_aging"),(T===!1||ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Fe===!1&&Y.push("zeni_accounts_promo_card"),kt===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:At}=ho();_.useLayoutEffect(()=>{yt&&he===T||vt!==!0||!At||ne?.fetchState!=="Completed"&&ne?.fetchState!=="Error"||(Ia(!0),n(jn(r.userId,F,y,!0,!1,Y)))},[yt,r,y,n,It,vt,ne?.fetchState,At]);const Ya=k(I=>I.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Va=k(I=>I.revenueState.uiState.selectedForecast?.id),Ga=k(I=>I.cardBalanceState.fetchState),ie=k(I=>Ln(I,Y,r,w,v,Ke)),Na=ie.fetchState;De({isDataReady:!0});const Et=h?.isTreasuryVideoViewed===!0||ie.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Na==="Completed"?l.jsx(Te,{analytics:A,onLoad:I=>{I.trackPageLoaded(V.Event.dashboard),Ke&&!Et&&I.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:C,onAskAiCfoClick:d,onDragAndDropCard:(I,Ka)=>{const Tt=function(Pe,qe,Be){const Ze=Be.indexOf(Pe),He=Be.indexOf(qe);if(Ze===-1||He===-1||Ze===He)return Be;const Je=[...Be];return Je.splice(Ze,1),Je.splice(He,0,Pe),Je}(I,Ka,ie.cardsOrdered);Tt.some((Pe,qe)=>Pe!==ie.cardsOrdered[qe])&&n(Mn(Tt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:y,companyId:F,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:fe,isBillPayEnabled:wa,isReimbursementEnabled:Ta,isSummaryCardsFiltered:Ne,isForecastOn:Ya,selectedForecastOnDashboard:Va,isVisitingFirstTime:f,isZeniAccountEnabled:Fe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:T&&ze===!1,selectedPeriod:Ea[y],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Ga,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:Et,treasuryFetchState:xa})]})}const is=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"},cs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=we(),a=e?.excludedResources?.find(f=>f.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=k(f=>L(f)),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=Qn(s,r),u=Xn(r);return i===!0||u===!0?l.jsx(nt,{children:l.jsx(D,{path:"/*",element:l.jsx(_o,{})})}):l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(rs,{})}),l.jsx(D,{path:"cash_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"card_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"operating_expenses/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"operating_expenses/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"net_burn_or_income/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"net_burn_or_income/*",element:l.jsx(Q,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_payable_aging/*",element:l.jsx(yo,{})}),l.jsx(D,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(So,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(D,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(D,{path:"cash_position/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"top_expenses/*",element:a===!0?l.jsx(Q,{}):l.jsx(Se,{})}),l.jsx(D,{path:"cash_in_cash_out/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"company_details",element:l.jsx(Co,{})}),l.jsx(D,{path:"referrals/*",element:l.jsx(ko,{})}),l.jsx(D,{path:"*",element:l.jsx(Se,{})})]})}export{js as default};
|
|
20
|
+
`,le=3,Ct=1;function Xo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;De({isDataReady:!0});const u={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...u});break;case"revenue":i=l.jsx(qo,{...u});break;case"net_burn_or_income":i=l.jsx(Vo,{...u});break;case"cash_position":i=l.jsx(Mo,{...u});break;case"top_expenses":i=l.jsx(Jo,{...u});break;case"cash_in_cash_out":i=l.jsx(Ro,{...u});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Qo,{children:i}):null}function Q(){const e=z(),a=G(),{forecastId:t}=K();let n="Not-Started";const o=k(c=>pt(c).fetchState),r=k(c=>ht(c).fetchState),s=k(c=>ct(c).fetchState),i=k(c=>c.cashPositionState.fetchState),u=k(c=>c.topExState.fetchState),f=k(c=>c.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k(c=>L(c)),b=g?.company?.companyInfo?.firstMonthOfFY??1,p=Vt((c=>{const m=Nt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(p){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=u;break;case"cash_in_cash_out":n=f;break;default:console.error(`${p} is not supported!`)}return _.useEffect(()=>{n==="Not-Started"&&function(c,m,C,d){switch(m){case"operating_expenses":c(ia(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Qt(!1,d)));break;case"revenue":c(ra(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(ea(!1,d)));break;case"net_burn_or_income":c(sa(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Ht(!1,d)));break;case"cash_position":c(oa(!0));break;case"top_expenses":c(na());break;case"cash_in_cash_out":c(aa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,p,b,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(Te,{analytics:A,onLoad:c=>((m,C)=>{const d=e.state?.referrer;switch(C){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,d);break;case"revenue":m.trackPageLoaded(V.Event.revenues,d);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,d);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,d);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,d);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,d);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,p)}):null,l.jsx(Xo,{firstMonthOfFY:b,fetchState:n,reportId:p,forecastId:t})]})}var Xe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(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 Ca(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 _t={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,"-":Xe?173:189,"=":Xe?61:187,";":Xe?59:186,"'":222,"[":219,"]":221,"\\":220},X={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},rt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},R={16:!1,18:!1,17:!1,91:!1},P={},Le=1;Le<20;Le++)_t["f".concat(Le)]=111+Le;var x=[],Bt=!1,_a="all",Rt=[],Ne=function(e){return _t[e.toLowerCase()]||X[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function jt(e){_a=e||"all"}function ke(){return _a||"all"}var et=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),u=i.length,f=i[u-1],g=f==="*"?"*":Ne(f);if(P[g]){t||(t=ke());var b=u>1?ba(X,i):[];P[g]=P[g].filter(function(p){return!((!n||p.method===n)&&p.scope===t&&function(c,m){for(var C=c.length>=m.length?c:m,d=c.length>=m.length?m:c,h=!0,S=0;S<C.length;S++)d.indexOf(C[S])===-1&&(h=!1);return h}(p.mods,b))})}})};function Lt(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,R)Object.prototype.hasOwnProperty.call(R,r)&&(!R[r]&&a.mods.indexOf(+r)>-1||R[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||R[16]||R[18]||R[17]||R[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 Mt(e,a){var t=P["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),x.indexOf(n)===-1&&n!==229&&x.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var C=rt[m];e[m]&&x.indexOf(C)===-1?x.push(C):!e[m]&&x.indexOf(C)>-1?x.splice(x.indexOf(C),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(C))))}),n in R){for(var o in R[n]=!0,X)X[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[rt[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(x.indexOf(17)===-1&&x.push(17),x.indexOf(18)===-1&&x.push(18),R[17]=!0,R[18]=!0);var s=ke();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)&&Lt(e,t[i],s,a);if(n in P){for(var u=0;u<P[n].length;u++)if((e.type==="keydown"&&P[n][u].keydown||e.type==="keyup"&&P[n][u].keyup)&&P[n][u].key){for(var f=P[n][u],g=f.splitKey,b=f.key.split(g),p=[],c=0;c<b.length;c++)p.push(Ne(b[c]));p.sort().join("")===x.sort().join("")&&Lt(e,f,s,a)}}}}function U(e,a,t){x=[];var n=Ca(e),o=[],r="all",s=document,i=0,u=!1,f=!0,g="+",b=!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&&(u=a.keyup),a.keydown!==void 0&&(f=a.keydown),a.capture!==void 0&&(b=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=ba(X,e)),(e=(e=e[e.length-1])==="*"?"*":Ne(e))in P||(P[e]=[]),P[e].push({keyup:u,keydown:f,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(p){return Rt.indexOf(p)>-1}(s)&&window&&(Rt.push(s),We(s,"keydown",function(p){Mt(p,s)},b),Bt||(Bt=!0,We(window,"focus",function(){x=[]},b)),We(s,"keyup",function(p){Mt(p,s),function(c){var m=c.keyCode||c.which||c.charCode,C=x.indexOf(m);if(C>=0&&x.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var d in R[m]=!1,X)X[d]===m&&(U[d]=!1)}(p)},b))}var tt={setScope:jt,getScope:ke,deleteScope:function(e,a){var t,n;for(var o in e||(e=ke()),P)if(Object.prototype.hasOwnProperty.call(P,o))for(t=P[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;ke()===e&&jt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ne(e)),x.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(P).forEach(function(t){var n=P[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(P).forEach(function(s){return delete P[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&et(s)});else if(typeof e=="object")e.key&&et(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=""),et({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:_t,modifier:X,modifierMap:rt};for(var at in tt)Object.prototype.hasOwnProperty.call(tt,at)&&(U[at]=tt[at]);if(typeof window<"u"){var Wo=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=Wo),U},window.hotkeys=U}U.filter=function(){return!0};var Ut=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function es(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,u=o.keydown,f=o.filterPreventDefault,g=f===void 0||f,b=o.enabled,p=b===void 0||b,c=o.enableOnContentEditable,m=c!==void 0&&c,C=_.useRef(null),d=_.useCallback(function(h,S){var y,F;return s&&!s(h)?!g:!!(Ut(h,["INPUT","TEXTAREA","SELECT"])&&!Ut(h,r)||(y=h.target)!=null&&y.isContentEditable&&!m)||!!(C.current===null||document.activeElement===C.current||(F=C.current)!=null&&F.contains(document.activeElement))&&(a(h,S),!0)},n?[C,r,s].concat(n):[C,r,s]);return _.useEffect(function(){if(p)return i&&u!==!0&&(t.keydown=!1),U(e,t||{},d),function(){return U.unbind(e,d)};U.unbind(e,d)},[d,e,p]),C}U.isPressed;const ts=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],as=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!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}),Ce=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ns=(e,a,t,n)=>Ce(void 0,e,_e,a,t),os=(e,a,t,n,o)=>({card:{dimension:ft(_e),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),ss=H(function(e,a){const t=cs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:u,hasUserSeenTreasuryVideo:f,treasuryFetchState:g}=a;let b=n.map((p,c)=>{if(p==="reimbursement_promo_card"||p==="bill_pay_promo_card")return ns(t,p,c);if(p==="zeni_promo_card")return Ce({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,_e,p,c);if(p==="treasury_promo_card")return os(g,p,c,u,f);if(p==="information_card")return Ce(void 0,"Completed",_e,p,c);{const m=o.find(C=>C?.reportId===p);return m?function(C,d,h,S){const y=C.reportId;switch(y){case"card_balance":case"cash_balance":return[as(C,d,h,y,S)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[Ce(C,d,h,y,S)];case"net_burn_or_income_story_card":return[Ce(C,d,h,"net_burn_or_income_story_card",S)];default:return console.error(`card type ${y} not yet supported!`),[]}}(m,m.fetchState,_e,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(b=b.filter(p=>ts.includes(p.card.cardType)==0).filter(p=>{const c=p.data?.availableNumberOfPeriods;return c!=null?c>0:p.card.cardType!="top_expenses"||p.data==null||function(m){if(m==null||m.length===0)return!0;let C=!0;for(const d of m)if(d.balance.available.amount!==0){C=!1;break}return C}(p.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:b,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:W(e,"navbar")},analytics:A,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)A.trackDashboardCardClicked("cards promo",2),A.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&&A.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(A.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,u,f,g){switch(u){case"card_balance":i($t());break;case"cash_balance":i(Gt());break;case"operating_expenses":i(ia(!0));break;case"revenue":i(ra(!0));break;case"net_burn_or_income":i(sa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(oa(!0));break;case"top_expenses":i(na());break;case"cash_in_cash_out":i(aa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(f));break;case"task_card":i($n());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(ot(de()));break;case"accounts_receivable_aging":i(st(de()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${u} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{A.trackTimeframeSwitch(ha(r),is(o),"Dashboard"),function(s,i,u){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(ue(u));break;case"top_expenses":s(ta(u));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Gn(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(A.trackUpdateBurnRateCalculatorSettings(r,s,Vn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ee({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ae(o,a.tenantEmailDomain):go(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(fo);function rs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=q(),n=G(),o=z(),r=j.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ye(),u=ye(r),[f,g]=_.useState(!1),[b,p]=_.useState(!1),c=da(),{tenantEmailDomain:m}=K(),{isAiCfoAccessEnabled:C,onAskAiCfoClick:d}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"Dashboard"}),h=k(I=>I.tenantState.fetchState==="Completed"||I.tenantState.activeTenantFetchState.fetchState==="Completed"?L(I):void 0),S=h??j.getSignedInUserTenant(m),y=S.tenantId,F=S.companyId;_.useEffect(()=>{f===!1&&o.state?.message==="activation"&&(n(Fn(F)),g(!0))},[o.state,f,F,n]),_.useEffect(()=>{c&&!b&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),p(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,b,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(M.isApAgingFeatureEnabled),{isFeatureEnabled:v}=s(M.isExpenseAutomationEnabled),{isFeatureEnabled:w}=s(M.isExpenseAutomationEnabledV2),T=w||v&&u,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),he=mo(T),{isFeatureEnabled:fe}=s(M.isArAgingFeatureEnabled),{isFeatureEnabled:Fe}=s(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:kt}=s(M.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(M.isDashboardSidebarNewYearAnimationEnabled),{configValue:St}=i(ua.zeniCardsConfig),va=St.charge_card_cashback_rate_per_transaction==null?.0175:St.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const I=po(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:I.newStack}})}const[yt,Ia]=_.useState(!1),[Ge,Aa]=_.useState(!1);es("command+p, Control+p",I=>{Aa(!Ge),I.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ge]);const vt=h?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const ne=k(I=>L(I)?.excludedResources),Ea=k(I=>I.expenseAutomationViewState.selectedPeriodByTenantId),Ta=!!h?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!h?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=h?.company!=null&&Pn(h.company),Ke=B&&Da,$e=we(),Oa=it($e?.loggedInUserRoleMap),Y=[],It=ne?.resources?.find(I=>I.resource==="/reports/top_expenses")==null,Fa=ne?.resources?.find(I=>I.resource==="/reports/task_card")==null,ze=h?.userRole!=null&&Xt(h?.userRole),Pa=ne?.resources?.find(I=>I.resource==="/bills")==null&&!ze,Ba=ne?.resources?.find(I=>I.resource==="/reimbursements")==null,Ra=Bn($e?.loggedInUserRoleMap),ja=Rn($e?.loggedInUserRoleMap),La=h?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=h?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fundsDetails;It===!1&&Y.push("top_expenses"),Fa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),fe===!1&&Y.push("accounts_receivable_aging"),(T===!1||ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Fe===!1&&Y.push("zeni_accounts_promo_card"),kt===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:At}=ho();_.useLayoutEffect(()=>{yt&&he===T||vt!==!0||!At||ne?.fetchState!=="Completed"&&ne?.fetchState!=="Error"||(Ia(!0),n(jn(r.userId,F,y,!0,!1,Y)))},[yt,r,y,n,It,vt,ne?.fetchState,At]);const Ya=k(I=>I.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Va=k(I=>I.revenueState.uiState.selectedForecast?.id),Na=k(I=>I.cardBalanceState.fetchState),ie=k(I=>Ln(I,Y,r,w,v,Ke)),Ga=ie.fetchState;De({isDataReady:!0});const Et=h?.isTreasuryVideoViewed===!0||ie.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Ga==="Completed"?l.jsx(Te,{analytics:A,onLoad:I=>{I.trackPageLoaded(V.Event.dashboard),Ke&&!Et&&I.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:C,onAskAiCfoClick:d,onDragAndDropCard:(I,Ka)=>{const Tt=function(Pe,qe,Be){const Ze=Be.indexOf(Pe),He=Be.indexOf(qe);if(Ze===-1||He===-1||Ze===He)return Be;const Je=[...Be];return Je.splice(Ze,1),Je.splice(He,0,Pe),Je}(I,Ka,ie.cardsOrdered);Tt.some((Pe,qe)=>Pe!==ie.cardsOrdered[qe])&&n(Mn(Tt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:y,companyId:F,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:fe,isBillPayEnabled:wa,isReimbursementEnabled:Ta,isSummaryCardsFiltered:Ge,isForecastOn:Ya,selectedForecastOnDashboard:Va,isVisitingFirstTime:f,isZeniAccountEnabled:Fe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:T&&ze===!1,selectedPeriod:Ea[y],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Na,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:Et,treasuryFetchState:xa})]})}const is=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"},cs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=we(),a=e?.excludedResources?.find(f=>f.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=k(f=>L(f)),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=Qn(s,r),u=Xn(r);return i===!0||u===!0?l.jsx(nt,{children:l.jsx(D,{path:"/*",element:l.jsx(_o,{})})}):l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(rs,{})}),l.jsx(D,{path:"cash_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"card_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"operating_expenses/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"operating_expenses/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"net_burn_or_income/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"net_burn_or_income/*",element:l.jsx(Q,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_payable_aging/*",element:l.jsx(yo,{})}),l.jsx(D,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(So,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(D,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(D,{path:"cash_position/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"top_expenses/*",element:a===!0?l.jsx(Q,{}):l.jsx(Se,{})}),l.jsx(D,{path:"cash_in_cash_out/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"company_details",element:l.jsx(Co,{})}),l.jsx(D,{path:"referrals/*",element:l.jsx(ko,{})}),l.jsx(D,{path:"*",element:l.jsx(Se,{})})]})}export{js as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-BJogRArg.js";import{a as u}from"./sentry-WdXgkw90.js";import{h as y,g as b,k as w,u as A,N}from"./core-BojUR2ky.js";import{Ig as k,eN as _,fi as U,Ih as L,ml as R,Ii as z}from"./zeni-epic-state-BJsXImBw.js";import{u as O,z as f,L as T,t as S,D as $,b as j}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{t as P}from"./getLocaleForTenant-DXctzPv_.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.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]="25aa12d1-2af3-4507-9532-9acbfc7286e2",t._sentryDebugIdIdentifier="sentry-dbid-25aa12d1-2af3-4507-9532-9acbfc7286e2")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=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,I=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=j(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});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=>k(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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}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"],G={"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 G[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-_XVPNAtR.js → DomesticWireDetailScreen-DqS4Tcvr.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-BJogRArg.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-BojUR2ky.js";import{Mc as k,Mj as _,fz as q,fy as J,fx as K,im as L,Jk as W,pv as Q,eN as V,LK as D,ik as T,Md as v,Mm as F,ii as G,iG as j}from"./zeni-epic-state-BJsXImBw.js";import{bn as X,q as N,a as R,z as U,h as z,v as p,p as S,B as M,bo as Y,o as O,bp as ee,x as te}from"./index-Dw0sYJvv.js";import{n as Z}from"./mui-Bg09VkiQ.js";import"./sentry-WdXgkw90.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]="2813b1ce-dae5-47b0-945c-617f53a5d220",e._sentryDebugIdIdentifier="sentry-dbid-2813b1ce-dae5-47b0-945c-617f53a5d220")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(W("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-tcXs1fes.js";import{j as w,u as C,g as h,k as A,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=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),
|
|
9
|
+
`,oe=A(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),c=s.poppedPathname??P();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(F({data:c}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??P(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),d=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>V(u)),g=z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=Z.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100vh;
|
|
12
12
|
width: 100%;
|
|
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-tcXs1fes.js";import{j as w,u as C,g as h,k as A,
|
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
17
|
box-shadow: ${e=>`0px 2px ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
-
`,
|
|
18
|
+
`,ce=A(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:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=z(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BJogRArg.js";import{q as c,C as l,h as f}from"./index-Dw0sYJvv.js";import{D as p}from"./mui-Bg09VkiQ.js";import"./sentry-WdXgkw90.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]="4c16b3f2-8281-4a9e-9fd4-8a0c1cec6b29",e._sentryDebugIdIdentifier="sentry-dbid-4c16b3f2-8281-4a9e-9fd4-8a0c1cec6b29")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=c(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.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-BJogRArg.js";import{a as d}from"./sentry-WdXgkw90.js";import{j as A,h as B,u as J,l as q,g as l,N,k as F,n as W,o as _}from"./core-BojUR2ky.js";import{Kr as z,eN as O,JQ as K,kq as M,Gz as b,Kw as R,Jj as V,jq as Y,GA as S,JV as $,JW as Q,Jl as H,Jk as L}from"./zeni-epic-state-BJsXImBw.js";import{aN as U,d as X,v as Z,x as tt}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{d as k}from"./decodeURIComponentSafe-Cj7RmfYA.js";import{w as et}from"./withTransactionSidePanel-DUWL7sXt.js";import{e as at,b as nt}from"./routePaths-DriCJPaW.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import"./TransactionDetailScreen-DwslT8ci.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]="114b5874-7081-46ef-b053-923aa25fa95d",a._sentryDebugIdIdentifier="sentry-dbid-114b5874-7081-46ef-b053-923aa25fa95d")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=R(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:V(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();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(b(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=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=q(),r=k(j??""),p=k(w??""),u=rt(r,p),x=[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")),G=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(b(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:I(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
|