@zeniai/web-app-ui 5.3.82-dev → 5.3.83-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-C1ayPIAG.js → AccountMappingScreen-BlAlbrnx.js} +1 -1
- package/dist/assets/{ActualMatchingMatchDetailScreen-WhvwIzcC.js → ActualMatchingMatchDetailScreen-BJS18VqA.js} +1 -1
- package/dist/assets/AddressRoutes-CjGixOCb.js +1 -0
- package/dist/assets/AddressScreen-BaUyC6hl.js +9 -0
- package/dist/assets/{AiCfoScreen-DFAyr8gH.js → AiCfoScreen-C2aGObgH.js} +1 -1
- package/dist/assets/{AppDrawer-DI_vp2xj.js → AppDrawer-B_sqYgfu.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DcY6lBge.js → BillPayApprovalRoutes-BdAzyIqn.js} +1 -1
- package/dist/assets/{BillPayRoutes-Cfhufn9I.js → BillPayRoutes-zkvSlLIB.js} +18 -18
- package/dist/assets/{BusinessVerificationPageScreen-DC4WfK27.js → BusinessVerificationPageScreen-DNhcrJIG.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-B5X7-nvK.js → CardsAiCfoScreen-C6zY5aHa.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-DKflGNQM.js → ChargeCardRoutes-CUIv6Ff9.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-y7X0MJz8.js → CompanyPassportScreen-2YfwMC3n.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-Dbf96wBm.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CsgeY_a3.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DOhBde9s.js → CustomerOnboardingRoutes-CmTSBCfZ.js} +1 -1
- package/dist/assets/{DashboardRoutes-DUDSVl0J.js → DashboardRoutes-ePaa6RzM.js} +1 -1
- package/dist/assets/{DefaultTenantHome-BPmXauyS.js → DefaultTenantHome-GxNyS_7I.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-DGTecQgJ.js +18 -0
- package/dist/assets/DrawerScreen-Ac2BNHGU.js +1 -0
- package/dist/assets/{EntityDetailRoutes-DWi6isSB.js → EntityDetailRoutes-By8U2MA9.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-CWCG6f-Z.js → ExpenseAutomationRoutes-CbAy6bRF.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-WONNYPz2.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BCD_byli.js → HubSpotOAuthCallbackScreen-CFlvNlLf.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-CnIopK35.js → InboxNotificationsProvider-yQHZ5K7x.js} +1 -1
- package/dist/assets/{InvoicingRoutes-By0wmZnY.js → InvoicingRoutes-7QJOc7_T.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-CrNQ1d6Y.js → MagicLinkRoutes-BibsnD1q.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-BpOShVw6.js +12 -0
- package/dist/assets/{MobileAppDrawer-DeMnqMws.js → MobileAppDrawer-l8XzezC6.js} +1 -1
- package/dist/assets/NotFoundScreen-azJwEf6u.js +1 -0
- package/dist/assets/{NotificationRoutes-DXwqR_6J.js → NotificationRoutes-C4m7rB7l.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-D-7AI34s.js → OAuthConsentScreen-CuXtenPv.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DwmnvviI.js → PandLWithForecastRoutes-FHrcpjWT.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-sxUNJ-ai.js → PaymentLinkScreen-BSk9RfvR.js} +1 -1
- package/dist/assets/PeopleRoutes-BxrX1JFh.js +22 -0
- package/dist/assets/{PerformanceRoutes-9mPYusWH.js → PerformanceRoutes-u7jsxKOk.js} +1 -1
- package/dist/assets/{Preview-CxGDVP6M.js → Preview-B0DOkYjv.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-fOrpVwph.js → QBOConnectionScreen-BSw99hss.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-B13CHT4T.js → ReimbursementApprovalRoutes-Q1SCHF1l.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DyHV9hua.js → ReimbursementApprovalRuleDetailScreen-DILlSzn2.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BIilRUCw.js → ReimbursementRoutes-6xzsoOoQ.js} +6 -6
- package/dist/assets/{ReportsRoutes-DGD0Kisc.js → ReportsRoutes-BOEFIFhM.js} +1 -1
- package/dist/assets/{RewardsRoutes-DOe7osW-.js → RewardsRoutes-DJDgplhQ.js} +1 -1
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-mgDC8nA3.js → ScheduleDetailsPrepaidExpensesScreen-5-GevFMn.js} +1 -1
- package/dist/assets/ScreenRoutes-C3N1CK9B.js +2 -0
- package/dist/assets/{SettingsRoutes-DsKTn4YF.js → SettingsRoutes-DFwRhTG0.js} +6 -6
- package/dist/assets/{SetupPagesScreen-1DRsRGaO.js → SetupPagesScreen-Bwcyn81K.js} +5 -5
- package/dist/assets/SignInScreen-VNP75F_z.js +1 -0
- package/dist/assets/{SignOutScreen-C9nuOKax.js → SignOutScreen-DqT1J3CH.js} +1 -1
- package/dist/assets/{TaskListScreen-BvZ3nUhV.js → TaskListScreen-vhycpFEZ.js} +1 -1
- package/dist/assets/TaskRoutes-B6-8g-HW.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BHcGo7KC.js +1 -0
- package/dist/assets/{TransactionDetailScreen-gg_jzjg4.js → TransactionDetailScreen-CuKBIwpF.js} +1 -1
- package/dist/assets/{TransactionListRoutes-DXtggfuW.js → TransactionListRoutes-D-MmK7A2.js} +1 -1
- package/dist/assets/{TreasuryRoutes-lxwEfAXe.js → TreasuryRoutes-Pqnpfg2v.js} +5 -5
- package/dist/assets/{VendorsRoutes-BuuNVNIw.js → VendorsRoutes-CNNCASwJ.js} +7 -7
- package/dist/assets/{WiseConfirmationScreen-Bm5Jwnlz.js → WiseConfirmationScreen-Q6839g40.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-DDXr_ULo.js → ZeniAccountRoutes-5EIDUyAv.js} +7 -7
- package/dist/assets/ZeniAccountStatementScreen-DEVWrSPx.js +9 -0
- package/dist/assets/{accountMappingHelper-DSmoEgXo.js → accountMappingHelper-Cmqzt3o8.js} +1 -1
- package/dist/assets/{analytics-ff6bapqe.js → analytics-Dk2G_EzJ.js} +1 -1
- package/dist/assets/{analyticsHelper-kcXI5tFD.js → analyticsHelper-D3Z95hnv.js} +1 -1
- package/dist/assets/{core-C32E0M-A.js → core-C9JgQJB4.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-C5UecJ4I.js → decodeURIComponentSafe-CYuijBUP.js} +1 -1
- package/dist/assets/{dnd-C_Bep5ai.js → dnd-C8GpPG0g.js} +1 -1
- package/dist/assets/{empty-DqCrlpnK.js → empty-BHiRckm6.js} +1 -1
- package/dist/assets/{empty-DAPHCQXk.js → empty-Bn6LwN65.js} +1 -1
- package/dist/assets/{emptyVideoElement-CBVQNEap.js → emptyVideoElement-WwpOn3mw.js} +1 -1
- package/dist/assets/epic-D8O9uIgs.js +2 -0
- package/dist/assets/{expenseAutomationHelper-DLsy_Ty8.js → expenseAutomationHelper-jtvNac2y.js} +1 -1
- package/dist/assets/{getLocaleForTenant-B7DrNxDF.js → getLocaleForTenant-CZcWFJHh.js} +1 -1
- package/dist/assets/{index-CfrgrNvU.js → index-B2whCLRz.js} +1 -1
- package/dist/assets/{index-BukMmlEq.js → index-B68exopT.js} +2 -2
- package/dist/assets/{index-CtLBLCty.js → index-BuFdtVKe.js} +1 -1
- package/dist/assets/{index-DCtJNiUy.js → index-BvMe6BwU.js} +11835 -11835
- package/dist/assets/{index-B4RhNvku.js → index-CJuvBgOO.js} +1 -1
- package/dist/assets/{index-DuYo1zmY.js → index-DF_McIvo.js} +1 -1
- package/dist/assets/{index-BcLofI65.js → index-Dv34Umyu.js} +1 -1
- package/dist/assets/{index-DIaTP7_M.js → index-e3kLs8y8.js} +1 -1
- package/dist/assets/{lexical-Byw8jdWu.js → lexical-DewpM37L.js} +1 -1
- package/dist/assets/{liveblocks-CcAJDSgG.js → liveblocks-QExkfWwX.js} +1 -1
- package/dist/assets/{lottie-DW03v0-7.js → lottie-C8c0mGol.js} +1 -1
- package/dist/assets/{mui-Ba-vLBC4.js → mui-DA_IUYGW.js} +1 -1
- package/dist/assets/{pathToGoBack-BbG758cW.js → pathToGoBack-Cad-ghSF.js} +1 -1
- package/dist/assets/{pdf-B6gXz38d.js → pdf-CglQcGFZ.js} +3 -3
- package/dist/assets/{pdf-lib-DW7wIt2i.js → pdf-lib-C9IVGH9O.js} +1 -1
- package/dist/assets/{plaid-CEp7her_.js → plaid-CG0Jj5NR.js} +1 -1
- package/dist/assets/{pusher-CeHXXfqs.js → pusher-BgQJzJsV.js} +1 -1
- package/dist/assets/{react-BQt0qic3.js → react-7YFwADXn.js} +1 -1
- package/dist/assets/{react-CTPAIO5c.js → react-Bsg7Q7CB.js} +1 -1
- package/dist/assets/{react-BEdnfLLu.js → react-BuwGlC3C.js} +1 -1
- package/dist/assets/{react-DcC_IWpk.js → react-CGoXARef.js} +1 -1
- package/dist/assets/{react-MOydQ4XL.js → react-DObiDMcZ.js} +1 -1
- package/dist/assets/{react-wmLhO00N.js → react-NcjXVgWJ.js} +1 -1
- package/dist/assets/{recharts-g8-bInqc.js → recharts-ikWEYduq.js} +1 -1
- package/dist/assets/{routePaths-BGf6E4zO.js → routePaths-CehqSbwZ.js} +1 -1
- package/dist/assets/{sentry-Bo3euLoP.js → sentry-oILOkT84.js} +1 -1
- package/dist/assets/{stripSplatSuffix-IWd2is7o.js → stripSplatSuffix-DfsbDgo5.js} +1 -1
- package/dist/assets/{url-DjGKFjyy.js → url-D33JsTdA.js} +1 -1
- package/dist/assets/{url-CzSmdUOo.js → url-DoKU4Zzh.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-D8RZjK70.js → useActualMatchingMatchDetail-hr4zSrCe.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Dc6ROsau.js → useAiCfoDashboardSuggestedQuestionsChips-C5O_5leW.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BCWJ7jlQ.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-mHgU3OkI.js → useChargeCardPusherEvents-C3NE2ZHP.js} +1 -1
- package/dist/assets/{useDeviceId-D1tbmD3W.js → useDeviceId-DZAWgg2s.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DICe2M-2.js → useEmailConnectResultRefresh-Bv3uwquX.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DitWfieX.js → useInitialThreadRequest-BCD3tBzH.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-DP5KTNvW.js → useTaskManagerAccess-BRPFjPMD.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-mQG4ptVc.js → useTaskManagerPusherEvents-6s-T5fU4.js} +1 -1
- package/dist/assets/{utils-CY3YGcdR.js → utils-A5fkS8h7.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DIBSJL4n.js → withTransactionSidePanel-C47wmMlX.js} +3 -3
- package/dist/assets/{zeni-epic-state-yHa8unrA.js → zeni-epic-state-DLEY0NmH.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-y8YhHSJR.js +0 -1
- package/dist/assets/AddressScreen-De5NyEzZ.js +0 -9
- package/dist/assets/ConnectionAuthScreen-DbBitMLj.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-LSIDUzax.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BtVT1jo7.js +0 -18
- package/dist/assets/DrawerScreen-DEO6aDXv.js +0 -1
- package/dist/assets/FeaturePreviewScreen-Bcz_KiRo.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CVv9wx7_.js +0 -12
- package/dist/assets/NotFoundScreen-DiKdubNF.js +0 -1
- package/dist/assets/PeopleRoutes-Dpf-nOzf.js +0 -22
- package/dist/assets/ScreenRoutes-B6CsF55P.js +0 -2
- package/dist/assets/SignInScreen-old3vVaI.js +0 -1
- package/dist/assets/TaskRoutes-vQ9Qc0Wt.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BnI9Ohm4.js +0 -1
- package/dist/assets/ZeniAccountStatementScreen-B61YBb2s.js +0 -9
- package/dist/assets/epic-uAZSWoZy.js +0 -2
- package/dist/assets/useAskAiCfoHostNavButtonProps-BO9PbO4e.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-QExkfWwX.js";import{z as b,a6 as N,j as d,Q as S,e0 as I,W as k,A as C}from"./index-BvMe6BwU.js";import"./mui-DA_IUYGW.js";import g from"./NotFoundScreen-azJwEf6u.js";import{a as c}from"./sentry-oILOkT84.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as u,N as y}from"./core-C9JgQJB4.js";import{fI as _,a2u as j,a2v as p,Ea as P,q3 as V,a2w as q,E8 as z}from"./zeni-epic-state-DLEY0NmH.js";import"./recharts-ikWEYduq.js";import"./analytics-Dk2G_EzJ.js";import"./plaid-CG0Jj5NR.js";import"./dnd-C8GpPG0g.js";import"./stripe-cKAAJElX.js";import"./lottie-C8c0mGol.js";import"./lexical-DewpM37L.js";import"./pdf-CglQcGFZ.js";import"./utils-A5fkS8h7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5fb6512a-3a91-46ee-8890-616d57807c4b",e._sentryDebugIdIdentifier="sentry-dbid-5fb6512a-3a91-46ee-8890-616d57807c4b")}catch{}})();const A=T((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(I),G=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),w=L(),f=b.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:d,onLoad:o=>(E=>E.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(A,{navigate:l,location:w,currentTenant:r,companyName:v,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(u,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(u,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as E}from"./liveblocks-
|
|
1
|
+
import{j as E}from"./liveblocks-QExkfWwX.js";import{a as A}from"./sentry-oILOkT84.js";import{i as M,u as H,h as Q,g as ee,j as h,l as te}from"./core-C9JgQJB4.js";import{Xc as Fe,Xd as Ve,m3 as ae,sB as Ge,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xe as Ye,fI as K,Wb as pe,Xf as Se,h2 as ne,cC as le,cD as se,FA as ve,Xg as Ce,FE as Xe,gS as ce,sE as ze,td as qe,dE as Ze,dD as We,Tz as fe,Fy as He,Fs as Qe,Xh as De,Fk as et,Fj as tt,Fe as at,Fp as nt,FF as lt,Xi as Y,Xj as ge,Fl as st,Wc as oe,FV as Ae,FO as Ie,Xk as xe,sH as Te,FI as Be,FG as Le,Xl as Je,G0 as je,FZ as we,FJ as be,F$ as Ne}from"./zeni-epic-state-DLEY0NmH.js";import{a2 as de,aW as ie,aX as ct,z as ot,h as dt,a5 as it,a6 as ue,j as _,at as ut,aY as rt,p as V,G as ye,K as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-BvMe6BwU.js";import{n as re}from"./mui-DA_IUYGW.js";import{p as St}from"./pathToGoBack-Cad-ghSF.js";import W from"./NotFoundScreen-azJwEf6u.js";import{c as G}from"./routePaths-CehqSbwZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b0e24764-79d6-4873-9029-357258a26f39",e._sentryDebugIdIdentifier="sentry-dbid-b0e24764-79d6-4873-9029-357258a26f39")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,s??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{s!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ge(s))}),[s,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(W,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(s,u,r))},onSkip:(u,r)=>{n($e(s,u,r))}})})}const ft=re.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-azJwEf6u.js","assets/sentry-oILOkT84.js","assets/core-C9JgQJB4.js","assets/zeni-epic-state-DLEY0NmH.js","assets/index-BvMe6BwU.js","assets/mui-DA_IUYGW.js","assets/analytics-Dk2G_EzJ.js","assets/utils-A5fkS8h7.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-ePaa6RzM.js","assets/withTransactionSidePanel-C47wmMlX.js","assets/useAskAiCfoHostNavButtonProps-BCWJ7jlQ.js","assets/TransactionDetailScreen-CuKBIwpF.js","assets/decodeURIComponentSafe-CYuijBUP.js","assets/useInitialThreadRequest-BCD3tBzH.js","assets/routePaths-CehqSbwZ.js","assets/expenseAutomationHelper-jtvNac2y.js","assets/stripSplatSuffix-DfsbDgo5.js","assets/analyticsHelper-D3Z95hnv.js","assets/CompanyPassportScreen-2YfwMC3n.js","assets/MobileAppDrawer-l8XzezC6.js","assets/InboxNotificationsProvider-yQHZ5K7x.js","assets/useTaskManagerAccess-BRPFjPMD.js","assets/useAiCfoDashboardSuggestedQuestionsChips-C5O_5leW.js","assets/FeaturePreviewScreen-WONNYPz2.js","assets/BillPayRoutes-zkvSlLIB.js","assets/AddressScreen-BaUyC6hl.js","assets/DomesticWireDetailScreen-DGTecQgJ.js","assets/BusinessVerificationPageScreen-DNhcrJIG.js","assets/DrawerScreen-Ac2BNHGU.js","assets/SetupPagesScreen-Bwcyn81K.js","assets/BillPayApprovalRoutes-BdAzyIqn.js","assets/ReimbursementApprovalRuleDetailScreen-DILlSzn2.js","assets/getLocaleForTenant-CZcWFJHh.js","assets/ReimbursementRoutes-6xzsoOoQ.js","assets/ReimbursementApprovalRoutes-Q1SCHF1l.js","assets/TransactionListRoutes-D-MmK7A2.js","assets/ZeniAccountStatementScreen-DEVWrSPx.js","assets/SettingsRoutes-DFwRhTG0.js","assets/AccountMappingScreen-BlAlbrnx.js","assets/QBOConnectionScreen-BSw99hss.js","assets/empty-Bn6LwN65.js","assets/index-B2whCLRz.js","assets/url-DoKU4Zzh.js","assets/index-BuFdtVKe.js","assets/accountMappingHelper-Cmqzt3o8.js","assets/useEmailConnectResultRefresh-Bv3uwquX.js","assets/ReportsRoutes-BOEFIFhM.js","assets/ChargeCardRoutes-CUIv6Ff9.js","assets/useChargeCardPusherEvents-C3NE2ZHP.js","assets/PeopleRoutes-BxrX1JFh.js","assets/ExpenseAutomationRoutes-CbAy6bRF.js","assets/useActualMatchingMatchDetail-hr4zSrCe.js","assets/ScheduleDetailsPrepaidExpensesScreen-5-GevFMn.js","assets/pathToGoBack-Cad-ghSF.js","assets/TreasuryRoutes-Pqnpfg2v.js","assets/VendorsRoutes-CNNCASwJ.js","assets/ZeniAccountRoutes-5EIDUyAv.js","assets/AddressRoutes-CjGixOCb.js","assets/PandLWithForecastRoutes-FHrcpjWT.js","assets/CustomerOnboardingRoutes-CmTSBCfZ.js","assets/TransactionDetailRoutes-BHcGo7KC.js","assets/EntityDetailRoutes-By8U2MA9.js","assets/InvoicingRoutes-7QJOc7_T.js","assets/NotificationRoutes-C4m7rB7l.js","assets/PerformanceRoutes-u7jsxKOk.js","assets/ActualMatchingMatchDetailScreen-BJS18VqA.js","assets/RewardsRoutes-DJDgplhQ.js","assets/TaskRoutes-B6-8g-HW.js","assets/TaskListScreen-vhycpFEZ.js","assets/useTaskManagerPusherEvents-6s-T5fU4.js","assets/AiCfoScreen-C2aGObgH.js","assets/CardsAiCfoScreen-C6zY5aHa.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as s,bn as Es,fI as hs,e0 as ps,d$ as xs,Bl as gs,dj as Rs,c9 as Is,gM as js,gc as Ts,dg as pe,cH as As,gq as bs,cz as Ds,bF as fs,br as ys,UE as vs,v as Cs,UH as Os,bq as Us,UI as Ps,bL as ws,bK as Fs,bu as Ls,cv as Hs,UJ as Vs,UK as ks,db as Bs,de as Ss,dd as Ns,cG as Ms,cN as Zs,pW as xe,gl as ge,h0 as $s,gn as Re,gO as Ie,gP as je,go as zs}from"./zeni-epic-state-DLEY0NmH.js";import{j as e}from"./liveblocks-QExkfWwX.js";import{a as P}from"./sentry-oILOkT84.js";import{N as u,u as Gs,h as qs,i as Ws,g as Ys,j as $,q as Te,n as Ks,o as n}from"./core-C9JgQJB4.js";import{I as l,u as Js,z as y,W as Qs,d as Xs,D as et,A as S,f as st,M as tt,V as nt,L as F,G as Ae,t as _,P as at,N as ot,j as ne}from"./index-BvMe6BwU.js";import{u as rt}from"./mui-DA_IUYGW.js";import{f as be}from"./analyticsHelper-D3Z95hnv.js";import{t as it}from"./getLocaleForTenant-CZcWFJHh.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="3fe75de4-c251-4930-a3e1-8bbe33451cd9",o._sentryDebugIdIdentifier="sentry-dbid-3fe75de4-c251-4930-a3e1-8bbe33451cd9")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-azJwEf6u.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(H===!0){if(o)return e.jsx(fe,{tenantEmailDomain:C});if(i)return e.jsx(De,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(fe,{tenantEmailDomain:C}):i?e.jsx(De,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):D?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-ePaa6RzM.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-zkvSlLIB.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-6xzsoOoQ.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-D-MmK7A2.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-DFwRhTG0.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-BOEFIFhM.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CUIv6Ff9.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-BxrX1JFh.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CbAy6bRF.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-Pqnpfg2v.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-CNNCASwJ.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-5EIDUyAv.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-BOEFIFhM.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-CjGixOCb.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-BxrX1JFh.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-FHrcpjWT.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-CmTSBCfZ.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-CNNCASwJ.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-BHcGo7KC.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-By8U2MA9.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-ePaa6RzM.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-zkvSlLIB.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),jt=l((()=>s((()=>import("./SettingsRoutes-DFwRhTG0.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-7QJOc7_T.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-6xzsoOoQ.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-5EIDUyAv.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-Pqnpfg2v.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-D-MmK7A2.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),ft=l((()=>s((()=>import("./ChargeCardRoutes-CUIv6Ff9.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-C4m7rB7l.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-u7jsxKOk.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-CbAy6bRF.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-BJS18VqA.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-DJDgplhQ.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-B6-8g-HW.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-C2aGObgH.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-C6zY5aHa.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-azJwEf6u.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-vhycpFEZ.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:V})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(H)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return C===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):H?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Gs(),N=qs(),{tenantEmailDomain:i}=Ws(),H=rt().mode,{setLoading:O,clearAllLoading:C,clearLoading:V}=Js(),f=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),K=Es(j),z=Ys(),[L,we]=P.useState(!1),r=$((a=>hs(a))),{useFeatureGate:k}=Qs(),M=Xs(),J=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=k(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,Q=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,Ve=st(r,He,oe),{isCardsHidden:ke}=tt(r?.tenantId),Be=!Ve||!!ke,{isFeatureEnabled:Se}=k(S.isSettingsFeatureEnabled),{isFeatureEnabled:X}=k(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),G=$((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,H)}const Z={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),h=nt(),$e=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),ze=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&f!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=fs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?D(vs(f,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,D,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,D,qe))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){B(Re(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(zs(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,f,j,O,D))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),j!=null&&be(j,r,H,void 0,G.tenantsBaseInOrder))}),[G,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(C(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:We}=k(S.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=k(S.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Je=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,Qe=Ps(h?.loggedInUserRoleMap),Xe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Hs(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=ks(h?.loggedInUserRoleMap),is=Bs(h?.loggedInUserRoleMap),ls=Ss(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Qe===!0||os===!0||rs===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(j!=null&&T!=="In-Progress"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||K&&!ee)&&es&&Xe!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||K?!L||te!==!1||ee||K?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Je?e.jsx(Rt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(Dt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:J===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:J===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:J===!0&&U===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(gt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(ft,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,$t as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-QExkfWwX.js";import{a as d}from"./sentry-oILOkT84.js";import{h as L,g as H,u as U,i as N,j as C,l as K,n as X,o as k}from"./core-C9JgQJB4.js";import{fI as w,ZT as Pe,O1 as ve,Zq as we,Zz as Ae,c9 as Q,cU as _e,cV as De,bq as Ue,df as Re,Gj as Me,ZU as Te,Pu as Be,MU as Oe,ML as de,MI as Ve,Gn as ue,MO as pe,MR as ge,MX as Y,Cx as ee,Gm as Fe,ly as $,lB as me,ZV as Le,mL as Ne,GE as Ze,W5 as Ge,W6 as $e,lw as He,ZW as Ke,lz as We,uL as ze,W0 as qe,W1 as Xe,uP as Je,hZ as Qe,U$ as q,hR as ae,hO as Ye,hW as en,V0 as nn,GB as tn,ZX as an,ZY as on,N9 as sn,m3 as rn,d$ as fe,e0 as he,ZZ as ln,gF as cn,Vf as dn,GA as oe,gK as se,gJ as un,Gz as pn,gI as gn,gH as mn,Z_ as fn,Ur as Ce,Z$ as hn,_0 as Cn,_1 as yn,_2 as Sn,_3 as bn,_4 as In,GH as xn,_5 as En,Gy as ie,Gs as G,_6 as kn,_7 as jn,_8 as re,_9 as Pn,dU as vn,_a as wn,_b as An,_c as _n,UD as Dn,c1 as Un,c8 as Rn,c7 as Mn,c2 as Tn,_d as Bn,c5 as On,c4 as Vn,c6 as Fn,c3 as Ln}from"./zeni-epic-state-DLEY0NmH.js";import{bR as Nn,z as v,V as Z,a5 as ne,c1 as Zn,j as W,W as te,A as V,f as ye,M as Se,c2 as Gn,h as $n,X as be,c3 as Hn,ag as Kn,c4 as Wn,c5 as zn,ao as qn,c6 as Xn,p as Jn,c as Ie,c7 as Qn}from"./index-BvMe6BwU.js";import{n as B}from"./mui-DA_IUYGW.js";import{u as xe}from"./useTaskManagerAccess-BRPFjPMD.js";import{U as Yn}from"./AccountMappingScreen-BlAlbrnx.js";import{t as et,A as nt}from"./AddressScreen-BaUyC6hl.js";import F from"./NotFoundScreen-azJwEf6u.js";import{g as tt}from"./analyticsHelper-D3Z95hnv.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DNhcrJIG.js";import{C as st}from"./CompanyPassportScreen-2YfwMC3n.js";import{M}from"./MobileAppDrawer-l8XzezC6.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-Bv3uwquX.js";import{q as le}from"./QBOConnectionScreen-BSw99hss.js";import{B as lt}from"./BillPayApprovalRoutes-BdAzyIqn.js";import{R as ct}from"./ReimbursementApprovalRoutes-Q1SCHF1l.js";import"./recharts-ikWEYduq.js";import"./analytics-Dk2G_EzJ.js";import"./plaid-CG0Jj5NR.js";import"./dnd-C8GpPG0g.js";import"./stripe-cKAAJElX.js";import"./lottie-C8c0mGol.js";import"./lexical-DewpM37L.js";import"./pdf-CglQcGFZ.js";import"./utils-A5fkS8h7.js";import"./accountMappingHelper-Cmqzt3o8.js";import"./routePaths-CehqSbwZ.js";import"./InboxNotificationsProvider-yQHZ5K7x.js";import"./empty-Bn6LwN65.js";import"./pdf-lib-C9IVGH9O.js";import"./index-B2whCLRz.js";import"./url-DoKU4Zzh.js";import"./index-BuFdtVKe.js";import"./decodeURIComponentSafe-CYuijBUP.js";import"./ReimbursementApprovalRuleDetailScreen-DILlSzn2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="cd861493-7ba3-4d61-966a-066b051e3488",e._sentryDebugIdIdentifier="sentry-dbid-cd861493-7ba3-4d61-966a-066b051e3488")}catch{}})();const dt=B.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-CcAJDSgG.js";import{a as d}from"./sentry-Bo3euLo
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(
|
|
9
|
+
`,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(Q(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Zn),pt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=Z();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-CcAJDSgG.js";import{a as d}from"./sentry-Bo3euLo
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(Y(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Oe(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),r=Z(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,
|
|
17
|
+
`,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(Y(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Oe(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),r=Z(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=_e(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),_=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Me(!1)))}),[h,o,p]);const T=A=>{u(A)};return b||P||E||_?a.jsxs(gt,{children:[a.jsx(M,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:_,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(F,{})},ht=B.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-CcAJDSgG.js";import{a as d}from"./sentry-Bo3euLo
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Le(e,o),{uiState:t}=n,s=(
|
|
25
|
+
`,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Le(e,o),{uiState:t}=n,s=(Q(i?.userRole??[])||r)&&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:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(Y(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=Z();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=K((function(e){const l=Xe(e,J);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Ye(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Qe(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(Wn),bt=()=>{const e=Kn(),l=L(),o=U(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=Z(),m=Q(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(J))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(M,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-CcAJDSgG.js";import{a as d}from"./sentry-Bo3euLo
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,Et=()=>{const e=U(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),
|
|
41
|
+
`,Et=()=>{const e=U(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(Y(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(M,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-CcAJDSgG.js";import{a as d}from"./sentry-Bo3euLo
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,ce=({appContent:e})=>{const l=U(),o=L(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:
|
|
49
|
+
`,ce=({appContent:e})=>{const l=U(),o=L(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&b,j=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),_=!j||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Xn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:_,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{D(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const O=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(O,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const O={...x.myProfileLocalData,phone:y};l(oe({localData:O})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,O)=>{l(un(y,O,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=U(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),_=d.useCallback(((f,D,y)=>{e(jn({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(Pn({groupId:f,frequency:vn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(wn({groupId:f,channel:re(D),enabled:y}))}),[e]),T=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:_,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,_,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(_n()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(M,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Qn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:R,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=Z(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Un(r)?a.jsxs(X,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Yn,{})}),Mn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),On(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Ln(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(X,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function Pt(e){return a.jsxs(X,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{da as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-QExkfWwX.js";import{h as Y,g as X,u as ee,i as W,j as _,N as R,l as H,t as en}from"./core-C9JgQJB4.js";import{bK as nn,fI as x,cH as tn,Ib as J,Zq as an,Zt as sn,v2 as ne,uS as te,mD as ae,C3 as N,Zv as be,gJ as He,gI as Ge,gH as Ke,Zw as on,Ik as cn,MU as Ce,ML as he,MI as Ie,Mn as Q,MO as Ae,MR as ke,MX as _e,Cx as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,Zx as yn,Ln as fe,L$ as fn,Zy as gn,bL as Sn,Od as ge,O1 as bn,Zz as Cn,ZA as hn,Oh as In,Ol as An,ZB as je,BY as kn,SM as _n,ZC as vn,ZD as Pn,ZE as Tn,ZF as qe,ZG as En,ZH as Dn,VQ as On,YH as Un,W3 as wn,ZI as Je,Mz as Fn,Mr as xn,W4 as Vn,Mv as Bn,ZJ as Ue,P1 as Qe,mL as jn,uV as Ye,C5 as Rn,bF as Re,Ch as Le,cF as Ln,ZK as Xe,OT as we,OA as Nn,OB as Mn,OF as zn,ZL as Zn,OW as Ne,ZM as $n,ZN as Wn,ZO as Hn,PI as Se,ZP as Gn,gZ as Kn,Jw as qn,ZQ as Jn,JB as Qn,JA as Yn}from"./zeni-epic-state-DLEY0NmH.js";import{ag as Pe,V as ie,W as de,A as q,z as E,a6 as se,j as D,a5 as Te,Q as $,bO as Xn,ac as oe,bP as V,bg as xe,bQ as et,bR as nt,bS as tt,n as Be,bT as at,p as Me,aE as ze,$ as it,a9 as st,bU as ot,bV as ct,bW as rt,w as ut}from"./index-BvMe6BwU.js";import{a as h}from"./sentry-oILOkT84.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-DA_IUYGW.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-DNhcrJIG.js";import{M as le}from"./MobileAppDrawer-l8XzezC6.js";import L from"./NotFoundScreen-azJwEf6u.js";import{a as $e}from"./analyticsHelper-D3Z95hnv.js";import{d as We}from"./routePaths-CehqSbwZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="3b39fb8a-22e2-4c79-9930-2ebfcfc3db33",e._sentryDebugIdIdentifier="sentry-dbid-3b39fb8a-22e2-4c79-9930-2ebfcfc3db33")}catch{}})();const mt=Ve.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-CcAJDSgG.js";import{h as Y,g as X,u as ee,i as W
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,yt=H((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=x(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(J(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(J(t,!0))},onEnableBillPayClick:()=>{e(Q(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(J(t,!0))},onGetOtp:(n,i)=>{e(Ke(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(He(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(N(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(N(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Xn),ft=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=de(),{isFeatureEnabled:s}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(q.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=k((m=>m.billPaySetupViewState.fetchState)),d=k((m=>x(m)));pt();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(J(y,!1,!0))):(_.current=!0,t(J(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(R,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.Event.billPaySetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Gt=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Kt=e=>`/${e}/cards`,qt=e=>`/${e}/cards/setup`,Jt=e=>`/${e}/cards/onboard`,Qt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Yt=(e,o)=>e.find((a=>a.id===o)),Xt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=H((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=x(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(ve("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ke(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(_e(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Ae(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Q(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Q(t,"charge_cards")):i===!0&&c===!1&&e(Q(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(d,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(be({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(N(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(N(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(N(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(fn(t,d))}}}))(et),ht=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>x(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(xe.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(q.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(q.isCardPolicyEnabled),y=k((M=>rn(M,i.companyId))),f=un(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=dn(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),O=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:O}),U=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,G]=h.useState(!1),[K,re]=h.useState(!1),Z=k((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{G(M)},pe=k((M=>yn(M,j)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{K||Z!=="Not-Started"||j==null?K||Z!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[K,Z,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=gt(A,C,b,v);return me||ye?me||ye?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),u.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:U,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):u.jsx(Te,{fetchState:"Not-Started"}):u.jsx(R,{to:"../promo"})},It=Ve.div`
|
|
9
|
+
`,yt=H((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=x(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(J(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(_e(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(J(t,!0))},onEnableBillPayClick:()=>{e(Q(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(J(t,!0))},onGetOtp:(n,i)=>{e(Ke(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(He(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(N(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(N(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Xn),ft=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=de(),{isFeatureEnabled:s}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(q.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),k=h.useRef(!1),I=_((m=>m.billPaySetupViewState.fetchState)),d=_((m=>x(m)));pt();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{k.current||I!=="Not-Started"||y==null?k.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(k.current=!0,t(J(y,!1,!0))):(k.current=!0,t(J(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(R,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.Event.billPaySetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Gt=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Kt=e=>`/${e}/cards`,qt=e=>`/${e}/cards/setup`,Jt=e=>`/${e}/cards/onboard`,Qt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Yt=(e,o)=>e.find((a=>a.id===o)),Xt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=H((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=x(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:k,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&k?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(ve("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(_e(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(ke(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Ae(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Q(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Q(t,"charge_cards")):i===!0&&c===!1&&e(Q(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(d,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(be({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(N(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(N(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(N(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(fn(t,d))}}}))(et),ht=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=_((M=>x(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(xe.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(q.isDebitCardFeatureEnabled),{isFeatureEnabled:k}=s(q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(q.isCardPolicyEnabled),y=_((M=>rn(M,i.companyId))),f=un(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=dn(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),O=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:k,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:O}),U=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,G]=h.useState(!1),[K,re]=h.useState(!1),Z=_((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{G(M)},pe=_((M=>yn(M,j)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{K||Z!=="Not-Started"||j==null?K||Z!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[K,Z,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=gt(A,C,b,v);return me||ye?me||ye?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),u.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:U,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):u.jsx(Te,{fetchState:"Not-Started"}):u.jsx(R,{to:"../promo"})},It=Ve.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-CcAJDSgG.js";import{h as Y,g as X,u as ee,i as W
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,At=H((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=x(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(Q(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(N(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"reimbursement_setup",n,i))}}}))(tt),_t=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=k((P=>P.remiSetupViewState.fetchState)),d=k((P=>x(P))),y=k((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(_(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(R,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(It,{children:[u.jsx(se,{analytics:D,onLoad:T=>P(T)}),u.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},kt=H((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=On(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Un(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:O,sourceOfFunds:A,companySubIndustry:U,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:G,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:j,usNexus:w,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Ln(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:P!=null?Re(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:O?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:U?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:G,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:j,usNexus:w,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Le({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:v,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Le({officers:c}))},onSaveDetailsClick:s=>{e(N(a,s,t))},onSendForVerificationClick:s=>{e(N(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Rn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Ye(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ke(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(He(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Qe())},onOverlayClose:()=>{e(Ue())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=Vn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(xn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Y(),r=X(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=de(),I=Ee(),{configValue:d}=_(xe.zeniAccountsConfig),y=je(d),f=k((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=k((A=>A.companyConfigState.fetchState)),b=k((A=>A.userRoleConfigState.fetchState)),m=k((A=>x(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(_n()),b==="Not-Started"&&n(kn(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=k((A=>{let U;switch(e){case"zeni_accounts":U=En(A,C);break;case"zeni_treasury":U=qe(A,C);break;case"charge_cards":U=Tn(A,C);break;case"reimbursement":U=Pn(A,C);break;default:U=vn(A,C)}return U})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&(Ze(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let O;switch(e){case"zeni_accounts":O=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":O=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":O=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":O=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:O=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return O===!1?null:P.fetchState==="Completed"&&O===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(kt,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Xe(e,t),c=qe(e,t),p=a&&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=Zn(e),S=g.transactions,_=Je(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Hn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(we(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ke(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(we(t,!0))},onEnableTreasuryClick:()=>{e(Q(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(N(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Ne(!1))}c===!0&&e(Qe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Ne(n))},onOverlayClose:()=>{e(Ue())}}}))(ot),Et=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=de(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(xe.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),O=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),U=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>x(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Xe(w,F))),G=ce.isAtomicAccountExists,K=E.getSignedInUser(),re=w=>{d(w)};if(K==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||O!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,O,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Nn()))}),[v,A,F,t]),h.useEffect((()=>{m||U!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,U,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(zn(!0)))}),[P,B,F,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||O!=="Completed"||G||j||!a.pathname.includes("setup")||p(!0)}),[O,G,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(R,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(dt,{onClose:()=>{t(Ue()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Dt,{onClick:w=>w.stopPropagation(),children:u.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ue()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:G,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=Ve(lt)`
|
|
17
|
+
`,At=H((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=x(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:k}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:k}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(_e(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(Q(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(N(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"reimbursement_setup",n,i))}}}))(tt),kt=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,k]=h.useState(!1),I=_((P=>P.remiSetupViewState.fetchState)),d=_((P=>x(P))),y=_((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(k(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(R,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(It,{children:[u.jsx(se,{analytics:D,onLoad:T=>P(T)}),u.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},_t=H((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=On(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Un(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:k,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:O,sourceOfFunds:A,companySubIndustry:U,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:G,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:j,usNexus:w,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:k,website:I!=""&&I!=null?Ln(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:P!=null?Re(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:O?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:U?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:G,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:j,usNexus:w,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Le({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:k,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:k.firstName,lastName:k.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:v,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Le({officers:c}))},onSaveDetailsClick:s=>{e(N(a,s,t))},onSendForVerificationClick:s=>{e(N(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((k,I)=>{S[I]=k})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Rn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Ye(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ke(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(He(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Qe())},onOverlayClose:()=>{e(Ue())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=Vn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(xn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Y(),r=X(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:k}=de(),I=Ee(),{configValue:d}=k(xe.zeniAccountsConfig),y=je(d),f=_((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=_((A=>A.companyConfigState.fetchState)),b=_((A=>A.userRoleConfigState.fetchState)),m=_((A=>x(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(kn()),b==="Not-Started"&&n(_n(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=_((A=>{let U;switch(e){case"zeni_accounts":U=En(A,C);break;case"zeni_treasury":U=qe(A,C);break;case"charge_cards":U=Tn(A,C);break;case"reimbursement":U=Pn(A,C);break;default:U=vn(A,C)}return U})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&(Ze(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let O;switch(e){case"zeni_accounts":O=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":O=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":O=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":O=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:O=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return O===!1?null:P.fetchState==="Completed"&&O===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(_t,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Xe(e,t),c=qe(e,t),p=a&&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=Zn(e),S=g.transactions,k=Je(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:k,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Hn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(we(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(_e(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(ke(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(we(t,!0))},onEnableTreasuryClick:()=>{e(Q(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(N(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Ne(!1))}c===!0&&e(Qe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Ne(n))},onOverlayClose:()=>{e(Ue())}}}))(ot),Et=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=de(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(xe.zeniAccountsConfig),k=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),O=_((w=>w.treasurySetupViewState.fetchState)),A=_((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),U=_((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=_((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=_((w=>x(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=_((w=>Xe(w,F))),G=ce.isAtomicAccountExists,K=E.getSignedInUser(),re=w=>{d(w)};if(K==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||O!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,O,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Nn()))}),[v,A,F,t]),h.useEffect((()=>{m||U!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,U,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(zn(!0)))}),[P,B,F,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||O!=="Completed"||G||j||!a.pathname.includes("setup")||p(!0)}),[O,G,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(R,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(dt,{onClose:()=>{t(Ue()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Dt,{onClick:w=>w.stopPropagation(),children:u.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ue()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:k.maxInsuredAmount,isAllocationDone:G,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=Ve(lt)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,Ot=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Gn(e,t),c=a&&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";return{zeniAccountSetUpView:s,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Se(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(ve("account_setup",n,i))},onEstablishConnectionClick:n=>{e(
|
|
21
|
+
`,Ot=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Gn(e,t),c=a&&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";return{zeniAccountSetUpView:s,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Se(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(ve("account_setup",n,i))},onEstablishConnectionClick:n=>{e(_e(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(Se(t,!0))},onEnableZeniAccountClick:()=>{e(Q(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"zeni_accounts","account_setup"):Ie("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(N(t,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(ct),Ut=()=>{const e=Pe(),o=Y(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=de(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(xe.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,k]=h.useState(!1),I=_((b=>b.zeniAccountSetupViewState.fetchState)),d=_((b=>x(b))),y=E.getSignedInUserTenant(r)?.companyId??d.companyId,f=E.getSignedInUser(),v=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(Se(y,!1,!0)):(k(!0),t(Se(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(R,{to:"../promo"});{const b=m=>m.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(le,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),u.jsx(Ot,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{v(!0)}})]})}},wt=Ve.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-CcAJDSgG.js";import{h as Y,g as X,u as ee,i as W
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Ft=H((function(e,o){const a=x(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Jn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Yn(t))},onSubmitClick:()=>{e(Qn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Ye(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(rt),xt=()=>{const e=Y(),o=X(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=de(),{isFeatureEnabled:S}=g(q.isBillPayLocalCurrencyFeatureEnabled),_
|
|
29
|
+
`,Ft=H((function(e,o){const a=x(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Jn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Yn(t))},onSubmitClick:()=>{e(Qn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Ye(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(rt),xt=()=>{const e=Y(),o=X(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=de(),{isFeatureEnabled:S}=g(q.isBillPayLocalCurrencyFeatureEnabled),k=_((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=_((T=>T.billPaySetupViewState.fetchState)),d=_((T=>x(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,v=_((T=>Kn(T.companyState,d.companyId))),b=v?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||k!=="Not-Started"||f==null||(r(!0),a(qn(f)))}),[t,k,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a(J(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=T=>{s(T)};return C===!1?u.jsx(R,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(wt,{children:[u.jsx(se,{analytics:D,onLoad:T=>(O=>O.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?u.jsx(le,{isAppContentDrawerOpen:l,handleDrawerToggle:P}):null,u.jsx(Ft,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Vt=H((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(ge(a,!0,!0));break;case"zeni_accounts":e(Se(a,!0,!0));break;case"charge_cards":e(fe(a,!0,!0));break;case"zeni_treasury":e(we(a,!0,!0));break;default:e(J(a,!0,!0))}}}}}))(ut((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Oe,{productType:s}):a?u.jsx(R,{to:"../"}):u.jsx(L,{});case"international-wire":return o?u.jsx(xt,{}):a?u.jsx(R,{to:"../"}):u.jsx(L,{});default:return o?u.jsx(ft,{}):a?u.jsx(R,{to:"../"}):u.jsx(L,{})}case"reimbursement":return c==="verification"?t?u.jsx(Oe,{productType:s}):u.jsx(L,{}):t?u.jsx(kt,{}):u.jsx(L,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Oe,{productType:"zeni_accounts"}):u.jsx(L,{}):r?u.jsx(Ut,{}):u.jsx(L,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(L,{});case"charge_cards":return c==="verification"?i?u.jsx(Oe,{productType:"charge_cards"}):l?u.jsx(R,{to:"../"}):u.jsx(L,{}):i?u.jsx(ht,{}):l?u.jsx(R,{to:"../"}):u.jsx(L,{})}})));function ua(e){const{tenantEmailDomain:o}=W(),a=_((r=>x(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Vt,{...e,companyId:a,...t})}export{ia as A,sa as P,ua as S,na as a,aa as b,St as c,bt as d,gt as e,oa as f,Qt as g,Kt as h,ea as i,ta as j,ca as k,Xt as l,Yt as m,qt as n,Jt as o,Gt as p,ra as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-QExkfWwX.js";import{a as f,R as T,t as A}from"./sentry-oILOkT84.js";import{u as z,h as D,j as c,g as M,N as O,l as j}from"./core-C9JgQJB4.js";import{u as P,z as s,j as E,G as F,O as N,Q as _,R as B,S as R,U as V,X as v}from"./index-BvMe6BwU.js";import{fI as $,Un as H,UH as J,gl as Q,gn as W,UM as X,gY as Y,dk as G,UN as y,UO as q,UP as K,c0 as U}from"./zeni-epic-state-DLEY0NmH.js";import{u as Z}from"./mui-DA_IUYGW.js";import{u as ee}from"./useDeviceId-DZAWgg2s.js";import{f as te}from"./analyticsHelper-D3Z95hnv.js";import{t as ne}from"./getLocaleForTenant-CZcWFJHh.js";import"./recharts-ikWEYduq.js";import"./analytics-Dk2G_EzJ.js";import"./plaid-CG0Jj5NR.js";import"./dnd-C8GpPG0g.js";import"./stripe-cKAAJElX.js";import"./lottie-C8c0mGol.js";import"./lexical-DewpM37L.js";import"./pdf-CglQcGFZ.js";import"./utils-A5fkS8h7.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]="ed121e85-48e8-47ca-aec9-3dcabd78f5b9",t._sentryDebugIdIdentifier="sentry-dbid-ed121e85-48e8-47ca-aec9-3dcabd78f5b9")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({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 l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(K({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(l),sourceUri:U(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(q(n,a)))},clearSignInError:()=>{t(y())}}}))(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:L}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),h=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>$(e))),I=c((e=>H(e))),m=M(),w=Z().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[k.fetchState,l]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),Q(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(X("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Y().then((()=>{const e=R();e!=null&&N(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",G(r.productSettings))}),2e3))}),[S,p,h,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 u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&L!=null?u.jsx(B,{onClose:()=>i(y()),unlockDate:L}):null]})}export{ve as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-QExkfWwX.js";import{a as i}from"./sentry-oILOkT84.js";import{u as d,g as f,N as u}from"./core-C9JgQJB4.js";import{z as n,j as a,Q as m,a5 as p}from"./index-BvMe6BwU.js";import{g$ as g,V1 as y}from"./zeni-epic-state-DLEY0NmH.js";import{n as b}from"./mui-DA_IUYGW.js";import"./recharts-ikWEYduq.js";import"./analytics-Dk2G_EzJ.js";import"./plaid-CG0Jj5NR.js";import"./dnd-C8GpPG0g.js";import"./stripe-cKAAJElX.js";import"./lottie-C8c0mGol.js";import"./lexical-DewpM37L.js";import"./pdf-CglQcGFZ.js";import"./utils-A5fkS8h7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c973ab0d-15e4-4860-812e-916a33444789",e._sentryDebugIdIdentifier="sentry-dbid-c973ab0d-15e4-4860-812e-916a33444789")}catch{}})();function N(){const e=d(),t=f(),r=i.useRef(!1),l=n.isSignedIn(),o=t.state?.message==="logout"||l;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(c){console.error("Error during sign out:",c)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as A}from"./liveblocks-
|
|
1
|
+
import{j as A}from"./liveblocks-QExkfWwX.js";import{a as u}from"./sentry-oILOkT84.js";import{u as H,k as J,j as C,h as me,g as Se,i as ye,l as De}from"./core-C9JgQJB4.js";import{z as Z,W as Ee,A as I,aq as be,a6 as he,j as Ce,Q as Ge,e3 as Ae,p as F,a2 as Ie}from"./index-BvMe6BwU.js";import{Qz as Re,Rn as ve,fI as Be,a2C as ne,gQ as q,a2D as re,a2y as Le,QR as X,a2E as Ke,R3 as Y,QB as we,Qd as Ue,Rz as ee,a2F as ae,gk as Pe,Rq as Fe,Rv as je,Ri as xe,Rg as te,Rw as $e,Rd as Oe,a2G as Ne,a2H as ze,a2I as Qe,a2J as Ze,a2K as R,dy as qe,dx as Me,a2L as Ve,Qy as We}from"./zeni-epic-state-DLEY0NmH.js";import{n as He}from"./mui-DA_IUYGW.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-BCWJ7jlQ.js";import{M as Xe}from"./MobileAppDrawer-l8XzezC6.js";import{u as Ye}from"./useTaskManagerPusherEvents-6s-T5fU4.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6e6ffdb9-54c4-4dc2-907b-39ccafd1af3d",e._sentryDebugIdIdentifier="sentry-dbid-6e6ffdb9-54c4-4dc2-907b-39ccafd1af3d")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-QExkfWwX.js";import he from"./NotFoundScreen-azJwEf6u.js";import{a as k}from"./sentry-oILOkT84.js";import{h as se,u as ne,j as g,g as Ee,i as be,N as De,l as Ie,n as Ce,o as E}from"./core-C9JgQJB4.js";import{Qq as oe,Qt as Ge,Qn as ye,a2x as _e,fI as re,a2y as ie,QU as D,QH as b,Qk as Ae,Rn as Re,Rg as Ue,a2z as ce,gk as le,a2A as H,Qg as ve,Qd as Be,v2 as xe,uS as we,mD as je,QF as Pe,a2B as Fe,Rz as Ke,QB as Le,R2 as Qe,Q$ as $e,Qw as Ne,QY as ze,QR as Ze}from"./zeni-epic-state-DLEY0NmH.js";import{z as I,e1 as Oe,K as Ve,W as qe,A as _,a2 as de,p as A,a6 as Me,j as J,Q as We,e2 as Ye,X,ac as He}from"./index-BvMe6BwU.js";import{n as Je}from"./mui-DA_IUYGW.js";import{u as Xe}from"./useInitialThreadRequest-BCD3tBzH.js";import{M as ea}from"./MobileAppDrawer-l8XzezC6.js";import{T as m,t as aa,b as ta,a as sa,c as na,d as ee,e as oa}from"./TaskListScreen-vhycpFEZ.js";import{u as ra}from"./useTaskManagerPusherEvents-6s-T5fU4.js";import"./recharts-ikWEYduq.js";import"./analytics-Dk2G_EzJ.js";import"./plaid-CG0Jj5NR.js";import"./dnd-C8GpPG0g.js";import"./stripe-cKAAJElX.js";import"./lottie-C8c0mGol.js";import"./lexical-DewpM37L.js";import"./pdf-CglQcGFZ.js";import"./utils-A5fkS8h7.js";import"./InboxNotificationsProvider-yQHZ5K7x.js";import"./useTaskManagerAccess-BRPFjPMD.js";import"./useAskAiCfoHostNavButtonProps-BCWJ7jlQ.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]="e1a24f11-2b76-4fd4-816d-9275ce4d1b14",e._sentryDebugIdIdentifier="sentry-dbid-e1a24f11-2b76-4fd4-816d-9275ce4d1b14")}catch{}})();function ia(){const e=se(),a=ne(),n=I.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:l}=g((r=>r.cannedResponsesState)),d=k.useCallback((()=>{a(oe())}),[a]),S=k.useCallback(((r,C,G)=>{a(Ge({name:r,content:C,cannedResponseId:G}))}),[a]),t=k.useCallback((r=>{a(ye({cannedResponseId:r}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(Oe,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:S})}const Q=e=>e?.taskState?.taskByID,K=(e,a)=>{const n=Q(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ca=_e([K,(e,a)=>{const n=K(e,a),c=Q(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=K(e,a),c=Q(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let ae,te=[];const la=Ie((function(e,a){const{location:n,taskGroupId:c}=a,s=ce(e,a.taskId),l=re(e),d=ca(e,a.taskId),S=s.taskGroupId??c,t=S!=null?H(e.taskGroupState,S):void 0,r=I.getSignedInUser(),C=l.tenantId,G={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:C??""},B=ie(e),{tenantEmailDomain:x}=l,R=s.recurringSourceTaskId,w=R!=null?`${X.appUrl}/${x}/tasks/${encodeURIComponent(R)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:G,isZeniUser:I.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==ae&&(ae=h,te=Object.values(h)),te),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:He.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${X.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:B,taskGroupName:S!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((f=>H(e.taskGroupState,f))).filter((f=>f!=null&&!f.isDeleted)).map((f=>({id:f.id,name:f.name,isDefault:f.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=s;return{onSaveChangesToLocalStore:t=>{e(Ze({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(ze(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Ne(a.taskId))},onSnoozeTask:(t,r)=>{e($e(t,r))},onUnsnoozeTask:t=>{e(Qe(t))},onCreateSubtask:(t,r)=>{e(Le({...r,parentTaskId:t}))},onSubtaskUpdate:(t,r)=>{e(Ke({task:t,updates:r}))},onShowToast:t=>{e(le(t))},onSubtaskRowClick:t=>{c(`/${S}/tasks/${t}`,{state:{pathnameStackToGoBack:A(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${S}/tasks/${t}`,{state:{pathnameStackToGoBack:A(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const t=de(l.state?.pathnameStackToGoBack),r=t.poppedPathname??"../../dashboard";c(r,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=v(S),r=A(l.state?.pathnameStackToGoBack,l.pathname);c(t,{state:{pathnameStackToGoBack:r}})}e(Fe({taskId:n}))},onDeleteTaskClick:()=>{e(Pe(n))},updateFilesEntity:t=>{e(je({files:t}))},onDeleteFile:t=>{e(we(t))},onEditFileName:(t,r)=>{e(xe(t,r.split(".")[0]))},onReloadTaskDetailPage:()=>{e(D(!1,n))},onCreateTagClick:t=>{e(Be(t,n))},onDeleteTagClick:t=>{e(ve(t,n))},onFetchCannedResponses:()=>{e(oe())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ye);function L(){const e=se(),a=ne(),n=Ee(),c=Ve(),{taskId:s,taskGroupId:l}=be(),d=g((o=>re(o))),S=Xe(d?.companyId),{useFeatureGate:t}=qe(),{isFeatureEnabled:r}=t(_.isTaskSnoozeEnabled),{isFeatureEnabled:C}=t(_.isTaskVisibilityEnabled),{isFeatureEnabled:G}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:B}=t(_.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=t(_.isTaskGroupAssigneesEnabled),[R,w]=k.useState(!1),[h,f]=k.useState(!1),[$,ue]=k.useState(!1),[N,j]=k.useState(!1),y=k.useRef(!1),U=g((o=>o.taskListState.updateTasksFetchState.fetchState)),z=g((o=>ie(o))),Z=g((o=>o.taskGroupViewState.fetchState));k.useEffect((()=>{a(D(!1,s)),s!=null&&a(b(s))}),[a,s]);const O=I.getSignedInUser()?.userId,ke=I.isZeniUser(),pe=g((o=>s!=null?o.taskState.taskByID[s]?.syncToken:void 0)),V=()=>{d?.tenantEmailDomain!=null&&e(v(d.tenantEmailDomain))},q=()=>{a(le({messageSection:"delete_task",messageText:"success",type:"success"})),V()},me=k.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],u=[...o,m.TASK_SNOOZE_RESURFACED];return[...ta(d?.companyId,o),...sa(O,u)]}),[d?.companyId,O]);ra({events:me,onSubscribed:()=>{s!=null&&(a(D(!0,s)),a(b(s)))},onEvent:(o,u)=>{if(s!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((F,fe,{isZeniUser:Te,storedSyncToken:ge,taskId:Y})=>{if(F!==m.TASK_CREATED&&F!==m.TASK_UPDATED)return"none";const T=aa(fe);return T==null?"none":T.parent_task_id===Y?"refreshSubtasks":F!==m.TASK_UPDATED||T.task_id!==Y?"none":T.is_deleted===!0?"leaveDeleted":T.is_private!==!0||Te?T.sync_token!=null&&T.sync_token===ge?"none":"refreshTask":"leaveNoAccess"})(o,u,{isZeniUser:ke,storedSyncToken:pe,taskId:s});p==="refreshTask"?(a(D(!0,s)),a(b(s))):p==="refreshSubtasks"?a(b(s)):p==="leaveDeleted"?q():p==="leaveNoAccess"&&V();break}case m.TASKS_BULK_UPDATED:{const p=ee(u);if(p==null)break;p.task_ids.includes(s)&&a(D(!0,s)),a(b(s));break}case m.TASKS_BULK_DELETED:{const p=ee(u);if(p==null)break;if(p.task_ids.includes(s)){q();break}a(b(s));break}case m.TASK_SNOOZE_RESURFACED:{na(u)?.task_id===s&&a(D(!0,s));break}}}}),k.useEffect((()=>{h||z.fetchState==="Completed"||(f(!0),a(Ae()))}),[h,a,z.fetchState]),k.useEffect((()=>{$||Z==="Completed"||(ue(!0),a(Re()))}),[$,a,Z]);const Se=k.useCallback((()=>{s!=null&&(y.current=!1,a(Ue([s],null,{isArchived:!1})),j(!0))}),[a,s]);k.useEffect((()=>{if(N)if(U!=="In-Progress"){if(y.current){if(U==="Error")return j(!1),void(y.current=!1);if(U==="Completed"){j(!1),y.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const u=de(n.state?.pathnameStackToGoBack);e(u.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:u.newStack}})}else{const u=v(o);e(u,{state:{pathnameStackToGoBack:A(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else y.current=!0}),[N,U,d,n,e]);const M=g((o=>ce(o,s))),P=M.fetchState,W=I.getSignedInUser();if(W==null)throw Error("Can't access task detail page without signing in...");if(P==="Error"&&M.error?.code===400){const{tenantEmailDomain:o}=d,u=v(o),p=A(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(De,{to:u,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[P==="Completed"?i.jsx(Me,{analytics:J,onLoad:o=>(u=>u.trackPageLoaded(We.Event.taskDetailPage))(o)}):null,i.jsxs(da,{children:[i.jsx(ea,{isAppContentDrawerOpen:R,handleDrawerToggle:o=>{w(o)}}),i.jsx(la,{analytics:J,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:W,navigate:e,taskGroupId:l,taskId:s,taskDetailFetchState:P,onUnarchiveTaskClick:Se,isTaskSnoozeEnabled:r,isTaskVisibilityEnabled:C,isTaskCannedResponsesEnabled:G,isTaskRecurringParentEnabled:B,isTaskGroupAssigneesEnabled:x})]})]})}const da=Je.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,v=e=>`/${e}/tasks`;function wa(){return i.jsxs(Ce,{children:[i.jsx(E,{path:"/new",element:i.jsx(L,{})}),i.jsx(E,{path:"/new/:taskGroupId",element:i.jsx(L,{})}),i.jsx(E,{path:"/group/:taskGroupId",element:i.jsx(oa,{})}),i.jsx(E,{path:"/quick-responses",element:i.jsx(ia,{})}),i.jsx(E,{path:"/:taskId",element:i.jsx(L,{})}),i.jsx(E,{path:"*",element:i.jsx(he,{})})]})}export{wa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-QExkfWwX.js";import i from"./NotFoundScreen-azJwEf6u.js";import{T as r}from"./TransactionDetailScreen-CuKBIwpF.js";import"./sentry-oILOkT84.js";import{n as a,o as e}from"./core-C9JgQJB4.js";import"./zeni-epic-state-DLEY0NmH.js";import"./recharts-ikWEYduq.js";import"./index-BvMe6BwU.js";import"./mui-DA_IUYGW.js";import"./analytics-Dk2G_EzJ.js";import"./plaid-CG0Jj5NR.js";import"./dnd-C8GpPG0g.js";import"./stripe-cKAAJElX.js";import"./lottie-C8c0mGol.js";import"./lexical-DewpM37L.js";import"./pdf-CglQcGFZ.js";import"./utils-A5fkS8h7.js";import"./useAskAiCfoHostNavButtonProps-BCWJ7jlQ.js";import"./decodeURIComponentSafe-CYuijBUP.js";import"./useInitialThreadRequest-BCD3tBzH.js";import"./routePaths-CehqSbwZ.js";import"./expenseAutomationHelper-jtvNac2y.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
|