@zeniai/web-app-ui 5.2.9-dev → 5.2.9-qa
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-C2iTumHM.js +1 -0
- package/dist/assets/{AddressScreen-CS_7zy0w.js → AddressScreen-Dqwi7asg.js} +1 -1
- package/dist/assets/{AiCfoScreen-iW6cLrky.js → AiCfoScreen-DZLM16VS.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-CX584cho.js → BillPayApprovalRoutes-CnCwb-Mh.js} +1 -1
- package/dist/assets/{BillPayRoutes-CZ_W5Z9a.js → BillPayRoutes-BusugyBh.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-CyYTkSJk.js → BusinessVerificationPageScreen-Cy2CFeUz.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-Do2CM9NI.js → CardsAiCfoScreen-Bvc4PWGQ.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-Bw9A89pe.js → ChargeCardRoutes-CXQLWwTK.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-Cfn_9183.js → CompanyPassportScreen-nmEzz6fq.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DNfbV6Cs.js → ConnectionAuthScreen-Bn6p5jCo.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-h8AsLQEL.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CYvJ6SV5.js → CustomerOnboardingRoutes-CzHVsO43.js} +1 -1
- package/dist/assets/{DashboardRoutes-PGKQ0Moe.js → DashboardRoutes-CYS11Tnq.js} +1 -1
- package/dist/assets/{DefaultTenantHome-x6jalJiO.js → DefaultTenantHome-DFG-x6vm.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-BfQ0MRPv.js → DomesticWireDetailScreen-zgK1EeEQ.js} +1 -1
- package/dist/assets/{DrawerScreen-ng7Vkepm.js → DrawerScreen-Dj5itxnJ.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-BZgvjOQf.js → EntityDetailRoutes-BVnuWs1u.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DhN19M7c.js → ExpenseAutomationRoutes-CGWYEvDw.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-BTGR97Fd.js → FeaturePreviewScreen-BjS0m3cA.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-BTBofz2n.js → HubSpotOAuthCallbackScreen-B4wj4jwx.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-CVvSbDRe.js → MagicLinkRoutes-DhLc4avU.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-BSaTrOoV.js → MagicLinkSignInScreen-Bka9M-FA.js} +1 -1
- package/dist/assets/{MobileAppDrawer-CrYdORTa.js → MobileAppDrawer-2f948WLd.js} +1 -1
- package/dist/assets/NotFoundScreen-BkB6DL-8.js +1 -0
- package/dist/assets/{NotificationRoutes-CpnG1o79.js → NotificationRoutes-BbxpzMby.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-UW-i7iNJ.js → OAuthConsentScreen-BFVA16-3.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-BhJsKt5l.js → PandLWithForecastRoutes-BbFjbA4X.js} +1 -1
- package/dist/assets/{PeopleRoutes-C2a-KGIZ.js → PeopleRoutes-yD3gTmoM.js} +1 -1
- package/dist/assets/{PerformanceRoutes-DUsD3MMO.js → PerformanceRoutes-C9rfaaZ7.js} +1 -1
- package/dist/assets/{Preview-Cj3JppRF.js → Preview-DVcLvlJM.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-6SpIc2GW.js → QBOConnectionScreen-KPblY_Id.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-uO-QkUb5.js → ReimbursementApprovalRoutes-BtVtLo57.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-h4Xa7G88.js → ReimbursementApprovalRuleDetailScreen-B-NF15uO.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DOnoVy-K.js → ReimbursementRoutes-DrPhcUVq.js} +1 -1
- package/dist/assets/{ReportsRoutes-D8ZGwQbw.js → ReportsRoutes-4al_6uGo.js} +1 -1
- package/dist/assets/{RewardsRoutes-WlT7olAX.js → RewardsRoutes-BUnw-0yn.js} +1 -1
- package/dist/assets/{ScreenRoutes-BfH4klTS.js → ScreenRoutes-CAYGh4eu.js} +2 -2
- package/dist/assets/{SettingsRoutes-LY7c8epf.js → SettingsRoutes-CKliNhdm.js} +1 -1
- package/dist/assets/{SetupPagesScreen-B6MCIymI.js → SetupPagesScreen-BjNE7Cm8.js} +1 -1
- package/dist/assets/{SignInScreen-By7D8uvx.js → SignInScreen-CQdJr7uQ.js} +1 -1
- package/dist/assets/{SignOutScreen-CsyzSdg-.js → SignOutScreen-C9nBkJOZ.js} +1 -1
- package/dist/assets/{TaskListScreen-C1omaWqK.js → TaskListScreen-Dy0ym2bJ.js} +1 -1
- package/dist/assets/{TaskRoutes-6hwT2MgW.js → TaskRoutes-C7FnHOcf.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-CtLhxWox.js → TransactionDetailRoutes-BkSAMpem.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-Brema_7y.js → TransactionDetailScreen-Df-lTaa7.js} +1 -1
- package/dist/assets/{TransactionListRoutes-huZThwT8.js → TransactionListRoutes-rczQJ3vr.js} +1 -1
- package/dist/assets/{TreasuryRoutes-B6pwb5CA.js → TreasuryRoutes-DRks-0zi.js} +1 -1
- package/dist/assets/{VendorsRoutes-BvqnyUHV.js → VendorsRoutes-DBFuiYnF.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-BZm8dkwf.js → WiseConfirmationScreen-DP9-e5Xd.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-BPo-hTc9.js → ZeniAccountRoutes-ewlJGl5c.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-DBY93QB3.js → ZeniAccountStatementScreen-DWnERIBu.js} +1 -1
- package/dist/assets/{accountMappingHelper-F9iVvIst.js → accountMappingHelper-Gr9m7o7F.js} +1 -1
- package/dist/assets/{analytics-CzAweyQD.js → analytics-CnnfCSOg.js} +1 -1
- package/dist/assets/{analyticsHelper-3Gu9cPjm.js → analyticsHelper-B-6LZuP4.js} +1 -1
- package/dist/assets/{core-DGp_s-v5.js → core-dwwFaYBE.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-B1HNc06R.js → decodeURIComponentSafe-DPB81zx3.js} +1 -1
- package/dist/assets/{dnd-Dv83AsVV.js → dnd-DZvuKFo2.js} +1 -1
- package/dist/assets/{empty-CwBt9OsO.js → empty-C6x_q-2g.js} +1 -1
- package/dist/assets/{empty-Bs3ZKbS5.js → empty-D-CDbU6V.js} +1 -1
- package/dist/assets/{emptyVideoElement-Ce3Auj8x.js → emptyVideoElement-BIRkbwVd.js} +1 -1
- package/dist/assets/{epic-B473FHIG.js → epic-BCPu20Qu.js} +1 -1
- package/dist/assets/{getLocaleForTenant-DQyjLBRZ.js → getLocaleForTenant-DwvsjOvL.js} +1 -1
- package/dist/assets/{index-CklnO7MC.js → index-8OwuFG0U.js} +1 -1
- package/dist/assets/{index-Du4bjclL.js → index-BI9GRfhX.js} +2 -2
- package/dist/assets/{index-D20OqJJX.js → index-BJuJWplp.js} +1 -1
- package/dist/assets/{index-TundQtwk.js → index-CJhMrDQa.js} +1 -1
- package/dist/assets/{index-BwhVclXq.js → index-DHUxeELF.js} +1 -1
- package/dist/assets/{index-s0HleIMs.js → index-DcHHjvaZ.js} +7 -7
- package/dist/assets/{index-B7XJe0Nt.js → index-DowwiI_V.js} +1 -1
- package/dist/assets/{index-CLXVBUN9.js → index-rl6qAmZH.js} +1 -1
- package/dist/assets/{lexical-BI9o6Rzd.js → lexical-CKHu_k04.js} +1 -1
- package/dist/assets/{liveblocks-BQ1kyMTn.js → liveblocks-BGSO0Qat.js} +1 -1
- package/dist/assets/{lottie-CBfI26wD.js → lottie-dHew8Pi0.js} +1 -1
- package/dist/assets/{mui-BKDz48_f.js → mui-BtJzVyNP.js} +1 -1
- package/dist/assets/{pathToGoBack-DkAc2FWv.js → pathToGoBack-961Nhi8-.js} +1 -1
- package/dist/assets/{pdf-CLZhSauj.js → pdf-fvaN7q8z.js} +3 -3
- package/dist/assets/{pdf-lib-KHPbWA1x.js → pdf-lib-BJAK6s2W.js} +1 -1
- package/dist/assets/{plaid-FOcqk85t.js → plaid-DQ7S7SfR.js} +1 -1
- package/dist/assets/{pusher-C_fUl_CW.js → pusher-BZ3fvlQ6.js} +1 -1
- package/dist/assets/{react-CE5DgNhh.js → react-BJ4U97lV.js} +1 -1
- package/dist/assets/{react-DXdWsARm.js → react-C0v88JXe.js} +1 -1
- package/dist/assets/{react-Dm2rgxL7.js → react-CgQ98v2I.js} +1 -1
- package/dist/assets/{react-Lt0NhAvg.js → react-DYrCJ5-l.js} +1 -1
- package/dist/assets/{react-BNvttsYS.js → react-hbwqeBOc.js} +1 -1
- package/dist/assets/{react-Ge7IlhvK.js → react-w9IdoRbZ.js} +1 -1
- package/dist/assets/{recharts-om305-Co.js → recharts-DHViZ79s.js} +1 -1
- package/dist/assets/{routePaths-BSw_NTbY.js → routePaths-Pys8bHTK.js} +1 -1
- package/dist/assets/{sentry-CRnwGvtj.js → sentry-BxK72NTv.js} +1 -1
- package/dist/assets/{url-BFXW4vx0.js → url-CJVt52Qh.js} +1 -1
- package/dist/assets/{url-BEGOiM2S.js → url-CpKMfgt9.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-QHUuBb0J.js → useAiCfoDashboardSuggestedQuestionsChips-Du-sPG0F.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-Bh9PS9wx.js → useAskAiCfoHostNavButtonProps-CEXExmUC.js} +1 -1
- package/dist/assets/{useCashManagementBanner-DTaGzioM.js → useCashManagementBanner-5JzC4Bv8.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-CtddpIll.js → useChargeCardPusherEvents-CnnOtBlk.js} +1 -1
- package/dist/assets/{useDeviceId-CunMxRLL.js → useDeviceId--iR7_ret.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BBoXuKk_.js → useEmailConnectResultRefresh-D80kpXmE.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-CwFv9Eqv.js → useInitialThreadRequest-Be44atB3.js} +1 -1
- package/dist/assets/{utils-BJ3kLhBy.js → utils-R2J97kpk.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-D7VzfbTv.js → withTransactionSidePanel-CNqfXJQc.js} +1 -1
- package/dist/assets/{zeni-epic-state-Dk4VKziD.js → zeni-epic-state-DZ68JIF_.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-q8yYrEbz.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B_3t9Fai.js +0 -1
- package/dist/assets/NotFoundScreen-De_OVTcT.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BQ1kyMTn.js";import{h as H,u as de,g as Q,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-DGp_s-v5.js";import{eW as V,QX as ue,c7 as pe,EW as Ue,kL as ut,F7 as oe,F6 as re,QY as pt,bn as be,gq as Le,QZ as bt,Nn as gt,kA as Pe,No as ke,Np as ht,jv as ft,Qf as St,jK as It,EK as Rt,uo as yt,jC as kt,Fu as $e,Q_ as Me,Q$ as At,R0 as vt,R1 as Ct,R2 as Et,R3 as wt,Fe as Ae,jQ as xt,Qo as Bt,F8 as Tt,EU as Ft,R4 as jt,ET as Dt,R5 as Ut,F0 as ve,Fi as Lt,Fh as Pt,Fd as $t,R6 as _e,Kt as Mt,bq as _t,F3 as Nt,FM as Ot,R7 as Gt,R8 as zt,Fq as Zt,Fn as Ce,PK as Qt,ER as Vt,R9 as Ne,Gc as Ee,Gk as Wt,Ra as Ht,Rb as z,Rc as qt,Rd as Oe,Re as Kt,Rf as Ge,Rg as ze,FC as le,bu as Jt,bK as ge,cI as he,fD as Ze,fB as Qe,Rh as Xt,fy as Yt,PX as en,Ri as tn,Rj as Ve,P$ as nn,QJ as an,Rk as sn,QW as on,Gh as we,Gg as rn,Rl as ln,Rm as mn,Rn as cn,Ro as dn,Rp as un,Qu as pn,G7 as bn,Gb as gn,bs as hn,bJ as fn,cC as Sn,cq as In,bt as Rn,Mb as yn,cS as kn,cV as An,cU as vn,cB as Cn}from"./zeni-epic-state-Dk4VKziD.js";import{w as We,J as He,A as ee,X as E,z as P,b$ as qe,_ as te,c as A,aM as xe,o as j,au as X,F as En,O as Ke,c0 as wn,s as Z,a0 as Je,c1 as xn,T as ne,c2 as Bn,Z as Tn,C as Fn,B as fe,f as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-s0HleIMs.js";import{n as N,S as $n}from"./mui-BKDz48_f.js";import me from"./NotFoundScreen-De_OVTcT.js";import{S as Be}from"./SetupPagesScreen-B6MCIymI.js";import{F as et}from"./FeaturePreviewScreen-BTGR97Fd.js";import{a as f}from"./sentry-CRnwGvtj.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-Bh9PS9wx.js";import{u as tt}from"./useInitialThreadRequest-CwFv9Eqv.js";import{D as Mn}from"./DrawerScreen-ng7Vkepm.js";import{M as nt}from"./MobileAppDrawer-CrYdORTa.js";import{R as _n}from"./ReimbursementApprovalRoutes-uO-QkUb5.js";import{FallBackRoute as Nn}from"./ScreenRoutes-BfH4klTS.js";import"./recharts-om305-Co.js";import"./analytics-CzAweyQD.js";import"./plaid-FOcqk85t.js";import"./dnd-Dv83AsVV.js";import"./stripe-cKAAJElX.js";import"./lottie-CBfI26wD.js";import"./lexical-BI9o6Rzd.js";import"./pdf-CLZhSauj.js";import"./utils-BJ3kLhBy.js";import"./analyticsHelper-3Gu9cPjm.js";import"./routePaths-BSw_NTbY.js";import"./BusinessVerificationPageScreen-CyYTkSJk.js";import"./ReimbursementApprovalRuleDetailScreen-h4Xa7G88.js";import"./getLocaleForTenant-DQyjLBRZ.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]="f8a551c8-7b2c-4fb8-a736-2615f5fba3ba",e._sentryDebugIdIdentifier="sentry-dbid-f8a551c8-7b2c-4fb8-a736-2615f5fba3ba")}catch{}})();const at=e=>`/${e}/reimbursements`,On=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"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),Gn=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(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=gt(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:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({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(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ae(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(Ae("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(At());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(kt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(It(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(wn);function Fe(){const e=H(),t=de(),n=Q(),{reimbursementId:r}=Y(),d=We(),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=Q().pathname,F=x.includes("edit"),k=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=P.getSignedInUser(),I=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(I?.userRole??[]);f.useEffect((()=>{(k&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==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"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:A,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(On,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-BGSO0Qat.js";import{h as H,u as de,g as Q,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-dwwFaYBE.js";import{eW as V,QX as ue,c7 as pe,EW as Ue,kL as ut,F7 as oe,F6 as re,QY as pt,bn as be,gq as Le,QZ as bt,Nn as gt,kA as Pe,No as ke,Np as ht,jv as ft,Qf as St,jK as It,EK as Rt,uo as yt,jC as kt,Fu as $e,Q_ as Me,Q$ as At,R0 as vt,R1 as Ct,R2 as Et,R3 as wt,Fe as Ae,jQ as xt,Qo as Bt,F8 as Tt,EU as Ft,R4 as jt,ET as Dt,R5 as Ut,F0 as ve,Fi as Lt,Fh as Pt,Fd as $t,R6 as _e,Kt as Mt,bq as _t,F3 as Nt,FM as Ot,R7 as Gt,R8 as zt,Fq as Zt,Fn as Ce,PK as Qt,ER as Vt,R9 as Ne,Gc as Ee,Gk as Wt,Ra as Ht,Rb as z,Rc as qt,Rd as Oe,Re as Kt,Rf as Ge,Rg as ze,FC as le,bu as Jt,bK as ge,cI as he,fD as Ze,fB as Qe,Rh as Xt,fy as Yt,PX as en,Ri as tn,Rj as Ve,P$ as nn,QJ as an,Rk as sn,QW as on,Gh as we,Gg as rn,Rl as ln,Rm as mn,Rn as cn,Ro as dn,Rp as un,Qu as pn,G7 as bn,Gb as gn,bs as hn,bJ as fn,cC as Sn,cq as In,bt as Rn,Mb as yn,cS as kn,cV as An,cU as vn,cB as Cn}from"./zeni-epic-state-DZ68JIF_.js";import{w as We,J as He,A as ee,X as E,z as P,b$ as qe,_ as te,c as A,aM as xe,o as j,au as X,F as En,O as Ke,c0 as wn,s as Z,a0 as Je,c1 as xn,T as ne,c2 as Bn,Z as Tn,C as Fn,B as fe,f as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-DcHHjvaZ.js";import{n as N,S as $n}from"./mui-BtJzVyNP.js";import me from"./NotFoundScreen-BkB6DL-8.js";import{S as Be}from"./SetupPagesScreen-BjNE7Cm8.js";import{F as et}from"./FeaturePreviewScreen-BjS0m3cA.js";import{a as f}from"./sentry-BxK72NTv.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CEXExmUC.js";import{u as tt}from"./useInitialThreadRequest-Be44atB3.js";import{D as Mn}from"./DrawerScreen-Dj5itxnJ.js";import{M as nt}from"./MobileAppDrawer-2f948WLd.js";import{R as _n}from"./ReimbursementApprovalRoutes-BtVtLo57.js";import{FallBackRoute as Nn}from"./ScreenRoutes-CAYGh4eu.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.js";import"./analyticsHelper-B-6LZuP4.js";import"./routePaths-Pys8bHTK.js";import"./BusinessVerificationPageScreen-Cy2CFeUz.js";import"./ReimbursementApprovalRuleDetailScreen-B-NF15uO.js";import"./getLocaleForTenant-DwvsjOvL.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]="f8a551c8-7b2c-4fb8-a736-2615f5fba3ba",e._sentryDebugIdIdentifier="sentry-dbid-f8a551c8-7b2c-4fb8-a736-2615f5fba3ba")}catch{}})();const at=e=>`/${e}/reimbursements`,On=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"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),Gn=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(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=gt(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:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({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(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ae(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(Ae("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(At());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(kt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(It(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(wn);function Fe(){const e=H(),t=de(),n=Q(),{reimbursementId:r}=Y(),d=We(),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=Q().pathname,F=x.includes("edit"),k=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=P.getSignedInUser(),I=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(I?.userRole??[]);f.useEffect((()=>{(k&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==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"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:A,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(On,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-BQ1kyMTn.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as H}from"./core-DGp_s-v5.js";import{eW as L,fS as w,ME as Te,kA as J,r3 as X,rU as O,ko as Re,js as Me,vr as K,rZ as Ae,bs as Oe,MF as Fe,bn as ke,wA as De,MG as je,MH as Ee,vj as Pe,MI as Y,MJ as Le,MK as Be,ML as ve,MM as Ue,MN as I,MO as F,MP as k,MQ as N,MR as D,MS as j,dI as Ve,wg as xe,w4 as $,w5 as q,wm as ze,w9 as Z,ws as Ge,MT as He,MU as Ye,MV as Ne,MW as $e,MX as qe,fD as Ze,fB as Qe}from"./zeni-epic-state-Dk4VKziD.js";import{Q as We,U as Je,W as Xe,Y as Ke,J as ea,A as ee,X as E,z as ae,Z as aa,T as sa,a as ta,$ as oa,a0 as na,_ as ra,c as P,f as ia,a1 as la,s as se,a2 as ca,a3 as da,a4 as pa}from"./index-s0HleIMs.js";import"./mui-BKDz48_f.js";import fa from"./NotFoundScreen-De_OVTcT.js";import{F as ma}from"./FeaturePreviewScreen-BTGR97Fd.js";import{a as _}from"./sentry-CRnwGvtj.js";import{u as ua}from"./useInitialThreadRequest-CwFv9Eqv.js";import{t as Q,a as W,b as _a}from"./routePaths-BSw_NTbY.js";import{M as ha}from"./MobileAppDrawer-CrYdORTa.js";import"./recharts-om305-Co.js";import"./analytics-CzAweyQD.js";import"./plaid-FOcqk85t.js";import"./dnd-Dv83AsVV.js";import"./stripe-cKAAJElX.js";import"./lottie-CBfI26wD.js";import"./lexical-BI9o6Rzd.js";import"./pdf-CLZhSauj.js";import"./utils-BJ3kLhBy.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]="29077c3a-c1e5-4943-a86e-45bf09ca6130",e._sentryDebugIdIdentifier="sentry-dbid-29077c3a-c1e5-4943-a86e-45bf09ca6130")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:X(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(O(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((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(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(Z({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(Z(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($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(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=Ve(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 Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(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?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(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(j({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(k({scrollPosition:s}));break;case"cash_flow":e(F({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(j({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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(ve({viewMode:a})),e(Ue({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(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>J(n))),M=d((n=>X(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(O(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(O(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Oe(V?.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=We(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,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:v,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=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
1
|
+
import{j as p}from"./liveblocks-BGSO0Qat.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as H}from"./core-dwwFaYBE.js";import{eW as L,fS as w,ME as Te,kA as J,r3 as X,rU as O,ko as Re,js as Me,vr as K,rZ as Ae,bs as Oe,MF as Fe,bn as ke,wA as De,MG as je,MH as Ee,vj as Pe,MI as Y,MJ as Le,MK as Be,ML as ve,MM as Ue,MN as I,MO as F,MP as k,MQ as N,MR as D,MS as j,dI as Ve,wg as xe,w4 as $,w5 as q,wm as ze,w9 as Z,ws as Ge,MT as He,MU as Ye,MV as Ne,MW as $e,MX as qe,fD as Ze,fB as Qe}from"./zeni-epic-state-DZ68JIF_.js";import{Q as We,U as Je,W as Xe,Y as Ke,J as ea,A as ee,X as E,z as ae,Z as aa,T as sa,a as ta,$ as oa,a0 as na,_ as ra,c as P,f as ia,a1 as la,s as se,a2 as ca,a3 as da,a4 as pa}from"./index-DcHHjvaZ.js";import"./mui-BtJzVyNP.js";import fa from"./NotFoundScreen-BkB6DL-8.js";import{F as ma}from"./FeaturePreviewScreen-BjS0m3cA.js";import{a as _}from"./sentry-BxK72NTv.js";import{u as ua}from"./useInitialThreadRequest-Be44atB3.js";import{t as Q,a as W,b as _a}from"./routePaths-Pys8bHTK.js";import{M as ha}from"./MobileAppDrawer-2f948WLd.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.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]="29077c3a-c1e5-4943-a86e-45bf09ca6130",e._sentryDebugIdIdentifier="sentry-dbid-29077c3a-c1e5-4943-a86e-45bf09ca6130")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:X(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(O(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((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(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(Z({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(Z(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($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(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=Ve(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 Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(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?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(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(j({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(k({scrollPosition:s}));break;case"cash_flow":e(F({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(j({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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(ve({viewMode:a})),e(Ue({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(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>J(n))),M=d((n=>X(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(O(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(O(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Oe(V?.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=We(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,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:v,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=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BGSO0Qat.js";import{z as b,_ as S,c as u,f as E,d8 as k,A as I,X as C}from"./index-DcHHjvaZ.js";import"./mui-BtJzVyNP.js";import g from"./NotFoundScreen-BkB6DL-8.js";import{a as l}from"./sentry-BxK72NTv.js";import{u as D,j as h,h as F,g as T,n as L,o as U,p as f,N as y}from"./core-dwwFaYBE.js";import{eW as V,TT as w,TU as p,vX as _,fJ as P,TV as X,vV as z}from"./zeni-epic-state-DZ68JIF_.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.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]="5b8286ff-c1e0-4ccf-94f3-4afc1be9dd80",e._sentryDebugIdIdentifier="sentry-dbid-5b8286ff-c1e0-4ccf-94f3-4afc1be9dd80")}catch{}})();const A=L((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(X({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),G=()=>{const e=D(),[t,n]=l.useState(!1),[i,s]=l.useState(!1),r=h((o=>V(o))),c=F(),j=T(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),v=d?.firstName!=null?d.firstName:"User";l.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),l.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[m.fetchState,e]);const x=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(A,{navigate:c,location:j,currentTenant:r,companyName:x,userName:v,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-
|
|
2
|
-
import{_ as t,bn as us,eW as ds,fD as cs,fB as ms,gl as _s,fq as hs,cW as Ee,cC as ps,fT as Es,cu as Rs,bE as xs,bo as gs,fX as Is,v as Ts,Ma as js,bs as As,Mb as fs,bK as Ds,bJ as ys,bt as bs,cq as Cs,Mc as vs,Md as Us,cS as Os,cV as ws,cU as Ps,cB as Fs,cI as Ls,oc as Re,fz as xe,gv as Hs,f$ as ge,gs as Ie,gt as Te,g0 as ks}from"./zeni-epic-state-Dk4VKziD.js";import{j as e}from"./liveblocks-BQ1kyMTn.js";import{a as w}from"./sentry-CRnwGvtj.js";import{u as Bs,h as Vs,i as Ss,g as Ns,j as z,l as je,N as u,o as Ms,p as a}from"./core-DGp_s-v5.js";import{y as Zs,u as zs,z as D,A as Gs,a as $s,M as Ws,X as G,i as qs,l as Ys,T as Xs,L as F,O as Ae,t as _,P as Js,c as Q,d as l}from"./index-s0HleIMs.js";import"./mui-BKDz48_f.js";import{f as fe}from"./analyticsHelper-3Gu9cPjm.js";import{t as Ks}from"./getLocaleForTenant-DQyjLBRZ.js";import"./recharts-om305-Co.js";import"./analytics-CzAweyQD.js";import"./plaid-FOcqk85t.js";import"./dnd-Dv83AsVV.js";import"./stripe-cKAAJElX.js";import"./lottie-CBfI26wD.js";import"./lexical-BI9o6Rzd.js";import"./pdf-CLZhSauj.js";import"./utils-BJ3kLhBy.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="0c17cb97-d799-44c5-9956-d1756152d003",o._sentryDebugIdIdentifier="sentry-dbid-0c17cb97-d799-44c5-9956-d1756152d003")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-PGKQ0Moe.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-CZ_W5Z9a.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-DOnoVy-K.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-huZThwT8.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-LY7c8epf.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-D8ZGwQbw.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-Bw9A89pe.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-C2a-KGIZ.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-DhN19M7c.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-B6pwb5CA.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-BvqnyUHV.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-BPo-hTc9.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-D8ZGwQbw.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-q8yYrEbz.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-C2a-KGIZ.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-BhJsKt5l.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-CYvJ6SV5.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-BvqnyUHV.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-CtLhxWox.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),De=l((()=>t((()=>import("./EntityDetailRoutes-BZgvjOQf.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-PGKQ0Moe.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),ye=l((()=>t((()=>import("./BillPayRoutes-CZ_W5Z9a.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),ut=l((()=>t((()=>import("./SettingsRoutes-LY7c8epf.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-DOnoVy-K.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-BPo-hTc9.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-B6pwb5CA.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-huZThwT8.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-Bw9A89pe.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-CpnG1o79.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),pt=l((()=>t((()=>import("./PerformanceRoutes-DUsD3MMO.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-DhN19M7c.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-WlT7olAX.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-6hwT2MgW.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),gt=l((()=>t((()=>import("./AiCfoScreen-iW6cLrky.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-Do2CM9NI.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-De_OVTcT.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),It=l((()=>t((()=>import("./TaskListScreen-C1omaWqK.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const j=Bs(),B=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:H}=zs(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=us(I),$=Ns(),[V,Pe]=w.useState(!1),r=z((n=>ds(n))),{useFeatureGate:N}=Gs(),M=$s(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=N(G.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(G.isDebitCardFeatureEnabled),A=z((n=>n.tenantState.fetchState)),T=z((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?cs(ne,r):void 0,X=T==="Completed"||A==="Completed"?ms(r):void 0,ke=qs(r,He,ne),{isCardsHidden:Be}=Ys(r?.tenantId),Ve=!ke||!!Be,{isFeatureEnabled:Se}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:J}=N(G.isAiCfoFileUploadEnabled),W=z((n=>_s(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=hs(),p=Xs(),Ne=r.company==null||p?.loggedInUserRoleMap!=null&&Ee(p.loggedInUserRole),Me=ps(p?.loggedInUserRoleMap),oe=w.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,K=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=z((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));w.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),w.useEffect((()=>{if(K!=null&&v!=null){const n=K.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=gs();c.isAfter(S,"month")===!1?j(Is(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[K,v]),w.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Ts(ae,Z)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Hs(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,I,j,Ze))}),[Z,ae,I,j,D]),w.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(q&&rs){k(ge(s));const Y=D.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(c.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),q&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(c.userId,s)));if(q){Q.identify(c.userId,{tenant_id:s});const Y=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),k(ks(c.userId,s,c.zeniSessionId))),Y&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Re(c.userId,c.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),w.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),D.saveSignedInUserTenants(js(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),w.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=w.useRef(!1);w.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[T,V]);const O=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:ze}=N(G.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,ue=!Ve&&!O,We=fs(p?.loggedInUserRoleMap),qe=r.externalConnections?.accounting[0]?.isValid,Ye=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&Ds(p?.loggedInUserRoleMap),_e=Fe&&!O,Xe=Le&&!O,Je=le&&ys(p?.loggedInUserRoleMap),Ke=ue&&bs(p?.loggedInUserRoleMap),Qe=_e&&Cs(p?.loggedInUserRoleMap),es=vs(p?.loggedInUserRoleMap),ss=Us(p?.loggedInUserRoleMap),ts=Os(p?.loggedInUserRoleMap),ns=ws(p?.loggedInUserRoleMap),as=Ps(p?.loggedInUserRoleMap),E=Fs(p?.loggedInUserRoleMap),R=Ls(p?.loggedInUserRoleMap),he=le&&E,pe=ce&&R,x=_e&&ts,g=Xe&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&Ye&&qe!==!0&&h===!1&&X===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(Tt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&O===!1||Ge||$e?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&O===!1?e.jsx(mt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&O===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&O===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(It,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(pt,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&O===!1?e.jsx(Et,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(gt,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Tt=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(Oe,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(Oe,{tenantEmailDomain:C}):j?e.jsx(At,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(b,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({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{y as FallBackRoute,Nt as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CYS11Tnq.js","assets/sentry-BxK72NTv.js","assets/core-dwwFaYBE.js","assets/zeni-epic-state-DZ68JIF_.js","assets/index-DcHHjvaZ.js","assets/mui-BtJzVyNP.js","assets/analytics-CnnfCSOg.js","assets/utils-R2J97kpk.js","assets/withTransactionSidePanel-CNqfXJQc.js","assets/useAskAiCfoHostNavButtonProps-CEXExmUC.js","assets/TransactionDetailScreen-Df-lTaa7.js","assets/decodeURIComponentSafe-DPB81zx3.js","assets/routePaths-Pys8bHTK.js","assets/NotFoundScreen-BkB6DL-8.js","assets/useInitialThreadRequest-Be44atB3.js","assets/analyticsHelper-B-6LZuP4.js","assets/CompanyPassportScreen-nmEzz6fq.js","assets/MobileAppDrawer-2f948WLd.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Du-sPG0F.js","assets/FeaturePreviewScreen-BjS0m3cA.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-BusugyBh.js","assets/AddressScreen-Dqwi7asg.js","assets/DomesticWireDetailScreen-zgK1EeEQ.js","assets/DrawerScreen-Dj5itxnJ.js","assets/SetupPagesScreen-BjNE7Cm8.js","assets/BusinessVerificationPageScreen-Cy2CFeUz.js","assets/BillPayApprovalRoutes-CnCwb-Mh.js","assets/ReimbursementApprovalRuleDetailScreen-B-NF15uO.js","assets/getLocaleForTenant-DwvsjOvL.js","assets/ReimbursementRoutes-DrPhcUVq.js","assets/ReimbursementApprovalRoutes-BtVtLo57.js","assets/TransactionListRoutes-rczQJ3vr.js","assets/ZeniAccountStatementScreen-DWnERIBu.js","assets/SettingsRoutes-CKliNhdm.js","assets/accountMappingHelper-Gr9m7o7F.js","assets/useEmailConnectResultRefresh-D80kpXmE.js","assets/QBOConnectionScreen-KPblY_Id.js","assets/empty-C6x_q-2g.js","assets/index-DHUxeELF.js","assets/url-CJVt52Qh.js","assets/index-BJuJWplp.js","assets/ReportsRoutes-4al_6uGo.js","assets/ChargeCardRoutes-CXQLWwTK.js","assets/useChargeCardPusherEvents-CnnOtBlk.js","assets/PeopleRoutes-yD3gTmoM.js","assets/ExpenseAutomationRoutes-CGWYEvDw.js","assets/TreasuryRoutes-DRks-0zi.js","assets/useCashManagementBanner-5JzC4Bv8.js","assets/VendorsRoutes-DBFuiYnF.js","assets/pathToGoBack-961Nhi8-.js","assets/ZeniAccountRoutes-ewlJGl5c.js","assets/AddressRoutes-C2iTumHM.js","assets/PandLWithForecastRoutes-BbFjbA4X.js","assets/CustomerOnboardingRoutes-CzHVsO43.js","assets/TransactionDetailRoutes-BkSAMpem.js","assets/EntityDetailRoutes-BVnuWs1u.js","assets/NotificationRoutes-BbxpzMby.js","assets/PerformanceRoutes-C9rfaaZ7.js","assets/RewardsRoutes-BUnw-0yn.js","assets/TaskRoutes-C7FnHOcf.js","assets/TaskListScreen-Dy0ym2bJ.js","assets/AiCfoScreen-DZLM16VS.js","assets/CardsAiCfoScreen-Bvc4PWGQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as us,eW as ds,fD as cs,fB as ms,gl as _s,fq as hs,cW as Ee,cC as ps,fT as Es,cu as Rs,bE as xs,bo as gs,fX as Is,v as Ts,Ma as js,bs as As,Mb as fs,bK as Ds,bJ as ys,bt as bs,cq as Cs,Mc as vs,Md as Us,cS as Os,cV as ws,cU as Ps,cB as Fs,cI as Ls,oc as Re,fz as xe,gv as Hs,f$ as ge,gs as Ie,gt as Te,g0 as ks}from"./zeni-epic-state-DZ68JIF_.js";import{j as e}from"./liveblocks-BGSO0Qat.js";import{a as w}from"./sentry-BxK72NTv.js";import{u as Bs,h as Vs,i as Ss,g as Ns,j as z,l as je,N as u,o as Ms,p as a}from"./core-dwwFaYBE.js";import{y as Zs,u as zs,z as D,A as Gs,a as $s,M as Ws,X as G,i as qs,l as Ys,T as Xs,L as F,O as Ae,t as _,P as Js,c as Q,d as l}from"./index-DcHHjvaZ.js";import"./mui-BtJzVyNP.js";import{f as fe}from"./analyticsHelper-B-6LZuP4.js";import{t as Ks}from"./getLocaleForTenant-DwvsjOvL.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="0c17cb97-d799-44c5-9956-d1756152d003",o._sentryDebugIdIdentifier="sentry-dbid-0c17cb97-d799-44c5-9956-d1756152d003")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-CYS11Tnq.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-BusugyBh.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-DrPhcUVq.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-rczQJ3vr.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-CKliNhdm.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-4al_6uGo.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-CXQLWwTK.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-yD3gTmoM.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-CGWYEvDw.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-DRks-0zi.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-DBFuiYnF.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-ewlJGl5c.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-4al_6uGo.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-C2iTumHM.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-yD3gTmoM.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-BbFjbA4X.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-CzHVsO43.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-DBFuiYnF.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-BkSAMpem.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),De=l((()=>t((()=>import("./EntityDetailRoutes-BVnuWs1u.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-CYS11Tnq.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),ye=l((()=>t((()=>import("./BillPayRoutes-BusugyBh.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),ut=l((()=>t((()=>import("./SettingsRoutes-CKliNhdm.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-DrPhcUVq.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-ewlJGl5c.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-DRks-0zi.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-rczQJ3vr.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-CXQLWwTK.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-BbxpzMby.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),pt=l((()=>t((()=>import("./PerformanceRoutes-C9rfaaZ7.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-CGWYEvDw.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-BUnw-0yn.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-C7FnHOcf.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),gt=l((()=>t((()=>import("./AiCfoScreen-DZLM16VS.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-Bvc4PWGQ.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-BkB6DL-8.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),It=l((()=>t((()=>import("./TaskListScreen-Dy0ym2bJ.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const j=Bs(),B=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:H}=zs(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=us(I),$=Ns(),[V,Pe]=w.useState(!1),r=z((n=>ds(n))),{useFeatureGate:N}=Gs(),M=$s(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=N(G.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(G.isDebitCardFeatureEnabled),A=z((n=>n.tenantState.fetchState)),T=z((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?cs(ne,r):void 0,X=T==="Completed"||A==="Completed"?ms(r):void 0,ke=qs(r,He,ne),{isCardsHidden:Be}=Ys(r?.tenantId),Ve=!ke||!!Be,{isFeatureEnabled:Se}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:J}=N(G.isAiCfoFileUploadEnabled),W=z((n=>_s(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=hs(),p=Xs(),Ne=r.company==null||p?.loggedInUserRoleMap!=null&&Ee(p.loggedInUserRole),Me=ps(p?.loggedInUserRoleMap),oe=w.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,K=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=z((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));w.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),w.useEffect((()=>{if(K!=null&&v!=null){const n=K.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=gs();c.isAfter(S,"month")===!1?j(Is(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[K,v]),w.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Ts(ae,Z)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Hs(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,I,j,Ze))}),[Z,ae,I,j,D]),w.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(q&&rs){k(ge(s));const Y=D.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(c.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),q&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(c.userId,s)));if(q){Q.identify(c.userId,{tenant_id:s});const Y=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),k(ks(c.userId,s,c.zeniSessionId))),Y&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Re(c.userId,c.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),w.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),D.saveSignedInUserTenants(js(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),w.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=w.useRef(!1);w.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[T,V]);const O=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:ze}=N(G.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,ue=!Ve&&!O,We=fs(p?.loggedInUserRoleMap),qe=r.externalConnections?.accounting[0]?.isValid,Ye=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&Ds(p?.loggedInUserRoleMap),_e=Fe&&!O,Xe=Le&&!O,Je=le&&ys(p?.loggedInUserRoleMap),Ke=ue&&bs(p?.loggedInUserRoleMap),Qe=_e&&Cs(p?.loggedInUserRoleMap),es=vs(p?.loggedInUserRoleMap),ss=Us(p?.loggedInUserRoleMap),ts=Os(p?.loggedInUserRoleMap),ns=ws(p?.loggedInUserRoleMap),as=Ps(p?.loggedInUserRoleMap),E=Fs(p?.loggedInUserRoleMap),R=Ls(p?.loggedInUserRoleMap),he=le&&E,pe=ce&&R,x=_e&&ts,g=Xe&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&Ye&&qe!==!0&&h===!1&&X===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(Tt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&O===!1||Ge||$e?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&O===!1?e.jsx(mt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&O===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&O===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(It,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(pt,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&O===!1?e.jsx(Et,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(gt,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Tt=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(Oe,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(Oe,{tenantEmailDomain:C}):j?e.jsx(At,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(b,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({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{y as FallBackRoute,Nt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-BGSO0Qat.js";import{a as u}from"./sentry-BxK72NTv.js";import{h as L,g as $,u as U,j as y,s as re,n as G,i as H,o as ne,p as v}from"./core-dwwFaYBE.js";import{bn as De,eW as P,gq as Te,n2 as le,Ov as Me,hG as he,Om as Ue,r3 as _e,kA as be,m_ as Be,hI as Re,Oo as Fe,On as Oe,QL as Ve,zy as ze,E$ as Le,Qk as Ne,Qt as Qe,c7 as ae,cN as $e,cO as Ge,bs as He,Mn as Ze,x_ as Ke,QM as qe,Hq as We,EH as Je,Ey as ye,Ev as Xe,y2 as Se,EB as Ce,EE as Ie,EK as oe,uo as se,y1 as Ye,kc as J,kf as Ae,QN as en,lg as nn,yh as tn,Ne as an,Nf as on,ka as sn,QO as cn,kd as rn,rx as ln,N9 as dn,Na as un,rB as pn,hr as gn,Mv as ee,hj as de,hg as mn,ho as fn,Mw as hn,ye as bn,QP as yn,QQ as Sn,EY as Cn,fB as Ee,fD as xe,QR as In,ge as An,MF as En,yd as ue,gj as pe,gi as xn,yc as vn,gh as kn,gg as wn,QS as jn,fG as ve,QT as Pn,QU as Dn,yk as Tn,yb as ge,QV as Mn,fW as Un,y8 as _n,b_ as Bn,c6 as Rn,c5 as Fn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as Qn}from"./zeni-epic-state-DZ68JIF_.js";import{A as X,X as O,z as w,ag as ke,bR as $n,c as Z,f as Gn,bC as Hn,T as K,B as ie,bS as Zn,i as we,l as je,bT as Kn,ar as qn,j as Pe,bU as Wn,bV as Jn,bW as Xn,Z as Yn,bX as et,s as nt,bY as tt}from"./index-DcHHjvaZ.js";import{n as V}from"./mui-BtJzVyNP.js";import{M as R}from"./MobileAppDrawer-2f948WLd.js";import{a as q,g as W,m as at}from"./accountMappingHelper-Gr9m7o7F.js";import{t as ot,A as st}from"./AddressScreen-Dqwi7asg.js";import Q from"./NotFoundScreen-BkB6DL-8.js";import{g as it}from"./analyticsHelper-B-6LZuP4.js";import{B as ct}from"./BusinessVerificationPageScreen-Cy2CFeUz.js";import{C as rt}from"./CompanyPassportScreen-nmEzz6fq.js";import{u as lt,a as dt}from"./useEmailConnectResultRefresh-D80kpXmE.js";import{q as me}from"./QBOConnectionScreen-KPblY_Id.js";import{B as ut}from"./BillPayApprovalRoutes-CnCwb-Mh.js";import{R as pt}from"./ReimbursementApprovalRoutes-BtVtLo57.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.js";import"./routePaths-Pys8bHTK.js";import"./empty-C6x_q-2g.js";import"./pdf-lib-BJAK6s2W.js";import"./index-DHUxeELF.js";import"./url-CJVt52Qh.js";import"./index-BJuJWplp.js";import"./decodeURIComponentSafe-DPB81zx3.js";import"./ReimbursementApprovalRuleDetailScreen-B-NF15uO.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]="8264165b-e17d-4d05-a32a-20f42e6120c6",e._sentryDebugIdIdentifier="sentry-dbid-8264165b-e17d-4d05-a32a-20f42e6120c6")}catch{}})();const gt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-BGSO0Qat.js";import{h as Y,g as ee,u as ne,i as $,j as P,N as x,n as H,t as en}from"./core-dwwFaYBE.js";import{bJ as nn,cq as Ce,Q8 as ye,eW as B,cC as tn,zO as Q,zy as an,Qk as sn,Qn as on,rQ as te,rE as ae,l8 as ie,tW as z,Qp as Ie,gi as Ge,gh as $e,gg as He,Qq as cn,zX as rn,EH as Ae,Ey as ke,Ev as _e,Ed as J,EB as Ee,EE as ve,EK as Pe,uo as Te,gx as un,cx as dn,fD as ln,fB as pn,fC as mn,bt as yn,Qr as fn,Dd as le,DR as gn,Qs as Sn,bK as bn,F_ as pe,E$ as hn,Qt as Cn,Qu as In,G2 as An,G6 as kn,tP as _n,Kw as En,GD as he,HD as me,Qv as vn,Qw as Pn,Qx as Tn,Qy as We,Qz as wn,MZ as Dn,PA as Un,Nc as On,QA as qe,Eh as Fn,Nd as Bn,El as Vn,QB as Oe,GZ as Ke,lg as xn,rH as Je,tY as jn,bE as Re,u8 as Ne,cA as Rn,QC as Xe,fV as Nn,Gl as zn,Gp as Ln,QD as Mn,GG as ze,QE as Zn,QF as Qn,QG as Gn,QH as $n,gq as Hn,B6 as Wn,QI as qn,Bb as Kn,Ba as Jn}from"./zeni-epic-state-DZ68JIF_.js";import{T as se,A as oe,X as K,y as we,aS as X,bC as Ye,z as U,_ as ce,c as O,B as De,f as G,bD as Xn,au as re,bE as V,bF as Yn,bG as et,ag as xe,bH as nt,s as Le,av as Me,J as tt,C as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-DcHHjvaZ.js";import{a as h}from"./sentry-BxK72NTv.js";import{n as Fe,D as rt,S as ut}from"./mui-BtJzVyNP.js";import{M as fe}from"./MobileAppDrawer-2f948WLd.js";import N from"./NotFoundScreen-BkB6DL-8.js";import{a as Ze}from"./analyticsHelper-B-6LZuP4.js";import{d as Qe}from"./routePaths-Pys8bHTK.js";import{B as Ue}from"./BusinessVerificationPageScreen-Cy2CFeUz.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]="97d8dd6e-04a1-4fa4-847c-329664c91df0",e._sentryDebugIdIdentifier="sentry-dbid-97d8dd6e-04a1-4fa4-847c-329664c91df0")}catch{}})();const dt=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-BGSO0Qat.js";import{a as u,b as M,q as T}from"./sentry-BxK72NTv.js";import{u as A,h as z,j as c,g as D,N as O,n as j}from"./core-dwwFaYBE.js";import{u as P,z as s,y as F,c as E,O as _,e as B,f as N,g as $,h as q,q as V,j as v}from"./index-DcHHjvaZ.js";import{eW as W,M9 as Z,Ma as J,fz as G,f$ as H,Mf as K,gp as Q,cZ as R,Mg as b,Mh as X,Mi as Y,bZ as y}from"./zeni-epic-state-DZ68JIF_.js";import"./mui-BtJzVyNP.js";import{u as ee}from"./useDeviceId--iR7_ret.js";import{f as te}from"./analyticsHelper-B-6LZuP4.js";import{t as ne}from"./getLocaleForTenant-DwvsjOvL.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="098ae810-89d9-4c16-b832-b53fc62dc6ae",t._sentryDebugIdIdentifier="sentry-dbid-098ae810-89d9-4c16-b832-b53fc62dc6ae")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(b())}}}))(V),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),L=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>W(e))),I=c((e=>Z(e))),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then((()=>{const e=q();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BGSO0Qat.js";import{a as i}from"./sentry-BxK72NTv.js";import{u as l,g as f,N as u}from"./core-dwwFaYBE.js";import{z as n,c as a,f as m,B as p}from"./index-DcHHjvaZ.js";import{gu as g,Mx as y}from"./zeni-epic-state-DZ68JIF_.js";import{n as b}from"./mui-BtJzVyNP.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.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]="a833c84c-1470-438b-91dd-ae48705cd682",e._sentryDebugIdIdentifier="sentry-dbid-a833c84c-1470-438b-91dd-ae48705cd682")}catch{}})();function M(){const e=l(),t=f(),r=i.useRef(!1),c=n.isSignedIn(),o=t.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-BGSO0Qat.js";import{a as G}from"./sentry-BxK72NTv.js";import{h as _,u as J,g as v,j as b,i as K,n as z}from"./core-dwwFaYBE.js";import{z as U,A as W,X as p,a0 as O,_ as M,c as V,f as Z,db as q,s as f,r as Q}from"./index-DcHHjvaZ.js";import{eW as X,T_ as F,Ji as I,T$ as R,TW as H,IG as y,U0 as Y,IO as E,I8 as aa,Jj as S,U1 as B,fy as ea,J9 as ta,Je as sa,J1 as oa,I$ as w,Jf as na,IY as ia,U2 as la,U3 as ra,U4 as ca,U5 as ka,U6 as T,eh as ua,U7 as da,U8 as pa}from"./zeni-epic-state-DZ68JIF_.js";import{n as Ta}from"./mui-BtJzVyNP.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-CEXExmUC.js";import{M as fa}from"./MobileAppDrawer-2f948WLd.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.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]="f29a271e-f4f9-4824-942a-b9c8cc8de826",e._sentryDebugIdIdentifier="sentry-dbid-f29a271e-f4f9-4824-942a-b9c8cc8de826")}catch{}})();const ga=Ta.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-BGSO0Qat.js";import se from"./NotFoundScreen-BkB6DL-8.js";import{a as c}from"./sentry-BxK72NTv.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-dwwFaYBE.js";import{Il as M,Io as le,Ii as de,eW as W,TW as X,IC as H,If as pe,J6 as ue,I$ as ke,TX as Q,TY as z,Ib as me,I8 as fe,rQ as ge,rE as he,l8 as Ie,Iw as Se,TZ as Te,IN as be,IK as Ee,Ir as Ce,IH as Ge,IG as De}from"./zeni-epic-state-DZ68JIF_.js";import{z as G,d9 as xe,w as je,A as we,X as b,r as Y,s as v,_ as ye,c as V,f as ve,da as Re,j as _,au as Fe}from"./index-DcHHjvaZ.js";import{n as Be}from"./mui-BtJzVyNP.js";import{u as Pe}from"./useInitialThreadRequest-Be44atB3.js";import{M as Ue}from"./MobileAppDrawer-2f948WLd.js";import Le from"./TaskListScreen-Dy0ym2bJ.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.js";import"./useAskAiCfoHostNavButtonProps-CEXExmUC.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]="bd09ae6c-ad72-4d37-9303-c0467dbd4d6c",e._sentryDebugIdIdentifier="sentry-dbid-bd09ae6c-ad72-4d37-9303-c0467dbd4d6c")}catch{}})();function $e(){const e=O(),t=Z(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),l=c.useCallback((()=>{t(M())}),[t]),k=c.useCallback(((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[t]),a=c.useCallback((o=>{t(de({cannedResponseId:o}))}),[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,q=[];const Ne=re((function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=W(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=X(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${_.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${_.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>z(e.taskGroupState,p))).filter((p=>p!=null&&!p.isDeleted)).map((p=>({id:p.id,name:p.name,isDefault:p.isDefault})))}}),(function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function y(){const e=O(),t=Z(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>W(i))),k=Pe(l?.companyId),{useFeatureGate:a}=we(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,J]=c.useState(!1),[F,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,j]=c.useState(!1),T=c.useRef(!1),C=g((i=>i.taskListState.updateTasksFetchState.fetchState)),U=g((i=>X(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(J(!0),t(H(!1,r)))}),[p,t]),c.useEffect((()=>{F||U.fetchState==="Completed"||(K(!0),t(pe()))}),[F,t,U.fetchState]),c.useEffect((()=>{B||L==="Completed"||(ee(!0),t(ue()))}),[B,t,L]);const ae=c.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))}),[t,r]);c.useEffect((()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return j(!1),void(T.current=!1);if(C==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0}),[P,C,l,s,e]);const $=g((i=>Q(i,r))),w=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(w==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[w==="Completed"?n.jsx(ye,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:w,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Be.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
package/dist/assets/{TransactionDetailRoutes-CtLhxWox.js → TransactionDetailRoutes-BkSAMpem.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-BGSO0Qat.js";import i from"./NotFoundScreen-BkB6DL-8.js";import{T as r}from"./TransactionDetailScreen-Df-lTaa7.js";import"./sentry-BxK72NTv.js";import{o as s,p as o}from"./core-dwwFaYBE.js";import"./zeni-epic-state-DZ68JIF_.js";import"./recharts-DHViZ79s.js";import"./index-DcHHjvaZ.js";import"./mui-BtJzVyNP.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./utils-R2J97kpk.js";import"./useAskAiCfoHostNavButtonProps-CEXExmUC.js";import"./decodeURIComponentSafe-DPB81zx3.js";import"./routePaths-Pys8bHTK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|
package/dist/assets/{TransactionDetailScreen-Brema_7y.js → TransactionDetailScreen-Df-lTaa7.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as x}from"./liveblocks-
|
|
1
|
+
import{j as x}from"./liveblocks-BGSO0Qat.js";import{a as i}from"./sentry-BxK72NTv.js";import{u as W,k as Ye,j as S,s as fe,g as ge,h as Te,i as Ee,N as Qe,n as Xe}from"./core-dwwFaYBE.js";import{nR as he,eW as Q,gq as Ze,Ov as et,n2 as tt,mM as at,bn as nt,cW as be,bs as Ie,ro as q,Nu as J,Ow as ve,Ox as oe,NU as De,kL as Ce,Oy as ke,NZ as se,N_ as ce,lA as Ae,Kp as ie,No as $,kF as Oe,kD as Ue,kP as ot,nE as st,Oz as ct,OA as it,vE as Y,kK as xe,JK as _e,cj as rt,c_ as lt,OB as dt,Nn as ut,OC as mt,vA as pt,OD as ft,OE as ht,OF as yt,OG as St,OH as gt,kO as Tt,OI as Et,OJ as bt,Np as It,OK as vt,OL as Dt,OM as Ct,JE as kt,Ju as At,JT as Ot,kQ as Ut,Kq as ye,nJ as xt}from"./zeni-epic-state-DZ68JIF_.js";import{A as H,X as _,z as we,aS as Pe,y as _t,J as wt,aT as Pt,C as Ft,r as ae,T as Vt,aU as Bt,s as ne,a0 as Nt,aV as Lt,c as Fe,aW as Rt,au as zt,a4 as te}from"./index-DcHHjvaZ.js";import{n as Gt,S as jt,D as Mt}from"./mui-BtJzVyNP.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-CEXExmUC.js";import{d as Ve}from"./decodeURIComponentSafe-DPB81zx3.js";import{h as Be,c as Ne,g as Wt,e as qt}from"./routePaths-Pys8bHTK.js";import{u as Jt}from"./utils-R2J97kpk.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d05c451e-8a90-44aa-8f28-b7b8a6f5c727",t._sentryDebugIdIdentifier="sentry-dbid-d05c451e-8a90-44aa-8f28-b7b8a6f5c727")}catch{}})();function Ht(t=!0){const e=W(),s=Ye(),{useFeatureGate:a}=H(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Kt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=H(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),E=k.companyId,U=S((h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:w,capitalizableAccountOverrides:B,dismissedAccounts:z}=S((h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(w);G.current=w;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const L=S((h=>et(h.accountState)),fe),I=i.useMemo((()=>{const h={};for(const b of L)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h}),[L]),l=m!=null?I[m]??null:null,j=i.useCallback((h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],M=new Set(h),X=N.current??{},K=P.current;for(const R of u)if(M.has(R.accountId)&&X[R.accountId]==null&&K?.[R.accountId]==null)return y(R.classificationType),O(R.accountId),void g(!0)}),[v]),D=i.useCallback(((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)}),[r,E]),F=i.useCallback((()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))}),[r,E,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=we.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Le(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=H(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),f=S((u=>J(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const M=J(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return M==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[M]?.saveStatus.fetchState??"Not-Started"})),E=i.useMemo((()=>f?.fetchState==="Completed"?Le(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),w=S((u=>oe(u))),B=S((u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")})),z=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[N,P]=i.useState(!1),[L,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{P(!1),I(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{P(!1),I(!1)}),[]),[F,h]=i.useState(!1),b=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(N?L||U==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),P(!0),s(Ae(E))))}),[s,l,f?.fetchState,f?.transaction,E,c,r,p,N,L,U,b]),i.useEffect((()=>{w.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[w.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s($("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:w,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=wt(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx(Mt,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BQ1kyMTn.js";import{h as W,g as U,u as K,i as X,j as S,N as R,n as H,o as ve,p as j}from"./core-DGp_s-v5.js";import{eW as q,r3 as Q,jZ as u,RS as ee,Kg as De,bo as le,RT as Pe,kA as te,NW as ae,RU as ue,RV as be,bE as Y,Kc as ye,RW as Ee,RX as me,RY as je,Kf as Ae,RZ as xe,R_ as pe,R$ as Me,S0 as ge,S1 as Le,S2 as Ce,S3 as fe,Ls as Be}from"./zeni-epic-state-Dk4VKziD.js";import{O as de,A as ne,X as Z,c as G,co as ce,s as N,r as oe,Z as Fe,M as Oe}from"./index-s0HleIMs.js";import"./mui-BKDz48_f.js";import{a as g}from"./sentry-CRnwGvtj.js";import{w as se}from"./withTransactionSidePanel-D7VzfbTv.js";import{p as ie,c as re}from"./routePaths-BSw_NTbY.js";import{v as ze}from"./utils-BJ3kLhBy.js";import{d as P}from"./decodeURIComponentSafe-B1HNc06R.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DBY93QB3.js";import"./recharts-om305-Co.js";import"./analytics-CzAweyQD.js";import"./plaid-FOcqk85t.js";import"./dnd-Dv83AsVV.js";import"./stripe-cKAAJElX.js";import"./lottie-CBfI26wD.js";import"./lexical-BI9o6Rzd.js";import"./pdf-CLZhSauj.js";import"./useAskAiCfoHostNavButtonProps-Bh9PS9wx.js";import"./TransactionDetailScreen-Brema_7y.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="7c66190d-96be-481a-a9ac-7a314f2ac81e",a._sentryDebugIdIdentifier="sentry-dbid-7c66190d-96be-481a-a9ac-7a314f2ac81e")}catch{}})();const Re=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),we=H((function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=W(),t=U(),n=K(),c=t.pathname.split("/").find((r=>Re.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=X(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S((r=>q(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(Z.isProjectsTransactionsEnabled),x=S((r=>Q(r)))&&k,{dataAvailable:C,initialTimeframeTick:b}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo((()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(R,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=H((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),Ze=se((function({referrerType:a,...e}){const t=W(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>be(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(Z.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ne(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:Se($.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),qe=H((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),We=se((function({referrerType:a,...e}){const t=W(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>je(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(Z.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ke(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Xe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Xe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=W(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=X(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S((v=>Me(v.transactionListState,A,p))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((v=>q(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Qe(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(Z.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(Z.isProjectsTransactionsEnabled),d=S((v=>Q(v)))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect((()=>{!b&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[b,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(He,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(R,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=S((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[S((n=>q(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(R,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(R,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(R,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(We,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-BGSO0Qat.js";import{h as W,g as U,u as K,i as X,j as S,N as R,n as H,o as ve,p as j}from"./core-dwwFaYBE.js";import{eW as q,r3 as Q,jZ as u,RS as ee,Kg as De,bo as le,RT as Pe,kA as te,NW as ae,RU as ue,RV as be,bE as Y,Kc as ye,RW as Ee,RX as me,RY as je,Kf as Ae,RZ as xe,R_ as pe,R$ as Me,S0 as ge,S1 as Le,S2 as Ce,S3 as fe,Ls as Be}from"./zeni-epic-state-DZ68JIF_.js";import{O as de,A as ne,X as Z,c as G,co as ce,s as N,r as oe,Z as Fe,M as Oe}from"./index-DcHHjvaZ.js";import"./mui-BtJzVyNP.js";import{a as g}from"./sentry-BxK72NTv.js";import{w as se}from"./withTransactionSidePanel-CNqfXJQc.js";import{p as ie,c as re}from"./routePaths-Pys8bHTK.js";import{v as ze}from"./utils-R2J97kpk.js";import{d as P}from"./decodeURIComponentSafe-DPB81zx3.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DWnERIBu.js";import"./recharts-DHViZ79s.js";import"./analytics-CnnfCSOg.js";import"./plaid-DQ7S7SfR.js";import"./dnd-DZvuKFo2.js";import"./stripe-cKAAJElX.js";import"./lottie-dHew8Pi0.js";import"./lexical-CKHu_k04.js";import"./pdf-fvaN7q8z.js";import"./useAskAiCfoHostNavButtonProps-CEXExmUC.js";import"./TransactionDetailScreen-Df-lTaa7.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="7c66190d-96be-481a-a9ac-7a314f2ac81e",a._sentryDebugIdIdentifier="sentry-dbid-7c66190d-96be-481a-a9ac-7a314f2ac81e")}catch{}})();const Re=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),we=H((function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=W(),t=U(),n=K(),c=t.pathname.split("/").find((r=>Re.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=X(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S((r=>q(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(Z.isProjectsTransactionsEnabled),x=S((r=>Q(r)))&&k,{dataAvailable:C,initialTimeframeTick:b}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo((()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(R,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=H((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),Ze=se((function({referrerType:a,...e}){const t=W(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>be(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(Z.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ne(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:Se($.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),qe=H((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),We=se((function({referrerType:a,...e}){const t=W(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=X(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S((d=>je(d.transactionListState,A,p,k))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((d=>q(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(Z.isProjectsTransactionsEnabled),w=S((d=>Q(d)))&&r;let i;const z=Ke(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Xe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(R,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Xe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=W(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=X(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S((v=>Me(v.transactionListState,A,p))),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S((v=>q(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Qe(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(Z.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(Z.isProjectsTransactionsEnabled),d=S((v=>Q(v)))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect((()=>{!b&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[b,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(He,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(R,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=S((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[S((n=>q(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(R,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(R,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(R,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(We,{referrerType:a})})]})}export{kt as default};
|