@zeniai/web-app-ui 5.0.73-qa → 5.0.74-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-oYMlFQPx.js +1 -0
- package/dist/assets/AddressScreen-DuqDDwbX.js +9 -0
- package/dist/assets/{AiCfoScreen-BuWzYLYw.js → AiCfoScreen-DmlMKQ45.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Bt8Z0pVh.js → BillPayApprovalRoutes-ZlmnVSSW.js} +1 -1
- package/dist/assets/{BillPayRoutes-D5KWvYEu.js → BillPayRoutes-CeziCNtw.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-B4Ydn5q-.js → BusinessVerificationPageScreen--aJrL6sY.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-ClxIUSvt.js → ChargeCardRoutes-Bseixdt5.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-C-PG6LRZ.js → CompanyPassportScreen-DZYGX7Ak.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-SPlAQ_Np.js → ConnectionAuthScreen-DYlxkvSU.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CtksFbgx.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DPukj_Rw.js → CustomerOnboardingRoutes-BmEKqRSj.js} +3 -3
- package/dist/assets/{DashboardRoutes-hwqRQl7V.js → DashboardRoutes-CogbIDn5.js} +4 -4
- package/dist/assets/{DefaultTenantHome-CJT8TR8y.js → DefaultTenantHome-BNhdpEJE.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-D0FJ0DFE.js → DomesticWireDetailScreen-DOvHZ_oC.js} +3 -3
- package/dist/assets/DrawerScreen-DwJwVhuI.js +1 -0
- package/dist/assets/{EntityDetailRoutes-OIVD1I9e.js → EntityDetailRoutes-B5Mz_0tK.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Bddv7sbf.js → ExpenseAutomationRoutes-43io-wzv.js} +4 -4
- package/dist/assets/{FeaturePreviewScreen-BlSIKXFS.js → FeaturePreviewScreen-BCjtGP_L.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-CLjAH-ee.js → HubSpotOAuthCallbackScreen-DP_xp7gX.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-BQnKzZaB.js → MagicLinkRoutes-5gC2RMuC.js} +6 -6
- package/dist/assets/{MagicLinkSignInScreen-uHKvnjU8.js → MagicLinkSignInScreen-1TZssQ2L.js} +1 -1
- package/dist/assets/{MobileAppDrawer-Dm68rJiS.js → MobileAppDrawer-CKb5yG63.js} +1 -1
- package/dist/assets/NotFoundScreen-DuU91hRO.js +1 -0
- package/dist/assets/{NotificationRoutes-YFiOMG6k.js → NotificationRoutes-thxZPpjj.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-kpejh2UL.js → OAuthConsentScreen-COOk_lDh.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DOPekVsK.js → PandLWithForecastRoutes-BHTypoFG.js} +1 -1
- package/dist/assets/{PeopleRoutes-CHh9S1ES.js → PeopleRoutes-BKLG-Nkw.js} +4 -4
- package/dist/assets/PerformanceRoutes-DZWxI-5H.js +1 -0
- package/dist/assets/{Preview-63x8M4Zb.js → Preview-DzpWuMNc.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CVxTOUos.js → QBOConnectionScreen-Bsxzkv43.js} +1 -1
- package/dist/assets/ReferralListScreen-Dg_jKXHY.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-BXvb2Znx.js → ReimbursementApprovalRoutes-UcfqpWRh.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-obTxBD8v.js → ReimbursementApprovalRuleDetailScreen-EaQ9JUjP.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DzuMZgdz.js → ReimbursementRoutes-DxXqSY1z.js} +5 -5
- package/dist/assets/{ReportsRoutes-Du1FN7AL.js → ReportsRoutes-CzzokNSO.js} +1 -1
- package/dist/assets/RewardsRoutes-C7-632Cj.js +1 -0
- package/dist/assets/{ScreenRoutes-C1s0Nxp2.js → ScreenRoutes-scBYKN6D.js} +2 -2
- package/dist/assets/{SettingsRoutes-CvzF47Mb.js → SettingsRoutes-C1mTTPPp.js} +7 -7
- package/dist/assets/{SetupPagesScreen-D9to9dY7.js → SetupPagesScreen-CMNbCjoJ.js} +1 -1
- package/dist/assets/{SignInScreen-C-T0IXf6.js → SignInScreen-Bw9YZhPQ.js} +1 -1
- package/dist/assets/{SignOutScreen-Czon70VP.js → SignOutScreen-CP-AKuF8.js} +1 -1
- package/dist/assets/{TaskListScreen-Xzvf8Hgp.js → TaskListScreen-B8MV3xma.js} +2 -2
- package/dist/assets/TaskRoutes-CC0KU-1O.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BY0yRYBD.js +1 -0
- package/dist/assets/{TransactionDetailScreen-Cx4z6equ.js → TransactionDetailScreen-CrO7VjQP.js} +2 -2
- package/dist/assets/TransactionListRoutes-D1V74e9e.js +1 -0
- package/dist/assets/{TreasuryRoutes-Bsh24hmh.js → TreasuryRoutes-fdgElXNz.js} +1 -1
- package/dist/assets/{VendorsRoutes-Dghnmhef.js → VendorsRoutes-D5J5iuOk.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-CQWm6HGp.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BwL43X6f.js → ZeniAccountRoutes-Dw3YCzKk.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-CXCXyV_O.js → ZeniAccountStatementScreen-YrMsUI59.js} +1 -1
- package/dist/assets/{accountMappingHelper-DEVWShIB.js → accountMappingHelper-CP3zTfM5.js} +1 -1
- package/dist/assets/{analytics-CLyVqw3m.js → analytics-TpOPKTBE.js} +1 -1
- package/dist/assets/{analyticsHelper-C6OV8Lji.js → analyticsHelper-C6rQwSxW.js} +1 -1
- package/dist/assets/{core-B8DAi0nh.js → core-DR8tDM_G.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-2RJaUBNT.js → decodeURIComponentSafe-BRa5aIWn.js} +1 -1
- package/dist/assets/{dnd-DNrenqEc.js → dnd-Tv7XXetM.js} +1 -1
- package/dist/assets/{empty-CMYkwe6B.js → empty-NmpZ4nNi.js} +1 -1
- package/dist/assets/{empty-D1H0TyYI.js → empty-oHPXgZDu.js} +1 -1
- package/dist/assets/{emptyVideoElement-89AhO6II.js → emptyVideoElement-8zuBwn96.js} +1 -1
- package/dist/assets/{epic-occCJYrK.js → epic-BA-x1krm.js} +1 -1
- package/dist/assets/{getLocaleForTenant-CzzxyTLH.js → getLocaleForTenant-DmihGqyc.js} +1 -1
- package/dist/assets/{index-DXkdnQWz.js → index-B3GU_r7Y.js} +1 -1
- package/dist/assets/{index-CVyF-mcC.js → index-BUaPDlId.js} +1 -1
- package/dist/assets/{index-CrWxCSey.js → index-BXSudR0L.js} +1 -1
- package/dist/assets/{index-eEUBMv7A.js → index-B_HEzhpc.js} +1 -1
- package/dist/assets/{index-CrhTmqTp.js → index-CjFymAYP.js} +8920 -8911
- package/dist/assets/{index-orAkddId.js → index-DvDHGUrV.js} +1 -1
- package/dist/assets/{index-LbX_nh30.js → index-LDid1hRj.js} +2 -2
- package/dist/assets/{index-o5I9Rsf6.js → index-YEViLwBF.js} +1 -1
- package/dist/assets/{lexical-BbcB7U6u.js → lexical-XdnXYpvk.js} +1 -1
- package/dist/assets/{liveblocks-6nZkQHFl.js → liveblocks-DH0u65Kt.js} +1 -1
- package/dist/assets/{lottie-Cp94NU-O.js → lottie-DXjy-4kQ.js} +1 -1
- package/dist/assets/{mui-DOBONCVx.js → mui-EgTXI2De.js} +1 -1
- package/dist/assets/{pathToGoBack-CuzLi8kB.js → pathToGoBack-Dzbxi3-3.js} +1 -1
- package/dist/assets/{pdf-B9LwAnPJ.js → pdf-C1ZWoPlC.js} +4 -4
- package/dist/assets/{pdf-lib-B6W-Zb6c.js → pdf-lib-D_Q1qkRs.js} +1 -1
- package/dist/assets/{plaid-BJER8-rG.js → plaid-C9BN4j5u.js} +1 -1
- package/dist/assets/{pusher-BKAvW8Ej.js → pusher-CrhyJDIe.js} +1 -1
- package/dist/assets/{react-XdIGJaYE.js → react-AvYNnxbu.js} +1 -1
- package/dist/assets/{react-Ch8Qff_2.js → react-BvYpSoIW.js} +1 -1
- package/dist/assets/{react-DZuEKM1F.js → react-CUhJjbx2.js} +1 -1
- package/dist/assets/{react-BsAtiQ73.js → react-CnsEuq7i.js} +1 -1
- package/dist/assets/{react-m-TEyxm9.js → react-CqNkdHXi.js} +1 -1
- package/dist/assets/{react-Az4VFoYA.js → react-DLMbYpVK.js} +1 -1
- package/dist/assets/{recharts-CDgByeDS.js → recharts-BN9u8kqw.js} +1 -1
- package/dist/assets/{routePaths-9AUhVaii.js → routePaths-BSK2K3Sa.js} +1 -1
- package/dist/assets/{sentry-Dr5FPm4d.js → sentry-Z2EfLBjp.js} +1 -1
- package/dist/assets/{url-DhbS62gt.js → url-DYeBp6T3.js} +1 -1
- package/dist/assets/{url-CgpVackm.js → url-ce6M3nR5.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CT7gco_a.js +1 -0
- package/dist/assets/{useDeviceId-fW8BPEnA.js → useDeviceId-DAVwENt1.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-Z1RjapDK.js → useFetchSuggestedQuestionsWhenReady-CQWT0XHy.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-D2GYlrz4.js → useInitialThreadRequest-XTK7FDn_.js} +1 -1
- package/dist/assets/{utils-XBrV3QeH.js → utils-CYYHm9mY.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C0vsYVl3.js → withTransactionSidePanel-DlYx7LYJ.js} +1 -1
- package/dist/assets/{zeni-epic-state-DITtSXPQ.js → zeni-epic-state-TB4o69vJ.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-BNwO1euv.js +0 -1
- package/dist/assets/AddressScreen-CQqRda3s.js +0 -9
- package/dist/assets/CustomerOnboardingAuthScreen-BLm7f-pp.js +0 -1
- package/dist/assets/DrawerScreen-BJd9OmNB.js +0 -1
- package/dist/assets/NotFoundScreen-DsEEwwTx.js +0 -1
- package/dist/assets/PerformanceRoutes-BH98gSrX.js +0 -1
- package/dist/assets/ReferralListScreen-bP3lCOJY.js +0 -5
- package/dist/assets/RewardsRoutes-Be9Ge6Wf.js +0 -1
- package/dist/assets/TaskRoutes-DCXtf0K8.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BTqPhOdT.js +0 -1
- package/dist/assets/TransactionListRoutes-DRiy7_ZT.js +0 -1
- package/dist/assets/WiseConfirmationScreen-D2hivvGc.js +0 -12
- package/dist/assets/useAskAiCfoHostNavButtonProps-DH6rjWyj.js +0 -1
package/dist/assets/{CustomerOnboardingRoutes-DPukj_Rw.js → CustomerOnboardingRoutes-BmEKqRSj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-DH0u65Kt.js";import{t as $e,A as Ce}from"./AddressScreen-DuqDDwbX.js";import ze from"./NotFoundScreen-DuU91hRO.js";import{a as g}from"./sentry-Z2EfLBjp.js";import{j as oe,u as se,h as ie,l as re,g as D,N as T,k as ce,i as Me,n as Qe,o as M}from"./core-DR8tDM_G.js";import{n as de,k as le,z as B,y as ue,m as qe,S as _,j as V,s as H,c as N,B as we,e as X,am as Je,Z as Ke,an as ke,f as te,ao as Ze,ap as Ie,o as He,aq as We,ar as Te,as as Xe}from"./index-CjFymAYP.js";import{bn as Ye,eO as ee,fb as et,eU as pe,eS as me,bv as tt,mt as at,f7 as nt,bN as ot,jc as ae,jf as ve,Ji as st,bS as it,c1 as ge,r$ as he,rM as rt,JP as Y,s0 as _e,Ha as ct,kg as Ue,JQ as Ve,JR as dt,JS as lt,JT as ut,ja as pt,jd as mt,rO as Be,r_ as gt,bD as Ee,cu as ht,sc as xe,pO as ft,pC as yt,k8 as bt,fA as St,fz as Ct,fy as kt,JU as It,rG as Tt,sd as Et,sg as xt,sj as Ot,sp as Pt,cT as At}from"./zeni-epic-state-TB4o69vJ.js";import{n as fe}from"./mui-EgTXI2De.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-Bsxzkv43.js";import"./recharts-BN9u8kqw.js";import"./analytics-TpOPKTBE.js";import"./plaid-C9BN4j5u.js";import"./dnd-Tv7XXetM.js";import"./stripe-DMRn4zHo.js";import"./lottie-DXjy-4kQ.js";import"./lexical-XdnXYpvk.js";import"./pdf-C1ZWoPlC.js";import"./utils-CYYHm9mY.js";import"./empty-NmpZ4nNi.js";import"./pdf-lib-D_Q1qkRs.js";import"./index-B3GU_r7Y.js";import"./url-ce6M3nR5.js";import"./index-YEViLwBF.js";import"./decodeURIComponentSafe-BRa5aIWn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="b8039bed-f420-4b9e-a681-0ca49dbe93bb",t._sentryDebugIdIdentifier="sentry-dbid-b8039bed-f420-4b9e-a681-0ca49dbe93bb")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Je),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],J=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(J===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(T,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(T,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(T,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(K=>K.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-6nZkQHFl.js";import{t as $e,A as Ce}from"./Addre
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
-
`,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),
|
|
19
|
+
`,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:b}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Et(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Tt(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:E,ssn:x,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,isPhoneVerified:O}=i;let S;return F.selectDocumentType==="driverLicense"?S="driving_license":F.selectDocumentType==="passport"?S="passport":F.selectDocumentType==="stateId"?S="id_document":F.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:E,ssn:x,nationalityCountryCode:k?.selectedOption!=null?Te(k.selectedOption):void 0,phone:U,birthday:f!=null?Ee(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:E,companyPhone:x,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:J,transactionVolume:z,transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:E!=""&&E!=null?ht(E):void 0,phone:x,syncToken:F,fileIds:$,incDate:j!=null?Ee(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(Z=>Z.length===2?Z:Te(Z))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:J,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q?.selectedOptions??[]},K={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:K}))},onAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Ze),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ke(),b=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:E}=re(),x=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=Me("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),j=D(y=>y.cardPaymentViewState),R=ke(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:w}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,J=P?.connectionName,z=P?.connectionId??"",Q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(S,G,w,z,Q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:J??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:z,user_id:Q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,z),u(d.pathname))},[S,G,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(E)?.companyId,q=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const K=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&K==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(X.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Ge?a.jsx(T,{to:"../../treasury"}):Le?a.jsx(T,{to:"../../checking"}):Re?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(T,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(T,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>be(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
height: 100vh;
|
|
22
22
|
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
-
`,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const
|
|
23
|
+
`,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Xe),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),E=me(i),x=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?x==="Completed"&&k===!0&&h&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&k===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:x}):I?a.jsx(T,{to:"../../checking"}):E?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"})};function oa(){return a.jsxs(Qe,{children:[a.jsx(M,{path:"/",element:a.jsx(W,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-6nZkQHFl.js";import{l as $,g as S,u as q,h as N,j as Z,k as Q,s as Ka,n as st,o as w}from"./core-B8DAi0nh.js";import{eO as L,K8 as Ye,bD as Gt,bq as he,Ll as qa,i0 as Za,Lm as wt,Ln as Ha,i3 as rt,Lo as je,Lp as Qa,i8 as Ja,Lq as Dt,Lr as Wa,ic as it,Ls as Me,Lt as Xa,ck as lt,Lu as en,Lv as tn,Ks as an,j6 as nn,Lw as on,bn as Ee,Lx as Nt,JY as ae,bc as zt,jk as $t,mD as Kt,j3 as qt,J_ as ne,JZ as H,f3 as sn,eL as rn,fl as cn,Ly as ln,Lz as dn,LA as Zt,LB as _e,tR as Ie,tS as Te,ud as fe,u7 as oe,tW as xe,LC as un,LD as mn,LE as pn,LF as Ht,LG as ke,LH as hn,dC as Ve,qm as Qt,LI as fn,LJ as gn,LK as bn,LL as dt,Jl as ut,jA as ge,ul as mt,qu as Cn,LM as _n,tT as Ft,qp as me,ql as Jt,LN as ie,LO as kn,LP as pt,Jj as ht,st as Wt,LQ as Sn,LR as yn,LS as An,LT as ft,sG as vn,LU as En,tV as Ot,ss as Xt,LV as ce,LW as In,bv as ea,up as ta,LX as Tn,LY as xn,LZ as wn,L_ as gt,uk as Dn,L$ as Fn,tU as Pt,uo as aa,M0 as le,M1 as On,M2 as Pn,M3 as na,jp as oa,mA as sa,ju as ra,my as ia,mx as ca,mw as la,rR as Rn,fb as Bn,cN as Ln,cO as jn,mt as Mn,f7 as Un,mK as Yn,Dt as Rt,M4 as Vn,M5 as Gn,M6 as Nn,M7 as zn,b5 as bt,e_ as $n,gK as Kn,fC as qn,mE as Zn,iY as Hn,mB as Qn,mz as Jn,eU as Wn,eS as Xn}from"./zeni-epic-state-DITtSXPQ.js";import{z as B,W as J,n as D,c as E,D as K,aR as eo,w as we,aS as da,e as V,aT as to,k as De,aU as ua,y as Ge,S as j,m as ao,aV as no,aW as oo,Q as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,V as lo,aZ as uo,a_ as mo,an as po,p as ho,R as fo,a$ as go,b0 as ye}from"./index-CrhTmqTp.js";import{n as Ct}from"./mui-DOBONCVx.js";import{a as C}from"./sentry-Dr5FPm4d.js";import{w as fa}from"./withTransactionSidePanel-C0vsYVl3.js";import{b as ga,t as be,e as se,a as _t,v as bo}from"./routePaths-9AUhVaii.js";import{u as W}from"./useAskAiCfoHostNavButtonProps-DH6rjWyj.js";import{c as Fe,b as Co,u as _o}from"./useFetchSuggestedQuestionsWhenReady-Z1RjapDK.js";import ve from"./NotFoundScreen-DsEEwwTx.js";import{t as ba}from"./analyticsHelper-C6OV8Lji.js";import{C as ko}from"./CompanyPassportScreen-C-PG6LRZ.js";import{F as So}from"./FeaturePreviewScreen-BlSIKXFS.js";import{R as yo}from"./ReferralListScreen-bP3lCOJY.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";import"./TransactionDetailScreen-Cx4z6equ.js";import"./decodeURIComponentSafe-2RJaUBNT.js";import"./MobileAppDrawer-Dm68rJiS.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]="5854d826-f155-4145-af99-ceafebc0bc81",e._sentryDebugIdIdentifier="sentry-dbid-5854d826-f155-4145-af99-ceafebc0bc81")}catch{}})();const Ao=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=B.getSignedInUser(),i=S(I=>I.tenantState.currentTenantId),d=S(I=>L(I)),{tenantEmailDomain:p}=$(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Ye()}),[]),m=C.useMemo(()=>r!=null?Gt(r):he(),[r]),h=N(),f=Z(),k=S(I=>qa(I,m,o)),y=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),b=C.useCallback(()=>{f("../../",{relative:"path"})},[]),A=C.useCallback((I,z)=>{h(wt({sortKey:I,sortOrder:z}))},[]),T=C.useCallback(I=>{h(wt({downloadState:I}))},[]),M=C.useCallback(I=>{if(e)e(I.transactionId,I.transactionType);else if(p!=null){const z=ga({id:I.transactionId,type:I.transactionType},p);f(z);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(z,{state:{pathnameStackToGoBack:de}})}},[p,e]),F=C.useCallback(()=>{k.vendor!=null&&E.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{y()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:E,onTransactionClick:M,onReload:y,onBackClick:b,onColumnSortConfigChanged:A,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),vo=()=>{const e=N(),a=Z(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AP Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Ye()}),[]),g=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(A=>{e(je({searchString:A}))},[]),h=C.useCallback((A,T)=>{e(je({sortKey:T,sortOrder:A}))},[]),f=C.useCallback(A=>{a(`./${A}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=C.useCallback(A=>{e(je({downloadState:A}))},[]),y=C.useCallback((A,T)=>{},[]),b=C.useCallback((A,T)=>{e(je({selectedDate:A,agingDateSelectionType:T})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:E,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:b,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Eo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=B.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Ye()}),[]),c=C.useMemo(()=>r!=null?Gt(r):he(),[r]),m=N(),h=Z(),f=S(F=>Qa(F,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Ja(o,c))},[c]),y=C.useCallback(()=>{h("../../",{relative:"path"})},[]),b=C.useCallback((F,I)=>{m(Dt({sortKey:F,sortOrder:I}))},[]),A=C.useCallback(F=>{m(Dt({downloadState:F}))},[]),T=C.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const I=ga({id:F.transactionId,type:F.transactionType},d);h(I);const z=D(p.state?.pathnameStackToGoBack,p.pathname);h(I,{state:{pathnameStackToGoBack:z}})}},[d,e]),M=C.useCallback(()=>{f.customer!=null&&E.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:E,onTransactionClick:T,onReload:k,onBackClick:y,onColumnSortConfigChanged:b,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=N(),a=Z(),t=S(b=>Wa(b)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AR Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S(b=>L(b)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Ye()}),[]),_=t.arAgingUIState.selectedDate??he(),g=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{g()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(b=>{e(Me({searchString:b}))},[]),m=C.useCallback((b,A)=>{e(Me({sortKey:A,sortOrder:b}))},[]),h=C.useCallback(b=>{a(`./${b}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(b=>{e(Me({downloadState:b}))},[]),k=C.useCallback((b,A)=>{e(Me({selectedDate:b,agingDateSelectionType:A})),e(it(b))},[]),y=C.useCallback((b,A)=>{e(Xa({nodeId:b,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:b=>b.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:E,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ca=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?E.trackZeniAccountsCashBalancePromoClicked("Move Money"):(E.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else E.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const To=Q(function(e){const a=en(e).accountsInOrder.map((n,o)=>Ca(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:E}},_a)(ua),xo=Q(function(e){const a=on(e).accountsInOrder.map((o,r)=>Ca(o,r)),t=B.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:E}},_a)(ua);function wo(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(To,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Fo=Ct.div`
|
|
1
|
+
import{j as l}from"./liveblocks-DH0u65Kt.js";import{l as $,g as S,u as q,h as N,j as Z,k as Q,s as Ka,n as st,o as w}from"./core-DR8tDM_G.js";import{eO as L,K8 as Ye,bD as Gt,bq as he,Ll as qa,i0 as Za,Lm as wt,Ln as Ha,i3 as rt,Lo as je,Lp as Qa,i8 as Ja,Lq as Dt,Lr as Wa,ic as it,Ls as Me,Lt as Xa,ck as lt,Lu as en,Lv as tn,Ks as an,j6 as nn,Lw as on,bn as Ee,Lx as Nt,JY as ae,bc as zt,jk as $t,mD as Kt,j3 as qt,J_ as ne,JZ as H,f3 as sn,eL as rn,fl as cn,Ly as ln,Lz as dn,LA as Zt,LB as _e,tR as Ie,tS as Te,ud as fe,u7 as oe,tW as xe,LC as un,LD as mn,LE as pn,LF as Ht,LG as ke,LH as hn,dC as Ve,qm as Qt,LI as fn,LJ as gn,LK as Cn,LL as dt,Jl as ut,jA as ge,ul as mt,qu as bn,LM as _n,tT as Ft,qp as me,ql as Jt,LN as ie,LO as kn,LP as pt,Jj as ht,st as Wt,LQ as Sn,LR as yn,LS as An,LT as ft,sG as vn,LU as En,tV as Ot,ss as Xt,LV as ce,LW as In,bv as ea,up as ta,LX as Tn,LY as xn,LZ as wn,L_ as gt,uk as Dn,L$ as Fn,tU as Pt,uo as aa,M0 as le,M1 as On,M2 as Pn,M3 as na,jp as oa,mA as sa,ju as ra,my as ia,mx as ca,mw as la,rR as Rn,fb as Bn,cN as Ln,cO as jn,mt as Mn,f7 as Un,mK as Yn,Dt as Rt,M4 as Vn,M5 as Gn,M6 as Nn,M7 as zn,b5 as Ct,e_ as $n,gK as Kn,fC as qn,mE as Zn,iY as Hn,mB as Qn,mz as Jn,eU as Wn,eS as Xn}from"./zeni-epic-state-TB4o69vJ.js";import{z as B,W as J,j as D,c as E,D as K,aR as eo,s as we,aS as da,e as V,aT as to,k as De,aU as ua,y as Ge,S as j,m as ao,aV as no,aW as oo,Q as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,V as lo,aZ as uo,a_ as mo,an as po,p as ho,R as fo,a$ as go,b0 as ye}from"./index-CjFymAYP.js";import{n as bt}from"./mui-EgTXI2De.js";import{a as b}from"./sentry-Z2EfLBjp.js";import{w as fa}from"./withTransactionSidePanel-DlYx7LYJ.js";import{b as ga,t as Ce,e as se,a as _t,v as Co}from"./routePaths-BSK2K3Sa.js";import{u as W}from"./useAskAiCfoHostNavButtonProps-CT7gco_a.js";import{c as Fe,b as bo,u as _o}from"./useFetchSuggestedQuestionsWhenReady-CQWT0XHy.js";import ve from"./NotFoundScreen-DuU91hRO.js";import{t as Ca}from"./analyticsHelper-C6rQwSxW.js";import{C as ko}from"./CompanyPassportScreen-DZYGX7Ak.js";import{F as So}from"./FeaturePreviewScreen-BCjtGP_L.js";import{R as yo}from"./ReferralListScreen-Dg_jKXHY.js";import"./recharts-BN9u8kqw.js";import"./analytics-TpOPKTBE.js";import"./plaid-C9BN4j5u.js";import"./dnd-Tv7XXetM.js";import"./stripe-DMRn4zHo.js";import"./lottie-DXjy-4kQ.js";import"./lexical-XdnXYpvk.js";import"./pdf-C1ZWoPlC.js";import"./utils-CYYHm9mY.js";import"./TransactionDetailScreen-CrO7VjQP.js";import"./decodeURIComponentSafe-BRa5aIWn.js";import"./MobileAppDrawer-CKb5yG63.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]="7a534423-93f6-4d04-997d-a7320fd012fc",e._sentryDebugIdIdentifier="sentry-dbid-7a534423-93f6-4d04-997d-a7320fd012fc")}catch{}})();const Ao=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=B.getSignedInUser(),i=S(I=>I.tenantState.currentTenantId),d=S(I=>L(I)),{tenantEmailDomain:p}=$(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Ye()}),[]),m=b.useMemo(()=>r!=null?Gt(r):he(),[r]),h=N(),f=Z(),k=S(I=>qa(I,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),C=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((I,z)=>{h(wt({sortKey:I,sortOrder:z}))},[]),T=b.useCallback(I=>{h(wt({downloadState:I}))},[]),M=b.useCallback(I=>{if(e)e(I.transactionId,I.transactionType);else if(p!=null){const z=ga({id:I.transactionId,type:I.transactionType},p);f(z);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(z,{state:{pathnameStackToGoBack:de}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&E.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:E,onTransactionClick:M,onReload:y,onBackClick:C,onColumnSortConfigChanged:A,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),vo=()=>{const e=N(),a=Z(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AP Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Ye()}),[]),g=t.apAgingUIState.selectedDate??he(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(je({searchString:A}))},[]),h=b.useCallback((A,T)=>{e(je({sortKey:T,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(je({downloadState:A}))},[]),y=b.useCallback((A,T)=>{},[]),C=b.useCallback((A,T)=>{e(je({selectedDate:A,agingDateSelectionType:T})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:E,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:C,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Eo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=B.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Ye()}),[]),c=b.useMemo(()=>r!=null?Gt(r):he(),[r]),m=N(),h=Z(),f=S(F=>Qa(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Ja(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),C=b.useCallback((F,I)=>{m(Dt({sortKey:F,sortOrder:I}))},[]),A=b.useCallback(F=>{m(Dt({downloadState:F}))},[]),T=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const I=ga({id:F.transactionId,type:F.transactionType},d);h(I);const z=D(p.state?.pathnameStackToGoBack,p.pathname);h(I,{state:{pathnameStackToGoBack:z}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&E.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:E,onTransactionClick:T,onReload:k,onBackClick:y,onColumnSortConfigChanged:C,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=N(),a=Z(),t=S(C=>Wa(C)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AR Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S(C=>L(C)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Ye()}),[]),_=t.arAgingUIState.selectedDate??he(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(C=>{e(Me({searchString:C}))},[]),m=b.useCallback((C,A)=>{e(Me({sortKey:A,sortOrder:C}))},[]),h=b.useCallback(C=>{a(`./${C}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=b.useCallback(C=>{e(Me({downloadState:C}))},[]),k=b.useCallback((C,A)=>{e(Me({selectedDate:C,agingDateSelectionType:A})),e(it(C))},[]),y=b.useCallback((C,A)=>{e(Xa({nodeId:C,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:C=>C.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:E,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ba=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Ce(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?E.trackZeniAccountsCashBalancePromoClicked("Move Money"):(E.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else E.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const To=Q(function(e){const a=en(e).accountsInOrder.map((n,o)=>ba(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:E}},_a)(ua),xo=Q(function(e){const a=on(e).accountsInOrder.map((o,r)=>ba(o,r)),t=B.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:E}},_a)(ua);function wo(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(To,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Fo=bt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
-
`,Oo=
|
|
7
|
+
`,Oo=bt.div`
|
|
8
8
|
display: flex;
|
|
9
9
|
flex: 1 1 auto;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: center;
|
|
12
12
|
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
-
`;function Po({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=Z(),i=N(),d=q(),{tenantEmailDomain:p}=$(),_=ao();return l.jsxs(Fo,{children:[l.jsx(no,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:_.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:g=>{g.trim().length>=2?i(ne({searchString:g,searchOrigin:"navbar"})):g.trim().length===0&&i(H("navbar"))},onAutoCompleteEntity:g=>{n!=null&&E?.trackSearch(V.Event.search,Ro(a),g.type,g.name,n);const u=se(g,p),c=D(d.state?.pathnameStackToGoBack,d.pathname);s(u,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:l.jsx(oo,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),l.jsx(Oo,{children:a==="cash_balance"?l.jsx(wo,{}):l.jsx(Do,{})})]})}function Bt(){const e=q(),a=N(),{useFeatureGate:t}=Ge(),{isFeatureEnabled:n}=t(j.isDepositAccountsFeatureEnabled),o=S(h=>h.cashBalanceState.fetchState),r=S(h=>h.cardBalanceState.fetchState),s=B.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=Nt((h=>{const f=zt(h,"/").split("/");return f[f.length-1]})(e.pathname));let d="Not-Started",p="";const _=K.getLocalizedStrings();switch(i){case"cash_balance":d=o,p=_.reportTitleById.cash_balance;break;case"card_balance":d=r,p=_.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:g,onAskAiCfoClick:u}=W({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});Fe({isDataReady:d==="Completed"});const c=S(h=>h.entityAutoCompleteState.autoCompleteText.navbar),m=S(h=>ae(h,"navbar"));return C.useEffect(()=>{d==="Not-Started"&&function(h,f,k){switch(f){case"card_balance":h(qt());break;case"cash_balance":h($t()),k===!0&&h(Kt());break;default:throw new Error(`balance report type ${f} is not yet supported`)}}(a,i,n)},[s,a,d]),l.jsxs(l.Fragment,{children:[d==="Completed"?l.jsx(we,{analytics:E,onLoad:h=>((f,k)=>{switch(k){case"card_balance":f.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${k}!`)}})(h,i)}):null,l.jsx(Po,{title:p,reportId:i,autoCompleteText:c,entityAutoCompleteView:m,isAiCfoAccessEnabled:g,onAskAiCfoClick:u})]})}const Ro=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Bo=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=N(),n=Z(),o=q(),{tenantEmailDomain:r}=$(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=ma(),d=so(),p=lo(d),_=Ka(),g=S(P=>sn(P)),u=g.uiState?.currentChatSessionId,c=g.allSessionsWithOrderedQuestionAnswers??Bo,m=B.getSignedInUser()?.userId,h=pa(),f=Co()&&h&&r!=null,k=ro(),y=_o(!0),b=S(P=>k!=null?rn(P,k):void 0),{useDynamicConfig:A}=Ge(),{configValue:T}=A(ha.aiCfoMessageDynamicConfig),M=C.useMemo(()=>Array.isArray(T.default_message_list)?T.default_message_list:[],[T.default_message_list]),F=C.useMemo(()=>M.slice(0,2),[M]),I=k!=null&&b!=null&&b.fetchState!=="Completed"&&b.fetchState!=="Error"&&(y||b.fetchState==="In-Progress"),z=C.useMemo(()=>{if(k==null||b?.fetchState==="Error")return F;if(I)return[];const P=(b?.suggestedQuestions??[]).map(X=>X.trim()).filter(X=>X.length>0).slice(0,2);return P.length===0?F:P},[F,I,k,b?.fetchState,b?.suggestedQuestions]),de=C.useCallback((P,X)=>{if(m==null||P.trim()==="")return;const Re=io(_.getState());if(p){const ze=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:ze,referrer:a,aiCfoInitialQuestion:P,aiCfoShouldSubmit:!Re}})}else{if(Re)return t(cn(P)),void s(!0);i(P),s(!0),co(t,P,"insights_section",u,c,m,X,void 0)}},[c,u,t,p,o.pathname,o.state,a,n,s,i,_,r,m]),Ce=C.useCallback(()=>{if(p){const P=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:P,referrer:a}})}else s(!0)},[p,o.pathname,o.state,a,n,s,r]);return C.useMemo(()=>{if(f)return{isSuggestedQuestionsLoading:I,onAskSomethingElseClick:Ce,onSuggestedQuestionClick:de,suggestedQuestions:z}},[f,I,Ce,de,z])}const Pe=uo,Lo=Q(function(e){const a=ln(e),t=dn(e),n=Zt(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=B.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),_=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${J}/statement`,authParams:g},analytics:E,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(un(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(_e({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(fe("month")),e(oe(a.firstMonthOfFY,t)),e(_e({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(_e({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(_e({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(_e({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(Pe),jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=W({mobileExploreReferrer:"DashboardCashInCashOut"}),s=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),i=S(d=>Zt(d)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},Mo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},Uo=Q(function(e){const a=mn(e),t=pn(e),n=Ht(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_position,i=B.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),_=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${J}/statement`,authParams:g},analytics:E,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(hn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ke({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ke({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Mo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(ke({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(Pe),Yo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=W({mobileExploreReferrer:"DashboardCashPosition"}),s=Oe({mobileExploreReferrer:"DashboardCashPosition"}),i=S(d=>Ht(d)).mode==="compare_mode";return l.jsx(Uo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},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 Xe(){return l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId/*",element:l.jsx(ve,{})})]})}const Vo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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=Q(function(e){const a=Qt(e),t=fn(e),n=gn(e),o=bn(e),r=dt(e),{scrollPosition:s,...i}=r,d=t.reportTitle,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(kn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ie({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ie({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(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(ie({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Vo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(ie({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ie({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(Jt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ie({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(_n({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Cn())},onResyncReports:()=>{e(mt("net_burn_or_income_by_classes"))}}})(Pe),No=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),d=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S(b=>dt(b)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(b=>pt(b.forecastState,u??"")),m=S(b=>Qt(b)),h=S(b=>ht(b)),f=S(b=>ge(b)),k=p.mode==="compare_mode",y=m.dataAvailable;return C.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const b=c?.forecastPeriod,A=y!=null&&b.endDate.isAfter(y?.endDate)===!0?y:b;a(oe(e.firstMonthOfFY,{startDate:A.endDate.startOf(g),endDate:A?.endDate}))}},[u]),l.jsx(Go,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,analytics:E,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},zo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},$o=Q(function(e){const a=Wt(e),t=Sn(e),n=yn(e),o=An(e),r=ft(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.operating_expenses,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ce({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(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(ce({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=zo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(ce({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ce({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Xt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(En({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(vn())},onResyncReports:()=>{e(mt("operating_expenses_by_classes"))}}})(Pe),Ko=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardOpEx"}),d=Oe({mobileExploreReferrer:"DashboardOpEx"}),p=S(T=>ft(T)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(T=>pt(T.forecastState,u??"")),m=S(T=>Wt(T)),h=S(T=>ht(T)),f=S(T=>ge(T)),k=p.mode==="compare_mode",y=m.dataAvailable;C.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const T=c?.forecastPeriod,M=y!=null&&T.endDate.isAfter(y?.endDate)===!0?y:T;a(oe(e.firstMonthOfFY,{startDate:M.endDate.startOf(g),endDate:M?.endDate}))}},[u]);const b=De(),A=b?.loggedInUserRole!=null&&ea(b?.loggedInUserRole)!==!0;return l.jsx($o,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:E,hasTransactionAccess:A,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},qo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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=Q(function(e){const a=ta(e),t=Tn(e),n=xn(e),o=wn(e),r=gt(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.revenue,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(On(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(le({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(le({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(le({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(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(le({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=qo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(le({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(le({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Pt({viewMode:"account_group"})),e(aa(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(le({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Pt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Fn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Dn())},onResyncReports:()=>{e(mt("revenue_by_classes"))}}})(Pe),Ho=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardRevenue"}),d=Oe({mobileExploreReferrer:"DashboardRevenue"}),p=S(y=>gt(y)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(y=>pt(y.forecastState,u??"")),m=S(y=>ta(y)).dataAvailable,h=p.mode==="compare_mode",f=S(y=>ge(y)),k=S(y=>ht(y));return C.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const y=c?.forecastPeriod,b=m!=null&&y.endDate.isAfter(m?.endDate)===!0?m:y;a(oe(e.firstMonthOfFY,{startDate:b.endDate.startOf(g),endDate:b?.endDate}))}},[u]),l.jsx(Zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:f,isCompareModeOn:h,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:E,reportsResyncFetchState:k.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Qo=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}},Jo=Q(function(e){const a=Pn(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ae(e,"navbar");return{report:a,analytics:E,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{E.trackTimeframeSwitch(ba(t),"Top Expenses"),e(na(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Qo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(mo),Wo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Jo,{tenantEmailDomain:a,location:t,navigate:n})},Xo=Ct.div`
|
|
13
|
+
`;function Po({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=Z(),i=N(),d=q(),{tenantEmailDomain:p}=$(),_=ao();return l.jsxs(Fo,{children:[l.jsx(no,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:_.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:g=>{g.trim().length>=2?i(ne({searchString:g,searchOrigin:"navbar"})):g.trim().length===0&&i(H("navbar"))},onAutoCompleteEntity:g=>{n!=null&&E?.trackSearch(V.Event.search,Ro(a),g.type,g.name,n);const u=se(g,p),c=D(d.state?.pathnameStackToGoBack,d.pathname);s(u,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:l.jsx(oo,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),l.jsx(Oo,{children:a==="cash_balance"?l.jsx(wo,{}):l.jsx(Do,{})})]})}function Bt(){const e=q(),a=N(),{useFeatureGate:t}=Ge(),{isFeatureEnabled:n}=t(j.isDepositAccountsFeatureEnabled),o=S(h=>h.cashBalanceState.fetchState),r=S(h=>h.cardBalanceState.fetchState),s=B.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=Nt((h=>{const f=zt(h,"/").split("/");return f[f.length-1]})(e.pathname));let d="Not-Started",p="";const _=K.getLocalizedStrings();switch(i){case"cash_balance":d=o,p=_.reportTitleById.cash_balance;break;case"card_balance":d=r,p=_.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:g,onAskAiCfoClick:u}=W({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});Fe({isDataReady:d==="Completed"});const c=S(h=>h.entityAutoCompleteState.autoCompleteText.navbar),m=S(h=>ae(h,"navbar"));return b.useEffect(()=>{d==="Not-Started"&&function(h,f,k){switch(f){case"card_balance":h(qt());break;case"cash_balance":h($t()),k===!0&&h(Kt());break;default:throw new Error(`balance report type ${f} is not yet supported`)}}(a,i,n)},[s,a,d]),l.jsxs(l.Fragment,{children:[d==="Completed"?l.jsx(we,{analytics:E,onLoad:h=>((f,k)=>{switch(k){case"card_balance":f.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${k}!`)}})(h,i)}):null,l.jsx(Po,{title:p,reportId:i,autoCompleteText:c,entityAutoCompleteView:m,isAiCfoAccessEnabled:g,onAskAiCfoClick:u})]})}const Ro=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Bo=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=N(),n=Z(),o=q(),{tenantEmailDomain:r}=$(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=ma(),d=so(),p=lo(d),_=Ka(),g=S(P=>sn(P)),u=g.uiState?.currentChatSessionId,c=g.allSessionsWithOrderedQuestionAnswers??Bo,m=B.getSignedInUser()?.userId,h=pa(),f=bo()&&h&&r!=null,k=ro(),y=_o(!0),C=S(P=>k!=null?rn(P,k):void 0),{useDynamicConfig:A}=Ge(),{configValue:T}=A(ha.aiCfoMessageDynamicConfig),M=b.useMemo(()=>Array.isArray(T.default_message_list)?T.default_message_list:[],[T.default_message_list]),F=b.useMemo(()=>M.slice(0,2),[M]),I=k!=null&&C!=null&&C.fetchState!=="Completed"&&C.fetchState!=="Error"&&(y||C.fetchState==="In-Progress"),z=b.useMemo(()=>{if(k==null||C?.fetchState==="Error")return F;if(I)return[];const P=(C?.suggestedQuestions??[]).map(X=>X.trim()).filter(X=>X.length>0).slice(0,2);return P.length===0?F:P},[F,I,k,C?.fetchState,C?.suggestedQuestions]),de=b.useCallback((P,X)=>{if(m==null||P.trim()==="")return;const Re=io(_.getState());if(p){const ze=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:ze,referrer:a,aiCfoInitialQuestion:P,aiCfoShouldSubmit:!Re}})}else{if(Re)return t(cn(P)),void s(!0);i(P),s(!0),co(t,P,"insights_section",u,c,m,X,void 0)}},[c,u,t,p,o.pathname,o.state,a,n,s,i,_,r,m]),be=b.useCallback(()=>{if(p){const P=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:P,referrer:a}})}else s(!0)},[p,o.pathname,o.state,a,n,s,r]);return b.useMemo(()=>{if(f)return{isSuggestedQuestionsLoading:I,onAskSomethingElseClick:be,onSuggestedQuestionClick:de,suggestedQuestions:z}},[f,I,be,de,z])}const Pe=uo,Lo=Q(function(e){const a=ln(e),t=dn(e),n=Zt(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=B.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),_=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${J}/statement`,authParams:g},analytics:E,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(un(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(_e({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(fe("month")),e(oe(a.firstMonthOfFY,t)),e(_e({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(_e({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(_e({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(_e({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(Pe),jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=W({mobileExploreReferrer:"DashboardCashInCashOut"}),s=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),i=S(d=>Zt(d)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},Mo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},Uo=Q(function(e){const a=mn(e),t=pn(e),n=Ht(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_position,i=B.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),_=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${J}/statement`,authParams:g},analytics:E,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(hn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ke({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ke({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Mo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Ce(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(ke({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(Pe),Yo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=W({mobileExploreReferrer:"DashboardCashPosition"}),s=Oe({mobileExploreReferrer:"DashboardCashPosition"}),i=S(d=>Ht(d)).mode==="compare_mode";return l.jsx(Uo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},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 Xe(){return l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId/*",element:l.jsx(ve,{})})]})}const Vo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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=Q(function(e){const a=Qt(e),t=fn(e),n=gn(e),o=Cn(e),r=dt(e),{scrollPosition:s,...i}=r,d=t.reportTitle,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(kn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ie({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ie({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(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(ie({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Vo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Ce(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(ie({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ie({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(Jt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ie({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(_n({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(bn())},onResyncReports:()=>{e(mt("net_burn_or_income_by_classes"))}}})(Pe),No=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),d=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S(C=>dt(C)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(C=>pt(C.forecastState,u??"")),m=S(C=>Qt(C)),h=S(C=>ht(C)),f=S(C=>ge(C)),k=p.mode==="compare_mode",y=m.dataAvailable;return b.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const C=c?.forecastPeriod,A=y!=null&&C.endDate.isAfter(y?.endDate)===!0?y:C;a(oe(e.firstMonthOfFY,{startDate:A.endDate.startOf(g),endDate:A?.endDate}))}},[u]),l.jsx(Go,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,analytics:E,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},zo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},$o=Q(function(e){const a=Wt(e),t=Sn(e),n=yn(e),o=An(e),r=ft(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.operating_expenses,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ce({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(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(ce({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=zo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Ce(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(ce({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ce({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Xt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(En({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(vn())},onResyncReports:()=>{e(mt("operating_expenses_by_classes"))}}})(Pe),Ko=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardOpEx"}),d=Oe({mobileExploreReferrer:"DashboardOpEx"}),p=S(T=>ft(T)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(T=>pt(T.forecastState,u??"")),m=S(T=>Wt(T)),h=S(T=>ht(T)),f=S(T=>ge(T)),k=p.mode==="compare_mode",y=m.dataAvailable;b.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const T=c?.forecastPeriod,M=y!=null&&T.endDate.isAfter(y?.endDate)===!0?y:T;a(oe(e.firstMonthOfFY,{startDate:M.endDate.startOf(g),endDate:M?.endDate}))}},[u]);const C=De(),A=C?.loggedInUserRole!=null&&ea(C?.loggedInUserRole)!==!0;return l.jsx($o,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:E,hasTransactionAccess:A,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},qo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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=Q(function(e){const a=ta(e),t=Tn(e),n=xn(e),o=wn(e),r=gt(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.revenue,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(On(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(le({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(le({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(le({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(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(le({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=qo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Ce(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(le({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(le({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Pt({viewMode:"account_group"})),e(aa(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(le({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Pt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Fn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Dn())},onResyncReports:()=>{e(mt("revenue_by_classes"))}}})(Pe),Ho=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardRevenue"}),d=Oe({mobileExploreReferrer:"DashboardRevenue"}),p=S(y=>gt(y)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(y=>pt(y.forecastState,u??"")),m=S(y=>ta(y)).dataAvailable,h=p.mode==="compare_mode",f=S(y=>ge(y)),k=S(y=>ht(y));return b.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const y=c?.forecastPeriod,C=m!=null&&y.endDate.isAfter(m?.endDate)===!0?m:y;a(oe(e.firstMonthOfFY,{startDate:C.endDate.startOf(g),endDate:C?.endDate}))}},[u]),l.jsx(Zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:f,isCompareModeOn:h,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:E,reportsResyncFetchState:k.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Qo=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}},Jo=Q(function(e){const a=Pn(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ae(e,"navbar");return{report:a,analytics:E,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{E.trackTimeframeSwitch(Ca(t),"Top Expenses"),e(na(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Qo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Ce(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(mo),Wo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Jo,{tenantEmailDomain:a,location:t,navigate:n})},Xo=bt.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
|
-
`,pe=3,kt=1;function es({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=Z(),r=q(),{tenantEmailDomain:s}=$();let i;Fe({isDataReady:!0});const d={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...d});break;case"revenue":i=l.jsx(Ho,{...d});break;case"net_burn_or_income":i=l.jsx(No,{...d});break;case"cash_position":i=l.jsx(Yo,{...d});break;case"top_expenses":i=l.jsx(Wo,{...d});break;case"cash_in_cash_out":i=l.jsx(jo,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Xo,{children:i}):null}function ee(){const e=q(),a=N(),{forecastId:t}=$();let n="Not-Started";const o=S(c=>ft(c).fetchState),r=S(c=>gt(c).fetchState),s=S(c=>dt(c).fetchState),i=S(c=>c.cashPositionState.fetchState),d=S(c=>c.topExState.fetchState),p=S(c=>c.cashInCashOutState.fetchState);if(B.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const _=S(c=>L(c)),g=_?.company?.companyInfo?.firstMonthOfFY??1,u=Nt((c=>{const m=zt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(u){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=d;break;case"cash_in_cash_out":n=p;break;default:console.error(`${u} is not supported!`)}return C.useEffect(()=>{n==="Not-Started"&&function(c,m,h,f){switch(m){case"operating_expenses":c(la(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Xt(!1,f)));break;case"revenue":c(ca(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(aa(!1,f)));break;case"net_burn_or_income":c(ia(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Jt(!1,f)));break;case"cash_position":c(ra(!0));break;case"top_expenses":c(sa());break;case"cash_in_cash_out":c(oa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,u,g,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(we,{analytics:E,onLoad:c=>((m,h)=>{const f=e.state?.referrer;switch(h){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,f);break;case"revenue":m.trackPageLoaded(V.Event.revenues,f);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,f);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,f);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,f);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,u)}):null,l.jsx(es,{firstMonthOfFY:g,fetchState:n,reportId:u,forecastId:t})]})}var et=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function tt(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ka(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 Sa(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 St={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,"-":et?173:189,"=":et?61:187,";":et?59:186,"'":222,"[":219,"]":221,"\\":220},te={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ct={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},O={},Ue=1;Ue<20;Ue++)St["f".concat(Ue)]=111+Ue;var x=[],Lt=!1,ya="all",jt=[],Ne=function(e){return St[e.toLowerCase()]||te[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Mt(e){ya=e||"all"}function Ae(){return ya||"all"}var at=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Sa(a).forEach(function(s){var i=s.split(r),d=i.length,p=i[d-1],_=p==="*"?"*":Ne(p);if(O[_]){t||(t=Ae());var g=d>1?ka(te,i):[];O[_]=O[_].filter(function(u){return!((!n||u.method===n)&&u.scope===t&&function(c,m){for(var h=c.length>=m.length?c:m,f=c.length>=m.length?m:c,k=!0,y=0;y<h.length;y++)f.indexOf(h[y])===-1&&(k=!1);return k}(u.mods,g))})}})};function Ut(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 Yt(e,a){var t=O["*"],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 h=ct[m];e[m]&&x.indexOf(h)===-1?x.push(h):!e[m]&&x.indexOf(h)>-1?x.splice(x.indexOf(h),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(h))))}),n in R){for(var o in R[n]=!0,te)te[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[ct[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=Ae();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)&&Ut(e,t[i],s,a);if(n in O){for(var d=0;d<O[n].length;d++)if((e.type==="keydown"&&O[n][d].keydown||e.type==="keyup"&&O[n][d].keyup)&&O[n][d].key){for(var p=O[n][d],_=p.splitKey,g=p.key.split(_),u=[],c=0;c<g.length;c++)u.push(Ne(g[c]));u.sort().join("")===x.sort().join("")&&Ut(e,p,s,a)}}}}function U(e,a,t){x=[];var n=Sa(e),o=[],r="all",s=document,i=0,d=!1,p=!0,_="+",g=!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&&(d=a.keyup),a.keydown!==void 0&&(p=a.keydown),a.capture!==void 0&&(g=a.capture),typeof a.splitKey=="string"&&(_=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(_)).length>1&&(o=ka(te,e)),(e=(e=e[e.length-1])==="*"?"*":Ne(e))in O||(O[e]=[]),O[e].push({keyup:d,keydown:p,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:_,element:s});s!==void 0&&!function(u){return jt.indexOf(u)>-1}(s)&&window&&(jt.push(s),tt(s,"keydown",function(u){Yt(u,s)},g),Lt||(Lt=!0,tt(window,"focus",function(){x=[]},g)),tt(s,"keyup",function(u){Yt(u,s),function(c){var m=c.keyCode||c.which||c.charCode,h=x.indexOf(m);if(h>=0&&x.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var f in R[m]=!1,te)te[f]===m&&(U[f]=!1)}(u)},g))}var nt={setScope:Mt,getScope:Ae,deleteScope:function(e,a){var t,n;for(var o in e||(e=Ae()),O)if(Object.prototype.hasOwnProperty.call(O,o))for(t=O[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Ae()===e&&Mt(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(O).forEach(function(t){var n=O[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(O).forEach(function(s){return delete O[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&at(s)});else if(typeof e=="object")e.key&&at(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=""),at({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:St,modifier:te,modifierMap:ct};for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(U[ot]=nt[ot]);if(typeof window<"u"){var ts=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=ts),U},window.hotkeys=U}U.filter=function(){return!0};var Vt=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function as(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,d=o.keydown,p=o.filterPreventDefault,_=p===void 0||p,g=o.enabled,u=g===void 0||g,c=o.enableOnContentEditable,m=c!==void 0&&c,h=C.useRef(null),f=C.useCallback(function(k,y){var b,A;return s&&!s(k)?!_:!!(Vt(k,["INPUT","TEXTAREA","SELECT"])&&!Vt(k,r)||(b=k.target)!=null&&b.isContentEditable&&!m)||!!(h.current===null||document.activeElement===h.current||(A=h.current)!=null&&A.contains(document.activeElement))&&(a(k,y),!0)},n?[h,r,s].concat(n):[h,r,s]);return C.useEffect(function(){if(u)return i&&d!==!0&&(t.keydown=!1),U(e,t||{},f),function(){return U.unbind(e,f)};U.unbind(e,f)},[f,e,u]),h}U.isPressed;const ns=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],os=(e,a,t,n,o)=>({card:{dimension:bt(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}),Se=(e,a,t,n,o)=>({card:{dimension:bt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ss=(e,a,t,n)=>Se(void 0,e,ye,a,t),rs=(e,a,t,n,o)=>({card:{dimension:bt(ye),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),is=Q(function(e,a){const t=ds(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:p,treasuryFetchState:_}=a;let g=n.map((u,c)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return ss(t,u,c);if(u==="zeni_promo_card")return Se({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ye,u,c);if(u==="treasury_promo_card")return rs(_,u,c,d,p);if(u==="information_card")return Se(void 0,"Completed",ye,u,c);{const m=o.find(h=>h?.reportId===u);return m?function(h,f,k,y){const b=h.reportId;switch(b){case"card_balance":case"cash_balance":return[os(h,f,k,b,y)];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[Se(h,f,k,b,y)];case"net_burn_or_income_story_card":return[Se(h,f,k,"net_burn_or_income_story_card",y)];default:return console.error(`card type ${b} not yet supported!`),[]}}(m,m.fetchState,ye,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(g=g.filter(u=>ns.includes(u.card.cardType)==0).filter(u=>{const c=u.data?.availableNumberOfPeriods;return c!=null?c>0:u.card.cardType!="top_expenses"||u.data==null||function(m){if(m==null||m.length===0)return!0;let h=!0;for(const f of m)if(f.balance.available.amount!==0){h=!1;break}return h}(u.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:g,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ae(e,"navbar")},analytics:E,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=B.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)E.trackDashboardCardClicked("cards promo",2),E.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&&E.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(E.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,d,p,_){switch(d){case"card_balance":i(qt());break;case"cash_balance":i($t());break;case"operating_expenses":i(la(!0));break;case"revenue":i(ca(!0));break;case"net_burn_or_income":i(ia(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(ra(!0));break;case"top_expenses":i(sa());break;case"cash_in_cash_out":i(oa());break;case"insights_dashboard":i(Qn());break;case"bill_pay_card":i(Hn());break;case"reimbursement_card":i(Zn());break;case"company_details":i(qn(p));break;case"task_card":i(Kn());break;case"accounts_payable_aging":_.includes("accounts_payable_aging")===!1&&i(rt(he()));break;case"accounts_receivable_aging":i(it(he()));break;case"zeni_accounts_promo_card":_.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":_.includes("rewards_card")===!1&&i($n(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{E.trackTimeframeSwitch(ba(r),ls(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(fe(d));break;case"top_expenses":s(na(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(zn(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=D(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=D(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=D(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){B.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=D(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"&&(E.trackUpdateBurnRateCalculatorSettings(r,s,Gn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Rt())},onVideoClose:()=>{e(Rt()),e(Vn())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ne({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(H("navbar"))},onCancelAutoComplete:()=>{e(H("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?se(o,a.tenantEmailDomain):bo(o.zeniId,o.qboId,a.tenantEmailDomain);const s=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(go);function cs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=ma(),t=Z(),n=N(),o=q(),r=B.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ge(),d=Ee(r),[p,_]=C.useState(!1),[g,u]=C.useState(!1),c=pa(),{tenantEmailDomain:m}=$(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:f}=W({mobileExploreReferrer:"Dashboard"}),k=S(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?L(v):void 0),y=k??B.getSignedInUserTenant(m),b=y.tenantId,A=y.companyId;C.useEffect(()=>{p===!1&&o.state?.message==="activation"&&(n(Rn(A)),_(!0))},[o.state,p,A,n]),C.useEffect(()=>{c&&!g&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),u(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,g,c,a,t,o.pathname]);const{isFeatureEnabled:T}=s(j.isApAgingFeatureEnabled),{isFeatureEnabled:M}=s(j.isExpenseAutomationEnabled),{isFeatureEnabled:F}=s(j.isExpenseAutomationEnabledV2),I=F||M&&d,{isFeatureEnabled:z}=s(j.isTreasuryEnabled),de=po(I),{isFeatureEnabled:Ce}=s(j.isArAgingFeatureEnabled),{isFeatureEnabled:P}=s(j.isDepositAccountsFeatureEnabled),{isFeatureEnabled:X}=s(j.isReferralFeatureEnabled),{isFeatureEnabled:Re}=s(j.isChargeCardFeatureEnabled),{isFeatureEnabled:ze}=s(j.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Aa}=s(j.isDashboardSidebarNewYearAnimationEnabled),{configValue:yt}=i(ha.zeniCardsConfig),va=yt.charge_card_cashback_rate_per_transaction==null?.0175:yt.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const v=ho(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[At,Ea]=C.useState(!1),[$e,Ia]=C.useState(!1);as("command+p, Control+p",v=>{Ia(!$e),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[$e]);const vt=k?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const re=S(v=>L(v)?.excludedResources),Ta=S(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),xa=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,Da=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Fa=k?.company!=null&&Bn(k.company),Ke=z&&Fa,qe=De(),Oa=lt(qe?.loggedInUserRoleMap),Y=[],Et=re?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,Pa=re?.resources?.find(v=>v.resource==="/reports/task_card")==null,Ze=k?.userRole!=null&&ea(k?.userRole),Ra=re?.resources?.find(v=>v.resource==="/bills")==null&&!Ze,Ba=re?.resources?.find(v=>v.resource==="/reimbursements")==null,La=Ln(qe?.loggedInUserRoleMap),ja=jn(qe?.loggedInUserRoleMap),Ma=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ua=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ya=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;Et===!1&&Y.push("top_expenses"),Pa===!1&&Y.push("task_card"),Ra===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),T===!1&&Y.push("accounts_payable_aging"),Ce===!1&&Y.push("accounts_receivable_aging"),(I===!1||Ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),P===!1&&Y.push("zeni_accounts_promo_card"),X===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:It}=fo();C.useLayoutEffect(()=>{At&&de===I||vt!==!0||!It||re?.fetchState!=="Completed"&&re?.fetchState!=="Error"||(Ea(!0),n(Mn(r.userId,A,b,!0,!1,Y)))},[At,r,b,n,Et,vt,re?.fetchState,It]);const Va=S(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Ga=S(v=>v.revenueState.uiState.selectedForecast?.id),Na=S(v=>v.cardBalanceState.fetchState),ue=S(v=>Un(v,Y,r,F,M,Ke)),za=ue.fetchState;Fe({isDataReady:!0});const Tt=k?.isTreasuryVideoViewed===!0||ue.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[za==="Completed"?l.jsx(we,{analytics:E,onLoad:v=>{v.trackPageLoaded(V.Event.dashboard),Ke&&!Tt&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(is,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:f,onDragAndDropCard:(v,$a)=>{const xt=function(Be,He,Le){const Qe=Le.indexOf(Be),Je=Le.indexOf(He);if(Qe===-1||Je===-1||Qe===Je)return Le;const We=[...Le];return We.splice(Qe,1),We.splice(Je,0,Be),We}(v,$a,ue.cardsOrdered);xt.some((Be,He)=>Be!==ue.cardsOrdered[He])&&n(Yn(xt))},dashboardReport:ue,passedCardsOrdered:ue.cardsForDashboardUI,tenantId:b,companyId:A,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:Ce,isBillPayEnabled:wa,isReimbursementEnabled:xa,isSummaryCardsFiltered:$e,isForecastOn:Va,selectedForecastOnDashboard:Ga,isVisitingFirstTime:p,isZeniAccountEnabled:P,isRewardsFeatureEnabled:X,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:I&&Ze===!1,selectedPeriod:Ta[b],isChargeCardFeatureEnabled:Re,isUserHasCardsAccess:La,isUserHasTreasuryAccess:ja,cardsCreditLimit:Ma,cashbackRate:va,isInterestedInChargeCard:Ua,cardBalanceFetchState:Na,christmasAnimationEnabled:ze,newYearAnimationEnabled:Aa,treasuryFundDetails:Ya,hasUserSeenTreasuryVideo:Tt,treasuryFetchState:Da})]})}const ls=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"},ds=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function Ms(){const e=De(),a=e?.excludedResources?.find(p=>p.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ge(),{isFeatureEnabled:n}=t(j.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(j.isArAgingFeatureEnabled),r=S(p=>L(p)),{isFeatureEnabled:s}=t(j.isDebitCardFeatureEnabled),i=Wn(s,r),d=Xn(r);return i===!0||d===!0?l.jsx(st,{children:l.jsx(w,{path:"/*",element:l.jsx(So,{})})}):l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(cs,{})}),l.jsx(w,{path:"cash_balance/*",element:l.jsx(Bt,{})}),l.jsx(w,{path:"card_balance/*",element:l.jsx(Bt,{})}),l.jsx(w,{path:"operating_expenses/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"operating_expenses/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"revenue/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"revenue/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"net_burn_or_income/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"net_burn_or_income/*",element:l.jsx(ee,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_payable_aging/*",element:l.jsx(vo,{})}),l.jsx(w,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(Ao,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(Eo,{})}),l.jsx(w,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(w,{path:"cash_position/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"top_expenses/*",element:a===!0?l.jsx(ee,{}):l.jsx(ve,{})}),l.jsx(w,{path:"cash_in_cash_out/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"company_details",element:l.jsx(ko,{})}),l.jsx(w,{path:"referrals/*",element:l.jsx(yo,{})}),l.jsx(w,{path:"*",element:l.jsx(ve,{})})]})}export{Ms as default};
|
|
20
|
+
`,pe=3,kt=1;function es({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=Z(),r=q(),{tenantEmailDomain:s}=$();let i;Fe({isDataReady:!0});const d={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...d});break;case"revenue":i=l.jsx(Ho,{...d});break;case"net_burn_or_income":i=l.jsx(No,{...d});break;case"cash_position":i=l.jsx(Yo,{...d});break;case"top_expenses":i=l.jsx(Wo,{...d});break;case"cash_in_cash_out":i=l.jsx(jo,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Xo,{children:i}):null}function ee(){const e=q(),a=N(),{forecastId:t}=$();let n="Not-Started";const o=S(c=>ft(c).fetchState),r=S(c=>gt(c).fetchState),s=S(c=>dt(c).fetchState),i=S(c=>c.cashPositionState.fetchState),d=S(c=>c.topExState.fetchState),p=S(c=>c.cashInCashOutState.fetchState);if(B.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const _=S(c=>L(c)),g=_?.company?.companyInfo?.firstMonthOfFY??1,u=Nt((c=>{const m=zt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(u){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=d;break;case"cash_in_cash_out":n=p;break;default:console.error(`${u} is not supported!`)}return b.useEffect(()=>{n==="Not-Started"&&function(c,m,h,f){switch(m){case"operating_expenses":c(la(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Xt(!1,f)));break;case"revenue":c(ca(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(aa(!1,f)));break;case"net_burn_or_income":c(ia(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Jt(!1,f)));break;case"cash_position":c(ra(!0));break;case"top_expenses":c(sa());break;case"cash_in_cash_out":c(oa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,u,g,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(we,{analytics:E,onLoad:c=>((m,h)=>{const f=e.state?.referrer;switch(h){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,f);break;case"revenue":m.trackPageLoaded(V.Event.revenues,f);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,f);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,f);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,f);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,u)}):null,l.jsx(es,{firstMonthOfFY:g,fetchState:n,reportId:u,forecastId:t})]})}var et=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function tt(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ka(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 Sa(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 St={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,"-":et?173:189,"=":et?61:187,";":et?59:186,"'":222,"[":219,"]":221,"\\":220},te={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ct={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},O={},Ue=1;Ue<20;Ue++)St["f".concat(Ue)]=111+Ue;var x=[],Lt=!1,ya="all",jt=[],Ne=function(e){return St[e.toLowerCase()]||te[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Mt(e){ya=e||"all"}function Ae(){return ya||"all"}var at=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Sa(a).forEach(function(s){var i=s.split(r),d=i.length,p=i[d-1],_=p==="*"?"*":Ne(p);if(O[_]){t||(t=Ae());var g=d>1?ka(te,i):[];O[_]=O[_].filter(function(u){return!((!n||u.method===n)&&u.scope===t&&function(c,m){for(var h=c.length>=m.length?c:m,f=c.length>=m.length?m:c,k=!0,y=0;y<h.length;y++)f.indexOf(h[y])===-1&&(k=!1);return k}(u.mods,g))})}})};function Ut(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 Yt(e,a){var t=O["*"],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 h=ct[m];e[m]&&x.indexOf(h)===-1?x.push(h):!e[m]&&x.indexOf(h)>-1?x.splice(x.indexOf(h),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(h))))}),n in R){for(var o in R[n]=!0,te)te[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[ct[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=Ae();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)&&Ut(e,t[i],s,a);if(n in O){for(var d=0;d<O[n].length;d++)if((e.type==="keydown"&&O[n][d].keydown||e.type==="keyup"&&O[n][d].keyup)&&O[n][d].key){for(var p=O[n][d],_=p.splitKey,g=p.key.split(_),u=[],c=0;c<g.length;c++)u.push(Ne(g[c]));u.sort().join("")===x.sort().join("")&&Ut(e,p,s,a)}}}}function U(e,a,t){x=[];var n=Sa(e),o=[],r="all",s=document,i=0,d=!1,p=!0,_="+",g=!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&&(d=a.keyup),a.keydown!==void 0&&(p=a.keydown),a.capture!==void 0&&(g=a.capture),typeof a.splitKey=="string"&&(_=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(_)).length>1&&(o=ka(te,e)),(e=(e=e[e.length-1])==="*"?"*":Ne(e))in O||(O[e]=[]),O[e].push({keyup:d,keydown:p,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:_,element:s});s!==void 0&&!function(u){return jt.indexOf(u)>-1}(s)&&window&&(jt.push(s),tt(s,"keydown",function(u){Yt(u,s)},g),Lt||(Lt=!0,tt(window,"focus",function(){x=[]},g)),tt(s,"keyup",function(u){Yt(u,s),function(c){var m=c.keyCode||c.which||c.charCode,h=x.indexOf(m);if(h>=0&&x.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var f in R[m]=!1,te)te[f]===m&&(U[f]=!1)}(u)},g))}var nt={setScope:Mt,getScope:Ae,deleteScope:function(e,a){var t,n;for(var o in e||(e=Ae()),O)if(Object.prototype.hasOwnProperty.call(O,o))for(t=O[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Ae()===e&&Mt(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(O).forEach(function(t){var n=O[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(O).forEach(function(s){return delete O[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&at(s)});else if(typeof e=="object")e.key&&at(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=""),at({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:St,modifier:te,modifierMap:ct};for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(U[ot]=nt[ot]);if(typeof window<"u"){var ts=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=ts),U},window.hotkeys=U}U.filter=function(){return!0};var Vt=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function as(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,d=o.keydown,p=o.filterPreventDefault,_=p===void 0||p,g=o.enabled,u=g===void 0||g,c=o.enableOnContentEditable,m=c!==void 0&&c,h=b.useRef(null),f=b.useCallback(function(k,y){var C,A;return s&&!s(k)?!_:!!(Vt(k,["INPUT","TEXTAREA","SELECT"])&&!Vt(k,r)||(C=k.target)!=null&&C.isContentEditable&&!m)||!!(h.current===null||document.activeElement===h.current||(A=h.current)!=null&&A.contains(document.activeElement))&&(a(k,y),!0)},n?[h,r,s].concat(n):[h,r,s]);return b.useEffect(function(){if(u)return i&&d!==!0&&(t.keydown=!1),U(e,t||{},f),function(){return U.unbind(e,f)};U.unbind(e,f)},[f,e,u]),h}U.isPressed;const ns=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],os=(e,a,t,n,o)=>({card:{dimension:Ct(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}),Se=(e,a,t,n,o)=>({card:{dimension:Ct(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ss=(e,a,t,n)=>Se(void 0,e,ye,a,t),rs=(e,a,t,n,o)=>({card:{dimension:Ct(ye),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),is=Q(function(e,a){const t=ds(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:p,treasuryFetchState:_}=a;let g=n.map((u,c)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return ss(t,u,c);if(u==="zeni_promo_card")return Se({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ye,u,c);if(u==="treasury_promo_card")return rs(_,u,c,d,p);if(u==="information_card")return Se(void 0,"Completed",ye,u,c);{const m=o.find(h=>h?.reportId===u);return m?function(h,f,k,y){const C=h.reportId;switch(C){case"card_balance":case"cash_balance":return[os(h,f,k,C,y)];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[Se(h,f,k,C,y)];case"net_burn_or_income_story_card":return[Se(h,f,k,"net_burn_or_income_story_card",y)];default:return console.error(`card type ${C} not yet supported!`),[]}}(m,m.fetchState,ye,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(g=g.filter(u=>ns.includes(u.card.cardType)==0).filter(u=>{const c=u.data?.availableNumberOfPeriods;return c!=null?c>0:u.card.cardType!="top_expenses"||u.data==null||function(m){if(m==null||m.length===0)return!0;let h=!0;for(const f of m)if(f.balance.available.amount!==0){h=!1;break}return h}(u.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:g,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ae(e,"navbar")},analytics:E,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=B.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)E.trackDashboardCardClicked("cards promo",2),E.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&&E.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(E.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,d,p,_){switch(d){case"card_balance":i(qt());break;case"cash_balance":i($t());break;case"operating_expenses":i(la(!0));break;case"revenue":i(ca(!0));break;case"net_burn_or_income":i(ia(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(ra(!0));break;case"top_expenses":i(sa());break;case"cash_in_cash_out":i(oa());break;case"insights_dashboard":i(Qn());break;case"bill_pay_card":i(Hn());break;case"reimbursement_card":i(Zn());break;case"company_details":i(qn(p));break;case"task_card":i(Kn());break;case"accounts_payable_aging":_.includes("accounts_payable_aging")===!1&&i(rt(he()));break;case"accounts_receivable_aging":i(it(he()));break;case"zeni_accounts_promo_card":_.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":_.includes("rewards_card")===!1&&i($n(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{E.trackTimeframeSwitch(Ca(r),ls(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(fe(d));break;case"top_expenses":s(na(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(zn(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=D(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=D(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=D(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){B.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=D(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"&&(E.trackUpdateBurnRateCalculatorSettings(r,s,Gn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Rt())},onVideoClose:()=>{e(Rt()),e(Vn())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ne({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(H("navbar"))},onCancelAutoComplete:()=>{e(H("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?se(o,a.tenantEmailDomain):Co(o.zeniId,o.qboId,a.tenantEmailDomain);const s=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(go);function cs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=ma(),t=Z(),n=N(),o=q(),r=B.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ge(),d=Ee(r),[p,_]=b.useState(!1),[g,u]=b.useState(!1),c=pa(),{tenantEmailDomain:m}=$(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:f}=W({mobileExploreReferrer:"Dashboard"}),k=S(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?L(v):void 0),y=k??B.getSignedInUserTenant(m),C=y.tenantId,A=y.companyId;b.useEffect(()=>{p===!1&&o.state?.message==="activation"&&(n(Rn(A)),_(!0))},[o.state,p,A,n]),b.useEffect(()=>{c&&!g&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),u(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,g,c,a,t,o.pathname]);const{isFeatureEnabled:T}=s(j.isApAgingFeatureEnabled),{isFeatureEnabled:M}=s(j.isExpenseAutomationEnabled),{isFeatureEnabled:F}=s(j.isExpenseAutomationEnabledV2),I=F||M&&d,{isFeatureEnabled:z}=s(j.isTreasuryEnabled),de=po(I),{isFeatureEnabled:be}=s(j.isArAgingFeatureEnabled),{isFeatureEnabled:P}=s(j.isDepositAccountsFeatureEnabled),{isFeatureEnabled:X}=s(j.isReferralFeatureEnabled),{isFeatureEnabled:Re}=s(j.isChargeCardFeatureEnabled),{isFeatureEnabled:ze}=s(j.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Aa}=s(j.isDashboardSidebarNewYearAnimationEnabled),{configValue:yt}=i(ha.zeniCardsConfig),va=yt.charge_card_cashback_rate_per_transaction==null?.0175:yt.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const v=ho(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[At,Ea]=b.useState(!1),[$e,Ia]=b.useState(!1);as("command+p, Control+p",v=>{Ia(!$e),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[$e]);const vt=k?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const re=S(v=>L(v)?.excludedResources),Ta=S(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),xa=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,Da=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Fa=k?.company!=null&&Bn(k.company),Ke=z&&Fa,qe=De(),Oa=lt(qe?.loggedInUserRoleMap),Y=[],Et=re?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,Pa=re?.resources?.find(v=>v.resource==="/reports/task_card")==null,Ze=k?.userRole!=null&&ea(k?.userRole),Ra=re?.resources?.find(v=>v.resource==="/bills")==null&&!Ze,Ba=re?.resources?.find(v=>v.resource==="/reimbursements")==null,La=Ln(qe?.loggedInUserRoleMap),ja=jn(qe?.loggedInUserRoleMap),Ma=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ua=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ya=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;Et===!1&&Y.push("top_expenses"),Pa===!1&&Y.push("task_card"),Ra===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),T===!1&&Y.push("accounts_payable_aging"),be===!1&&Y.push("accounts_receivable_aging"),(I===!1||Ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),P===!1&&Y.push("zeni_accounts_promo_card"),X===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:It}=fo();b.useLayoutEffect(()=>{At&&de===I||vt!==!0||!It||re?.fetchState!=="Completed"&&re?.fetchState!=="Error"||(Ea(!0),n(Mn(r.userId,A,C,!0,!1,Y)))},[At,r,C,n,Et,vt,re?.fetchState,It]);const Va=S(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Ga=S(v=>v.revenueState.uiState.selectedForecast?.id),Na=S(v=>v.cardBalanceState.fetchState),ue=S(v=>Un(v,Y,r,F,M,Ke)),za=ue.fetchState;Fe({isDataReady:!0});const Tt=k?.isTreasuryVideoViewed===!0||ue.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[za==="Completed"?l.jsx(we,{analytics:E,onLoad:v=>{v.trackPageLoaded(V.Event.dashboard),Ke&&!Tt&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(is,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:f,onDragAndDropCard:(v,$a)=>{const xt=function(Be,He,Le){const Qe=Le.indexOf(Be),Je=Le.indexOf(He);if(Qe===-1||Je===-1||Qe===Je)return Le;const We=[...Le];return We.splice(Qe,1),We.splice(Je,0,Be),We}(v,$a,ue.cardsOrdered);xt.some((Be,He)=>Be!==ue.cardsOrdered[He])&&n(Yn(xt))},dashboardReport:ue,passedCardsOrdered:ue.cardsForDashboardUI,tenantId:C,companyId:A,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:be,isBillPayEnabled:wa,isReimbursementEnabled:xa,isSummaryCardsFiltered:$e,isForecastOn:Va,selectedForecastOnDashboard:Ga,isVisitingFirstTime:p,isZeniAccountEnabled:P,isRewardsFeatureEnabled:X,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:I&&Ze===!1,selectedPeriod:Ta[C],isChargeCardFeatureEnabled:Re,isUserHasCardsAccess:La,isUserHasTreasuryAccess:ja,cardsCreditLimit:Ma,cashbackRate:va,isInterestedInChargeCard:Ua,cardBalanceFetchState:Na,christmasAnimationEnabled:ze,newYearAnimationEnabled:Aa,treasuryFundDetails:Ya,hasUserSeenTreasuryVideo:Tt,treasuryFetchState:Da})]})}const ls=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"},ds=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function Ms(){const e=De(),a=e?.excludedResources?.find(p=>p.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ge(),{isFeatureEnabled:n}=t(j.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(j.isArAgingFeatureEnabled),r=S(p=>L(p)),{isFeatureEnabled:s}=t(j.isDebitCardFeatureEnabled),i=Wn(s,r),d=Xn(r);return i===!0||d===!0?l.jsx(st,{children:l.jsx(w,{path:"/*",element:l.jsx(So,{})})}):l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(cs,{})}),l.jsx(w,{path:"cash_balance/*",element:l.jsx(Bt,{})}),l.jsx(w,{path:"card_balance/*",element:l.jsx(Bt,{})}),l.jsx(w,{path:"operating_expenses/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"operating_expenses/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"revenue/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"revenue/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"net_burn_or_income/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"net_burn_or_income/*",element:l.jsx(ee,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_payable_aging/*",element:l.jsx(vo,{})}),l.jsx(w,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(Ao,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(Eo,{})}),l.jsx(w,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(w,{path:"cash_position/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"top_expenses/*",element:a===!0?l.jsx(ee,{}):l.jsx(ve,{})}),l.jsx(w,{path:"cash_in_cash_out/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"company_details",element:l.jsx(ko,{})}),l.jsx(w,{path:"referrals/*",element:l.jsx(yo,{})}),l.jsx(w,{path:"*",element:l.jsx(ve,{})})]})}export{Ms as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-DH0u65Kt.js";import{a as u}from"./sentry-Z2EfLBjp.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-DR8tDM_G.js";import{IO as N,eO as _,fj as U,IP as L,mv as O,IQ as R}from"./zeni-epic-state-TB4o69vJ.js";import{u as z,z as f,L as T,t as S,D as j,b as $}from"./index-CjFymAYP.js";import"./mui-EgTXI2De.js";import{t as P}from"./getLocaleForTenant-DmihGqyc.js";import"./recharts-BN9u8kqw.js";import"./analytics-TpOPKTBE.js";import"./plaid-C9BN4j5u.js";import"./dnd-Tv7XXetM.js";import"./stripe-DMRn4zHo.js";import"./lottie-DXjy-4kQ.js";import"./lexical-XdnXYpvk.js";import"./pdf-C1ZWoPlC.js";import"./utils-CYYHm9mY.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]="ba04bac4-2a9e-46f5-a872-db8f8cb6a481",t._sentryDebugIdIdentifier="sentry-dbid-ba04bac4-2a9e-46f5-a872-db8f8cb6a481")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:R(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=$(c,p);return v.jsx(k,{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}=z(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&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(O(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const 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-D0FJ0DFE.js → DomesticWireDetailScreen-DOvHZ_oC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-DH0u65Kt.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DR8tDM_G.js";import{MR as k,MY as _,fA as J,fz as Q,fy as W,ix as Y,JZ as q,pF as K,eO as V,Mn as D,iv as F,MS as S,M$ as T,it as G,iQ as j}from"./zeni-epic-state-TB4o69vJ.js";import{bn as L,Z as R,y as N,z as U,m as Z,p,S as v,B as M,bo as X,o as O,bp as ee,j as te}from"./index-CjFymAYP.js";import{n as z}from"./mui-EgTXI2De.js";import"./sentry-Z2EfLBjp.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]="0781d8c8-4318-4fa1-b554-bfe8596adffa",e._sentryDebugIdIdentifier="sentry-dbid-0781d8c8-4318-4fa1-b554-bfe8596adffa")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(Y(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(Q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(L);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,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-6nZkQHFl.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),i=s.poppedPathname??E();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(T({data:i}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??E(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(X);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),c=e??s,{useFeatureGate:r}=N(),d=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,c)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(d==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:c,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(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,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 Se(e,t,n){return $(e,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(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-6nZkQHFl.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
|
+
`,ie=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:i}=t,{tenantEmailDomain:c}=i;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:d}=r;e(T({data:d}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),d=r.poppedPathname??P();a(d,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const d=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(d,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),d=r.poppedPathname??P(0);t.navigate(d,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),c=e??s,r=U.getSignedInUser(),{useFeatureGate:d}=N(),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,c)),{isFeatureEnabled:I}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.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:c,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(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,ve as d,he as g,ge as i,Se as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-DH0u65Kt.js";import{Z as l,C as c,m as f}from"./index-CjFymAYP.js";import{D as p}from"./mui-EgTXI2De.js";import"./sentry-Z2EfLBjp.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]="f8ace2f2-59d3-4d7c-88a8-3d7139be3b09",e._sentryDebugIdIdentifier="sentry-dbid-f8ace2f2-59d3-4d7c-88a8-3d7139be3b09")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),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{m as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DH0u65Kt.js";import{a as d}from"./sentry-Z2EfLBjp.js";import{j as B,h as G,u as q,l as O,g as l,N as F,k as _,n as N,o as z}from"./core-DR8tDM_G.js";import{L4 as H,eO as J,Kt as K,kA as Y,H2 as k,L9 as L,JY as M,jA as R,H3 as S,Ky as W,Kz as $,J_ as V,JZ as Z}from"./zeni-epic-state-TB4o69vJ.js";import{aO as Q,c as U,p as X,j as tt}from"./index-CjFymAYP.js";import"./mui-EgTXI2De.js";import{d as b}from"./decodeURIComponentSafe-BRa5aIWn.js";import{w as et}from"./withTransactionSidePanel-DlYx7LYJ.js";import{e as at,b as nt}from"./routePaths-BSK2K3Sa.js";import"./recharts-BN9u8kqw.js";import"./analytics-TpOPKTBE.js";import"./plaid-C9BN4j5u.js";import"./dnd-Tv7XXetM.js";import"./stripe-DMRn4zHo.js";import"./lottie-DXjy-4kQ.js";import"./lexical-XdnXYpvk.js";import"./pdf-C1ZWoPlC.js";import"./utils-CYYHm9mY.js";import"./useAskAiCfoHostNavButtonProps-CT7gco_a.js";import"./useFetchSuggestedQuestionsWhenReady-CQWT0XHy.js";import"./TransactionDetailScreen-CrO7VjQP.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]="9ed777a8-ba8e-4435-b0c9-32284e6e9ab9",a._sentryDebugIdIdentifier="sentry-dbid-9ed777a8-ba8e-4435-b0c9-32284e6e9ab9")}catch{}})();const ot=_(function(a,t){const e=t.entity,o=L(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:M(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:R(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(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Z("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(W()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(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(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=O(),r=b(j??""),p=b(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=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(Y(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,A=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(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{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(N,{children:s.jsx(z,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
|