@zeniai/web-app-ui 5.4.1-qa → 5.4.2-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-BdtNjCBI.js → AccountMappingScreen-DfowxAc-.js} +1 -1
- package/dist/assets/ActualMatchingMatchDetailScreen-DpqBi3lD.js +1 -0
- package/dist/assets/AddressRoutes-DAUco87Q.js +1 -0
- package/dist/assets/AddressScreen-Diwm_C2C.js +9 -0
- package/dist/assets/{AiCfoScreen-CCkwAPqN.js → AiCfoScreen-k4JvYL5q.js} +1 -1
- package/dist/assets/{AppDrawer-CWQ1asO3.js → AppDrawer-DBMNE-tW.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-C0ruzPoZ.js → BillPayApprovalRoutes-D9G2_YOz.js} +1 -1
- package/dist/assets/{BillPayRoutes-CV9mDJiA.js → BillPayRoutes-P8ok7ngf.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-CPavKmhf.js → BusinessVerificationPageScreen-B4wIaSZ_.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-csdwe-Dr.js +14 -0
- package/dist/assets/{ChargeCardRoutes-DJMJStiR.js → ChargeCardRoutes-D1ZdbX_z.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-CIGUDZ1Q.js → CompanyPassportScreen-d28meAXB.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BbmNog_4.js → ConnectionAuthScreen-CIc-7q2q.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BCLoKVKx.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DO2-x5Dx.js → CustomerOnboardingRoutes-DcNGx8td.js} +3 -3
- package/dist/assets/{DashboardRoutes-CDHfwzF8.js → DashboardRoutes-Cn2JvSx_.js} +3 -3
- package/dist/assets/{DefaultTenantHome-IpUFcj-v.js → DefaultTenantHome-CsXVfKlZ.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Cxel_MVr.js +18 -0
- package/dist/assets/{DrawerScreen-CRNbz1gn.js → DrawerScreen-C2EkheMn.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-z2LJmKvw.js → EntityDetailRoutes-DYnrDK2H.js} +1 -1
- package/dist/assets/ExpenseAutomationRoutes-CFonPv_D.js +38 -0
- package/dist/assets/{FeaturePreviewScreen-Jnj2USgZ.js → FeaturePreviewScreen-DDYtwmUp.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-CvAgMLyP.js → HubSpotOAuthCallbackScreen-DrQG17NC.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-TM2N59sT.js → InboxNotificationsProvider-Bh2XZMjj.js} +1 -1
- package/dist/assets/{InvoicingRoutes-DsiW7avo.js → InvoicingRoutes-aLT5Oywn.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-CoB6xZJH.js → MagicLinkRoutes-B98z2_te.js} +3 -3
- package/dist/assets/MagicLinkSignInScreen-CUSvf6DA.js +12 -0
- package/dist/assets/{MobileAppDrawer-DVEpwTSb.js → MobileAppDrawer-CYOS7P1p.js} +1 -1
- package/dist/assets/NotFoundScreen-Cg7JNFkQ.js +1 -0
- package/dist/assets/{NotificationRoutes-BgRe6yDH.js → NotificationRoutes-Cw3UPZ5H.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BlWg9xpv.js → OAuthConsentScreen-DvsId_K6.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DCylgwyr.js → PandLWithForecastRoutes-BtveWrPc.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-zJNZOLxG.js → PaymentLinkScreen-CyUO-4Wu.js} +1 -1
- package/dist/assets/{PeopleRoutes-BTMtvnWM.js → PeopleRoutes-DVMl8LKW.js} +1 -1
- package/dist/assets/PerformanceRoutes-DDDEYaGA.js +1 -0
- package/dist/assets/{Preview-DdNlHcw7.js → Preview-Bk5qAysj.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B8my3HK2.js → QBOConnectionScreen-BZaN5thA.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DbHjrDG1.js → ReimbursementApprovalRoutes-D7E_M16q.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BOO5QQZQ.js → ReimbursementApprovalRuleDetailScreen-CXyB0PcY.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CIvtHgV3.js → ReimbursementRoutes-CRRoqag9.js} +4 -4
- package/dist/assets/{ReportsRoutes-CqTVhtIe.js → ReportsRoutes-Cgg5QVAq.js} +1 -1
- package/dist/assets/RewardsRoutes-phMlkhIl.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DPJPIIjz.js → ScheduleDetailsPrepaidExpensesScreen-y_RWHH2C.js} +4 -4
- package/dist/assets/{ScreenRoutes-BW0Nfg5n.js → ScreenRoutes-BfdhNdv6.js} +2 -2
- package/dist/assets/{SettingsRoutes-BZ6-ok7C.js → SettingsRoutes-C030Wm5E.js} +1 -1
- package/dist/assets/{SetupPagesScreen-CWaKuALw.js → SetupPagesScreen-BhmiBe4o.js} +5 -5
- package/dist/assets/{SignInScreen-C6Coynvq.js → SignInScreen-uxgoeqdj.js} +1 -1
- package/dist/assets/{SignOutScreen-5ap7jROI.js → SignOutScreen-DlEh7dhK.js} +1 -1
- package/dist/assets/{TaskListScreen-Tr5pYH2M.js → TaskListScreen-BAeSb59G.js} +2 -2
- package/dist/assets/{TaskRoutes-DD87OV_2.js → TaskRoutes-B0DNH_tz.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-CvRMjyJd.js +1 -0
- package/dist/assets/{TransactionDetailScreen-DGgQpMc5.js → TransactionDetailScreen-wMG_3E3j.js} +1 -1
- package/dist/assets/{TransactionListRoutes-BfRuV8RM.js → TransactionListRoutes-BP3KJlde.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CCh_KTDj.js → TreasuryRoutes-18cBgc_x.js} +1 -1
- package/dist/assets/{VendorsRoutes-DjYMshEP.js → VendorsRoutes-DLFjUFun.js} +10 -10
- package/dist/assets/{WiseConfirmationScreen-DfNXRsaU.js → WiseConfirmationScreen-Tt2rFi3i.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-CKgCFBgo.js → ZeniAccountRoutes-wVFrAQ-3.js} +9 -9
- package/dist/assets/ZeniAccountStatementScreen-ku-97h_n.js +9 -0
- package/dist/assets/{accountMappingHelper-DpK2x2pO.js → accountMappingHelper-CHry1WVR.js} +1 -1
- package/dist/assets/{analytics-CvDaD8K9.js → analytics-C4h9uwWs.js} +1 -1
- package/dist/assets/{analyticsHelper-VdIlZC-X.js → analyticsHelper-CsTjLa_U.js} +1 -1
- package/dist/assets/{core-BEvMNwAD.js → core-DRRkK-nh.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CYLAirQ0.js → decodeURIComponentSafe-DZs4O12l.js} +1 -1
- package/dist/assets/{dnd-B2-znEgk.js → dnd-_2sJc_42.js} +1 -1
- package/dist/assets/{empty-MCEjxjzc.js → empty-CTTtTEUb.js} +1 -1
- package/dist/assets/{empty-YxcYKzZr.js → empty-DLiHGVfw.js} +1 -1
- package/dist/assets/{emptyVideoElement-B-77FBVY.js → emptyVideoElement-DVRRW-8o.js} +1 -1
- package/dist/assets/{epic-DBYEx4XZ.js → epic-1JvU70v2.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-n1rnu5_l.js → expenseAutomationHelper-BC0QbU5f.js} +1 -1
- package/dist/assets/{getLocaleForTenant-GfQpMbrO.js → getLocaleForTenant-UyMudcKz.js} +1 -1
- package/dist/assets/{index-BLeLfbhZ.js → index-4rD-Inub.js} +2 -2
- package/dist/assets/{index-Bo2P7yfm.js → index-C4gCcAzE.js} +1 -1
- package/dist/assets/{index-Bfnxdwcm.js → index-C8t0n_dK.js} +6800 -6800
- package/dist/assets/{index-CknhGBud.js → index-C9SmCfob.js} +1 -1
- package/dist/assets/{index-BRtn7Fg5.js → index-DV4hjrJB.js} +1 -1
- package/dist/assets/{index-CHQdsKk6.js → index-DojZx2HJ.js} +1 -1
- package/dist/assets/{index-BNJSTOyr.js → index-DsnNO9ob.js} +1 -1
- package/dist/assets/{index-B8gVWGQ4.js → index-tDitJ4zF.js} +1 -1
- package/dist/assets/{lexical-VH-Dh1bf.js → lexical-DcIe1jg7.js} +1 -1
- package/dist/assets/{liveblocks-DXMWX-Ft.js → liveblocks-BMZsanry.js} +1 -1
- package/dist/assets/{lottie-CunmMvLM.js → lottie-C0cdlMyO.js} +1 -1
- package/dist/assets/{mui-Bueuo6bM.js → mui-Cs4dDAVi.js} +1 -1
- package/dist/assets/{pathToGoBack-Mm2jhyqa.js → pathToGoBack-CkgUjsRE.js} +1 -1
- package/dist/assets/{pdf-byaFE2JF.js → pdf-DTtYOrE_.js} +4 -4
- package/dist/assets/{pdf-lib-Dvs_Xgmp.js → pdf-lib-0L0P6hdy.js} +1 -1
- package/dist/assets/{plaid-QK7fwo4O.js → plaid-3Z5MZAow.js} +1 -1
- package/dist/assets/{pusher-C7Bm4ma8.js → pusher-CwJ3oZrv.js} +1 -1
- package/dist/assets/{react-Cb2nvCGx.js → react-BFbkar2S.js} +1 -1
- package/dist/assets/{react-D6s1bFFI.js → react-CM1VGrgK.js} +1 -1
- package/dist/assets/{react-DIKP2Ov_.js → react-DEFivwtJ.js} +1 -1
- package/dist/assets/{react-DThrm6Ze.js → react-DdN0oGm3.js} +1 -1
- package/dist/assets/{react-B64enUeQ.js → react-Du8d_1DW.js} +1 -1
- package/dist/assets/{react-DaoXpjNM.js → react-clYOjmSd.js} +1 -1
- package/dist/assets/{recharts-DktJiIze.js → recharts-Dv_Zobiy.js} +1 -1
- package/dist/assets/{reportTimeframe-oMu7u5jv.js → reportTimeframe-BZ8sifp3.js} +1 -1
- package/dist/assets/{routePaths-D1-5FufF.js → routePaths-CXiI4qT4.js} +1 -1
- package/dist/assets/{sentry-B8ZcloT9.js → sentry-w92aQEbS.js} +1 -1
- package/dist/assets/{stripSplatSuffix-DqLj2OQc.js → stripSplatSuffix-Dsy_ttXJ.js} +1 -1
- package/dist/assets/{url-BjOfzwJn.js → url--dAX0VEW.js} +1 -1
- package/dist/assets/{url-BhMCuX-k.js → url-CfBqFLaf.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-BOoloLk9.js → useActualMatchingMatchDetail-D7oh67gX.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-C_YRnGmr.js +1 -0
- package/dist/assets/{useAskAiCfoHostNavButtonProps-CGDjoe-C.js → useAskAiCfoHostNavButtonProps-DYip9Dx9.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-BscXbqVG.js → useChargeCardPusherEvents-DoonLDx8.js} +1 -1
- package/dist/assets/{useDeviceId-TkNUqREt.js → useDeviceId-BCt1yivX.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-LdJl4Ytr.js → useEmailConnectResultRefresh-Bp56oLLy.js} +1 -1
- package/dist/assets/{useEnsureVendorListLoaded-CbpMm19m.js → useEnsureVendorListLoaded-C9_7Q9zw.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-U0N2vfd2.js → useInitialThreadRequest-BLzbdgeM.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-CRuBFsxT.js → useTaskManagerAccess-D2-4N0AP.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-DQJBsAoF.js → useTaskManagerPusherEvents-DiIvQwiL.js} +1 -1
- package/dist/assets/{utils-BVoHYbte.js → utils-BKjdMjTj.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DEhOfD8m.js → withTransactionSidePanel-By5bvka9.js} +2 -2
- package/dist/assets/{zeni-epic-state-D1qILDrP.js → zeni-epic-state-BgQvRRQh.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/ActualMatchingMatchDetailScreen-DgD9-vsh.js +0 -1
- package/dist/assets/AddressRoutes-DK5Vvq-X.js +0 -1
- package/dist/assets/AddressScreen-C7sDNd06.js +0 -9
- package/dist/assets/CardsAiCfoScreen-DszL1fJa.js +0 -14
- package/dist/assets/CustomerOnboardingAuthScreen-C_JF03U2.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-Citgr--D.js +0 -18
- package/dist/assets/ExpenseAutomationRoutes-CSdM2SYG.js +0 -38
- package/dist/assets/MagicLinkSignInScreen-D3x0Vkxy.js +0 -12
- package/dist/assets/NotFoundScreen-CgHV3hZC.js +0 -1
- package/dist/assets/PerformanceRoutes-DDd1pzav.js +0 -1
- package/dist/assets/RewardsRoutes-CdxGa5FH.js +0 -1
- package/dist/assets/TransactionDetailRoutes-C2tJZ49c.js +0 -1
- package/dist/assets/ZeniAccountStatementScreen-BhXX83Ao.js +0 -9
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-D10zF3m4.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as E}from"./liveblocks-
|
|
1
|
+
import{j as E}from"./liveblocks-BMZsanry.js";import{a as A}from"./sentry-w92aQEbS.js";import{i as M,u as W,h as Q,g as ee,j as h,l as te}from"./core-DRRkK-nh.js";import{Xz as Fe,XA as Ge,m3 as ae,sB as Ve,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,XB as Ye,fI as K,Wy as pe,XC as Se,h2 as ne,cD as se,cE as le,FJ as ve,XD as Ce,FN as Xe,gS as ce,sE as ze,td as qe,dF as Ze,dE as He,TV as fe,FH as We,FB as Qe,XE as De,Ft as et,Fs as tt,Fn as at,Fy as nt,FO as st,XF as Y,XG as ge,Fu as lt,Wz as oe,G2 as Ae,FX as Ie,XH as xe,sH as Te,FR as Be,FP as Le,XI as be,G9 as Je,G6 as we,FS as je,G8 as Ne}from"./zeni-epic-state-BgQvRRQh.js";import{a2 as de,aW as ie,aX as ct,z as ot,j as dt,a5 as it,a6 as ue,k as _,at as ut,aY as rt,p as G,G as ye,U as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-C8t0n_dK.js";import{n as re}from"./mui-Cs4dDAVi.js";import{p as St}from"./pathToGoBack-CkgUjsRE.js";import H from"./NotFoundScreen-Cg7JNFkQ.js";import{c as V}from"./routePaths-CXiI4qT4.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]="bd9754f9-e20c-4344-a8cb-ddc8bcdfbe32",e._sentryDebugIdIdentifier="sentry-dbid-bd9754f9-e20c-4344-a8cb-ddc8bcdfbe32")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=W(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ge(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((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ve(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(H,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(H,{}):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(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as E}from"./liveblocks-DXMWX-Ft.js";import{a as A}from"./sentry-B8ZcloT
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,
|
|
17
|
+
`,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,b=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||b==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=W(),C=Ee(),{tenantEmailDomain:g}=M(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=M(),v=s??r;let D;v!=="new"&&(D=v);const b=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),J="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),w=h((L=>fe(L))),j=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),N=w!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&N?(p(We(J,D)),u(!0)):N===!1&&f===!1&&v!=="new"&&(p(Qe(J,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",X=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:J,onDecided:()=>{if(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=X;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),F=k.fetchState,$=k.allAccountList,Z=k.allClassList,y=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(b!==!0||k.fetchState==="Error")return E.jsx(H,{});const R=F==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?E.jsxs(Et,{children:[R===!0?E.jsx(ue,{analytics:_,onLoad:()=>{vt(k,J,T)}}):null,E.jsx(kt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:I,navigate:m,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:y,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:_,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&_.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{..._e(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as E}from"./liveblocks-DXMWX-Ft.js";import{a as A}from"./sentry-B8ZcloT
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(
|
|
25
|
+
`,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(Je(i,d,o))},onJELinkClick:d=>{e(be({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${V(d,t.tenantEmailDomain)}`,m=G(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${V(d,t.tenantEmailDomain)}`,m=G(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,b=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:b?.zeniId??D?.selectedOption??"",name:b?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:b?.logo},J=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),N=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:J?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:N,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&J?.classId==null||r==null||j==null||P!==!0&&N==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=Q(),n=ee(),i=W(),a=Ee(),{tenantEmailDomain:d}=M(),[o,m]=A.useState(!1),{scheduleDetailId:I}=M(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((y=>y.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((y=>oe(y,u))),v=h((y=>y.entityAutoCompleteState.autoCompleteText.common)),D=h((y=>De(y,"common"))),b=h((y=>fe(y))),B=h((y=>y.classListState.fetchState)),J=h((y=>ae(y))),k=h((y=>ce(y).selectedPeriod)),w=b!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&w?(i(Ae(u,F,!0)),m(!0)):w===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:y,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((y=>K(y))),x=h((y=>ne(y,j.companyId))),N=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:y,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else c()}}),O=r.fetchState,X=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return E.jsx(H,{});const $=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?E.jsxs(At,{children:[$===!0?E.jsx(ue,{analytics:_,onLoad:()=>{Bt(r,u,x)}}):null,E.jsx(It,{onScheduleDecision:N?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(y,S)=>{i(Te(y,S))},accountList:X,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:_,controllerUserDetails:x,isAccountingClassesEnabled:J,status:r.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
min-height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,4 +30,4 @@ import{j as E}from"./liveblocks-DXMWX-Ft.js";import{a as A}from"./sentry-B8ZcloT
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,
|
|
33
|
+
`,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,bt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Ne(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(Je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(be({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${V(a,t.tenantEmailDomain)}`,o=G(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${V(a,t.tenantEmailDomain)}`,o=G(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,b=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,J=m.map(((x,N)=>({...t.scheduleLocalData.jeScheduleDetails[N],amount:{...t.scheduleLocalData.jeScheduleDetails[N].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,w=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:b?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:J,lastDayOfMonth:w,selectedVendor:v,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||b?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||w!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Xt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=Q(),i=ee(),a=W(),d=Ee(),{tenantEmailDomain:o}=M(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=M(),f=t??g,u=Jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),b=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),J=h((S=>fe(S))),k=h((S=>S.classListState.fetchState)),w=h((S=>ae(S))),j=h((S=>ce(S).selectedPeriod)),x=J!=="Completed"||k!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,$,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const N=h((S=>K(S))),P=h((S=>ne(S,N.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:X}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return E.jsx(H,{});const Z=U==="Completed"&&m===!0,y=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&y?E.jsxs(Lt,{children:[Z===!0?E.jsx(ue,{analytics:_,onLoad:()=>{jt(D,v,P)}}):null,E.jsx(bt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:X,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:b,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:_,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},Jt=(e,t)=>pe(e)!=null&&t!=null,wt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...wt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Yt as S,Ut as a,Xt as b,Kt as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-
|
|
2
|
-
import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bo as Rs,dk as gs,ca as Is,gM as js,gc as Ts,dh as pe,cI as As,gq as fs,cA as Ds,bG as ys,br as bs,U_ as Cs,v as vs,V1 as Os,bq as Ps,V2 as Us,bM as ws,bL as Fs,bu as Ls,cw as Vs,V3 as ks,V4 as Hs,dc as Bs,df as Ss,de as Ns,cH as Ms,cO as Zs,pW as xe,gl as Re,h0 as Gs,gn as ge,gO as Ie,gP as je,go as $s}from"./zeni-epic-state-D1qILDrP.js";import{j as e}from"./liveblocks-DXMWX-Ft.js";import{a as U}from"./sentry-B8ZcloT9.js";import{N as u,u as zs,h as qs,i as Ws,g as Ys,j as G,q as Te,n as Xs,o as n}from"./core-BEvMNwAD.js";import{M as l,u as Js,z as b,c as Ks,e as Qs,f as et,F as S,h as st,N as tt,V as nt,L as F,G as Ae,t as _,P as at,O as ot,k as ne}from"./index-Bfnxdwcm.js";import{u as rt}from"./mui-Bueuo6bM.js";import{f as fe}from"./analyticsHelper-VdIlZC-X.js";import{t as it}from"./getLocaleForTenant-GfQpMbrO.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]="c5e37c1c-a993-4fd5-945e-a077c35ae74c",o._sentryDebugIdIdentifier="sentry-dbid-c5e37c1c-a993-4fd5-945e-a077c35ae74c")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-CgHV3hZC.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`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(O)return e.jsx(be,{tenantEmailDomain:v})}return o?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):O?e.jsx(be,{tenantEmailDomain:v}):D?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-CDHfwzF8.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,25,8])),bills:()=>s((()=>import("./BillPayRoutes-CV9mDJiA.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-CIvtHgV3.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])),transactions:()=>s((()=>import("./TransactionListRoutes-BfRuV8RM.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])),settings:()=>s((()=>import("./SettingsRoutes-BZ6-ok7C.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])),reports:()=>s((()=>import("./ReportsRoutes-CqTVhtIe.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-DJMJStiR.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])),people:()=>s((()=>import("./PeopleRoutes-BTMtvnWM.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CSdM2SYG.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CCh_KTDj.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])),vendors:()=>s((()=>import("./VendorsRoutes-DjYMshEP.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,15,11,21,22,23,30,47,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-CKgCFBgo.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-CqTVhtIe.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),ht=l((()=>s((()=>import("./AddressRoutes-DK5Vvq-X.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-BTMtvnWM.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-DCylgwyr.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-DO2-x5Dx.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-DjYMshEP.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,15,11,21,22,23,30,47,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-C2tJZ49c.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-z2LJmKvw.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-CDHfwzF8.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,25,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-CV9mDJiA.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])))),jt=l((()=>s((()=>import("./SettingsRoutes-BZ6-ok7C.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-DsiW7avo.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,27,0,21,22,23,42,43,44,45,46,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-CIvtHgV3.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-CKgCFBgo.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8])))),ft=l((()=>s((()=>import("./TreasuryRoutes-CCh_KTDj.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-BfRuV8RM.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),yt=l((()=>s((()=>import("./ChargeCardRoutes-DJMJStiR.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),bt=l((()=>s((()=>import("./NotificationRoutes-BgRe6yDH.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-DDd1pzav.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-CSdM2SYG.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-DgD9-vsh.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Pt=l((()=>s((()=>import("./RewardsRoutes-CdxGa5FH.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),Ut=l((()=>s((()=>import("./TaskRoutes-DD87OV_2.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-CCkwAPqN.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-DszL1fJa.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-CgHV3hZC.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-Tr5pYH2M.js").then((o=>o.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=zs(),N=qs(),{tenantEmailDomain:i}=Ws(),V=rt().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Js(),y=b.getSignedInUserTenant(i)?.tenantId,j=b.getSignedInUser(),X=hs(j),$=Ys(),[L,we]=U.useState(!1),r=G((a=>Es(a))),{useFeatureGate:H}=Ks(),M=Qs(),J=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,K=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,ke=st(r,Ve,oe),{isCardsHidden:He}=tt(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=G((a=>js(a)));if(i!=null){const a=b.getSignedInUserTenant(i);j!=null&&a!=null&&fe(j,r,V)}const Z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),Ge=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),$e=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=G((a=>Z.tenantId!=null?fs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=bs();t.isAfter(d,"month")===!1?D(Cs(y,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,y]),U.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,D,b]),U.useLayoutEffect((()=>{!vs(ie,Z)&&b.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=b.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,D,qe))}),[y]),U.useEffect((()=>{b.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(ge(t));const Y=b.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),Re(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($s(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,y,j,O,D))}),[y,p]),U.useEffect((()=>{b.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),b.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&fe(j,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(v(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,y,L]);const le=U.useRef(!1);U.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 P=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:We}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=H(S.isAccrualEnabled),Xe=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&&!P,de=!Be&&!P,Ke=Us(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!P,ss=Le&&!P,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Vs(E?.loggedInUserRoleMap),os=ks(E?.loggedInUserRoleMap),rs=Hs(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Ke===!0||os===!0||rs===!0;return b.isSignedIn()?y==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&T!=="In-Progress"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||X&&!ee)&&es&&Qe!==!0&&h===!1&&K===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||X?!L||te!==!1||ee||X?L&&r?.userRole&&h!=null&&K!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Xs,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Xe||Je?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(Dt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ut,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:J===!0?e.jsx(Ct,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:J===!0&&P===!1?e.jsx(vt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:J===!0&&P===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(bt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(Rt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(yt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Pt,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):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:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,Gt as S};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-Cg7JNFkQ.js","assets/sentry-w92aQEbS.js","assets/core-DRRkK-nh.js","assets/zeni-epic-state-BgQvRRQh.js","assets/index-C8t0n_dK.js","assets/mui-Cs4dDAVi.js","assets/analytics-C4h9uwWs.js","assets/utils-BKjdMjTj.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-Cn2JvSx_.js","assets/withTransactionSidePanel-By5bvka9.js","assets/useAskAiCfoHostNavButtonProps-DYip9Dx9.js","assets/TransactionDetailScreen-wMG_3E3j.js","assets/decodeURIComponentSafe-DZs4O12l.js","assets/useInitialThreadRequest-BLzbdgeM.js","assets/routePaths-CXiI4qT4.js","assets/expenseAutomationHelper-BC0QbU5f.js","assets/stripSplatSuffix-Dsy_ttXJ.js","assets/reportTimeframe-BZ8sifp3.js","assets/analyticsHelper-CsTjLa_U.js","assets/CompanyPassportScreen-d28meAXB.js","assets/MobileAppDrawer-CYOS7P1p.js","assets/InboxNotificationsProvider-Bh2XZMjj.js","assets/useTaskManagerAccess-D2-4N0AP.js","assets/useAiCfoDashboardSuggestedQuestionsChips-C_YRnGmr.js","assets/FeaturePreviewScreen-DDYtwmUp.js","assets/BillPayRoutes-P8ok7ngf.js","assets/AddressScreen-Diwm_C2C.js","assets/DomesticWireDetailScreen-Cxel_MVr.js","assets/BusinessVerificationPageScreen-B4wIaSZ_.js","assets/DrawerScreen-C2EkheMn.js","assets/SetupPagesScreen-BhmiBe4o.js","assets/BillPayApprovalRoutes-D9G2_YOz.js","assets/useEnsureVendorListLoaded-C9_7Q9zw.js","assets/ReimbursementApprovalRuleDetailScreen-CXyB0PcY.js","assets/getLocaleForTenant-UyMudcKz.js","assets/ReimbursementRoutes-CRRoqag9.js","assets/ReimbursementApprovalRoutes-D7E_M16q.js","assets/TransactionListRoutes-BP3KJlde.js","assets/ZeniAccountStatementScreen-ku-97h_n.js","assets/SettingsRoutes-C030Wm5E.js","assets/AccountMappingScreen-DfowxAc-.js","assets/QBOConnectionScreen-BZaN5thA.js","assets/empty-CTTtTEUb.js","assets/index-DV4hjrJB.js","assets/url-CfBqFLaf.js","assets/index-tDitJ4zF.js","assets/accountMappingHelper-CHry1WVR.js","assets/useEmailConnectResultRefresh-Bp56oLLy.js","assets/ReportsRoutes-Cgg5QVAq.js","assets/ChargeCardRoutes-D1ZdbX_z.js","assets/useChargeCardPusherEvents-DoonLDx8.js","assets/PeopleRoutes-DVMl8LKW.js","assets/ExpenseAutomationRoutes-CFonPv_D.js","assets/useActualMatchingMatchDetail-D7oh67gX.js","assets/ScheduleDetailsPrepaidExpensesScreen-y_RWHH2C.js","assets/pathToGoBack-CkgUjsRE.js","assets/TreasuryRoutes-18cBgc_x.js","assets/VendorsRoutes-DLFjUFun.js","assets/ZeniAccountRoutes-wVFrAQ-3.js","assets/AddressRoutes-DAUco87Q.js","assets/PandLWithForecastRoutes-BtveWrPc.js","assets/CustomerOnboardingRoutes-DcNGx8td.js","assets/TransactionDetailRoutes-CvRMjyJd.js","assets/EntityDetailRoutes-DYnrDK2H.js","assets/InvoicingRoutes-aLT5Oywn.js","assets/NotificationRoutes-Cw3UPZ5H.js","assets/PerformanceRoutes-DDDEYaGA.js","assets/ActualMatchingMatchDetailScreen-DpqBi3lD.js","assets/RewardsRoutes-phMlkhIl.js","assets/TaskRoutes-B0DNH_tz.js","assets/TaskListScreen-BAeSb59G.js","assets/useTaskManagerPusherEvents-DiIvQwiL.js","assets/AiCfoScreen-k4JvYL5q.js","assets/CardsAiCfoScreen-csdwe-Dr.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bo as Rs,dk as gs,ca as Is,gM as js,gc as Ts,dh as pe,cI as As,gq as fs,cA as Ds,bG as ys,br as bs,U_ as Cs,v as vs,V1 as Os,bq as Ps,V2 as Us,bM as ws,bL as Fs,bu as Ls,cw as Vs,V3 as ks,V4 as Hs,dc as Bs,df as Ss,de as Ns,cH as Ms,cO as Zs,pW as xe,gl as Re,h0 as Gs,gn as ge,gO as Ie,gP as je,go as $s}from"./zeni-epic-state-BgQvRRQh.js";import{j as e}from"./liveblocks-BMZsanry.js";import{a as U}from"./sentry-w92aQEbS.js";import{N as u,u as zs,h as qs,i as Ws,g as Ys,j as G,q as Te,n as Xs,o as n}from"./core-DRRkK-nh.js";import{M as l,u as Js,z as b,c as Ks,e as Qs,f as et,F as S,h as st,N as tt,V as nt,L as F,G as Ae,t as _,P as at,O as ot,k as ne}from"./index-C8t0n_dK.js";import{u as rt}from"./mui-Cs4dDAVi.js";import{f as fe}from"./analyticsHelper-CsTjLa_U.js";import{t as it}from"./getLocaleForTenant-UyMudcKz.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]="c5e37c1c-a993-4fd5-945e-a077c35ae74c",o._sentryDebugIdIdentifier="sentry-dbid-c5e37c1c-a993-4fd5-945e-a077c35ae74c")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-Cg7JNFkQ.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`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(O)return e.jsx(be,{tenantEmailDomain:v})}return o?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):O?e.jsx(be,{tenantEmailDomain:v}):D?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-Cn2JvSx_.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,25,8])),bills:()=>s((()=>import("./BillPayRoutes-P8ok7ngf.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-CRRoqag9.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])),transactions:()=>s((()=>import("./TransactionListRoutes-BP3KJlde.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])),settings:()=>s((()=>import("./SettingsRoutes-C030Wm5E.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])),reports:()=>s((()=>import("./ReportsRoutes-Cgg5QVAq.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-D1ZdbX_z.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])),people:()=>s((()=>import("./PeopleRoutes-DVMl8LKW.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CFonPv_D.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])),treasury:()=>s((()=>import("./TreasuryRoutes-18cBgc_x.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])),vendors:()=>s((()=>import("./VendorsRoutes-DLFjUFun.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,15,11,21,22,23,30,47,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-wVFrAQ-3.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-Cgg5QVAq.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),ht=l((()=>s((()=>import("./AddressRoutes-DAUco87Q.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-DVMl8LKW.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-BtveWrPc.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-DcNGx8td.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-DLFjUFun.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,15,11,21,22,23,30,47,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-CvRMjyJd.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-DYnrDK2H.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-Cn2JvSx_.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,25,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-P8ok7ngf.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])))),jt=l((()=>s((()=>import("./SettingsRoutes-C030Wm5E.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-aLT5Oywn.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,27,0,21,22,23,42,43,44,45,46,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-CRRoqag9.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-wVFrAQ-3.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8])))),ft=l((()=>s((()=>import("./TreasuryRoutes-18cBgc_x.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-BP3KJlde.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),yt=l((()=>s((()=>import("./ChargeCardRoutes-D1ZdbX_z.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),bt=l((()=>s((()=>import("./NotificationRoutes-Cw3UPZ5H.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-DDDEYaGA.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-CFonPv_D.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-DpqBi3lD.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Pt=l((()=>s((()=>import("./RewardsRoutes-phMlkhIl.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),Ut=l((()=>s((()=>import("./TaskRoutes-B0DNH_tz.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-k4JvYL5q.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-csdwe-Dr.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-Cg7JNFkQ.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-BAeSb59G.js").then((o=>o.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=zs(),N=qs(),{tenantEmailDomain:i}=Ws(),V=rt().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Js(),y=b.getSignedInUserTenant(i)?.tenantId,j=b.getSignedInUser(),X=hs(j),$=Ys(),[L,we]=U.useState(!1),r=G((a=>Es(a))),{useFeatureGate:H}=Ks(),M=Qs(),J=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,K=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,ke=st(r,Ve,oe),{isCardsHidden:He}=tt(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=G((a=>js(a)));if(i!=null){const a=b.getSignedInUserTenant(i);j!=null&&a!=null&&fe(j,r,V)}const Z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),Ge=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),$e=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=G((a=>Z.tenantId!=null?fs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=bs();t.isAfter(d,"month")===!1?D(Cs(y,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,y]),U.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,D,b]),U.useLayoutEffect((()=>{!vs(ie,Z)&&b.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=b.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,D,qe))}),[y]),U.useEffect((()=>{b.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(ge(t));const Y=b.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),Re(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($s(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,y,j,O,D))}),[y,p]),U.useEffect((()=>{b.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),b.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&fe(j,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(v(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,y,L]);const le=U.useRef(!1);U.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 P=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:We}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=H(S.isAccrualEnabled),Xe=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&&!P,de=!Be&&!P,Ke=Us(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!P,ss=Le&&!P,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Vs(E?.loggedInUserRoleMap),os=ks(E?.loggedInUserRoleMap),rs=Hs(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Ke===!0||os===!0||rs===!0;return b.isSignedIn()?y==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&T!=="In-Progress"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||X&&!ee)&&es&&Qe!==!0&&h===!1&&K===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||X?!L||te!==!1||ee||X?L&&r?.userRole&&h!=null&&K!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Xs,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Xe||Je?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(Dt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ut,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:J===!0?e.jsx(Ct,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:J===!0&&P===!1?e.jsx(vt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:J===!0&&P===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(bt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(Rt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(yt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Pt,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):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:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,Gt as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BMZsanry.js";import{a as d}from"./sentry-w92aQEbS.js";import{h as O,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-DRRkK-nh.js";import{fI as v,_l as Pe,Oa as je,ZU as ve,_1 as we,ca as X,cV as Ae,cW as De,bq as Ue,dg as Re,Gs as Te,_m as Me,PD as Be,N1 as Ne,MU as de,MR as Ve,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Fe,ly as $,lB as me,_n as Oe,mL as Le,GN as Ge,Ws as Ze,Wt as $e,lw as He,_o as Ke,lz as We,uL as ze,Wn as qe,Wo as Je,uP as Qe,hZ as Xe,Vl as q,hR as ae,hO as Ye,hW as en,Vm as nn,GK as tn,_p as an,_q as on,Ni as sn,m3 as rn,e0 as fe,e1 as he,_r as ln,gF as cn,VB as dn,GJ as oe,gK as se,gJ as un,GI as pn,gI as gn,gH as mn,_s as fn,UN as Ce,_t as hn,_u as Cn,_v as yn,_w as Sn,_x as bn,_y as In,GQ as xn,_z as En,GH as ie,GB as Z,_A as kn,_B as _n,_C as re,_D as Pn,dV as jn,_E as vn,_F as wn,_G as An,UZ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_H as Bn,c6 as Nn,c5 as Vn,c7 as Fn,c4 as On}from"./zeni-epic-state-BgQvRRQh.js";import{bU as Ln,z as j,V as G,a5 as ne,c4 as Gn,k as W,c as te,F as V,h as ye,N as Se,c5 as Zn,j as $n,X as be,c6 as Hn,ag as Kn,c7 as Wn,c8 as zn,ao as qn,c9 as Jn,p as Qn,d as Ie,ca as Xn}from"./index-C8t0n_dK.js";import{n as B}from"./mui-Cs4dDAVi.js";import{u as xe}from"./useTaskManagerAccess-D2-4N0AP.js";import{U as Yn}from"./AccountMappingScreen-DfowxAc-.js";import{t as et,A as nt}from"./AddressScreen-Diwm_C2C.js";import F from"./NotFoundScreen-Cg7JNFkQ.js";import{g as tt}from"./analyticsHelper-CsTjLa_U.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-B4wIaSZ_.js";import{C as st}from"./CompanyPassportScreen-d28meAXB.js";import{M as T}from"./MobileAppDrawer-CYOS7P1p.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-Bp56oLLy.js";import{q as le}from"./QBOConnectionScreen-BZaN5thA.js";import{B as lt}from"./BillPayApprovalRoutes-D9G2_YOz.js";import{R as ct}from"./ReimbursementApprovalRoutes-D7E_M16q.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.js";import"./accountMappingHelper-CHry1WVR.js";import"./routePaths-CXiI4qT4.js";import"./InboxNotificationsProvider-Bh2XZMjj.js";import"./empty-CTTtTEUb.js";import"./pdf-lib-0L0P6hdy.js";import"./index-DV4hjrJB.js";import"./url-CfBqFLaf.js";import"./index-tDitJ4zF.js";import"./decodeURIComponentSafe-DZs4O12l.js";import"./useEnsureVendorListLoaded-C9_7Q9zw.js";import"./ReimbursementApprovalRuleDetailScreen-CXyB0PcY.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]="985c13ee-f615-4ae4-8e17-d0625bd56a40",e._sentryDebugIdIdentifier="sentry-dbid-985c13ee-f615-4ae4-8e17-d0625bd56a40")}catch{}})();const dt=B.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-BMZsanry.js";import{h as Y,g as Q,u as ee,i as W,j as k,N as R,l as G,t as en}from"./core-DRRkK-nh.js";import{bL as nn,fI as V,cI as tn,Ik as J,ZU as an,ZX as sn,v2 as ne,uS as te,mD as ae,C6 as N,ZZ as be,gJ as Ge,gI as He,gH as Ke,Z_ as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as X,MX as Ae,M_ as _e,N4 as ke,CA as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,Z$ as yn,Lw as fe,M8 as fn,_0 as gn,bM as Sn,Om as ge,Oa as bn,_1 as Cn,_2 as hn,Oq as In,Ou as An,_3 as je,B$ as _n,T6 as kn,_4 as vn,_5 as Pn,_6 as Tn,_7 as qe,_8 as En,_9 as Dn,Wb as Un,Z9 as On,Wq as wn,_a as Je,MI as Fn,MA as Vn,Wr as xn,ME as Bn,_b as Oe,Pa as Xe,mL as jn,uV as Ye,C8 as Rn,bG as Re,Ck as Le,cG as Ln,_c as Qe,P0 as we,OJ as Nn,OK as Mn,OO as zn,_d as Zn,P3 as Ne,_e as $n,_f as Wn,_g as Gn,PR as Se,_h as Hn,gZ as Kn,JF as qn,_i as Jn,JK as Xn,JJ as Yn}from"./zeni-epic-state-BgQvRRQh.js";import{ag as Pe,V as ie,c as de,F as q,z as E,a6 as se,k as D,a5 as Te,R as $,bR as Qn,ac as oe,bS as x,bj as Ve,bT as et,bU as nt,bV as tt,q as Be,bW as at,p as Me,aE as ze,$ as it,a9 as st,bX as ot,bY as ct,bZ as rt,w as ut}from"./index-C8t0n_dK.js";import{a as h}from"./sentry-w92aQEbS.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-Cs4dDAVi.js";import{u as pt,d as Ze,B as Ue}from"./BusinessVerificationPageScreen-B4wIaSZ_.js";import{M as le}from"./MobileAppDrawer-CYOS7P1p.js";import L from"./NotFoundScreen-Cg7JNFkQ.js";import{a as $e}from"./analyticsHelper-CsTjLa_U.js";import{d as We}from"./routePaths-CXiI4qT4.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]="45e4a05b-86f6-4fd8-8026-4ecbe5c7c3e4",e._sentryDebugIdIdentifier="sentry-dbid-45e4a05b-86f6-4fd8-8026-4ecbe5c7c3e4")}catch{}})();const mt=xe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-DXMWX-Ft.js";import{h as Q,g as Y,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=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=V(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(X(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(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ge(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]))}}}))(Yn),ft=()=>{const e=Pe(),o=Q(),a=Y(),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=>V(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}})},Ht=(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`,Xt=(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},Qt=(e,o)=>e.find((a=>a.id===o)),Yt=(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:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:x(t.limit.amount),creditAccountAvailableAmount:x(t.available.amount),creditAccountSpentAmount:x(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:x(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=>x(n.accountBalance.available.amount))),debitCardsSpend:x(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:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,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=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=V(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(X(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(X(t,"charge_cards")):i===!0&&c===!1&&e(X(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:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:x(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=Q(),a=Y(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>V(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.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),U=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:U}),O=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,H]=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=>{H(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:O,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=xe.div`
|
|
9
|
+
`,yt=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=V(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(X(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(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ge(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]))}}}))(Qn),ft=()=>{const e=Pe(),o=Y(),a=Q(),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=>V(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}})},Ht=(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`,Xt=(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)),Qt=(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:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:x(t.limit.amount),creditAccountAvailableAmount:x(t.available.amount),creditAccountSpentAmount:x(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:x(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=>x(n.accountBalance.available.amount))),debitCardsSpend:x(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:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,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=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=V(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(X(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(X(t,"charge_cards")):i===!0&&c===!1&&e(X(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:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:x(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=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>V(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.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),U=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:U}),O=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,H]=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=>{H(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:O,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=xe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-DXMWX-Ft.js";import{h as Q,g as Y,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=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=V(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(X(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=Q(),a=Y(),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=>V(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=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Un(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=On(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:U,sourceOfFunds:A,companySubIndustry:O,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:H,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:U?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:O?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:H,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:U,treasuryUserVerificationStatus:A,fileIds:O}=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:U,treasuryUserVerificationStatus:A,fileIds:O,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(Qe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ke(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ge(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Xe())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=xn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(Vn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Q(),r=Y(),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}=_(Ve.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=>V(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 O;switch(e){case"zeni_accounts":O=En(A,C);break;case"zeni_treasury":O=qe(A,C);break;case"charge_cards":O=Tn(A,C);break;case"reimbursement":O=Pn(A,C);break;default:O=vn(A,C)}return O})),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 U;switch(e){case"zeni_accounts":U=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":U=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":U=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":U=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:U=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return U===!1?null:P.fetchState==="Completed"&&U===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(O=>{switch(e){case"zeni_accounts":return O.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return O.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return O.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=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ye(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(Gn(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(X(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(Xe())},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(Oe())}}}))(ot),Et=()=>{const e=Pe(),o=Q(),a=Y(),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(Ve.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),U=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),O=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>V(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Ye(w,F))),H=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||U!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,U,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Nn()))}),[v,A,F,t]),h.useEffect((()=>{m||O!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,O,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||U!=="Completed"||H||j||!a.pathname.includes("setup")||p(!0)}),[U,H,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(Oe()),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(Oe()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=xe(lt)`
|
|
17
|
+
`,At=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=V(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(X(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=Q(),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=>V(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=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Un(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=On(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:U,sourceOfFunds:A,companySubIndustry:O,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:H,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:U?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:O?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:H,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:U,treasuryUserVerificationStatus:A,fileIds:O}=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:U,treasuryUserVerificationStatus:A,fileIds:O,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(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ge(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Xe())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=xn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(Vn({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=Q(),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}=_(Ve.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=>V(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 O;switch(e){case"zeni_accounts":O=En(A,C);break;case"zeni_treasury":O=qe(A,C);break;case"charge_cards":O=Tn(A,C);break;case"reimbursement":O=Pn(A,C);break;default:O=vn(A,C)}return O})),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 U;switch(e){case"zeni_accounts":U=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":U=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":U=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":U=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:U=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return U===!1?null:P.fetchState==="Completed"&&U===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(O=>{switch(e){case"zeni_accounts":return O.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return O.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return O.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=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(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(Gn(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(X(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(Xe())},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(Oe())}}}))(ot),Et=()=>{const e=Pe(),o=Y(),a=Q(),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(Ve.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),U=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),O=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>V(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Qe(w,F))),H=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||U!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,U,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Nn()))}),[v,A,F,t]),h.useEffect((()=>{m||O!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,O,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||U!=="Completed"||H||j||!a.pathname.includes("setup")||p(!0)}),[U,H,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(Oe()),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(Oe()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=xe(lt)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,Ut=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Hn(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(ke(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(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(X(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),Ot=()=>{const e=Pe(),o=
|
|
21
|
+
`,Ut=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Hn(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(ke(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(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(X(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),Ot=()=>{const e=Pe(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=de(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=k((b=>b.zeniAccountSetupViewState.fetchState)),d=k((b=>V(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)):(_(!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(Ut,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{v(!0)}})]})}},wt=xe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-DXMWX-Ft.js";import{h as Q,g as Y,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=G((function(e,o){const a=V(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(
|
|
29
|
+
`,Ft=G((function(e,o){const a=V(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(Xn(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),Vt=()=>{const e=Y(),o=Q(),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=k((T=>T.billPaySetupViewState.fetchState)),d=k((T=>V(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,v=k((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||_!=="Not-Started"||f==null||(r(!0),a(qn(f)))}),[t,_,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=>(U=>U.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}})},xt=G((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(Ue,{productType:s}):a?u.jsx(R,{to:"../"}):u.jsx(L,{});case"international-wire":return o?u.jsx(Vt,{}):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(Ue,{productType:s}):u.jsx(L,{}):t?u.jsx(_t,{}):u.jsx(L,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(L,{}):r?u.jsx(Ot,{}):u.jsx(L,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(L,{});case"charge_cards":return c==="verification"?i?u.jsx(Ue,{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=k((r=>V(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(xt,{...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,Xt as g,Kt as h,ea as i,ta as j,ca as k,Qt as l,Yt as m,qt as n,Jt as o,Ht as p,ra as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-BMZsanry.js";import{a as u,R as T,t as A}from"./sentry-w92aQEbS.js";import{u as z,h as D,j as l,g as M,N as O,l as V}from"./core-DRRkK-nh.js";import{u as j,z as s,k as E,G as P,Q as F,R as _,S as B,T as N,W as J,X as v}from"./index-C8t0n_dK.js";import{fI as R,UJ as W,V1 as $,gl as Q,gn as X,V6 as Y,gY as G,dl as H,V7 as b,V8 as q,V9 as K,c1 as y}from"./zeni-epic-state-BgQvRRQh.js";import{u as Z}from"./mui-Cs4dDAVi.js";import{u as ee}from"./useDeviceId-BCt1yivX.js";import{f as te}from"./analyticsHelper-CsTjLa_U.js";import{t as ne}from"./getLocaleForTenant-UyMudcKz.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.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]="f82fb462-1198-4a70-8da1-c5ee82c72bb2",t._sentryDebugIdIdentifier="sentry-dbid-f82fb462-1198-4a70-8da1-c5ee82c72bb2")}catch{}})();const ie=V((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(K({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(q(n,a)))},clearSignInError:()=>{t(b())}}}))(J),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:U,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>R(e))),I=l((e=>W(e))),m=M(),w=Z().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.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($(I.tenantsInOrder),o.zeniSessionId),Q(o.userId,o.zeniSessionId,r.tenantId),i(X(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Y("Completed")),P.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=N();e!=null&&F(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(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 f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&L!=null?f.jsx(B,{onClose:()=>i(b()),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-BMZsanry.js";import{a as i}from"./sentry-w92aQEbS.js";import{u as c,g as d,N as u}from"./core-DRRkK-nh.js";import{z as n,k as a,R as m,a5 as p}from"./index-C8t0n_dK.js";import{g$ as g,Vn as y}from"./zeni-epic-state-BgQvRRQh.js";import{n as b}from"./mui-Cs4dDAVi.js";import"./recharts-Dv_Zobiy.js";import"./analytics-C4h9uwWs.js";import"./plaid-3Z5MZAow.js";import"./dnd-_2sJc_42.js";import"./stripe-cKAAJElX.js";import"./lottie-C0cdlMyO.js";import"./lexical-DcIe1jg7.js";import"./pdf-DTtYOrE_.js";import"./utils-BKjdMjTj.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]="556ab88e-1a7f-49a7-b52c-920d63000332",e._sentryDebugIdIdentifier="sentry-dbid-556ab88e-1a7f-49a7-b52c-920d63000332")}catch{}})();function L(){const e=c(),t=d(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}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%;
|