@zeniai/web-app-ui 5.1.95-qa → 5.1.96-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-CewQvCq1.js +1 -0
- package/dist/assets/{AddressScreen-60Qj_YsR.js → AddressScreen-Bf6z05aj.js} +2 -2
- package/dist/assets/{AiCfoScreen-Di0AIuiw.js → AiCfoScreen-hpWqSyVv.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DYpPCevA.js → BillPayApprovalRoutes-Ckx826UI.js} +1 -1
- package/dist/assets/{BillPayRoutes-Bu0-qZ-c.js → BillPayRoutes-CKYTkGee.js} +17 -17
- package/dist/assets/{BusinessVerificationPageScreen-BJQI2dfg.js → BusinessVerificationPageScreen-NHYnfNWv.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-DZM91jF5.js → CardsAiCfoScreen-BK4WjShZ.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-BAl2IXHY.js → ChargeCardRoutes-blMP2Zfr.js} +10 -10
- package/dist/assets/{CompanyPassportScreen-BqFRrI6s.js → CompanyPassportScreen-D4bAa7oB.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-2EM3kmCX.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CtP5GG_m.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BF11xENe.js → CustomerOnboardingRoutes-DKJRjfSQ.js} +7 -7
- package/dist/assets/{DashboardRoutes-21HP5X_L.js → DashboardRoutes-DI74i-ae.js} +4 -4
- package/dist/assets/{DefaultTenantHome-DFLplybG.js → DefaultTenantHome-DVGmQ0LO.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-CKua19CI.js +18 -0
- package/dist/assets/{DrawerScreen-BUPBRQzG.js → DrawerScreen-BbfxfoZt.js} +1 -1
- package/dist/assets/EntityDetailRoutes-Dt2dByW5.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CVoR9HYp.js → ExpenseAutomationRoutes-DNryC1u1.js} +3 -3
- package/dist/assets/{FeaturePreviewScreen-Cwp5VJhY.js → FeaturePreviewScreen-BCluNQT9.js} +1 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-B-T1yq1e.js +1 -0
- package/dist/assets/{MagicLinkRoutes-BDpBWVZh.js → MagicLinkRoutes-CNq4fGE1.js} +17 -17
- package/dist/assets/MagicLinkSignInScreen-Dbjp_w_B.js +12 -0
- package/dist/assets/{MobileAppDrawer-zPhOmrIU.js → MobileAppDrawer-B31HXetk.js} +1 -1
- package/dist/assets/NotFoundScreen-Cc3hICVQ.js +1 -0
- package/dist/assets/{NotificationRoutes-Cdv9W6jW.js → NotificationRoutes-dtkj3nej.js} +1 -1
- package/dist/assets/OAuthConsentScreen-BOjPwGFz.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-ek3HUoVb.js +1 -0
- package/dist/assets/PeopleRoutes-mpWefUzK.js +22 -0
- package/dist/assets/PerformanceRoutes-DaiSgudg.js +1 -0
- package/dist/assets/{Preview-D7PPqlLr.js → Preview-K3T9DlYV.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-QhaMmbnN.js → QBOConnectionScreen-BuUxb8jy.js} +1 -1
- package/dist/assets/ReferralListScreen-CSEitR2_.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-OfO6QOTb.js → ReimbursementApprovalRoutes-Gp2otsO5.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C909zELF.js → ReimbursementApprovalRuleDetailScreen-DWSQ5fho.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-D7NThH82.js → ReimbursementRoutes-k1nILFA3.js} +11 -11
- package/dist/assets/{ReportsRoutes-C3CvAXR5.js → ReportsRoutes-BF3euNVO.js} +1 -1
- package/dist/assets/RewardsRoutes-CABV08Kz.js +1 -0
- package/dist/assets/{ScreenRoutes-Bi_xt3-M.js → ScreenRoutes-PRaRdjI-.js} +2 -2
- package/dist/assets/{SettingsRoutes-Cpq8r6km.js → SettingsRoutes-Cja67c6S.js} +8 -8
- package/dist/assets/{SetupPagesScreen-BDROUOA_.js → SetupPagesScreen-Cd49Na2T.js} +5 -5
- package/dist/assets/SignInScreen-4dz8lFo3.js +1 -0
- package/dist/assets/SignOutScreen-DKrrBM1h.js +9 -0
- package/dist/assets/{TaskListScreen-ey3bya3t.js → TaskListScreen-DL_nQ0pc.js} +2 -2
- package/dist/assets/TaskRoutes-DOx1ej7V.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-DGUPG-G4.js → TransactionDetailRoutes-O78W-_gh.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BB5tBHdE.js → TransactionDetailScreen-IXeieJAZ.js} +2 -2
- package/dist/assets/{TransactionListRoutes-D1CLAZ1r.js → TransactionListRoutes-BpRRzlki.js} +1 -1
- package/dist/assets/{TreasuryRoutes-Dw2aLpt8.js → TreasuryRoutes-BqNgWhqu.js} +6 -6
- package/dist/assets/{VendorsRoutes-D1DStejL.js → VendorsRoutes-DFr8Q9Uz.js} +13 -13
- package/dist/assets/WiseConfirmationScreen-AsYtK2S5.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DqgQBbks.js → ZeniAccountRoutes-Clu4CNh1.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-uDm1gv9G.js +9 -0
- package/dist/assets/{accountMappingHelper-ut7GsrYE.js → accountMappingHelper-CsZH9NCw.js} +1 -1
- package/dist/assets/{analytics-JEmFuY6G.js → analytics-bPb2gemn.js} +1 -1
- package/dist/assets/{analyticsHelper-B5fcdQll.js → analyticsHelper-D-aKdeNy.js} +1 -1
- package/dist/assets/{core-BSTuY0H-.js → core-DwNLEOUU.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BNCMkOsy.js → decodeURIComponentSafe-ZRjeK6SK.js} +1 -1
- package/dist/assets/{dnd-dl03JNeH.js → dnd-DpYxHMns.js} +1 -1
- package/dist/assets/{empty-DnsKiXU9.js → empty-DDyPKwd4.js} +1 -1
- package/dist/assets/{empty-DYmrXdfl.js → empty-DIi3YpRJ.js} +1 -1
- package/dist/assets/{emptyVideoElement-B3t4QYSU.js → emptyVideoElement-ffWp6e-q.js} +1 -1
- package/dist/assets/epic-DQp3msw1.js +2 -0
- package/dist/assets/{getLocaleForTenant-CDIB5Rqc.js → getLocaleForTenant-CviIXzRZ.js} +1 -1
- package/dist/assets/{index-kHgGJTZG.js → index-BjdITt-r.js} +1 -1
- package/dist/assets/{index-BmrJYl86.js → index-CJDKumPK.js} +1 -1
- package/dist/assets/{index-DaSzb7kA.js → index-Cbh5vqog.js} +1 -1
- package/dist/assets/{index-DsO1D_HX.js → index-DAauKzFE.js} +2 -2
- package/dist/assets/{index-DW3WLCwX.js → index-DLHtRKv8.js} +7 -7
- package/dist/assets/{index-BOGEwH6C.js → index-DXN9TBPl.js} +1 -1
- package/dist/assets/{index-BVB9LccC.js → index-Gt8T4Uga.js} +1 -1
- package/dist/assets/{index-QbJM5D9Y.js → index-feg2jCwH.js} +1 -1
- package/dist/assets/{lexical-Dh5_f1t7.js → lexical-DlKSah80.js} +1 -1
- package/dist/assets/{liveblocks-4Rd12v3w.js → liveblocks-DClVyt0g.js} +1 -1
- package/dist/assets/{lottie-ljbmWmMi.js → lottie-Cp-NiPB5.js} +1 -1
- package/dist/assets/{mui-BNQNnKUH.js → mui-CcvyX9MX.js} +1 -1
- package/dist/assets/{pathToGoBack-ujlITM0J.js → pathToGoBack-2sirIvp5.js} +1 -1
- package/dist/assets/{pdf-ZOuFxOIc.js → pdf-C5rqS6jt.js} +3 -3
- package/dist/assets/{pdf-lib-BsIrhPFz.js → pdf-lib-BqWhHtM5.js} +1 -1
- package/dist/assets/{plaid-CR_panTl.js → plaid-DWAYeop0.js} +1 -1
- package/dist/assets/{pusher-BfvbtoI-.js → pusher-AlMf_d96.js} +1 -1
- package/dist/assets/{react-BdwosVEo.js → react-9I1A70J-.js} +1 -1
- package/dist/assets/{react-Cir_kPlQ.js → react-BLLkkOL7.js} +1 -1
- package/dist/assets/{react-DZ3VkH8V.js → react-C0v8NVO3.js} +1 -1
- package/dist/assets/{react-DvJkgILo.js → react-DAnUM0sS.js} +1 -1
- package/dist/assets/{react-1yHRQMMK.js → react-DVUOFd8T.js} +1 -1
- package/dist/assets/{react-49qJJm6Q.js → react-DvosTe1_.js} +1 -1
- package/dist/assets/{recharts-DWt5pa4F.js → recharts-DBEszjUX.js} +1 -1
- package/dist/assets/{routePaths-Bf6hqCDy.js → routePaths-9gR2KaOM.js} +1 -1
- package/dist/assets/{sentry-DNaNh7eC.js → sentry-D8Xosfgm.js} +1 -1
- package/dist/assets/{url-Cw5ckI0h.js → url-BsrlRBrh.js} +1 -1
- package/dist/assets/{url-QenweuSk.js → url-CzYCjp5O.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BT0w9R5w.js → useAiCfoDashboardSuggestedQuestionsChips-DqI8c90n.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-Dnw9TFpe.js → useAskAiCfoHostNavButtonProps-BTcQ_CA9.js} +1 -1
- package/dist/assets/useCashManagementBanner-B7-_c5GC.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-Kefa2Uws.js → useChargeCardPusherEvents-DuMKDFn-.js} +1 -1
- package/dist/assets/{useDeviceId-DKhHygcY.js → useDeviceId-CG-b8U3x.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BrSRbVYh.js +1 -0
- package/dist/assets/{useInitialThreadRequest-Cm9uHxR_.js → useInitialThreadRequest-CMUTHt1d.js} +1 -1
- package/dist/assets/{utils-pxMpwT17.js → utils-I0SDHsA7.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DvXF470h.js → withTransactionSidePanel-BmXvO_Jy.js} +1 -1
- package/dist/assets/{zeni-epic-state-C1K4xiie.js → zeni-epic-state-xNVi8DVg.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-Bvp69dKv.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BPYnoMNn.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CpFI1iA5.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-CDRDMeDf.js +0 -18
- package/dist/assets/EntityDetailRoutes-Q3W6ugXO.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-EZqM5g1_.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-JI4681jr.js +0 -12
- package/dist/assets/NotFoundScreen-8EvUnY3z.js +0 -1
- package/dist/assets/OAuthConsentScreen-CUtdcAoz.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CuuM3cYK.js +0 -1
- package/dist/assets/PeopleRoutes-CphF1WML.js +0 -22
- package/dist/assets/PerformanceRoutes-DSbitX-g.js +0 -1
- package/dist/assets/ReferralListScreen-DTyhwsoO.js +0 -5
- package/dist/assets/RewardsRoutes-Dxy1QY7_.js +0 -1
- package/dist/assets/SignInScreen-Bmr5nDta.js +0 -1
- package/dist/assets/SignOutScreen-p_VDTC3u.js +0 -9
- package/dist/assets/TaskRoutes-e7xFo9Ej.js +0 -9
- package/dist/assets/WiseConfirmationScreen-CqRNL2k6.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-DN7zMc9n.js +0 -9
- package/dist/assets/epic-DBBFIgZi.js +0 -2
- package/dist/assets/useCashManagementBanner-CY5tE-AL.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-DQEVaDNk.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-
|
|
2
|
-
import{_ as t,bn as ls,eX as us,fE as cs,fC as ds,gk as ms,fr as _s,cU as pe,cA as hs,fU as Es,cs as ps,bE as Rs,bo as xs,fY as gs,v as Is,LZ as Ts,bs as js,L_ as As,bK as fs,bJ as Ds,bt as ys,co as bs,L$ as Cs,M0 as vs,cQ as Us,cT as ws,cS as Os,cz as Ps,cG as Fs,o9 as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as Te,g1 as ks}from"./zeni-epic-state-C1K4xiie.js";import{j as e}from"./liveblocks-4Rd12v3w.js";import{a as O}from"./sentry-DNaNh7eC.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-BSTuY0H-.js";import{y as Zs,u as Ms,z as D,C as Gs,c as zs,d as $s,G as z,i as Ys,Z as Ws,T as qs,L as F,a as Ae,t as _,P as Js,e as X,l}from"./index-DW3WLCwX.js";import"./mui-BNQNnKUH.js";import{f as fe}from"./analyticsHelper-B5fcdQll.js";import{t as Ks}from"./getLocaleForTenant-CDIB5Rqc.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="c32b8ac3-7fb1-4c31-9655-607b75963e97",o._sentryDebugIdIdentifier="sentry-dbid-c32b8ac3-7fb1-4c31-9655-607b75963e97")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-21HP5X_L.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t((()=>import("./BillPayRoutes-Bu0-qZ-c.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-D7NThH82.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t((()=>import("./TransactionListRoutes-D1CLAZ1r.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t((()=>import("./SettingsRoutes-Cpq8r6km.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t((()=>import("./ReportsRoutes-C3CvAXR5.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-BAl2IXHY.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t((()=>import("./PeopleRoutes-CphF1WML.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-CVoR9HYp.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t((()=>import("./TreasuryRoutes-Dw2aLpt8.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t((()=>import("./VendorsRoutes-D1DStejL.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-DqgQBbks.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-C3CvAXR5.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])))),st=l((()=>t((()=>import("./AddressRoutes-Bvp69dKv.js")),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21])))),tt=l((()=>t((()=>import("./PeopleRoutes-CphF1WML.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CuuM3cYK.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-BF11xENe.js")),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21])))),ot=l((()=>t((()=>import("./VendorsRoutes-D1DStejL.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-DGUPG-G4.js")),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21])))),De=l((()=>t((()=>import("./EntityDetailRoutes-Q3W6ugXO.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21])))),it=l((()=>t((()=>import("./DashboardRoutes-21HP5X_L.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])))),ye=l((()=>t((()=>import("./BillPayRoutes-Bu0-qZ-c.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])))),lt=l((()=>t((()=>import("./SettingsRoutes-Cpq8r6km.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])))),be=l((()=>t((()=>import("./ReimbursementRoutes-D7NThH82.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-DqgQBbks.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21])))),ct=l((()=>t((()=>import("./TreasuryRoutes-Dw2aLpt8.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])))),dt=l((()=>t((()=>import("./TransactionListRoutes-D1CLAZ1r.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-BAl2IXHY.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])))),_t=l((()=>t((()=>import("./NotificationRoutes-Cdv9W6jW.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21])))),ht=l((()=>t((()=>import("./PerformanceRoutes-DSbitX-g.js")),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-CVoR9HYp.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])))),pt=l((()=>t((()=>import("./RewardsRoutes-Dxy1QY7_.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21])))),Rt=l((()=>t((()=>import("./TaskRoutes-e7xFo9Ej.js")),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21])))),xt=l((()=>t((()=>import("./AiCfoScreen-Di0AIuiw.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-DZM91jF5.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,21])))),b=l((()=>t((()=>import("./NotFoundScreen-8EvUnY3z.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,21])))),gt=l((()=>t((()=>import("./TaskListScreen-ey3bya3t.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21]))));function St({setTenantEmailDomain:o}){const j=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),Z=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),T=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?cs(ne,r):void 0,J=T==="Completed"||A==="Completed"?ds(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>M.tenantId!=null?Es(n,M.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const c=ps(Number(f[0])),s=Number(f[1]),d=Rs(`01-${c<10?`0${c}`:c}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();d.isAfter(S,"month")===!1?j(gs(v,{month:c,year:s})):B("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,c,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),c(Ls(!0)),c(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const d=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),d?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(M,I,j,Me))}),[M,ae,I,j,D]),O.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,c,s,d,S,H){if(c==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&d?.zeniSessionId!=null,os=c==null||c.tenantId!==s,rs=c!=null&&c.excludedResources==null,is=c!=null&&c.externalConnections==null;if(W&&os){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(d?.userId,d?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(d.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(d.userId,s)));if(W){X.identify(d.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(d.userId,s,d.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(d.userId,d.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),O.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(Ts(Y.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,A,r,I]),O.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=Xs,f=3e3){setTimeout((()=>{const c=s=>{if(s>=n.length)return;const d=n[s],S=Qs[d];S!=null?S().then((()=>ee((()=>c(s+1))))).catch((()=>ee((()=>c(s+1))))):c(s+1)};ee((()=>c(0)))}),f)})())}),[T,V]);const w=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,ce=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=de&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&ys(E?.loggedInUserRoleMap),Qe=_e&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=de&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ze===!0||Ye===!0||Xe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(ce===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||ce!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(dt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):j?e.jsx(jt,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DI74i-ae.js","assets/sentry-D8Xosfgm.js","assets/core-DwNLEOUU.js","assets/zeni-epic-state-xNVi8DVg.js","assets/index-DLHtRKv8.js","assets/mui-CcvyX9MX.js","assets/analytics-bPb2gemn.js","assets/utils-I0SDHsA7.js","assets/withTransactionSidePanel-BmXvO_Jy.js","assets/useAskAiCfoHostNavButtonProps-BTcQ_CA9.js","assets/TransactionDetailScreen-IXeieJAZ.js","assets/decodeURIComponentSafe-ZRjeK6SK.js","assets/routePaths-9gR2KaOM.js","assets/NotFoundScreen-Cc3hICVQ.js","assets/useInitialThreadRequest-CMUTHt1d.js","assets/analyticsHelper-D-aKdeNy.js","assets/CompanyPassportScreen-D4bAa7oB.js","assets/MobileAppDrawer-B31HXetk.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DqI8c90n.js","assets/FeaturePreviewScreen-BCluNQT9.js","assets/ReferralListScreen-CSEitR2_.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-CKYTkGee.js","assets/AddressScreen-Bf6z05aj.js","assets/DomesticWireDetailScreen-CKua19CI.js","assets/DrawerScreen-BbfxfoZt.js","assets/SetupPagesScreen-Cd49Na2T.js","assets/BusinessVerificationPageScreen-NHYnfNWv.js","assets/BillPayApprovalRoutes-Ckx826UI.js","assets/ReimbursementApprovalRuleDetailScreen-DWSQ5fho.js","assets/getLocaleForTenant-CviIXzRZ.js","assets/ReimbursementRoutes-k1nILFA3.js","assets/ReimbursementApprovalRoutes-Gp2otsO5.js","assets/TransactionListRoutes-BpRRzlki.js","assets/ZeniAccountStatementScreen-uDm1gv9G.js","assets/SettingsRoutes-Cja67c6S.js","assets/accountMappingHelper-CsZH9NCw.js","assets/useEmailConnectResultRefresh-BrSRbVYh.js","assets/QBOConnectionScreen-BuUxb8jy.js","assets/empty-DDyPKwd4.js","assets/index-BjdITt-r.js","assets/url-CzYCjp5O.js","assets/index-Gt8T4Uga.js","assets/ReportsRoutes-BF3euNVO.js","assets/ChargeCardRoutes-blMP2Zfr.js","assets/useChargeCardPusherEvents-DuMKDFn-.js","assets/PeopleRoutes-mpWefUzK.js","assets/ExpenseAutomationRoutes-DNryC1u1.js","assets/TreasuryRoutes-BqNgWhqu.js","assets/useCashManagementBanner-B7-_c5GC.js","assets/VendorsRoutes-DFr8Q9Uz.js","assets/pathToGoBack-2sirIvp5.js","assets/ZeniAccountRoutes-Clu4CNh1.js","assets/AddressRoutes-CewQvCq1.js","assets/PandLWithForecastRoutes-ek3HUoVb.js","assets/CustomerOnboardingRoutes-DKJRjfSQ.js","assets/TransactionDetailRoutes-O78W-_gh.js","assets/EntityDetailRoutes-Dt2dByW5.js","assets/NotificationRoutes-dtkj3nej.js","assets/PerformanceRoutes-DaiSgudg.js","assets/RewardsRoutes-CABV08Kz.js","assets/TaskRoutes-DOx1ej7V.js","assets/TaskListScreen-DL_nQ0pc.js","assets/AiCfoScreen-hpWqSyVv.js","assets/CardsAiCfoScreen-BK4WjShZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as ls,eX as us,fE as ds,fC as cs,gk as ms,fr as _s,cU as pe,cA as hs,fU as Es,cs as ps,bE as Rs,bo as xs,fY as gs,v as Is,M0 as Ts,bs as js,M1 as As,bK as fs,bJ as Ds,bt as ys,co as bs,M2 as Cs,M3 as vs,cQ as Us,cT as ws,cS as Os,cz as Ps,cG as Fs,oc as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as Te,g1 as ks}from"./zeni-epic-state-xNVi8DVg.js";import{j as e}from"./liveblocks-DClVyt0g.js";import{a as O}from"./sentry-D8Xosfgm.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-DwNLEOUU.js";import{y as Ms,u as Zs,z as D,C as Gs,c as zs,d as $s,G as z,i as Ys,Z as Ws,T as qs,L as F,a as Ae,t as _,P as Js,e as X,l}from"./index-DLHtRKv8.js";import"./mui-CcvyX9MX.js";import{f as fe}from"./analyticsHelper-D-aKdeNy.js";import{t as Ks}from"./getLocaleForTenant-CviIXzRZ.js";import"./recharts-DBEszjUX.js";import"./analytics-bPb2gemn.js";import"./plaid-DWAYeop0.js";import"./dnd-DpYxHMns.js";import"./stripe-cKAAJElX.js";import"./lottie-Cp-NiPB5.js";import"./lexical-DlKSah80.js";import"./pdf-C5rqS6jt.js";import"./utils-I0SDHsA7.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="127ebde4-2e87-4ee8-a0e8-fc3b185e7749",o._sentryDebugIdIdentifier="sentry-dbid-127ebde4-2e87-4ee8-a0e8-fc3b185e7749")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-DI74i-ae.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t((()=>import("./BillPayRoutes-CKYTkGee.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-k1nILFA3.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t((()=>import("./TransactionListRoutes-BpRRzlki.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t((()=>import("./SettingsRoutes-Cja67c6S.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t((()=>import("./ReportsRoutes-BF3euNVO.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-blMP2Zfr.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t((()=>import("./PeopleRoutes-mpWefUzK.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-DNryC1u1.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t((()=>import("./TreasuryRoutes-BqNgWhqu.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t((()=>import("./VendorsRoutes-DFr8Q9Uz.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-Clu4CNh1.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-BF3euNVO.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])))),st=l((()=>t((()=>import("./AddressRoutes-CewQvCq1.js")),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21])))),tt=l((()=>t((()=>import("./PeopleRoutes-mpWefUzK.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-ek3HUoVb.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-DKJRjfSQ.js")),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21])))),ot=l((()=>t((()=>import("./VendorsRoutes-DFr8Q9Uz.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-O78W-_gh.js")),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21])))),De=l((()=>t((()=>import("./EntityDetailRoutes-Dt2dByW5.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21])))),it=l((()=>t((()=>import("./DashboardRoutes-DI74i-ae.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])))),ye=l((()=>t((()=>import("./BillPayRoutes-CKYTkGee.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])))),lt=l((()=>t((()=>import("./SettingsRoutes-Cja67c6S.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])))),be=l((()=>t((()=>import("./ReimbursementRoutes-k1nILFA3.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-Clu4CNh1.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21])))),dt=l((()=>t((()=>import("./TreasuryRoutes-BqNgWhqu.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])))),ct=l((()=>t((()=>import("./TransactionListRoutes-BpRRzlki.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-blMP2Zfr.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])))),_t=l((()=>t((()=>import("./NotificationRoutes-dtkj3nej.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21])))),ht=l((()=>t((()=>import("./PerformanceRoutes-DaiSgudg.js")),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-DNryC1u1.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])))),pt=l((()=>t((()=>import("./RewardsRoutes-CABV08Kz.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21])))),Rt=l((()=>t((()=>import("./TaskRoutes-DOx1ej7V.js")),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21])))),xt=l((()=>t((()=>import("./AiCfoScreen-hpWqSyVv.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-BK4WjShZ.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,21])))),b=l((()=>t((()=>import("./NotFoundScreen-Cc3hICVQ.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,21])))),gt=l((()=>t((()=>import("./TaskListScreen-DL_nQ0pc.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21]))));function St({setTenantEmailDomain:o}){const j=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Zs(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),T=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?ds(ne,r):void 0,J=T==="Completed"||A==="Completed"?cs(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?j(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,Z)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,j,Ze))}),[Z,ae,I,j,D]),O.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)));if(W){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),O.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(Ts(Y.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,A,r,I]),O.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=Xs,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[T,V]);const w=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&ys(E?.loggedInUserRoleMap),Qe=_e&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||Ye===!0||Xe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):j?e.jsx(jt,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-DClVyt0g.js";import{a as u}from"./sentry-D8Xosfgm.js";import{h as L,g as $,u as U,j as S,s as le,n as H,i as Z,o as ne,p as v}from"./core-DwNLEOUU.js";import{bn as De,eX as j,gp as Me,n2 as re,Ol as Te,hF as he,Oc as Ue,qU as _e,kA as be,m_ as Fe,hH as Re,Oe as Be,Od as Oe,QE as Ve,zo as ze,ER as Le,Qd as Ne,Qm as Qe,c6 as ae,cL as $e,cM as He,bs as Ze,Md as Ge,xQ as Ke,QF as qe,Hg as Je,Ex as Xe,Eo as Se,El as Ye,xU as ye,Er as Ce,Eu as Ie,EA as oe,ue as se,xT as We,kc as X,kf as Ae,QG as en,lg as nn,y7 as tn,N4 as an,N5 as on,ka as sn,QH as cn,kd as ln,rm as rn,M$ as dn,N0 as un,rq as pn,hq as gn,Ml as ee,hi as de,hf as mn,hn as fn,Mm as hn,y4 as bn,QI as Sn,QJ as yn,EO as Cn,fC as Ee,fE as xe,QK as In,gd as An,Mv as En,y3 as ue,gi as pe,gh as xn,y2 as vn,gg as wn,gf as kn,QL as Pn,fH as ve,QM as jn,QN as Dn,ya as Mn,y1 as ge,QO as Tn,fX as Un,x_ as _n,bZ as Fn,c5 as Rn,c4 as Bn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-xNVi8DVg.js";import{C as Y,G as O,z as k,ag as we,bT as $n,e as G,g as Hn,bE as Zn,T as K,B as ie,bU as Gn,i as ke,Z as Pe,bV as Kn,ar as qn,m as je,bW as Jn,bX as Xn,bY as Yn,Y as Wn,bZ as et,v as nt,b_ as tt}from"./index-DLHtRKv8.js";import{n as V}from"./mui-CcvyX9MX.js";import{M as R}from"./MobileAppDrawer-B31HXetk.js";import{a as q,g as J,m as at}from"./accountMappingHelper-CsZH9NCw.js";import{t as ot,A as st}from"./AddressScreen-Bf6z05aj.js";import Q from"./NotFoundScreen-Cc3hICVQ.js";import{g as it}from"./analyticsHelper-D-aKdeNy.js";import{B as ct}from"./BusinessVerificationPageScreen-NHYnfNWv.js";import{C as lt}from"./CompanyPassportScreen-D4bAa7oB.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-BrSRbVYh.js";import{q as me}from"./QBOConnectionScreen-BuUxb8jy.js";import{B as ut}from"./BillPayApprovalRoutes-Ckx826UI.js";import{R as pt}from"./ReimbursementApprovalRoutes-Gp2otsO5.js";import"./recharts-DBEszjUX.js";import"./analytics-bPb2gemn.js";import"./plaid-DWAYeop0.js";import"./dnd-DpYxHMns.js";import"./stripe-cKAAJElX.js";import"./lottie-Cp-NiPB5.js";import"./lexical-DlKSah80.js";import"./pdf-C5rqS6jt.js";import"./utils-I0SDHsA7.js";import"./routePaths-9gR2KaOM.js";import"./empty-DDyPKwd4.js";import"./pdf-lib-BqWhHtM5.js";import"./index-BjdITt-r.js";import"./url-CzYCjp5O.js";import"./index-Gt8T4Uga.js";import"./decodeURIComponentSafe-ZRjeK6SK.js";import"./ReimbursementApprovalRuleDetailScreen-DWSQ5fho.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]="73aead6a-4db7-40da-8e4c-2382a6e5aeb9",e._sentryDebugIdIdentifier="sentry-dbid-73aead6a-4db7-40da-8e4c-2382a6e5aeb9")}catch{}})();const gt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7e
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,mt=
|
|
9
|
+
`,mt=H((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,_=q(a.accountMappingView.incomeAccountList,y.selectedOption),M=q(a.accountMappingView.expenseAccountList,g.selectedOption),x=q(a.accountMappingView.billPayAccountList,r.selectedOption),F=q(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=J(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=J(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),B=J(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=J(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),T={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:F?.accountId,selectedPrepaidExpensesAccountIds:D.map((P=>P.accountId)),selectedFixedAssetsAccountIds:N.map((P=>P.accountId)),selectedAccruedExpensesAccountIds:B.map((P=>P.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((P=>P.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Be())):e(he())},onSaveClick:()=>{e(Re()),l&&G.track(Hn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Fe(a.currentTenant.companyId,n))}}}))($n),ft=()=>{const e=L(),a=$(),s=U(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),y=De(f),g=S((d=>j(d))),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=S((d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,P=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:P?.company.companyLocaleInfo?.currencySymbol??"$"}}),le),E=u.useCallback(((d,C)=>{s(re(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[P,W]=T[0]??[];P!=null&&s(re(g.companyId,P,W,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=S((d=>Te(d.accountState)),le),_=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[M,x]=u.useState(!1),[F,D]=u.useState(!1);u.useEffect((()=>{M===!1&&(s(he()),x(!0))}),[M]);const N=S((d=>Ue(d))),B=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(R,{isAppContentDrawerOpen:F,handleDrawerToggle:B}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>B(!0)})]})},ht=V.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7e
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,bt=
|
|
17
|
+
`,bt=H((function(e,a){const s=j(e),c=Ne(e),l=Qe(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:G}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Gn),St=()=>{const e=L(),a=$(),s=U(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S((A=>j(A))),y=S((A=>A.billPaySetupApproverViewState.fetchState)),g=S((A=>A.remiSetupApproverViewState.fetchState)),r=S((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=K();u.useEffect((()=>{p||y!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,y,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},yt=V.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7e
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=
|
|
25
|
+
`,Ct=H((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=j(e);return{bankSetupView:qe(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(ye(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?Se(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Xe(l,t,n,i))},onRemoveConnection:n=>{e(Je(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Kn),It=()=>{const e=L(),a=$(),s=U(),{tenantEmailDomain:c}=Z(),l=K(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,y]=u.useState(!1),g=S((D=>j(D))),r=S((D=>D.settingsViewState.bankConnection.fetchState)),b=$e(g,l?.loggedInUserRoleMap),I=He(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,A=ke(g,t,i),_=Ge(g,l?.loggedInUserRoleMap)&&A,{isCardsHidden:M}=Pe(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||r==="Completed"||(y(!0),s(Ke(!1)))}),[f,s,r]);const F=D=>{m(D)};return b||E||I||_?o.jsxs(yt,{children:[o.jsx(R,{isAppContentDrawerOpen:p,handleDrawerToggle:F}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:_,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{F(!0)}})]}):o.jsx(Q,{})},At=V.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7e
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,
|
|
33
|
+
`,Et=H((function(e,a){const{companyId:s}=a,c=j(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:je.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ye("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(Se(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Jn),xt=()=>{const e=L(),a=$(),s=U(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S((h=>j(h))),y=S((h=>h.cardPaymentViewState)),g=S((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),r=qn(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=K();u.useEffect((()=>{I!=null&&s(We(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(X()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{r==="In-Progress"&&b==="Completed"&&s(X())}),[r,b]);const E=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:je.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=H((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}}))(Xn),wt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=Z();rt();const[c,l]=u.useState(!1),n=S((h=>h.tenantState.fetchState)),t=S((h=>j(h))),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(rn(te))}),[a]);const[y,g]=u.useState(!1);u.useEffect((()=>{y||(g(!0),a(X()))}),[y,a]);const r=h=>{l(h)},b=S((h=>dn(h,i))),I=S((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:w,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7e
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,
|
|
41
|
+
`,Pt=V.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7e
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,
|
|
49
|
+
`,jt=()=>{const e=U(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),l=S((r=>j(r))).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=S((r=>Sn(r,n.userId))),i=S((r=>yn(r,l,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback((r=>{e(se("user_reimbursement_account",r))}),[]),y=u.useCallback((r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(Pt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:y,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7e
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,fe=({appContent:e})=>{const a=U(),s=L(),c
|
|
57
|
+
`,fe=({appContent:e})=>{const a=U(),s=L(),c=$(),[l,n]=u.useState(!1),t=S((d=>j(d))),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=S((d=>be(d))),I=Ee(t),w=xe(g,t),E=!w&&b,h=ke(t,y,g),{isCardsHidden:A}=Pe(t?.tenantId),_=!h||A,{areTenantIdsInSync:M}=Wn();u.useEffect((()=>{M&&a(In(p,E))}),[p,a,E,M]);const x=S((d=>An(d,E))),F=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{B(!0)},isLoading:F,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(P,W){let z=`/${P}/settings/my_profile`;return z=z.concat(`/new/${W}`),z})(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=U(),a=S((r=>j(r))).companyId,s=S((r=>Pn(r))),c=S((r=>ve(r))),l=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((r=>{t(r)}),[]),p=u.useCallback((r=>{e(jn(r))}),[]),m=u.useCallback((()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))}),[l?.userEmail]),f=u.useCallback((()=>{e(Mn())}),[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const y=u.useCallback((()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Tn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=S((r=>ve(r))),l=S((r=>j(r))),n=K(),t=k.getSignedInUser(),i=U(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,l);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))}),[c.fetchState,a]);const y=xe(m,l),g=Ee(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Fn(l)?o.jsxs(ne,{children:[Rn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Bn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(jt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),Qn(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx(Q,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx(Q,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(St,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx(Q,{})}),o.jsx(v,{path:"*",element:o.jsx(Q,{})})]})}export{ga as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-DClVyt0g.js";import{h as X,g as ee,u as ne,i as G,j as P,N as x,n as W,t as en}from"./core-DwNLEOUU.js";import{bJ as nn,co as Ce,Q1 as ye,eX as V,cA as tn,zE as Q,zo as an,Qd as on,Qg as sn,rF as te,rt as ae,l8 as ie,tM as z,Qi as Ie,gh as $e,gg as Ge,gf as We,Qj as cn,zN as rn,Ex as Ae,Eo as ke,El as _e,E3 as J,Er as Ee,Eu as ve,EA as Pe,ue as we,gw as un,cv as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qk as fn,D3 as le,DH as gn,Ql as bn,bK as Sn,FQ as pe,ER as hn,Qm as Cn,Qn as In,FU as An,FY as kn,tF as _n,Km as En,Gt as he,Ht as me,Qo as vn,Qp as Pn,Qq as wn,Qr as He,Qs as Tn,MP as Dn,Pq as Un,N2 as On,Qt as qe,E7 as Fn,N3 as Vn,Eb as Bn,Qu as Oe,GP as Ke,lg as xn,rw as Je,tO as jn,bE as Re,t_ as Ne,cy as Rn,Qv as Ye,fW as Nn,Gb as zn,Gf as Ln,Qw as Mn,Gw as ze,Qx as Zn,Qy as Qn,Qz as $n,QA as Gn,gp as Wn,AY as Hn,QB as qn,B1 as Kn,B0 as Jn}from"./zeni-epic-state-xNVi8DVg.js";import{T as oe,C as se,G as K,y as Te,aS as Y,bE as Xe,z as U,A as ce,e as O,B as De,g as $,bF as Yn,au as re,bG as B,bH as Xn,bI as et,ag as xe,bJ as nt,v as Le,av as Me,J as tt,D as at,bK as it,bL as ot,bM as st,a9 as ct}from"./index-DLHtRKv8.js";import{a as h}from"./sentry-D8Xosfgm.js";import{n as Fe,D as rt,S as ut}from"./mui-CcvyX9MX.js";import{M as fe}from"./MobileAppDrawer-B31HXetk.js";import N from"./NotFoundScreen-Cc3hICVQ.js";import{a as Ze}from"./analyticsHelper-D-aKdeNy.js";import{d as Qe}from"./routePaths-9gR2KaOM.js";import{B as Ue}from"./BusinessVerificationPageScreen-NHYnfNWv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="911075ab-fa0e-49e5-b33d-6557418cac23",e._sentryDebugIdIdentifier="sentry-dbid-911075ab-fa0e-49e5-b33d-6557418cac23")}catch{}})();const dt=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-4Rd12v3w.js";import{h as Y,g as ee,u as ne,i as
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,lt=W((function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e($e(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(Xn),pt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(K.isBillPayLocalCurrencyFeatureEnabled),g=we(),{configValue:C}=i(X.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),E=P((T=>T.billPaySetupViewState.fetchState)),f=P((T=>V(T))),b=P((T=>T.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Ye(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect((()=>{S.current||E!=="Not-Started"||m==null?S.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(Q(m,!1,!0))):(S.current=!0,t(Q(m,!0)))}),[E,m,t]),h.useEffect((()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))}),[y,b,A,D,t]);const F=T=>{d(T)};if(v===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(B,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const T=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>T(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:o,$t=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,Wt=e=>`/${e}/cards/onboard`,Ht=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},qt=(e,o)=>e.find((t=>t.id===o)),Kt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map((n=>n.id)),debitAccountName:a.depositAccounts.map((n=>n.accountName)),debitAccountBalance:a.depositAccounts.map((n=>x(n.accountBalance.available.amount))),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=W((function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(Te("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(ve(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)),E=n.allBankAccounts.find((f=>f.accountId===d));O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find((f=>f.id===d)),_=n.allFundingAccounts.findIndex((f=>f.id===n.primaryFundingAccount?.id))+1,E=n.allFundingAccounts.findIndex((f=>f.id===d))+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:x(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}}))(Yn),St=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=P((L=>V(L))),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(X.zeniAccountsConfig),{configValue:p}=s(X.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(K.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(K.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(K.isCardPolicyEnabled),S=P((L=>un(L,n.companyId))),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&v===!1,F=b===!1&&v,T=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=P((L=>L.chargeCardSetupViewState.fetchState)),w=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=L=>{Se(L)},xe=P((L=>fn(L,w)));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{M||Z!=="Not-Started"||w==null?M||Z!=="Completed"||w==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(w,!1,!0)):(ue(!0),t(le(w,!0)))}),[M,Z,w,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,q=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(v,b,E,_);return be||q?be||q?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded($.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:w,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:q,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:xe,isCreditCardProductVisible:v,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,accountsPromoConfig:T})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(B,{to:"../promo"})},bt=Fe.div`
|
|
9
|
+
`,lt=W((function(e,s){const{isUserBillPayAdmin:t,companyId:a}=s,c=V(e),n=on(e),o=U.getSignedInUser(),l=c.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:l??""},r=sn(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:s.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}}),(function(e,s){const{navigate:t,companyId:a,currentTenant:c}=s;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,o)=>{e(we("bill_pay_setup",n,o))},onEstablishConnectionClick:n=>{e(Pe(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,o,l)=>{e(ve(n,o,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,o)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",o))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,o,l)=>{e(l==="paymentAccount"?ke(n,o,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,o))},onUpdatePrimaryFundingAccount:(n,o)=>{e(Ae(a,"bill_pay_setup",n,o))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,o)=>{e(We(n,"SpendManagementSetup")),o!=null&&e(cn({officerType:o,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,o)=>{e($e(n,o,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,o)=>{n!=null&&o!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,o)=>{e(Ie({officerType:n,fileIds:o}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,o)=>{e(te(n,o.split(".")[0]))},onSignUpClick:()=>{s.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(Yn),pt=()=>{const e=X(),s=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=oe(),n=nn(c?.loggedInUserRoleMap),o=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=se(),{isFeatureEnabled:r}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(K.isBillPayLocalCurrencyFeatureEnabled),g=Te(),{configValue:C}=i(Y.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),b=h.useRef(!1),[y,_]=h.useState(!1),E=P((w=>w.billPaySetupViewState.fetchState)),f=P((w=>V(w))),S=P((w=>w.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Xe(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect((()=>{b.current||E!=="Not-Started"||m==null?b.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(b.current=!0,t(Q(m,!1,!0))):(b.current=!0,t(Q(m,!0)))}),[E,m,t]),h.useEffect((()=>{y||S!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))}),[y,S,A,D,t]);const F=w=>{d(w)};if(v===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const w=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>w(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:s,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:o,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,s)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:s,$t=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,Wt=e=>`/${e}/cards/onboard`,Ht=(e,s,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(s)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},qt=(e,s)=>e.find((t=>t.id===s)),Kt=(e,s,t)=>!e||!s||t.fetchState==="Completed",mt=(e,s,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:s,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,s)=>e?{creditCardCashbackOffer:`${s.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${s.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:B(s.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(s.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(s.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:s.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:s.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Yt=(e,s,t,a,c)=>e&&s&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(c.remainingAmountDue.amount)}:void 0,Xt=(e,s,t,a,c)=>e&&s&&t?{debitAccountId:a.depositAccounts.map((n=>n.id)),debitAccountName:a.depositAccounts.map((n=>n.accountName)),debitAccountBalance:a.depositAccounts.map((n=>B(n.accountBalance.available.amount))),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,s)=>e&&s.depositAccountLimit!=null&&s.chargeCard!=null?{debitAccountId:s.depositAccountLimit.id,debitAccountName:s.depositAccountLimit?.accountName??s.connectedAccount?.accountName,debitAccountBalance:B(s.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(s.chargeCard.limit.amount-s.chargeCard.available.amount),debitAccountStatus:s.depositAccountLimit?.accountStatus??s.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:s})=>s||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:s,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||s||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:s,isBookKeepingTenant:t})=>e||s||t,oa=({cardInfo:e,isProductVisible:s,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&s&&(!t&&c||n&&!c&&!a),gt=W((function(e,s){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=s,o=V(e),l=U.getSignedInUser(),i=o.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:o.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,s){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:o,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=s;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,b)=>{e(we("charge_card_setup",d,b))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,b,y)=>{e(ve(d,b,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,b)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",b))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&o===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):o===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,b,y)=>{const _=n.allBankAccounts.find((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)),E=n.allBankAccounts.find((f=>f.accountId===d));O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,b,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,b))},onUpdatePrimaryFundingAccount:(d,b)=>{const y=n.allFundingAccounts.find((f=>f.id===d)),_=n.allFundingAccounts.findIndex((f=>f.id===n.primaryFundingAccount?.id))+1,E=n.allFundingAccounts.findIndex((f=>f.id===d))+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:B(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,b))},onEnableChargeCardSuccess:()=>{e(bn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,b)=>{e(Ie({officerType:d,fileIds:b}))},onSendForVerificationClick:d=>{l===!0&&o===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):o===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,b)=>{e(te(d,b.split(".")[0]))},onSignUpClick:()=>{s.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}}))(Xn),bt=()=>{const e=X(),s=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=oe(),n=P((L=>V(L))),{useDynamicConfig:o,useFeatureGate:l}=se(),i=s.state?.pathnameStackToGoBack?.[0],{configValue:r}=o(Y.zeniAccountsConfig),{configValue:p}=o(Y.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(K.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(K.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(K.isCardPolicyEnabled),b=P((L=>un(L,n.companyId))),y=dn(b.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),S=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:S,chargeCardsCreditAccountLimit:m}),j=S&&v===!1,F=S===!1&&v,w=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,be]=h.useState(!1),[M,ue]=h.useState(!1),Z=P((L=>L.chargeCardSetupViewState.fetchState)),T=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=L=>{be(L)},Be=P((L=>fn(L,T)));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{M||Z!=="Not-Started"||T==null?M||Z!=="Completed"||T==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(T,!1,!0)):(ue(!0),t(le(T,!0)))}),[M,Z,T,t]);const Se=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,q=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(v,S,E,_);return Se||q?Se||q?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded($.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:s,companyId:T,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:Se,isDebitCardTOSAccepted:q,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Be,isCreditCardProductVisible:v,isDebitCardFeatureEnabled:S,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,accountsPromoConfig:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},St=Fe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-4Rd12v3w.js";import{h as Y,g as ee,u as ne,i as
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,ht=W((function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(et),Ct=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),{useDynamicConfig:n}=oe(),s=we(),{configValue:l}=n(X.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=P((m=>m.remiSetupViewState.fetchState)),y=P((m=>V(m))),_=P((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:E,isLoading:f}=Ye(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))}),[S,b,t]),h.useEffect((()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))}),[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(B,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=W((function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:T,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Ve}=i,de=g?.selectedOption,xe={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((q=>q.length===2?q:Me(q)))??[],companySourceOfFunds:T?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Ve?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:E};e(Ne({companyDetails:xe,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map((p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:E,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:E,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach(((I,k)=>{C[k]=I})),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(Bn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(xn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}}))(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=se(),{useDynamicConfig:I}=oe(),k=we(),{configValue:d}=I(X.zeniAccountsConfig),S=ye(d),y=P((m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}})),_=P((m=>m.companyConfigState.fetchState)),E=P((m=>m.userRoleConfigState.fetchState)),f=P((m=>V(m))),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))}),[_,E,n]),h.useEffect((()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(Q(b,!0))}}),[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=P((m=>{let v;switch(e){case"zeni_accounts":v=wn(m,b);break;case"zeni_treasury":v=He(m,b);break;case"charge_cards":v=Tn(m,b);break;case"reimbursement":v=Pn(m,b);break;default:v=vn(m,b)}return v}));return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded($.Event.billPayBusinessVerification,Be(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:Be(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=W((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=qe(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e($n(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(Te("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(ve(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}}))(it),Et=()=>{const e=Y(),o=ee(),t=ne(),a=we(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(X.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[b,D]=h.useState(!1),A=P((w=>w.treasurySetupViewState.fetchState)),m=P((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),v=P((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=P((w=>w.treasuryDetailState.transactionsState?.fetchState)),F=P((w=>V(w))),T=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=P((w=>Xe(w,T))),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=w=>{k(w)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{d||A!=="Not-Started"||T==null||(S(!0),t(he(T,!0,!1)))}),[d,A,T,t]),h.useEffect((()=>{y||m!=="Not-Started"||T==null||(_(!0),t(Nn()))}),[y,m,T,t]),h.useEffect((()=>{E||v!=="Not-Started"||T==null||(f(!0),t(zn()))}),[E,v,T,t]),h.useEffect((()=>{b||j!=="Not-Started"||T==null||(D(!0),t(Ln(!0)))}),[b,j,T,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect((()=>{i||A!=="Completed"||H||Z||!o.pathname.includes("setup")||r(!0)}),[A,H,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(B,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:w=>w.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:T,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=Fe(ut)`
|
|
17
|
+
`,ht=W((function(e,s){const{isUserRemiAdmin:t,companyId:a}=s,c=V(e),n=Cn(e),o=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&o.updateStatus.fetchState!=="In-Progress"&&o.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&o.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&o.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:o,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,s){const{navigate:t,companyId:a,currentTenant:c}=s;return{updateMileageDetails:n=>{const{mileageAmount:o,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:o,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,o)=>{e(we("reimbursement_setup",n,o))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,o,l)=>{e(ve(n,o,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,o)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",o))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,o,l)=>{e(l==="paymentAccount"?ke(n,o,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,o))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,o)=>{e(Ie({officerType:n,fileIds:o}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,o)=>{e(te(n,o.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,o)=>{e(Ae(a,"reimbursement_setup",n,o))},onSignUpClick:()=>{s.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(et),Ct=()=>{const e=X(),s=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=oe(),{useDynamicConfig:n}=se(),o=Te(),{configValue:l}=n(Y.zeniAccountsConfig),i=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),b=P((m=>m.remiSetupViewState.fetchState)),y=P((m=>V(m))),_=P((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:E,isLoading:f}=Xe(y?.tenantId),S=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{I.current||b!=="Not-Started"||S==null?I.current||b!=="Completed"||S==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(S,!1,!0))):(I.current=!0,t(pe(S,!0)))}),[b,S,t]),h.useEffect((()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))}),[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(St,{children:[u.jsx(ce,{analytics:O,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:s,companyId:S,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:o.colors.grey5}})},It=W((function(e,s){const{businessVerificationDetails:t,productType:a}=s,c=V(e),n=U.getSignedInUser(),o=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},i=Dn(s.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,s){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:o}=s,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:b,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:S,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:w,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:be,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve}=i,de=g?.selectedOption,Be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:S,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((q=>q.length===2?q:Me(q)))??[],companySourceOfFunds:w?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:be?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve?.selectedOptions??[]},Se={userId:_,firstName:y.firstName,lastName:y.lastName,email:b,syncToken:E};e(Ne({companyDetails:Be,primaryContactDetails:Se}))},onCompanyOfficerUpdated:i=>{const r=i.map((p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:b,dob:y,phone:_,syncToken:E,selectDocument:f,role:S,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:b,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:E,titleAtCompany:S.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=Le(o.state?.pathnameStackToGoBack,o.pathname),g=new URLSearchParams(o.search),C={};g.forEach(((I,k)=>{C[k]=I})),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=Le(o.state?.pathnameStackToGoBack,o.pathname),g=new URLSearchParams(o.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(Bn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}}))(nt),At=({productType:e,isBusinessVerificationDrawerOpen:s,closeDrawerHandler:t})=>{const a=X(),c=ee(),n=ne(),[o]=en(),l=o.get("showStepProgress"),i=o.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=oe(),{useDynamicConfig:I}=se(),k=Te(),{configValue:d}=I(Y.zeniAccountsConfig),b=ye(d),y=P((m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}})),_=P((m=>m.companyConfigState.fetchState)),E=P((m=>m.userRoleConfigState.fetchState)),f=P((m=>V(m))),S=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))}),[_,E,n]),h.useEffect((()=>{if(!r&&y==="Not-Started"&&S!=null)switch(p(!0),e){case"zeni_accounts":n(me(S,!0));break;case"zeni_treasury":n(he(S,!0));break;case"reimbursement":n(pe(S,!0));break;case"charge_cards":n(le(S,!0));break;default:n(Q(S,!0))}}),[r,y,S,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=P((m=>{let v;switch(e){case"zeni_accounts":v=Tn(m,S);break;case"zeni_treasury":v=He(m,S);break;case"charge_cards":v=wn(m,S);break;case"reimbursement":v=Pn(m,S);break;default:v=vn(m,S)}return v}));return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:S,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:b.maxInsuredAmount,isBusinessVerificationDrawerOpen:s,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=W((function(e,s){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=s,n=V(e),o=U.getSignedInUser(),l=n.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:l??""},r=Ye(e,a),p=He(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=qe(e),d=C.accountSummary?.totalBalance?.amount,b=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:b,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}}),(function(e,s){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:o,treasurySetupView:l}=s;return{onTransferSaveChangesToLocalStore:i=>{e($n(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(we("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(ve(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{o.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{s.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}}))(it),Et=()=>{const e=X(),s=ee(),t=ne(),a=Te(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:o}=se(),l=oe(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=o(Y.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,b]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[S,D]=h.useState(!1),A=P((T=>T.treasurySetupViewState.fetchState)),m=P((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),v=P((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=P((T=>T.treasuryDetailState.transactionsState?.fetchState)),F=P((T=>V(T))),w=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=P((T=>Ye(T,w))),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,be=U.getSignedInUser(),M=T=>{k(T)};if(be==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{d||A!=="Not-Started"||w==null||(b(!0),t(he(w,!0,!1)))}),[d,A,w,t]),h.useEffect((()=>{y||m!=="Not-Started"||w==null||(_(!0),t(Nn()))}),[y,m,w,t]),h.useEffect((()=>{E||v!=="Not-Started"||w==null||(f(!0),t(zn()))}),[E,v,w,t]),h.useEffect((()=>{S||j!=="Not-Started"||w==null||(D(!0),t(Ln(!0)))}),[S,j,w,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect((()=>{i||A!=="Completed"||H||Z||!s.pathname.includes("setup")||r(!0)}),[A,H,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:s.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:T=>T.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:s,companyId:w,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=Fe(ut)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,Pt=W((function(e,
|
|
21
|
+
`,Pt=W((function(e,s){const{isUserZeniAccountsAdmin:t,companyId:a}=s,c=V(e),n=U.getSignedInUser(),o=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},i=Gn(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,s){const{navigate:t,companyId:a,currentTenant:c}=s;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,o)=>{e(we("account_setup",n,o))},onEstablishConnectionClick:n=>{e(Pe(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,o,l)=>{e(ve(n,o,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,o)=>{e(Ee(!1,n,"zeni_accounts","account_setup",o))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,o,l)=>{e(l==="paymentAccount"?ke(n,o,"zeni_accounts","account_setup"):_e("account_setup",n,o))},onUpdatePrimaryFundingAccount:(n,o)=>{e(Ae(a,"account_setup",n,o))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,o)=>{e(Ie({officerType:n,fileIds:o}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,o)=>{e(te(n,o.split(".")[0]))}}}))(ot),wt=()=>{const e=X(),s=ee(),t=ne(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=se(),n=oe(),o=Ce(n?.loggedInUserRoleMap),{configValue:l}=c(Y.zeniAccountsConfig),i=ye(l),[r,p]=h.useState(!1),[g,C]=h.useState(!1),I=P((_=>_.zeniAccountSetupViewState.fetchState)),k=P((_=>V(_))),d=U.getSignedInUserTenant(a)?.companyId??k.companyId,b=U.getSignedInUser(),y=_=>{p(_)};if(b==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{g||I!=="Not-Started"||d==null?g||I!=="Completed"||d==null||k.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(d,!1,!0)):(C(!0),t(me(d,!0)))}),[g,I,d,t]),k.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(x,{to:"../promo"});{const _=E=>E.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:E=>_(E)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:y}),u.jsx(Pt,{navigate:e,location:s,companyId:d,currentTenant:k,isUserZeniAccountsAdmin:o,accountsPromoConfig:i,onClickMenuIcon:()=>{y(!0)}})]})}},Tt=Fe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-4Rd12v3w.js";import{h as Y,g as ee,u as ne,i as
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Dt=W((function(e,
|
|
29
|
+
`,Dt=W((function(e,s){const t=V(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:qn(e),isReadonly:s.isFormReadonly,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:n,analytics:O}}),(function(e,s){const{navigate:t}=s;return{onFormDataChange:a=>{e(Jn(a))},onSubmitClick:()=>{e(Kn(s.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ie({files:a}))},onDeleteFile:a=>{e(ae(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(te(a,c.split(".")[0]))}}}))(st),Ut=()=>{const e=X(),s=ee(),t=ne(),[a,c]=h.useState(!1),[n,o]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=G(),p=oe(),{useFeatureGate:g}=se(),{isFeatureEnabled:C}=g(K.isBillPayLocalCurrencyFeatureEnabled),I=P((A=>A.internationalWireVerificationState.verificationFormFetchState.fetchState)),k=P((A=>A.billPaySetupViewState.fetchState)),d=P((A=>V(A))),b=Te(),y=d.companyId??U.getSignedInUserTenant(r)?.companyId,_=P((A=>Wn(A.companyState,d.companyId))),E=_?.company.companyBillPayInfo.internationalWireOnboardingStatus,f=E?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{a||I!=="Not-Started"||y==null||(c(!0),t(Hn(y)))}),[a,I,y,t]),h.useEffect((()=>{n||k!=="Not-Started"||y==null||(o(!0),t(Q(y,!0)))}),[k,n,y,t]),U.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const S=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=A=>{i(A)};return S===!1?u.jsx(x,{to:"../promo"}):S===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Tt,{children:[u.jsx(ce,{analytics:O,onLoad:A=>(m=>m.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(A)}),xe(s)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(Dt,{navigate:e,location:s,companyId:y,analytics:O,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:f,isLocalCurrencyEnabled:C})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:b.colors.grey5}})},Ot=W((function(){return{}}),(function(e,s){const{companyId:t,productType:a}=s;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(he(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}}))(ct((e=>{const{isBillPayAdminLevelAccess:s,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:o,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return s?u.jsx(Ue,{productType:i}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});case"international-wire":return s?u.jsx(Ut,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});default:return s?u.jsx(pt,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Ue,{productType:i}):u.jsx(N,{}):a?u.jsx(Ct,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(wt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?o?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(x,{to:"../"}):u.jsx(N,{}):o?u.jsx(bt,{}):l?u.jsx(x,{to:"../"}):u.jsx(N,{})}})));function sa(e){const{tenantEmailDomain:s}=G(),t=P((c=>V(c))).companyId??U.getSignedInUserTenant(s)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,o)=>{o.onEventReceived(c)}};if(U.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ot,{...e,companyId:t,...a})}export{na as A,ta as P,sa as S,Yt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Ht as g,$t as h,Jt as i,Xt as j,ia as k,Kt as l,qt as m,Gt as n,Wt as o,Qt as p,oa as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-DClVyt0g.js";import{a as u,b as A,q as M}from"./sentry-D8Xosfgm.js";import{u as T,h as z,j as l,g as D,N as j,n as O}from"./core-DwNLEOUU.js";import{u as P,z as s,y as F,e as E,a as _,f as B,g as N,h as $,j as V,k as Y,m as v}from"./index-DLHtRKv8.js";import{eX as q,L$ as J,M0 as W,fA as X,g0 as H,M5 as G,go as K,cY as Q,M6 as b,M7 as R,M8 as Z,bY as y}from"./zeni-epic-state-xNVi8DVg.js";import"./mui-CcvyX9MX.js";import{u as ee}from"./useDeviceId-CG-b8U3x.js";import{f as te}from"./analyticsHelper-D-aKdeNy.js";import{t as ne}from"./getLocaleForTenant-CviIXzRZ.js";import"./recharts-DBEszjUX.js";import"./analytics-bPb2gemn.js";import"./plaid-DWAYeop0.js";import"./dnd-DpYxHMns.js";import"./stripe-cKAAJElX.js";import"./lottie-Cp-NiPB5.js";import"./lexical-DlKSah80.js";import"./pdf-C5rqS6jt.js";import"./utils-I0SDHsA7.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="b99755f1-a2d9-41f7-8b40-e5da2a19f068",t._sentryDebugIdIdentifier="sentry-dbid-b99755f1-a2d9-41f7-8b40-e5da2a19f068")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{M({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(R(n,a)))},clearSignInError:()=>{t(b())}}}))(Y),ae=A.memo(ie);function ve({setTenantEmailDomain:t}){const i=T(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),K().then((()=>{const e=V();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
|