@zeniai/web-app-ui 5.1.84-prod → 5.1.85-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-DpMeCgDh.js +1 -0
- package/dist/assets/AddressScreen-jEbIVhK3.js +9 -0
- package/dist/assets/{AiCfoScreen-DZZ9Es_I.js → AiCfoScreen-D2GxwJyN.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DnTpyFTu.js → BillPayApprovalRoutes-Csh9SPnU.js} +1 -1
- package/dist/assets/{BillPayRoutes-DvFVSZYb.js → BillPayRoutes-Dg9I-63-.js} +12 -12
- package/dist/assets/{BusinessVerificationPageScreen-BnNwUvQl.js → BusinessVerificationPageScreen-BLuK4dS7.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-CrL4NPtU.js → CardsAiCfoScreen-D8ZPE13M.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-COA4Ttqp.js → ChargeCardRoutes-CyGButQm.js} +11 -11
- package/dist/assets/{CompanyPassportScreen-jDLVUM9p.js → CompanyPassportScreen--SPdIRlf.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-OTfxAxPR.js → ConnectionAuthScreen-C8nHjroP.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-C6uz2GLr.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-Dk5stUMd.js +30 -0
- package/dist/assets/{DashboardRoutes-CoUu5Cck.js → DashboardRoutes-B2SXqHam.js} +3 -3
- package/dist/assets/{DefaultTenantHome-DwNthuPY.js → DefaultTenantHome-DDzJzPvG.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-DDaUfwcf.js +18 -0
- package/dist/assets/DrawerScreen-DZ4DkgHO.js +1 -0
- package/dist/assets/EntityDetailRoutes-CFPPv2Q-.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-hrRcKAyV.js → ExpenseAutomationRoutes-B0EQq9x4.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-Dgm-EaRp.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BzGwbaWe.js → HubSpotOAuthCallbackScreen-DiHy3hck.js} +1 -1
- package/dist/assets/MagicLinkRoutes-CPrGkntv.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BHI5Ju3h.js +12 -0
- package/dist/assets/MobileAppDrawer-ChAhLGZE.js +1 -0
- package/dist/assets/NotFoundScreen-By2F-w6l.js +1 -0
- package/dist/assets/{NotificationRoutes-B5b9qbFA.js → NotificationRoutes-0mjOYLwF.js} +1 -1
- package/dist/assets/OAuthConsentScreen-_yz0BOYy.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CSm9JBFf.js +1 -0
- package/dist/assets/PeopleRoutes-DF4Scn5d.js +22 -0
- package/dist/assets/PerformanceRoutes-C0h70RAc.js +1 -0
- package/dist/assets/{Preview-41ym7gHq.js → Preview-D29JeEmY.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-C5yzBY6U.js → QBOConnectionScreen-CwZNkZEW.js} +1 -1
- package/dist/assets/ReferralListScreen-C3Yy7aIK.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-C_09hxGy.js → ReimbursementApprovalRoutes-DAVTSD8z.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-4j6TLc0b.js → ReimbursementApprovalRuleDetailScreen-CtUn349v.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CZTFsgZy.js → ReimbursementRoutes-BYbEE0sN.js} +6 -6
- package/dist/assets/{ReportsRoutes-B23-me0V.js → ReportsRoutes-Cb8uSh4z.js} +1 -1
- package/dist/assets/RewardsRoutes-BqWi3Rha.js +1 -0
- package/dist/assets/ScreenRoutes-CFWhfVwu.js +2 -0
- package/dist/assets/{SettingsRoutes-D9EquIbx.js → SettingsRoutes-Dqo8Gg1_.js} +8 -8
- package/dist/assets/{SetupPagesScreen-BrOUPqZ2.js → SetupPagesScreen-Drdx2Cz2.js} +5 -5
- package/dist/assets/{SignInScreen-Cr3ZSlo_.js → SignInScreen-HaZFyYNm.js} +1 -1
- package/dist/assets/SignOutScreen-DGQ597Ur.js +9 -0
- package/dist/assets/{TaskListScreen-FN424GvS.js → TaskListScreen-B2sNWFUZ.js} +2 -2
- package/dist/assets/TaskRoutes-DqlemW4d.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-D-phlSTE.js → TransactionDetailRoutes-BBXGE-Zw.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-ChYMeeuU.js → TransactionDetailScreen-D7m7OZhn.js} +2 -2
- package/dist/assets/{TransactionListRoutes-HIlzTcv6.js → TransactionListRoutes-C8nLf9Ob.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CIV1iFBt.js → TreasuryRoutes-CAqMFzPt.js} +6 -6
- package/dist/assets/{VendorsRoutes-CyPMxlSq.js → VendorsRoutes-kgQCFQez.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-Dj8vTbGW.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C2PDa54s.js → ZeniAccountRoutes-B85icQ0n.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-CPK7RprH.js +9 -0
- package/dist/assets/{accountMappingHelper-DQHzz13r.js → accountMappingHelper-B3v4RMhl.js} +1 -1
- package/dist/assets/{analytics-BqIH6fAG.js → analytics-7PXXxPIN.js} +1 -1
- package/dist/assets/{analyticsHelper-5XBUO62r.js → analyticsHelper-Ce6ZNBVM.js} +1 -1
- package/dist/assets/{core-NoaByI8l.js → core-BDPZcSG4.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-D4oN1pCl.js → decodeURIComponentSafe-BR3AOxh5.js} +1 -1
- package/dist/assets/{dnd-Du6eXVDD.js → dnd-fU8QmJ8U.js} +1 -1
- package/dist/assets/{empty-CEKgz2fB.js → empty-CM59KsLF.js} +1 -1
- package/dist/assets/{empty-BvUWprs4.js → empty-DridEUN5.js} +1 -1
- package/dist/assets/{emptyVideoElement-ZMsiapTn.js → emptyVideoElement--ZfOaFPu.js} +1 -1
- package/dist/assets/epic-D7C6_Y7q.js +2 -0
- package/dist/assets/getLocaleForTenant-5gC9KZpR.js +1 -0
- package/dist/assets/{index-BFyN1ofW.js → index-B1tuor_E.js} +15819 -15778
- package/dist/assets/{index-5Tu4gqxT.js → index-BAkEFBVP.js} +1 -1
- package/dist/assets/{index-EkvVVXEG.js → index-BEZZznbS.js} +2 -2
- package/dist/assets/{index-DoqO3YOT.js → index-BZG4Ai-c.js} +1 -1
- package/dist/assets/{index-AbnUeQou.js → index-CAEfbAkM.js} +1 -1
- package/dist/assets/{index-FgS5TdYq.js → index-DA1h5kq3.js} +1 -1
- package/dist/assets/{index-EsLbYfGC.js → index-DNm9oOTV.js} +1 -1
- package/dist/assets/{index-DmDBViw_.js → index-TPK5ayqQ.js} +1 -1
- package/dist/assets/{lexical-B2cdcYiO.js → lexical-_D-pPLdL.js} +1 -1
- package/dist/assets/{liveblocks-BxEyo0kz.js → liveblocks-B2nLBm11.js} +1 -1
- package/dist/assets/{lottie-UPit3prG.js → lottie--jYlW6ya.js} +1 -1
- package/dist/assets/{mui-C_Ua4fCS.js → mui-HaM5aBuG.js} +1 -1
- package/dist/assets/{pathToGoBack-CRRzValL.js → pathToGoBack-Bp5QCbKd.js} +1 -1
- package/dist/assets/{pdf-MSfEJkEc.js → pdf-CbrAe2yy.js} +3 -3
- package/dist/assets/{pdf-lib-B3Lczh5w.js → pdf-lib-CHfVanCJ.js} +1 -1
- package/dist/assets/{plaid-CIE7io0e.js → plaid-DuKDxXr2.js} +1 -1
- package/dist/assets/{pusher-wrSf3qW5.js → pusher-p1571_5u.js} +1 -1
- package/dist/assets/{react-Ccff0kAN.js → react-BvU2rtwe.js} +1 -1
- package/dist/assets/{react-snBQBT6B.js → react-BzGU_BeP.js} +1 -1
- package/dist/assets/{react-JeguhHTv.js → react-CXLD6oJa.js} +1 -1
- package/dist/assets/{react-C266XqEO.js → react-D7-m9gXP.js} +1 -1
- package/dist/assets/{react-Cq9w84Ng.js → react-DZP7sDw7.js} +1 -1
- package/dist/assets/{react-DcDrNSsQ.js → react-Di2JdnAu.js} +1 -1
- package/dist/assets/{recharts-BwTK_Eeu.js → recharts-srrgu-jp.js} +1 -1
- package/dist/assets/{routePaths-QihwZ0bI.js → routePaths-DbVBNvPC.js} +1 -1
- package/dist/assets/{sentry-C1EYnYRT.js → sentry-CLlo3TXi.js} +1 -1
- package/dist/assets/{url-CPuzza6x.js → url-DqIeqdCZ.js} +1 -1
- package/dist/assets/{url-CfxDm57W.js → url-ky0ROLAQ.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BKKT7-j8.js → useAiCfoDashboardSuggestedQuestionsChips-Dpypv2iO.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CtdOXC4O.js +1 -0
- package/dist/assets/useCashManagementBanner-DTfbqox_.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BHOw6eR7.js → useChargeCardPusherEvents-BSAOVtAf.js} +1 -1
- package/dist/assets/{useDeviceId-BolNU1M2.js → useDeviceId-CQ3pf2OT.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-7EeCPqR2.js +1 -0
- package/dist/assets/{useInitialThreadRequest-6WPL8uY4.js → useInitialThreadRequest-DaoYHqyn.js} +1 -1
- package/dist/assets/{utils-B0dgdNkv.js → utils-BPOASmy-.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DnwgB1TB.js → withTransactionSidePanel-DKz4VB48.js} +3 -3
- package/dist/assets/{zeni-epic-state-BI6-8w2O.js → zeni-epic-state-pQFlpfOQ.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-DLAQfWFc.js +0 -1
- package/dist/assets/AddressScreen-Bg3hk-yy.js +0 -9
- package/dist/assets/CustomerOnboardingAuthScreen-D5Aw6_G_.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-ClgzcIVk.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-BZTFAdor.js +0 -18
- package/dist/assets/DrawerScreen-Dd4Y8UH4.js +0 -1
- package/dist/assets/EntityDetailRoutes-Cgy2yXfV.js +0 -1
- package/dist/assets/FeaturePreviewScreen-B2XpRD7k.js +0 -1
- package/dist/assets/MagicLinkRoutes-D3ZKOCaZ.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-DJ7d3iOG.js +0 -12
- package/dist/assets/MobileAppDrawer-vzZ1rhfW.js +0 -1
- package/dist/assets/NotFoundScreen-0I7QDvAA.js +0 -1
- package/dist/assets/OAuthConsentScreen-CQjfm7q-.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-9pKXgmoj.js +0 -1
- package/dist/assets/PeopleRoutes-BKFl1VKQ.js +0 -22
- package/dist/assets/PerformanceRoutes-rOkui2hB.js +0 -1
- package/dist/assets/ReferralListScreen-CSwCFzK8.js +0 -5
- package/dist/assets/RewardsRoutes-CmhrKVpN.js +0 -1
- package/dist/assets/ScreenRoutes-nmj-mhJ1.js +0 -2
- package/dist/assets/SignOutScreen-C4CZ4wUa.js +0 -9
- package/dist/assets/TaskRoutes-MZNF4Xft.js +0 -9
- package/dist/assets/WiseConfirmationScreen-Da_PX85y.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Bx1yxBfi.js +0 -9
- package/dist/assets/epic-7-_paY6l.js +0 -2
- package/dist/assets/getLocaleForTenant-DHEVkaRb.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CUwiq2yT.js +0 -1
- package/dist/assets/useCashManagementBanner-N8JxdG7K.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-DCRcKSZ_.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BxEyo0kz.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-NoaByI8l.js";import{eX as H,QK as ue,c6 as pe,EG as Fe,kI as dt,ET as oe,ES as re,QL as ut,bn as be,gp as Ue,QM as pt,N7 as bt,kx as Le,N8 as Ae,N9 as gt,js as ht,Q2 as ft,jH as St,Eu as It,ub as Rt,jz as yt,Fe as Pe,QN as $e,QO as At,QP as vt,QQ as kt,QR as Ct,QS as Et,E_ as ve,jN as wt,Qb as xt,EU as Bt,EE as Tt,QT as jt,ED as Dt,QU as Ft,EM as ke,F2 as Ut,F1 as Lt,EZ as Pt,QV as Me,Kd as $t,bq as Mt,EP as _t,Fw as Nt,QW as Ot,QX as Qt,Fa as zt,F7 as Ce,Px as Gt,EB as Zt,QY as _e,FY as Ee,G4 as Ht,QZ as Vt,Q_ as z,Q$ as Wt,R0 as Ne,R1 as Kt,R2 as Oe,R3 as Qe,Fm as le,bu as qt,bK as ge,cG as he,fE as ze,fC as Ge,R4 as Jt,fz as Xt,PK as Yt,R5 as en,R6 as Ze,PO as tn,Qw as nn,R7 as an,QJ as sn,G1 as we,G0 as on,R8 as rn,R9 as ln,Ra as mn,Rb as cn,Rc as dn,Qh as un,FT as pn,FX as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LX as Rn,cQ as yn,cT as An,cS as vn,cz as kn}from"./zeni-epic-state-BI6-8w2O.js";import{A as He,Z as Ve,Q as ee,e as E,z as $,c0 as We,J as te,f as v,aL as xe,o as D,at as X,H as Cn,a as Ke,c1 as En,v as G,$ as qe,c2 as wn,I as ne,c3 as xn,Y as Bn,D as Tn,y as fe,h as Je,a8 as jn,bo as Dn,a3 as Fn,m as Xe,c4 as Un,i as Ln}from"./index-BFyN1ofW.js";import{n as N,S as Pn}from"./mui-C_Ua4fCS.js";import me from"./NotFoundScreen-0I7QDvAA.js";import{S as Be}from"./SetupPagesScreen-BrOUPqZ2.js";import{F as Ye}from"./FeaturePreviewScreen-B2XpRD7k.js";import{a as f}from"./sentry-C1EYnYRT.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CUwiq2yT.js";import{u as et}from"./useInitialThreadRequest-6WPL8uY4.js";import{D as $n}from"./DrawerScreen-Dd4Y8UH4.js";import{M as tt}from"./MobileAppDrawer-vzZ1rhfW.js";import{R as Mn}from"./ReimbursementApprovalRoutes-C_09hxGy.js";import{FallBackRoute as _n}from"./ScreenRoutes-nmj-mhJ1.js";import"./recharts-BwTK_Eeu.js";import"./analytics-BqIH6fAG.js";import"./plaid-CIE7io0e.js";import"./dnd-Du6eXVDD.js";import"./stripe-DMRn4zHo.js";import"./lottie-UPit3prG.js";import"./lexical-B2cdcYiO.js";import"./pdf-MSfEJkEc.js";import"./utils-B0dgdNkv.js";import"./analyticsHelper-5XBUO62r.js";import"./routePaths-QihwZ0bI.js";import"./BusinessVerificationPageScreen-BnNwUvQl.js";import"./ReimbursementApprovalRuleDetailScreen-4j6TLc0b.js";import"./getLocaleForTenant-DHEVkaRb.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]="227bd154-b5b1-4193-b1b1-0af2817904d3",e._sentryDebugIdIdentifier="sentry-dbid-227bd154-b5b1-4193-b1b1-0af2817904d3")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ke.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),k=$.getSignedInUser(),I=w(p=>H(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(k==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-B2nLBm11.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-BDPZcSG4.js";import{eX as V,QK as ue,c6 as pe,EG as Fe,kI as dt,ET as oe,ES as re,QL as ut,bn as be,gp as Ue,QM as pt,N7 as bt,kx as Le,N8 as ke,N9 as gt,js as ht,Q2 as ft,jH as St,Eu as It,ub as Rt,jz as yt,Fe as Pe,QN as $e,QO as kt,QP as vt,QQ as At,QR as Ct,QS as Et,E_ as ve,jN as wt,Qb as xt,EU as Bt,EE as Tt,QT as jt,ED as Dt,QU as Ft,EM as Ae,F2 as Ut,F1 as Lt,EZ as Pt,QV as Me,Kd as $t,bq as Mt,EP as _t,Fw as Nt,QW as Ot,QX as Qt,Fa as zt,F7 as Ce,Px as Gt,EB as Zt,QY as _e,FY as Ee,G4 as Vt,QZ as Ht,Q_ as z,Q$ as Wt,R0 as Ne,R1 as Kt,R2 as Oe,R3 as Qe,Fm as le,bu as qt,bK as ge,cG as he,fE as ze,fC as Ge,R4 as Xt,fz as Jt,PK as Yt,R5 as en,R6 as Ze,PO as tn,Qw as nn,R7 as an,QJ as sn,G1 as we,G0 as on,R8 as rn,R9 as ln,Ra as mn,Rb as cn,Rc as dn,Qh as un,FT as pn,FX as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LX as Rn,cQ as yn,cT as kn,cS as vn,cz as An}from"./zeni-epic-state-pQFlpfOQ.js";import{T as Ve,K as He,V as ee,Q as E,z as $,c0 as We,v as te,d as v,aL as xe,o as D,at as J,D as Cn,a as Ke,c1 as En,r as G,$ as qe,c2 as wn,k as ne,c3 as xn,Y as Bn,x as Tn,B as fe,f as Xe,a8 as jn,bo as Dn,a3 as Fn,y as Je,c4 as Un,i as Ln}from"./index-B1tuor_E.js";import{n as N,S as Pn}from"./mui-HaM5aBuG.js";import me from"./NotFoundScreen-By2F-w6l.js";import{S as Be}from"./SetupPagesScreen-Drdx2Cz2.js";import{F as Ye}from"./FeaturePreviewScreen-Dgm-EaRp.js";import{a as f}from"./sentry-CLlo3TXi.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CtdOXC4O.js";import{u as et}from"./useInitialThreadRequest-DaoYHqyn.js";import{D as $n}from"./DrawerScreen-DZ4DkgHO.js";import{M as tt}from"./MobileAppDrawer-ChAhLGZE.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DAVTSD8z.js";import{FallBackRoute as _n}from"./ScreenRoutes-CFWhfVwu.js";import"./recharts-srrgu-jp.js";import"./analytics-7PXXxPIN.js";import"./plaid-DuKDxXr2.js";import"./dnd-fU8QmJ8U.js";import"./stripe-DMRn4zHo.js";import"./lottie--jYlW6ya.js";import"./lexical-_D-pPLdL.js";import"./pdf-CbrAe2yy.js";import"./utils-BPOASmy-.js";import"./analyticsHelper-Ce6ZNBVM.js";import"./routePaths-DbVBNvPC.js";import"./BusinessVerificationPageScreen-BLuK4dS7.js";import"./ReimbursementApprovalRuleDetailScreen-CtUn349v.js";import"./getLocaleForTenant-5gC9KZpR.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]="16e3d80e-9708-4229-9a91-a65beec116ac",e._sentryDebugIdIdentifier="sentry-dbid-16e3d80e-9708-4229-9a91-a65beec116ac")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ke.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(kt());const i=nt(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=Ve(),c=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),k=x.includes("reimbursement/new"),[F,B]=f.useState(!1),A=$.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(k&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(A==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(H=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&H.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-BxEyo0kz.js";import{h as W,u as de,g as Z,i as Y
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
overflow-y: auto;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
`,
|
|
36
|
+
`,Vn=N.button`
|
|
37
37
|
align-self: flex-end;
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-BxEyo0kz.js";import{h as W,u as de,g as Z,i as Y
|
|
|
48
48
|
width: ${D.sp4};
|
|
49
49
|
height: ${D.sp4};
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Hn=N.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,Wn=K(function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Qt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${
|
|
56
|
+
`,Wn=K(function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Qt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=nt(o),i=G(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=G(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(Pe(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=W(),t=de(),n=Z(),r=n.hash.substring(1),d=Ve(),{reimbursementId:c}=Y(),m=$.getSignedInUser(),o=w(R=>V(R)),a=w(R=>Me(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,k]=f.useState(!1),[F,B]=f.useState(!1),{isFeatureEnabled:A}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w(R=>ue(R,c??"")),L=$t(o),P=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(P||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,P,o.isZeni,L,m]),f.useEffect(()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(k(!0),t(Fe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(We,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:A,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=K(function(e,t){return{remisReviewView:_e(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Ht(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}})(xn);function Xn(){const e=W(),t=w(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(c=>_e(c)),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const Q=tn(),at="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Jn,common:je}=Ke.getLocalizedStrings(),De=Jn.reimbursement.bulkActions,Yn=N.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-BxEyo0kz.js";import{h as W,u as de,g as Z,i as Y
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,ea=K(function(e,t){const n=Qe(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=
|
|
64
|
+
`,ea=K(function(e,t){const n=Qe(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:Q,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ne(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=G(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=G(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=G(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(sn(!1))},onEventReceived:o=>{o===at&&e(an())}}})(jn(Dn));function ta(){const e=W(),t=de(),n=Z(),r=n.state,d=He(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Oe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=w(S=>V(S)),[x,j]=f.useState(!1),[k,F]=f.useState(!1),B=ne(),A=B?.loggedInUserRole?.includes("admin")===!0,I=w(S=>Qe(S,Q,h)),{areTenantIdsInSync:g}=Bn(),L=I.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:M}=Se({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:L==="Completed"}),f.useEffect(()=>{!k&&g&&(F(!0),t(le(Q,!0,l,!1,!0)))},[k,Q,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=ge(B?.loggedInUserRoleMap),H=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,q=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w(S=>Ue(S.companyState,u.companyId)),st=ie?.company.featuresActivationInfo.connectedAccountProvider,Ie=S=>{j(S)},{isFeatureEnabled:it}=a(E.isDebitCardFeatureEnabled),ot=ze(it,u),rt=Ge(u),{remisProcessed:X,remisProcessing:Re}=w(S=>Xt(S));f.useEffect(()=>{X===Re&&c!=null&&(t(Jt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:X>1?De.reports:De.report},{variableName:"_has_",variableValue:X>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(le(Q,!0,l,!1,!0,!0))},3e3),m(null))},[X,Re]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,O,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ye,{}):q&&(!R||p)||H&&ae?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(te,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Xe.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:x,handleDrawerToggle:Ie}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Q,isAdmin:A,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ie(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:P,onAskAiCfoClick:M,...lt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ze(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=Z(),{tenantEmailDomain:n}=Y(),r=
|
|
68
|
+
`,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=Z(),{tenantEmailDomain:n}=Y(),r=Je(),[d,c]=f.useState(!1),m=w(k=>V(k)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=k=>{c(k)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:k=>(F=>F.trackPageLoaded(Xe.Event.reimbursementPromoPage))(k)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=w(ie=>V(ie)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Je(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=ze(a,e),l=Ge(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,j=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,k=j&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b,B=F&&In(t?.loggedInUserRoleMap),A=Rn(t?.loggedInUserRoleMap),I=yn(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),L=j&&I,P=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=vn(t?.loggedInUserRoleMap),R=An(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),H=F&&M,{tenantEmailDomain:ae}=Y(),q=Z(),se=n===!0&&(u||p&&c);return s.jsxs(ct,{children:[q.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(Mn,{}):s.jsx(_n,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:P,isTenantBankingOnly:i,showChargeCardRoute:H,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ze(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):q.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Te,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Te,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{Pa as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-BxEyo0kz.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-NoaByI8l.js";import{eX as v,fT as w,Mo as Te,kx as J,qR as K,rG as A,kl as Re,jp as Me,vb as W,rL as Oe,bs as Ae,Mp as ke,bn as Fe,wk as De,Mq as Ee,Mr as je,v3 as Pe,Ms as Y,Mt as ve,Mu as Le,Mv as Be,Mw as Ve,Mx as I,My as k,Mz as F,MA as N,MB as D,MC as E,dK as Ue,w0 as xe,vQ as q,vR as $,w6 as ze,vV as Q,wc as Ge,MD as He,ME as Ye,MF as Ne,MG as qe,MH as $e,fE as Qe,fC as Ze}from"./zeni-epic-state-BI6-8w2O.js";import{U as Xe,V as Je,W as Ke,X as We,Z as ea,Q as ee,e as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,J as ra,f as P,h as ia,a0 as la,v as se,a1 as ca,a2 as da,a3 as pa}from"./index-BFyN1ofW.js";import"./mui-C_Ua4fCS.js";import fa from"./NotFoundScreen-0I7QDvAA.js";import{F as ma}from"./FeaturePreviewScreen-B2XpRD7k.js";import{a as _}from"./sentry-C1EYnYRT.js";import{u as ua}from"./useInitialThreadRequest-6WPL8uY4.js";import{t as Z,a as X,b as _a}from"./routePaths-QihwZ0bI.js";import{M as ha}from"./MobileAppDrawer-vzZ1rhfW.js";import"./recharts-BwTK_Eeu.js";import"./analytics-BqIH6fAG.js";import"./plaid-CIE7io0e.js";import"./dnd-Du6eXVDD.js";import"./stripe-DMRn4zHo.js";import"./lottie-UPit3prG.js";import"./lexical-B2cdcYiO.js";import"./pdf-MSfEJkEc.js";import"./utils-B0dgdNkv.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]="50d09d1e-1c82-468d-9505-6507d7185664",e._sentryDebugIdIdentifier="sentry-dbid-50d09d1e-1c82-468d-9505-6507d7185664")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e(qe()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:K(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),M=d(n=>K(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Ke({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Qe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
1
|
+
import{j as p}from"./liveblocks-B2nLBm11.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-BDPZcSG4.js";import{eX as v,fT as w,Mo as Te,kx as K,qR as W,rG as k,kl as Re,jp as Me,vb as J,rL as Oe,bs as ke,Mp as Ae,bn as Fe,wk as De,Mq as Ee,Mr as je,v3 as Pe,Ms as Y,Mt as ve,Mu as Le,Mv as Be,Mw as Ve,Mx as I,My as A,Mz as F,MA as N,MB as D,MC as E,dK as Ue,w0 as xe,vQ as q,vR as $,w6 as ze,vV as Q,wc as Ge,MD as He,ME as Ye,MF as Ne,MG as qe,MH as $e,fE as Qe,fC as Ze}from"./zeni-epic-state-pQFlpfOQ.js";import{R as Xe,U as Ke,W as We,X as Je,K as ea,V as ee,Q as j,z as ae,Y as aa,k as sa,c as ta,Z as oa,$ as na,v as ra,d as P,f as ia,a0 as la,r as se,a1 as ca,a2 as da,a3 as pa}from"./index-B1tuor_E.js";import"./mui-HaM5aBuG.js";import fa from"./NotFoundScreen-By2F-w6l.js";import{F as ma}from"./FeaturePreviewScreen-Dgm-EaRp.js";import{a as _}from"./sentry-CLlo3TXi.js";import{u as ua}from"./useInitialThreadRequest-DaoYHqyn.js";import{t as Z,a as X,b as _a}from"./routePaths-DbVBNvPC.js";import{M as ha}from"./MobileAppDrawer-ChAhLGZE.js";import"./recharts-srrgu-jp.js";import"./analytics-7PXXxPIN.js";import"./plaid-DuKDxXr2.js";import"./dnd-fU8QmJ8U.js";import"./stripe-DMRn4zHo.js";import"./lottie--jYlW6ya.js";import"./lexical-_D-pPLdL.js";import"./pdf-CbrAe2yy.js";import"./utils-BPOASmy-.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]="2b760c4b-b465-4f98-9dcc-71fea4b98a85",e._sentryDebugIdIdentifier="sentry-dbid-2b760c4b-b465-4f98-9dcc-71fea4b98a85")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e(qe()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Ae(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>K(n)),M=d(n=>W(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(k(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))},[i,L,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&ke(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Qe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-B2nLBm11.js";import{V as x,z as w,aR as b,v as I,d as p,f as F,d7 as P,Q as T}from"./index-B1tuor_E.js";import"./mui-HaM5aBuG.js";import m from"./NotFoundScreen-By2F-w6l.js";import{a as f}from"./sentry-CLlo3TXi.js";import{u as L,j as y,h as V,g as R,n as A,o as U,p as u}from"./core-BDPZcSG4.js";import{eX as z,TC as C,PX as X,TD as v,vH as Y,fK as G,TE as H,vF as K}from"./zeni-epic-state-pQFlpfOQ.js";import{R as j}from"./ReferralListScreen-C3Yy7aIK.js";import"./recharts-srrgu-jp.js";import"./analytics-7PXXxPIN.js";import"./plaid-DuKDxXr2.js";import"./dnd-fU8QmJ8U.js";import"./stripe-DMRn4zHo.js";import"./lottie--jYlW6ya.js";import"./lexical-_D-pPLdL.js";import"./pdf-CbrAe2yy.js";import"./utils-BPOASmy-.js";import"./useAskAiCfoHostNavButtonProps-CtdOXC4O.js";import"./MobileAppDrawer-ChAhLGZE.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="4bfb90aa-0e45-4aab-93f6-6f7d188415ee",a._sentryDebugIdIdentifier="sentry-dbid-4bfb90aa-0e45-4aab-93f6-6f7d188415ee")}catch{}})();const O=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(K())},onUpdateInviteFormLocalData:s=>{a(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),Q=()=>{const a=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=y(o=>z(o)),c=V(),D=R(),{useDynamicConfig:g}=x(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=y(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:k}=g(b.zeniAccountsConfig),N=X(k);f.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(Y()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(G(!0)))},[l.fetchState,a]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(O,{navigate:c,location:D,currentTenant:r,companyName:S,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=x(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(u,{path:"/",element:t?e.jsx(j,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(j,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(Q,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-B2SXqHam.js","assets/sentry-CLlo3TXi.js","assets/core-BDPZcSG4.js","assets/zeni-epic-state-pQFlpfOQ.js","assets/index-B1tuor_E.js","assets/mui-HaM5aBuG.js","assets/analytics-7PXXxPIN.js","assets/utils-BPOASmy-.js","assets/withTransactionSidePanel-DKz4VB48.js","assets/useAskAiCfoHostNavButtonProps-CtdOXC4O.js","assets/TransactionDetailScreen-D7m7OZhn.js","assets/decodeURIComponentSafe-BR3AOxh5.js","assets/routePaths-DbVBNvPC.js","assets/NotFoundScreen-By2F-w6l.js","assets/useInitialThreadRequest-DaoYHqyn.js","assets/analyticsHelper-Ce6ZNBVM.js","assets/CompanyPassportScreen--SPdIRlf.js","assets/MobileAppDrawer-ChAhLGZE.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Dpypv2iO.js","assets/FeaturePreviewScreen-Dgm-EaRp.js","assets/ReferralListScreen-C3Yy7aIK.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-Dg9I-63-.js","assets/AddressScreen-jEbIVhK3.js","assets/DomesticWireDetailScreen-DDaUfwcf.js","assets/DrawerScreen-DZ4DkgHO.js","assets/SetupPagesScreen-Drdx2Cz2.js","assets/BusinessVerificationPageScreen-BLuK4dS7.js","assets/BillPayApprovalRoutes-Csh9SPnU.js","assets/ReimbursementApprovalRuleDetailScreen-CtUn349v.js","assets/getLocaleForTenant-5gC9KZpR.js","assets/ReimbursementRoutes-BYbEE0sN.js","assets/ReimbursementApprovalRoutes-DAVTSD8z.js","assets/TransactionListRoutes-C8nLf9Ob.js","assets/ZeniAccountStatementScreen-CPK7RprH.js","assets/SettingsRoutes-Dqo8Gg1_.js","assets/accountMappingHelper-B3v4RMhl.js","assets/useEmailConnectResultRefresh-7EeCPqR2.js","assets/QBOConnectionScreen-CwZNkZEW.js","assets/empty-CM59KsLF.js","assets/index-CAEfbAkM.js","assets/url-DqIeqdCZ.js","assets/index-DNm9oOTV.js","assets/ReportsRoutes-Cb8uSh4z.js","assets/ChargeCardRoutes-CyGButQm.js","assets/useChargeCardPusherEvents-BSAOVtAf.js","assets/PeopleRoutes-DF4Scn5d.js","assets/ExpenseAutomationRoutes-B0EQq9x4.js","assets/TreasuryRoutes-CAqMFzPt.js","assets/useCashManagementBanner-DTfbqox_.js","assets/VendorsRoutes-kgQCFQez.js","assets/pathToGoBack-Bp5QCbKd.js","assets/ZeniAccountRoutes-B85icQ0n.js","assets/AddressRoutes-DpMeCgDh.js","assets/PandLWithForecastRoutes-CSm9JBFf.js","assets/CustomerOnboardingRoutes-Dk5stUMd.js","assets/TransactionDetailRoutes-BBXGE-Zw.js","assets/EntityDetailRoutes-CFPPv2Q-.js","assets/NotificationRoutes-0mjOYLwF.js","assets/PerformanceRoutes-C0h70RAc.js","assets/RewardsRoutes-BqWi3Rha.js","assets/TaskRoutes-DqlemW4d.js","assets/TaskListScreen-B2sNWFUZ.js","assets/AiCfoScreen-D2GxwJyN.js","assets/CardsAiCfoScreen-D8ZPE13M.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as rs,eX as is,fE as ls,fC as us,gk as cs,fr as ds,cU as pe,cA as ms,fU as _s,cs as hs,bE as Es,bo as ps,fY as Rs,v as xs,LW as gs,bs as Is,LX as js,bK as Ts,bJ as As,bt as bs,co as Ds,LY as fs,LZ as ys,cQ as Cs,cT as vs,cS as Us,cz as Os,cG as ws,o9 as Re,fA as xe,gu as Ps,g0 as ge,gr as Ie,gs as je,g1 as Ls}from"./zeni-epic-state-pQFlpfOQ.js";import{j as e}from"./liveblocks-B2nLBm11.js";import{a as w}from"./sentry-CLlo3TXi.js";import{u as Fs,h as ks,i as Hs,g as Bs,j as z,l as Te,N as u,o as Vs,p as a}from"./core-BDPZcSG4.js";import{y as Ss,u as Ns,z as D,V as Zs,c as Ms,O as zs,Q as G,i as Gs,k as $s,L,a as Ae,t as _,P as Ys,d as K,l}from"./index-B1tuor_E.js";import"./mui-HaM5aBuG.js";import{f as be}from"./analyticsHelper-Ce6ZNBVM.js";import{t as Ws}from"./getLocaleForTenant-5gC9KZpR.js";import"./recharts-srrgu-jp.js";import"./analytics-7PXXxPIN.js";import"./plaid-DuKDxXr2.js";import"./dnd-fU8QmJ8U.js";import"./stripe-DMRn4zHo.js";import"./lottie--jYlW6ya.js";import"./lexical-_D-pPLdL.js";import"./pdf-CbrAe2yy.js";import"./utils-BPOASmy-.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="35b75b9a-502c-473e-b161-36a3091ba82c",o._sentryDebugIdIdentifier="sentry-dbid-35b75b9a-502c-473e-b161-36a3091ba82c")}catch{}})();const qs={dashboard:()=>t(()=>import("./DashboardRoutes-B2SXqHam.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t(()=>import("./BillPayRoutes-Dg9I-63-.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t(()=>import("./ReimbursementRoutes-BYbEE0sN.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t(()=>import("./TransactionListRoutes-C8nLf9Ob.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t(()=>import("./SettingsRoutes-Dqo8Gg1_.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t(()=>import("./ReportsRoutes-Cb8uSh4z.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t(()=>import("./ChargeCardRoutes-CyGButQm.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t(()=>import("./PeopleRoutes-DF4Scn5d.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-B0EQq9x4.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t(()=>import("./TreasuryRoutes-CAqMFzPt.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t(()=>import("./VendorsRoutes-kgQCFQez.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t(()=>import("./ZeniAccountRoutes-B85icQ0n.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},Xs=l(()=>t(()=>import("./ReportsRoutes-Cb8uSh4z.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Js=l(()=>t(()=>import("./AddressRoutes-DpMeCgDh.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Ks=l(()=>t(()=>import("./PeopleRoutes-DF4Scn5d.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),et=l(()=>t(()=>import("./PandLWithForecastRoutes-CSm9JBFf.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),st=l(()=>t(()=>import("./CustomerOnboardingRoutes-Dk5stUMd.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),tt=l(()=>t(()=>import("./VendorsRoutes-kgQCFQez.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nt=l(()=>t(()=>import("./TransactionDetailRoutes-BBXGE-Zw.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>t(()=>import("./EntityDetailRoutes-CFPPv2Q-.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),at=l(()=>t(()=>import("./DashboardRoutes-B2SXqHam.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),fe=l(()=>t(()=>import("./BillPayRoutes-Dg9I-63-.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ot=l(()=>t(()=>import("./SettingsRoutes-Dqo8Gg1_.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>t(()=>import("./ReimbursementRoutes-BYbEE0sN.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rt=l(()=>t(()=>import("./ZeniAccountRoutes-B85icQ0n.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),it=l(()=>t(()=>import("./TreasuryRoutes-CAqMFzPt.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),lt=l(()=>t(()=>import("./TransactionListRoutes-C8nLf9Ob.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ut=l(()=>t(()=>import("./ChargeCardRoutes-CyGButQm.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),ct=l(()=>t(()=>import("./NotificationRoutes-0mjOYLwF.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),dt=l(()=>t(()=>import("./PerformanceRoutes-C0h70RAc.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mt=l(()=>t(()=>import("./ExpenseAutomationRoutes-B0EQq9x4.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_t=l(()=>t(()=>import("./RewardsRoutes-BqWi3Rha.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),ht=l(()=>t(()=>import("./TaskRoutes-DqlemW4d.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Et=l(()=>t(()=>import("./AiCfoScreen-D2GxwJyN.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-D8ZPE13M.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>t(()=>import("./NotFoundScreen-By2F-w6l.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),pt=l(()=>t(()=>import("./TaskListScreen-B2sNWFUZ.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Ht({setTenantEmailDomain:o}){const T=Fs(),B=ks(),{tenantEmailDomain:r}=Hs(),F=Ss().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ns(),v=D.getSignedInUserTenant(r)?.tenantId,I=D.getSignedInUser(),se=rs(I),$=Bs(),[V,Pe]=w.useState(!1),i=z(n=>is(n)),{useFeatureGate:N}=Zs(),Z=Ms(),te=zs(),Le=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(G.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(G.isDebitCardFeatureEnabled),A=z(n=>n.tenantState.fetchState),j=z(n=>n.tenantState.activeTenantFetchState.fetchState),h=j==="Completed"||A==="Completed"?ls(ne,i):void 0,Q=j==="Completed"||A==="Completed"?us(i):void 0,He=Gs(i,ke,ne),{isFeatureEnabled:Be}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:X}=N(G.isAiCfoFileUploadEnabled),Y=z(n=>cs(n));if(r!=null){const n=D.getSignedInUserTenant(r);I!=null&&n!=null&&be(I,i,F)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=ds(),E=$s(),Ve=i.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Se=ms(E?.loggedInUserRoleMap),oe=w.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,J=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=z(n=>M.tenantId!=null?_s(n,M.tenantId):void 0);w.useEffect(()=>{U(L.TENANT_FETCHING),o(r)},[r]),w.useEffect(()=>{if(J!=null&&v!=null){const n=J.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const c=hs(Number(b[0])),s=Number(b[1]),d=Es(`01-${c<10?`0${c}`:c}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=ps();d.isAfter(S,"month")===!1?T(Rs(v,{month:c,year:s})):B("./month_end_close_checks/review")}}}},[J,v]),w.useEffect(()=>{V||(Pe(!0),U(L.TENANT_FETCHING)),oe.current?oe.current=!1:!xs(ae,M)&&D.isSignedIn()&&(U(L.TENANT_FETCHING),function(n,b,c,s){if(xe(b?.userId,b?.zeniSessionId,n.tenantId),c(Ps(!0)),c(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const d=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ws(s)),d?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}n.userId!=null?K.identify(n.userId,{tenant_id:n.tenantId}):K.resetUserIdentity()}(M,I,T,Ne))},[M,ae,I,T,D]),w.useEffect(()=>{D.isSignedIn()&&(U(L.TENANT_FETCHING),function(n,b,c,s,d,S,H){if(c==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&d?.zeniSessionId!=null,ns=c==null||c.tenantId!==s,as=c!=null&&c.excludedResources==null,os=c!=null&&c.externalConnections==null;if(W&&ns){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(d?.userId,d?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(d.userId,s)))}else W&&as&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),W&&os&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(d.userId,s)));if(W){K.identify(d.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(L.TENANT_FETCHING),H(Ls(d.userId,s,d.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(d.userId,d.zeniSessionId)))}}(A,j,i,v,I,U,T))},[v,j]),w.useEffect(()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(L.TENANT_FETCHING),D.saveSignedInUserTenants(gs(Y.tenantsBaseInOrder)),I!=null&&be(I,i,F,void 0,Y.tenantsBaseInOrder))},[Y,A,i,I]),w.useEffect(()=>{j==="In-Progress"&&U(L.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(L.TENANT_FETCHING),k(L.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())},[j,A,v,V]);const ie=w.useRef(!1);w.useEffect(()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,function(n=Qs,b=3e3){setTimeout(()=>{const c=s=>{if(s>=n.length)return;const d=n[s],S=qs[d];S!=null?S().then(()=>ee(()=>c(s+1))).catch(()=>ee(()=>c(s+1))):c(s+1)};ee(()=>c(0))},b)}())},[j,V]);const O=i?.userRole!=null&&Is(i?.userRole),{isFeatureEnabled:Ze}=N(G.isReferralFeatureEnabled),Me=i?.userRole!=null&&i.userRole.includes("charge_card_user"),ze=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&pe(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,ue=He&&!O,Ge=js(E?.loggedInUserRoleMap),$e=i.externalConnections?.accounting[0]?.isValid,ce=i.company?.companyOnboardingInfo.isOnboardingCompleted,de=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=de&&Ts(E?.loggedInUserRoleMap),_e=Le&&!O,Ye=Fe&&!O,We=le&&As(E?.loggedInUserRoleMap),qe=ue&&bs(E?.loggedInUserRoleMap),Qe=_e&&Ds(E?.loggedInUserRoleMap),Xe=fs(E?.loggedInUserRoleMap),Je=ys(E?.loggedInUserRoleMap),Ke=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),p=Os(E?.loggedInUserRoleMap),R=ws(E?.loggedInUserRoleMap),he=le&&p,Ee=de&&R,x=_e&&Ke,g=Ye&&es,m=ue&&ss,ts=i.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||Ge===!0||Xe===!0||Je===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(ce===!0||se&&!re)&&$e===!1&&h===!1&&Q===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||ce!==!1||re||se?V&&i?.userRole&&h!=null&&Q!=null&&r!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx(Ys,{}),children:[e.jsx(a,{path:"/",element:e.jsx(Rt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(at,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Xs,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"people/*",element:ts||P?e.jsx(Ks,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(et,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(st,{})}),e.jsx(a,{path:"transaction/*",element:P&&O===!1||Me||ze?e.jsx(nt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"transactions/*",element:P&&O===!1?e.jsx(lt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"customer/*",element:P&&O===!1?e.jsx(De,{entityType:"customer"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"vendor/*",element:P&&O===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"tasks",element:e.jsx(pt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"address/*",element:We||me||Qe||qe?e.jsx(Js,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(rt,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(it,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(dt,{}):e.jsx(we,{tenantEmailDomain:r})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&O===!1?e.jsx(mt,{}):e.jsx(we,{tenantEmailDomain:r})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ct,{})}),e.jsx(a,{path:"vendors/*",element:Ve?e.jsx(tt,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(fe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(fe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"settings/*",element:Be?e.jsx(ot,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(ut,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(_t,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(Et,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Rt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:r,showTreasuryRoute:F,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(F)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):F?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):r?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},f=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:r,isTenantBankingOnly:F,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(F===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(r)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(Oe,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):r?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(Oe,{tenantEmailDomain:C}):T?e.jsx(gt,{tenantEmailDomain:C}):B?e.jsx(xt,{tenantEmailDomain:C}):e.jsx(y,{})},xt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),gt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{f as FallBackRoute,Ht as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-B2nLBm11.js";import{a as d}from"./sentry-CLlo3TXi.js";import{h as L,g as $,u as _,j as b,s as ce,n as Q,i as Z,o as W,p as k}from"./core-BDPZcSG4.js";import{bn as je,eX as D,gp as De,m$ as le,Of as Me,hF as fe,O6 as Te,qR as Ue,kx as he,mX as _e,hH as Fe,O8 as Be,O7 as Re,Qy as Oe,zi as Ve,EL as ze,Q7 as Le,Qg as Ne,c6 as ne,cL as $e,cM as Qe,bs as Ze,M7 as Ge,xK as He,Qz as Ke,Ha as Xe,Er as qe,Ei as be,Ef as Ye,xO as Se,El as ye,Eo as Ce,Eu as te,ub as ae,xN as Je,k9 as q,kc as Ie,QA as We,ld as en,y1 as nn,M_ as tn,M$ as an,k7 as on,QB as sn,ka as cn,rj as ln,MV as rn,MW as dn,rn as un,hq as pn,Mf as J,hi as re,hf as gn,hn as mn,Mg as fn,x_ as hn,QC as bn,QD as Sn,EI as yn,fC as Ae,fE as Ee,QE as Cn,gd as In,Mp as An,xZ as de,gi as ue,gh as En,xY as xn,gg as vn,gf as kn,QF as wn,fH as xe,QG as Pn,QH as jn,y4 as Dn,xX as pe,QI as Mn,fX as Tn,xU as Un,bZ as _n,c5 as Fn,c4 as Bn,b_ as Rn,c2 as On,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-pQFlpfOQ.js";import{V as Y,Q as O,z as j,af as ve,bS as $n,d as G,f as Qn,bD as Zn,k as H,B as oe,bT as Gn,i as ke,bU as Hn,aq as Kn,m as we,bV as Xn,bW as qn,bX as Yn,Y as Jn,bY as Wn,r as et,bZ as nt}from"./index-B1tuor_E.js";import{n as V}from"./mui-HaM5aBuG.js";import{M as R}from"./MobileAppDrawer-ChAhLGZE.js";import{a as K,g as X,m as tt}from"./accountMappingHelper-B3v4RMhl.js";import{t as at,A as ot}from"./AddressScreen-jEbIVhK3.js";import N from"./NotFoundScreen-By2F-w6l.js";import{g as st}from"./analyticsHelper-Ce6ZNBVM.js";import{B as it}from"./BusinessVerificationPageScreen-BLuK4dS7.js";import{C as ct}from"./CompanyPassportScreen--SPdIRlf.js";import{u as lt,a as rt}from"./useEmailConnectResultRefresh-7EeCPqR2.js";import{q as ge}from"./QBOConnectionScreen-CwZNkZEW.js";import{B as dt}from"./BillPayApprovalRoutes-Csh9SPnU.js";import{R as ut}from"./ReimbursementApprovalRoutes-DAVTSD8z.js";import"./recharts-srrgu-jp.js";import"./analytics-7PXXxPIN.js";import"./plaid-DuKDxXr2.js";import"./dnd-fU8QmJ8U.js";import"./stripe-DMRn4zHo.js";import"./lottie--jYlW6ya.js";import"./lexical-_D-pPLdL.js";import"./pdf-CbrAe2yy.js";import"./utils-BPOASmy-.js";import"./routePaths-DbVBNvPC.js";import"./empty-CM59KsLF.js";import"./pdf-lib-CHfVanCJ.js";import"./index-CAEfbAkM.js";import"./url-DqIeqdCZ.js";import"./index-DNm9oOTV.js";import"./decodeURIComponentSafe-BR3AOxh5.js";import"./ReimbursementApprovalRuleDetailScreen-CtUn349v.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="f3039931-882a-41ff-b34b-067d04b6341f",e._sentryDebugIdIdentifier="sentry-dbid-f3039931-882a-41ff-b34b-067d04b6341f")}catch{}})();const pt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-BxEyo0kz.js";import{a as d}from"./sentry-C1EYnYR
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,gt=Q(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:he(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:u,vendorsAccountSection:p,filing1099Section:m}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:h}=u,{prepaidExpensesAccount:A,fixedAssetsAccount:
|
|
9
|
+
`,gt=Q(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:he(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:u,vendorsAccountSection:p,filing1099Section:m}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:h}=u,{prepaidExpensesAccount:A,fixedAssetsAccount:w,accruedExpensesAccount:x}=p,{bankAccount:f,expenseCategory1099:I}=m,E=K(a.accountMappingView.incomeAccountList,y.selectedOption),F=K(a.accountMappingView.expenseAccountList,g.selectedOption),B=K(a.accountMappingView.billPayAccountList,r.selectedOption),M=K(a.accountMappingView.reimbursementsAccountList,h.selectedOption),z=X(a.accountMappingView.prepaidExpensesAccountList,A.selectedOptions),S=X(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),T=X(a.accountMappingView.accruedExpensesAccountList,x.selectedOptions),C=X(a.accountMappingView.bankAccounts1099FilingAccountList,f.selectedOptions),v=tt(a.accountMappingView.expenseAccounts1099FilingAccountList,I),U={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:B?.accountId,selectedReimbursementsAccountId:M?.accountId,selectedPrepaidExpensesAccountIds:z.map(P=>P.accountId),selectedFixedAssetsAccountIds:S.map(P=>P.accountId),selectedAccruedExpensesAccountIds:T.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:C.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:v};e(Re({data:U}))},onBackClick:()=>{ve(c)===!1?(s("../../dashboard"),e(Be())):e(fe())},onSaveClick:()=>{e(Fe()),l&&G.track(Qn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(_e(a.currentTenant.companyId,n))}}})($n),mt=()=>{const e=L(),a=$(),s=_(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:u}=l("transaction_categorization_config"),p=!u&&i?.capitalization_enabled===!0,m=j.getSignedInUser(),y=je(m),g=b(C=>D(C)),{capitalizableAccounts:r,capitalizableAccountOverrides:h,isCapitalizationThresholdSaving:A,currencySymbol:w}=b(C=>{const v=C.tenantState.currentTenantId,U=v!=null?C.tenantState.tenantsById[v]:void 0,P=De(C.companyState,g.companyId);return{capitalizableAccounts:U?.capitalizableAccounts??null,capitalizableAccountOverrides:U?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:C.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:P?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),x=d.useCallback((C,v)=>{s(le(g.companyId,C,v))},[s,g.companyId]),f=d.useCallback(C=>{const v={...h??{}},U=Object.entries(C);for(const[se,ie]of U)ie===null?delete v[se]:v[se]=ie;const[P,Pe]=U[0]??[];P!=null&&s(le(g.companyId,P,Pe,void 0,Object.keys(v).length>0?v:null))},[s,g.companyId,h]),I=b(C=>Me(C.accountState),ce),E=d.useMemo(()=>{const C={};for(const v of I)v.accountId!=null&&v.accountName!=null&&(C[v.accountId]=v.accountName);return C},[I]),[F,B]=d.useState(!1),[M,z]=d.useState(!1);d.useEffect(()=>{F===!1&&(s(fe()),B(!0))},[F]);const S=b(C=>Te(C)),T=C=>{z(C)};return o.jsxs(pt,{children:[o.jsx(R,{isAppContentDrawerOpen:M,handleDrawerToggle:T}),o.jsx(gt,{currentTenant:g,navigate:e,accountMappingView:S,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:p,capitalizableAccounts:r,accountNamesById:E,capitalizableAccountOverrides:h,currencySymbol:w,isCapitalizationThresholdSaving:A,onSaveCapitalizationAccountThreshold:x,onSaveCapitalizationAccountThresholds:f,location:a,isSettings:ve(a),onClickMenuIcon:()=>T(!0)})]})},ft=V.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-BxEyo0kz.js";import{a as d}from"./sentry-C1EYnYR
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,ht=Q(function(e,a){const s=D(e),c=Le(e),l=Ne(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ne(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:G}},function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),bt=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=d.useState(!1),[t,i]=d.useState(!1),[u,p]=d.useState(!1),m=b(I=>D(I)),y=b(I=>I.billPaySetupApproverViewState.fetchState),g=b(I=>I.remiSetupApproverViewState.fetchState),r=b(I=>Oe(I)),{isApprovalRulesV3Enabled:h,isLoading:A}=Zn(m?.tenantId),
|
|
17
|
+
`,ht=Q(function(e,a){const s=D(e),c=Le(e),l=Ne(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ne(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:G}},function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),bt=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=d.useState(!1),[t,i]=d.useState(!1),[u,p]=d.useState(!1),m=b(I=>D(I)),y=b(I=>I.billPaySetupApproverViewState.fetchState),g=b(I=>I.remiSetupApproverViewState.fetchState),r=b(I=>Oe(I)),{isApprovalRulesV3Enabled:h,isLoading:A}=Zn(m?.tenantId),w=m.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const x=H();d.useEffect(()=>{u||y!=="Not-Started"||A||(p(!0),s(Ve(!0,!0,h)))},[u,y,A,h,s]),d.useEffect(()=>{t||g!=="Not-Started"||A||(i(!0),s(ze(!0,!1,!1,h)))},[t,g,A,h,s]);const f=I=>{n(I)};return x?.loggedInUserRoleMap!=null?o.jsxs(ft,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:f}),o.jsx(ht,{navigate:e,location:a,companyId:w,currentTenant:m,roleMap:x.loggedInUserRoleMap,onClickMenuIcon:()=>{f(!0)}})]}):o.jsx(oe,{fetchState:r.fetchState})},St=V.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-BxEyo0kz.js";import{a as d}from"./sentry-C1EYnYR
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,yt=Q(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,u=D(e);return{bankSetupView:Ke(e,s,n,t,c,l,i),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(ae(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(te(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,u,p)=>{e(Ce(n,t,p,u,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,u)=>{e(ye(!1,n,u,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,u,p)=>{e(p==="paymentAccount"?be(n,t,i,u):Ye(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(qe(l,t,n,i))},onRemoveConnection:n=>{e(Xe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Hn),Ct=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),l=H(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[u,p]=d.useState(!1),[m,y]=d.useState(!1),g=b(M=>D(M)),r=b(M=>M.settingsViewState.bankConnection.fetchState),h=$e(g,l?.loggedInUserRoleMap),A=Qe(g,l?.loggedInUserRoleMap),
|
|
25
|
+
`,yt=Q(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,u=D(e);return{bankSetupView:Ke(e,s,n,t,c,l,i),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(ae(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(te(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,u,p)=>{e(Ce(n,t,p,u,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,u)=>{e(ye(!1,n,u,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,u,p)=>{e(p==="paymentAccount"?be(n,t,i,u):Ye(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(qe(l,t,n,i))},onRemoveConnection:n=>{e(Xe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Hn),Ct=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),l=H(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[u,p]=d.useState(!1),[m,y]=d.useState(!1),g=b(M=>D(M)),r=b(M=>M.settingsViewState.bankConnection.fetchState),h=$e(g,l?.loggedInUserRoleMap),A=Qe(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),x=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,f=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,I=ke(g,t,i),E=Ge(g,l?.loggedInUserRoleMap)&&I,F=g.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect(()=>{m||r==="Completed"||(y(!0),s(He(!1)))},[m,s,r]);const B=M=>{p(M)};return h||x||A||E?o.jsxs(St,{children:[o.jsx(R,{isAppContentDrawerOpen:u,handleDrawerToggle:B}),o.jsx(yt,{navigate:e,location:a,companyId:F,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:h,isRemiEnabled:A,isZeniAccountEnabled:x,isChargeCardEnabled:E,isTreasuryEnabled:f,onClickMenuIcon:()=>{B(!0)}})]}):o.jsx(N,{})},It=V.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-BxEyo0kz.js";import{a as d}from"./sentry-C1EYnYR
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,At=Q(function(e,a){const{companyId:s}=a,c=D(e),l=a.roleMap.bill_pay_admin,n=We(e,s),{uiState:t}=n,i=(ne(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:
|
|
33
|
+
`,At=Q(function(e,a){const{companyId:s}=a,c=D(e),l=a.roleMap.bill_pay_admin,n=We(e,s),{uiState:t}=n,i=(ne(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:we.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(ae("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(te(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ce(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(ye(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(be(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ie(n))},handleConfirmCardSetupIntent:n=>{e(cn(n))},updateCardPaymentModalState:n=>{e(sn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(on(n,t,i))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(an())},handleResetCardPaymentErrorStatuses:()=>{e(tn())},onBillingAddressSave:n=>{e(nn(n))},onAddressEditHandler:n=>{if(n!=null){const t=at(n);e(en({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Xn),Et=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=d.useState(!1),[t,i]=d.useState(!1),[u,p]=d.useState(!1),m=b(f=>D(f)),y=b(f=>f.cardPaymentViewState),g=b(f=>f.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Kn(y.addCardPaymentSourceStatus.fetchState),h=y.addCardPaymentSourceStatus.fetchState,A=m.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=H();d.useEffect(()=>{A!=null&&s(Je(A,!1))},[A,s]),d.useEffect(()=>{t||(i(!0),s(q()))},[t,s]),d.useEffect(()=>{u||(Ie(["card"]),p(!0))},[u]),d.useEffect(()=>{r==="In-Progress"&&h==="Completed"&&s(q())},[r,h]);const x=f=>{n(f)};return w?.loggedInUserRoleMap!=null?o.jsxs(It,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:x}),o.jsx(At,{navigate:e,location:a,companyId:A,currentTenant:m,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{x(!0)},googleAPIKey:we.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},ee="external_integrations",xt=Q(function(e){const a=dn(e,ee);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{ge.init("/connection/auth",n),ge.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(hn())},onSaveChargeBeeCredentials:(i,u)=>{const p=c.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;p!=null&&e(mn(t,p,J("revenue"),fn("chargebee"),{api_key:i,site:u}))},onConnectHubSpot:(i,u)=>{const p=c.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(p!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:u,connection_id:p,redirect_uri:m,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(i,u)=>{e(gn(t,i,J(u)))},onConnectGmail:()=>{e(re(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(re(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(pn(t,J("payments"),i))},onNotifyMe:i=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(un(ee,i,l))}}})(qn),vt=()=>{const e=L(),a=_(),{tenantEmailDomain:s}=Z();lt();const[c,l]=d.useState(!1),n=b(f=>f.tenantState.fetchState),t=b(f=>D(f)),i=t.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),p=H(),m=ne(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");d.useEffect(()=>{a(ln(ee))},[a]);const[y,g]=d.useState(!1);d.useEffect(()=>{y||(g(!0),a(q()))},[y,a]);const r=f=>{l(f)},h=b(f=>rn(f,i)),A=b(f=>f.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:w,onAddPlaidAccount:x}=rt({companyId:i??t.companyId});return p?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(xt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:m,integrationsView:h,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:h.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:h.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:h.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:h.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:h.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(h.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([f,I])=>[f,I?.message])),deleteConnectionState:h.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:h.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:x,plaidConnectionDetails:A})]}):o.jsx(oe,{fetchState:n})},kt=V.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as o}from"./liveblocks-BxEyo0kz.js";import{a as d}from"./sentry-C1EYnYR
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,
|
|
41
|
+
`,wt=V.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-BxEyo0kz.js";import{a as d}from"./sentry-C1EYnYR
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,Pt=()=>{const e=_(),{tenantEmailDomain:a}=Z(),[s,c]=d.useState(!1),l=b(r=>D(r)).companyId??j.getSignedInUserTenant(a)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=b(r=>bn(r,n.userId)),i=b(r=>Sn(r,l,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=i,p=r=>{c(r)},m=d.useCallback(r=>{e(ae("user_reimbursement_account",r))},[]),y=d.useCallback(r=>{e(te(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);d.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(yn(n.userId))},[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(
|
|
49
|
+
`,Pt=()=>{const e=_(),{tenantEmailDomain:a}=Z(),[s,c]=d.useState(!1),l=b(r=>D(r)).companyId??j.getSignedInUserTenant(a)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=b(r=>bn(r,n.userId)),i=b(r=>Sn(r,l,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=i,p=r=>{c(r)},m=d.useCallback(r=>{e(ae("user_reimbursement_account",r))},[]),y=d.useCallback(r=>{e(te(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);d.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(yn(n.userId))},[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(wt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:p}),o.jsx(Yn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:m,onEstablishConnectionClick:y,onClickMenuIcon:()=>{p(!0)}})]})},jt=V.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-BxEyo0kz.js";import{a as d}from"./sentry-C1EYnYR
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,me=({appContent:e})=>{const a=_(),s=L(),c=$(),[l,n]=d.useState(!1),t=b(S=>D(S)),{tenantEmailDomain:i}=t,u=t.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:p}=Y(),m=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=p(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=p(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=b(S=>he(S)),A=Ae(t),
|
|
57
|
+
`,me=({appContent:e})=>{const a=_(),s=L(),c=$(),[l,n]=d.useState(!1),t=b(S=>D(S)),{tenantEmailDomain:i}=t,u=t.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:p}=Y(),m=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=p(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=p(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=b(S=>he(S)),A=Ae(t),w=Ee(g,t),x=!w&&h,f=ke(t,y,g),{areTenantIdsInSync:I}=Jn();d.useEffect(()=>{I&&a(Cn(u,x))},[u,a,x,I]);const E=b(S=>In(S,x)),F=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||u==null,B=An(t),M=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,z=S=>{n(S)};return o.jsxs(jt,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:z}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Wn,{myProfileView:E,isAccountingClassesEnabled:h,isReimbursementDisabled:M===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:f===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:B===!1,onClickMenuIcon:()=>{z(!0)},isLoading:F,isBankingOnlyTenant:w,isCardsOnlyTenant:A,onAddressClick:S=>{const T=function(v,U){let P=`/${v}/settings/my_profile`;return P=P.concat(`/new/${U}`),P}(i,S),C=et(c.state?.pathnameStackToGoBack,c.pathname);s(T,{state:{pathnameStackToGoBack:C}})},onGetOtp:S=>{const T={...E.myProfileLocalData,phone:S};a(de({localData:T})),a(kn(S,"MyProfile"))},onResendOtp:S=>{a(vn(S,"MyProfile"))},onCancelClick:()=>{a(xn())},onSaveClick:()=>{a(ue("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(S,T)=>{a(En(S,T,"MyProfile"))},onVerifyOtpSuccess:S=>{S!=null&&j.saveZeniOtpToken(S),a(ue("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:S=>{a(de({localData:S}))}})]})};function Dt(){const e=_(),a=b(r=>D(r)).companyId,s=b(r=>wn(r)),c=b(r=>xe(r)),l=j.getSignedInUser(),[n,t]=d.useState(!1),i=d.useCallback(r=>{t(r)},[]),u=d.useCallback(r=>{e(Pn(r))},[]),p=d.useCallback(()=>{l?.userEmail!=null&&e(jn({loggedInUserEmail:l.userEmail}))},[l?.userEmail]),m=d.useCallback(()=>{e(Dn())},[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const y=d.useCallback(()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=d.useCallback(()=>{e(Mn())},[]);return d.useEffect(()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,a))}},[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(nt,{notificationSettingsView:s,onFormDataChange:u,onCancel:p,onSave:m,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:y,resetUpdateStatus:g})]})}function pa(e){const[a,s]=d.useState(!1),c=b(r=>xe(r)),l=b(r=>D(r)),n=H(),t=j.getSignedInUser(),i=_(),{useFeatureGate:u}=Y(),{isFeatureEnabled:p}=u(O.isDebitCardFeatureEnabled),m=t?.userEmail==null||c.fetchState!=="Completed"||Tn(c.notificationSettings,t.userEmail,p,l);d.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(Un()))},[c.fetchState,a]);const y=Ee(p,l),g=Ae(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||m!==!0?_n(l)?o.jsxs(W,{children:[Fn(n?.loggedInUserRole??[],p,l,n?.loggedInUserRoleMap)&&o.jsx(k,{path:"accounting/*",element:o.jsx(mt,{})}),Bn(n?.loggedInUserRole??[],p,l,n?.loggedInUserRoleMap)&&o.jsx(k,{path:"approval_rules/*",element:o.jsx(Mt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Rn(l,n?.loggedInUserRoleMap)&&o.jsx(k,{path:"my_bank_connections",element:o.jsx(Pt,{})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(k,{path:"bank_connections",element:o.jsx(Ct,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(k,{path:"business_verification",element:o.jsx(it,{productType:y?"zeni_accounts":g?"charge_cards":st(l,n?.loggedInUserRoleMap)})}),zn(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(k,{path:"company_details",element:o.jsx(ct,{})}),Ln(n?.loggedInUserRole??[],l)&&o.jsx(k,{path:"billing",element:o.jsx(Et,{})}),Nn(n?.loggedInUserRole??[],p,l)&&o.jsx(k,{path:"integrations",element:o.jsx(vt,{})}),o.jsx(k,{path:"my_profile/new/:addressType",element:o.jsx(me,{appContent:o.jsx(ot,{isSubPage:!1})})}),o.jsx(k,{path:"my_profile",element:o.jsx(me,{})}),m&&o.jsx(k,{path:"notifications",element:o.jsx(Dt,{})}),o.jsx(k,{path:"*",element:o.jsx(N,{})})]}):o.jsx(W,{children:o.jsx(k,{path:"*",element:o.jsx(N,{})})}):null}function Mt(e){return o.jsxs(W,{children:[o.jsx(k,{path:"/",element:o.jsx(bt,{})}),o.jsx(k,{path:"bills/approval-rules/*",element:o.jsx(dt,{})}),o.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(ut,{}):o.jsx(N,{})}),o.jsx(k,{path:"*",element:o.jsx(N,{})})]})}export{pa as default};
|