@zeniai/web-app-ui 5.1.75-dev → 5.1.75-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.
Files changed (64) hide show
  1. package/dist/assets/{AddressRoutes-BqX5wkCR.js → AddressRoutes-C8E4I-UT.js} +1 -1
  2. package/dist/assets/{AddressScreen-ScWWmTbP.js → AddressScreen-DV4gK_4i.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-quWQqhzX.js → AiCfoScreen-CJQFw07R.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CQmYX8YN.js → BillPayApprovalRoutes-Dz2xD1tC.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-jZS0wJcj.js → BillPayRoutes-Os14xiVD.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DFgVqXvI.js → BusinessVerificationPageScreen-BKvR8fKs.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-BbBCL2AM.js → CardsAiCfoScreen-DTFvzHIL.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BPGek5pB.js → ChargeCardRoutes-DDxAQjwA.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-DavSJynu.js → CompanyPassportScreen-DetGWMZx.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-BbANlW5J.js → ConnectionAuthScreen-BC2sFUmX.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-kiJ2IeW7.js → CustomerOnboardingAuthScreen-Bq-Ubv4b.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-6ipmFo_1.js → CustomerOnboardingRoutes-CXBEVGX4.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-Brg8B8gk.js → DashboardRoutes-eNF287fs.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-B6se2qjz.js → DefaultTenantHome-bOMFA9uq.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-jS6brB2p.js → DomesticWireDetailScreen-BMyfqSTi.js} +1 -1
  16. package/dist/assets/{DrawerScreen-D0g6PABS.js → DrawerScreen--Suq3tvT.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-qim0q068.js → EntityDetailRoutes-BGhUBNO_.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-D3rXxAM_.js → ExpenseAutomationRoutes-ByFBxCiw.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-Y7t6ABdh.js → FeaturePreviewScreen-heeivM6W.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BUpxwCNc.js → HubSpotOAuthCallbackScreen-0saA8ZXr.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-5wgvqx65.js → MagicLinkRoutes-CMAONj1z.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-CelaLjKf.js → MagicLinkSignInScreen-Dg99P6Pw.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-Sx7ydj7A.js → MobileAppDrawer-BI_hKtLW.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-BDl5tn8o.js → NotFoundScreen-DUKrEDOk.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-Cdcu8PTz.js → NotificationRoutes-D64xsn7f.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-C5pyboC-.js → OAuthConsentScreen-Mj5Bje1l.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-DjwWiUAb.js → PandLWithForecastRoutes-Dt90QdCw.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-x62_g_WP.js → PeopleRoutes-2kLgkUle.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-DQciMsYC.js → PerformanceRoutes-CKlQ6rou.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DXq_HXCX.js → QBOConnectionScreen-BaZwNX6H.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-DNdLnut4.js → ReferralListScreen-DyC1Khln.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-BazeprVG.js → ReimbursementApprovalRoutes-Bks_7P4u.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js → ReimbursementApprovalRuleDetailScreen-ClRq5kCS.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-Bb9JPi0m.js → ReimbursementRoutes-4pQ7nHpz.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-DB2v4EPm.js → ReportsRoutes-BOrBSfD8.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-ChJyJSHY.js → RewardsRoutes-kDqXZQmp.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-8R8Dd2d9.js → ScreenRoutes-BddXHfq8.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-oK_kou4I.js → SettingsRoutes-CN__-GS9.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-CVKPKeC9.js → SetupPagesScreen-Duc28IO6.js} +1 -1
  40. package/dist/assets/{SignInScreen-C7vB3Bra.js → SignInScreen-WsALbw6J.js} +1 -1
  41. package/dist/assets/{SignOutScreen-CQYa9Dvp.js → SignOutScreen-DBYHyG26.js} +1 -1
  42. package/dist/assets/{TaskListScreen-WRcn05lO.js → TaskListScreen-gPJk_aPE.js} +1 -1
  43. package/dist/assets/{TaskRoutes-DoWinBID.js → TaskRoutes-D7b5hUHG.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-B4ryZwp2.js → TransactionDetailRoutes-DMGvj5pX.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-DB5lxQrk.js → TransactionDetailScreen-L3SyvDDw.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-6SM8gNlu.js → TransactionListRoutes-yd5cXXN9.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-DHuVCY9q.js → TreasuryRoutes-idT6t3yc.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-CwYVQ8VQ.js → VendorsRoutes-Cv1guWUA.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-DLnf9dkP.js → WiseConfirmationScreen-B9z9Ex9l.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-u96OM2YN.js → ZeniAccountRoutes-Bmxg5Hu_.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-D9UEHLLF.js → ZeniAccountStatementScreen-B1x9Ll2M.js} +1 -1
  52. package/dist/assets/{analyticsHelper-Cq2pq-lr.js → analyticsHelper-F9bkDfUR.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-O3Y2pcaQ.js → getLocaleForTenant-YNgm3b7A.js} +1 -1
  54. package/dist/assets/{index-ilZtTEZn.js → index-BGtgXdBV.js} +5 -5
  55. package/dist/assets/{routePaths-C1rKvS5o.js → routePaths-DZDk8gbY.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js → useAiCfoDashboardSuggestedQuestionsChips-D6zsFuCp.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-33WX5dhg.js → useAskAiCfoHostNavButtonProps-re9SKSxV.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-CBJfpbK7.js → useCashManagementBanner-DoVCCRms.js} +1 -1
  59. package/dist/assets/{useChargeCardPusherEvents-Cvnaf2Z-.js → useChargeCardPusherEvents-DxT609il.js} +1 -1
  60. package/dist/assets/{useEmailConnectResultRefresh-BzWsu8a4.js → useEmailConnectResultRefresh-CdPAtb7K.js} +1 -1
  61. package/dist/assets/{useInitialThreadRequest-Bx57kb_d.js → useInitialThreadRequest-CmTGqSIj.js} +1 -1
  62. package/dist/assets/{withTransactionSidePanel-DeW-W6do.js → withTransactionSidePanel-R0O15XnS.js} +1 -1
  63. package/dist/index.html +1 -1
  64. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import{h as W,u as me,g as H,i as J,j as w,N as _,n as K,l as mt,o as ct,p as E}from"./core-D6ttr5iw.js";import{eX as V,QL as ce,c6 as de,EH as je,kJ as dt,EU as se,ET as ie,QM as ut,bn as ue,gq as Fe,QN as pt,N8 as bt,ky as De,N9 as Re,Na as gt,jt as ht,Q2 as ft,jI as St,Ev as It,uc as Rt,jA as yt,Ff as Ue,QO as Le,QP as At,QQ as kt,QR as vt,QS as Ct,QT as Et,E$ as ye,jO as wt,Qb as xt,EV as Bt,EF as Tt,QU as jt,EE as Ft,QV as Dt,EN as Ae,F3 as Ut,F2 as Lt,E_ as Pt,QW as Pe,Ke as $t,bq as Mt,EQ as _t,Fx as Nt,QX as Ot,QY as Qt,Fb as zt,F8 as ke,Px as Gt,EC as Zt,QZ as $e,FZ as ve,G5 as Ht,Q_ as Vt,Q$ as G,R0 as Wt,R1 as Me,R2 as Kt,R3 as _e,R4 as Ne,Fn as oe,bu as qt,bK as pe,cG as be,fE as Oe,fC as Qe,R5 as Yt,fz as Jt,PK as Xt,R6 as en,R7 as ze,PO as tn,Qw as nn,R8 as an,QK as sn,G2 as Ce,G1 as on,R9 as rn,Ra as ln,Rb as mn,Rc as cn,Rd as dn,Qh as un,FU as pn,FY as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LY as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-Cl3jFj7z.js";import{S as Ge,Z as Ze,Q as X,d as k,z as M,c0 as He,K as ee,e as v,aL as Ee,o as F,at as Y,D as Cn,a as Ve,c1 as En,s as Z,$ as We,c2 as wn,I as te,c3 as xn,Y as Bn,A as Tn,w as ge,g as Ke,a8 as jn,bo as Fn,a3 as Dn,m as qe,c4 as Un,i as Ln}from"./index-ilZtTEZn.js";import{n as N,S as Pn}from"./mui-vLo47rlo.js";import re from"./NotFoundScreen-BDl5tn8o.js";import{S as we}from"./SetupPagesScreen-CVKPKeC9.js";import{F as Ye}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as f}from"./sentry-CEfOando.js";import{u as he}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{u as Je}from"./useInitialThreadRequest-Bx57kb_d.js";import{D as $n}from"./DrawerScreen-D0g6PABS.js";import{M as Xe}from"./MobileAppDrawer-Sx7ydj7A.js";import{R as Mn}from"./ReimbursementApprovalRoutes-BazeprVG.js";import{FallBackRoute as _n}from"./ScreenRoutes-8R8Dd2d9.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./analyticsHelper-Cq2pq-lr.js";import"./routePaths-C1rKvS5o.js";import"./BusinessVerificationPageScreen-DFgVqXvI.js";import"./ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js";import"./getLocaleForTenant-O3Y2pcaQ.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]="10b4bdab-40a8-4c90-a298-9a324ce9a9eb",e._sentryDebugIdIdentifier="sentry-dbid-10b4bdab-40a8-4c90-a298-9a324ce9a9eb")}catch{}})();const et=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ve.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ue(d),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ce(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.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:de(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ie(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ye(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ye("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(se({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Le()),e(At());const i=et(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Ue(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}})(En);function xe(){const e=W(),t=me(),n=H(),{reimbursementId:r}=J(),d=Ge(),c=Ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=he({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),C=M.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ce(p,r)),L=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=de(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(je(!1,b,y,r)))});const $=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(C==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(z=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&z.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{h as W,u as me,g as H,i as J,j as w,N as _,n as K,l as mt,o as ct,p as E}from"./core-D6ttr5iw.js";import{eX as V,QL as ce,c6 as de,EH as je,kJ as dt,EU as se,ET as ie,QM as ut,bn as ue,gq as Fe,QN as pt,N8 as bt,ky as De,N9 as Re,Na as gt,jt as ht,Q2 as ft,jI as St,Ev as It,uc as Rt,jA as yt,Ff as Ue,QO as Le,QP as At,QQ as kt,QR as vt,QS as Ct,QT as Et,E$ as ye,jO as wt,Qb as xt,EV as Bt,EF as Tt,QU as jt,EE as Ft,QV as Dt,EN as Ae,F3 as Ut,F2 as Lt,E_ as Pt,QW as Pe,Ke as $t,bq as Mt,EQ as _t,Fx as Nt,QX as Ot,QY as Qt,Fb as zt,F8 as ke,Px as Gt,EC as Zt,QZ as $e,FZ as ve,G5 as Ht,Q_ as Vt,Q$ as G,R0 as Wt,R1 as Me,R2 as Kt,R3 as _e,R4 as Ne,Fn as oe,bu as qt,bK as pe,cG as be,fE as Oe,fC as Qe,R5 as Yt,fz as Jt,PK as Xt,R6 as en,R7 as ze,PO as tn,Qw as nn,R8 as an,QK as sn,G2 as Ce,G1 as on,R9 as rn,Ra as ln,Rb as mn,Rc as cn,Rd as dn,Qh as un,FU as pn,FY as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LY as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-Cl3jFj7z.js";import{S as Ge,Z as Ze,Q as X,d as k,z as M,c0 as He,K as ee,e as v,aL as Ee,o as F,at as Y,D as Cn,a as Ve,c1 as En,s as Z,$ as We,c2 as wn,I as te,c3 as xn,Y as Bn,A as Tn,w as ge,g as Ke,a8 as jn,bo as Fn,a3 as Dn,m as qe,c4 as Un,i as Ln}from"./index-BGtgXdBV.js";import{n as N,S as Pn}from"./mui-vLo47rlo.js";import re from"./NotFoundScreen-DUKrEDOk.js";import{S as we}from"./SetupPagesScreen-Duc28IO6.js";import{F as Ye}from"./FeaturePreviewScreen-heeivM6W.js";import{a as f}from"./sentry-CEfOando.js";import{u as he}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{u as Je}from"./useInitialThreadRequest-CmTGqSIj.js";import{D as $n}from"./DrawerScreen--Suq3tvT.js";import{M as Xe}from"./MobileAppDrawer-BI_hKtLW.js";import{R as Mn}from"./ReimbursementApprovalRoutes-Bks_7P4u.js";import{FallBackRoute as _n}from"./ScreenRoutes-BddXHfq8.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./analyticsHelper-F9bkDfUR.js";import"./routePaths-DZDk8gbY.js";import"./BusinessVerificationPageScreen-BKvR8fKs.js";import"./ReimbursementApprovalRuleDetailScreen-ClRq5kCS.js";import"./getLocaleForTenant-YNgm3b7A.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]="10b4bdab-40a8-4c90-a298-9a324ce9a9eb",e._sentryDebugIdIdentifier="sentry-dbid-10b4bdab-40a8-4c90-a298-9a324ce9a9eb")}catch{}})();const et=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ve.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ue(d),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ce(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.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:de(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ie(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ye(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ye("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(se({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Le()),e(At());const i=et(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Ue(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}})(En);function xe(){const e=W(),t=me(),n=H(),{reimbursementId:r}=J(),d=Ge(),c=Ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=he({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),C=M.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ce(p,r)),L=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=de(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(je(!1,b,y,r)))});const $=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(C==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(z=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&z.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-CS0rfBBF.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-D6ttr5iw.js";import{eX as v,fT as w,Mp as Te,ky as Z,qS as X,rH as A,km as Re,jq as Me,vc as J,rM as Oe,bs as Ae,Mq as Fe,bn as ke,wl as De,Mr as Ee,Ms as je,v4 as Pe,Mt as Y,Mu as ve,Mv as Le,Mw as Be,Mx as Ve,My as I,Mz as F,MA as k,MB as q,MC as D,MD as E,dK as Ue,w1 as xe,vR as N,vS as $,w7 as ze,vW as K,wd as Ge,ME as He,MF as Ye,MG as qe,MH as Ne,MI as $e,fE as Ke,fC as Qe}from"./zeni-epic-state-Cl3jFj7z.js";import{R as We,V as Ze,W as Xe,X as Je,Z as ea,Q as ee,d as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,K as ra,e as P,g as ia,a0 as la,s as se,a1 as ca,a2 as da,a3 as pa}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import fa from"./NotFoundScreen-BDl5tn8o.js";import{F as ma}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as _}from"./sentry-CEfOando.js";import{u as ua}from"./useInitialThreadRequest-Bx57kb_d.js";import{t as Q,a as W,b as _a}from"./routePaths-C1rKvS5o.js";import{M as ha}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="06403b31-f3c5-49d7-8d66-1419e33f2214",e._sentryDebugIdIdentifier="sentry-dbid-06403b31-f3c5-49d7-8d66-1419e33f2214")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(qe()),e(Ne()),e($e())},ga=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=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:Z(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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({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(K(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(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return 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(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({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(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Z(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Ze(_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:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(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-CS0rfBBF.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-D6ttr5iw.js";import{eX as v,fT as w,Mp as Te,ky as Z,qS as X,rH as A,km as Re,jq as Me,vc as J,rM as Oe,bs as Ae,Mq as Fe,bn as ke,wl as De,Mr as Ee,Ms as je,v4 as Pe,Mt as Y,Mu as ve,Mv as Le,Mw as Be,Mx as Ve,My as I,Mz as F,MA as k,MB as q,MC as D,MD as E,dK as Ue,w1 as xe,vR as N,vS as $,w7 as ze,vW as K,wd as Ge,ME as He,MF as Ye,MG as qe,MH as Ne,MI as $e,fE as Ke,fC as Qe}from"./zeni-epic-state-Cl3jFj7z.js";import{R as We,V as Ze,W as Xe,X as Je,Z as ea,Q as ee,d as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,K as ra,e as P,g as ia,a0 as la,s as se,a1 as ca,a2 as da,a3 as pa}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import fa from"./NotFoundScreen-DUKrEDOk.js";import{F as ma}from"./FeaturePreviewScreen-heeivM6W.js";import{a as _}from"./sentry-CEfOando.js";import{u as ua}from"./useInitialThreadRequest-CmTGqSIj.js";import{t as Q,a as W,b as _a}from"./routePaths-DZDk8gbY.js";import{M as ha}from"./MobileAppDrawer-BI_hKtLW.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="06403b31-f3c5-49d7-8d66-1419e33f2214",e._sentryDebugIdIdentifier="sentry-dbid-06403b31-f3c5-49d7-8d66-1419e33f2214")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(qe()),e(Ne()),e($e())},ga=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=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:Z(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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({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(K(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(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return 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(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({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(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Z(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Ze(_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:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(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 e}from"./liveblocks-CS0rfBBF.js";import{Q as j,z as w,aR as y,K as E,e as p,g as F,d7 as P,d as T}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import m from"./NotFoundScreen-BDl5tn8o.js";import{a as f}from"./sentry-CEfOando.js";import{u as L,j as b,h as R,g as V,n as A,o as U,p as u}from"./core-D6ttr5iw.js";import{eX as z,TD as C,PX as G,TE as v,vI as K,fK as X,TF as Y,vG as O}from"./zeni-epic-state-Cl3jFj7z.js";import{R as x}from"./ReferralListScreen-DNdLnut4.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./MobileAppDrawer-Sx7ydj7A.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6192166c-9a62-4d32-b2f1-8af86b346738",a._sentryDebugIdIdentifier="sentry-dbid-6192166c-9a62-4d32-b2f1-8af86b346738")}catch{}})();const Q=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(O())},onUpdateInviteFormLocalData:s=>{a(Y({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const a=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=R(),D=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),I=G(k);f.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(K()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(X(!0)))},[l.fetchState,a]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(Q,{navigate:c,location:D,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(u,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(q,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
1
+ import{j as e}from"./liveblocks-CS0rfBBF.js";import{Q as j,z as w,aR as y,K as E,e as p,g as F,d7 as P,d as T}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import m from"./NotFoundScreen-DUKrEDOk.js";import{a as f}from"./sentry-CEfOando.js";import{u as L,j as b,h as R,g as V,n as A,o as U,p as u}from"./core-D6ttr5iw.js";import{eX as z,TD as C,PX as G,TE as v,vI as K,fK as X,TF as Y,vG as O}from"./zeni-epic-state-Cl3jFj7z.js";import{R as x}from"./ReferralListScreen-DyC1Khln.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import"./MobileAppDrawer-BI_hKtLW.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6192166c-9a62-4d32-b2f1-8af86b346738",a._sentryDebugIdIdentifier="sentry-dbid-6192166c-9a62-4d32-b2f1-8af86b346738")}catch{}})();const Q=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(O())},onUpdateInviteFormLocalData:s=>{a(Y({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const a=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=R(),D=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),I=G(k);f.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(K()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(X(!0)))},[l.fetchState,a]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(Q,{navigate:c,location:D,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(u,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(q,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Brg8B8gk.js","assets/sentry-CEfOando.js","assets/core-D6ttr5iw.js","assets/zeni-epic-state-Cl3jFj7z.js","assets/index-ilZtTEZn.js","assets/mui-vLo47rlo.js","assets/analytics-Ba6zmRos.js","assets/utils-DKj7mVPA.js","assets/withTransactionSidePanel-DeW-W6do.js","assets/useAskAiCfoHostNavButtonProps-33WX5dhg.js","assets/TransactionDetailScreen-DB5lxQrk.js","assets/decodeURIComponentSafe-D0vQ4d1Q.js","assets/routePaths-C1rKvS5o.js","assets/NotFoundScreen-BDl5tn8o.js","assets/useInitialThreadRequest-Bx57kb_d.js","assets/analyticsHelper-Cq2pq-lr.js","assets/CompanyPassportScreen-DavSJynu.js","assets/MobileAppDrawer-Sx7ydj7A.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js","assets/FeaturePreviewScreen-Y7t6ABdh.js","assets/ReferralListScreen-DNdLnut4.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-jZS0wJcj.js","assets/AddressScreen-ScWWmTbP.js","assets/DomesticWireDetailScreen-jS6brB2p.js","assets/DrawerScreen-D0g6PABS.js","assets/SetupPagesScreen-CVKPKeC9.js","assets/BusinessVerificationPageScreen-DFgVqXvI.js","assets/BillPayApprovalRoutes-CQmYX8YN.js","assets/ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js","assets/getLocaleForTenant-O3Y2pcaQ.js","assets/ReimbursementRoutes-Bb9JPi0m.js","assets/ReimbursementApprovalRoutes-BazeprVG.js","assets/TransactionListRoutes-6SM8gNlu.js","assets/ZeniAccountStatementScreen-D9UEHLLF.js","assets/SettingsRoutes-oK_kou4I.js","assets/accountMappingHelper-s2xO6MjH.js","assets/useEmailConnectResultRefresh-BzWsu8a4.js","assets/QBOConnectionScreen-DXq_HXCX.js","assets/empty-B81gHGCB.js","assets/index-pFVjg2n3.js","assets/url-BQNo9gT5.js","assets/index-lXh6fiHl.js","assets/ReportsRoutes-DB2v4EPm.js","assets/ChargeCardRoutes-BPGek5pB.js","assets/useChargeCardPusherEvents-Cvnaf2Z-.js","assets/PeopleRoutes-x62_g_WP.js","assets/ExpenseAutomationRoutes-D3rXxAM_.js","assets/TreasuryRoutes-DHuVCY9q.js","assets/useCashManagementBanner-CBJfpbK7.js","assets/VendorsRoutes-CwYVQ8VQ.js","assets/pathToGoBack-CkJN8BOO.js","assets/ZeniAccountRoutes-u96OM2YN.js","assets/AddressRoutes-BqX5wkCR.js","assets/PandLWithForecastRoutes-DjwWiUAb.js","assets/CustomerOnboardingRoutes-6ipmFo_1.js","assets/TransactionDetailRoutes-B4ryZwp2.js","assets/EntityDetailRoutes-qim0q068.js","assets/NotificationRoutes-Cdcu8PTz.js","assets/PerformanceRoutes-DQciMsYC.js","assets/RewardsRoutes-ChJyJSHY.js","assets/TaskRoutes-DoWinBID.js","assets/TaskListScreen-WRcn05lO.js","assets/AiCfoScreen-quWQqhzX.js","assets/CardsAiCfoScreen-BbBCL2AM.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as as,eX as rs,fE as is,fC as os,gl as ls,fr as cs,cU as Ae,cA as ds,fU as us,cs as ms,bE as _s,bo as Es,fZ as ps,v as As,LX as hs,bs as gs,LY as xs,bK as Is,fW as Ts,bJ as js,bt as Rs,co as Us,LZ as Ds,L_ as bs,cQ as ys,cT as fs,cS as Cs,cz as Hs,cG as vs,oa as he,fA as ge,gv as Os,g1 as xe,gs as Ie,gt as Te,g2 as Ps}from"./zeni-epic-state-Cl3jFj7z.js";import{j as e}from"./liveblocks-CS0rfBBF.js";import{a as v}from"./sentry-CEfOando.js";import{u as Fs,h as Ls,i as ks,g as Bs,j as G,l as je,N as c,o as Vs,p as a}from"./core-D6ttr5iw.js";import{m as Ss,u as Ns,z as D,Q as ws,c as Zs,T as Ms,d as B,i as zs,I as Gs,L as F,a as Re,t as _,P as $s,e as K,l}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{f as Ue}from"./analyticsHelper-Cq2pq-lr.js";import{t as Ys}from"./getLocaleForTenant-O3Y2pcaQ.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new r.Error().stack;j&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[j]="f82ecb94-1a4f-4a10-a990-a5703ddf5add",r._sentryDebugIdIdentifier="sentry-dbid-f82ecb94-1a4f-4a10-a990-a5703ddf5add")}catch{}})();const Ws={dashboard:()=>n(()=>import("./DashboardRoutes-Brg8B8gk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-jZS0wJcj.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-Bb9JPi0m.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-6SM8gNlu.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-oK_kou4I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-DB2v4EPm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-BPGek5pB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>n(()=>import("./PeopleRoutes-x62_g_WP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-D3rXxAM_.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-DHuVCY9q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-CwYVQ8VQ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-u96OM2YN.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=r=>{"requestIdleCallback"in window?requestIdleCallback(r):setTimeout(r,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-DB2v4EPm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Xs=l(()=>n(()=>import("./AddressRoutes-BqX5wkCR.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Js=l(()=>n(()=>import("./PeopleRoutes-x62_g_WP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),Ks=l(()=>n(()=>import("./PandLWithForecastRoutes-DjwWiUAb.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-6ipmFo_1.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-CwYVQ8VQ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-B4ryZwp2.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>n(()=>import("./EntityDetailRoutes-qim0q068.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),tn=l(()=>n(()=>import("./DashboardRoutes-Brg8B8gk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),be=l(()=>n(()=>import("./BillPayRoutes-jZS0wJcj.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),an=l(()=>n(()=>import("./SettingsRoutes-oK_kou4I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>n(()=>import("./ReimbursementRoutes-Bb9JPi0m.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-u96OM2YN.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-DHuVCY9q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-6SM8gNlu.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-BPGek5pB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-Cdcu8PTz.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),un=l(()=>n(()=>import("./PerformanceRoutes-DQciMsYC.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mn=l(()=>n(()=>import("./ExpenseAutomationRoutes-D3rXxAM_.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-ChJyJSHY.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),En=l(()=>n(()=>import("./TaskRoutes-DoWinBID.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-quWQqhzX.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>n(()=>import("./CardsAiCfoScreen-BbBCL2AM.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>n(()=>import("./NotFoundScreen-BDl5tn8o.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),An=l(()=>n(()=>import("./TaskListScreen-WRcn05lO.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:r}){const j=Fs(),V=Ls(),{tenantEmailDomain:o}=ks(),S=Ss().mode,{setLoading:C,clearAllLoading:O,clearLoading:N}=Ns(),f=D.getSignedInUserTenant(o)?.tenantId,I=D.getSignedInUser(),se=as(I),$=Bs(),[w,He]=v.useState(!1),i=G(t=>rs(t)),{useFeatureGate:L}=ws(),M=Zs(),ne=Ms(),{isFeatureEnabled:ve}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Oe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Pe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),R=G(t=>t.tenantState.fetchState),T=G(t=>t.tenantState.activeTenantFetchState.fetchState),E=T==="Completed"||R==="Completed"?is(te,i):void 0,Q=T==="Completed"||R==="Completed"?os(i):void 0,Fe=zs(i,Pe,te),{isFeatureEnabled:Le}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=L(B.isAiCfoFileUploadEnabled),Y=G(t=>ls(t));if(o!=null){const t=D.getSignedInUserTenant(o);I!=null&&t!=null&&Ue(I,i,S)}const z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ae=cs(),p=Gs(),ke=i.company==null||p?.loggedInUserRoleMap!=null&&Ae(p.loggedInUserRole),Be=ds(p?.loggedInUserRoleMap),re=v.useRef(!0),ie=je("/:tenantEmailDomain/onboarding/*")!==null,J=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(t=>z.tenantId!=null?us(t,z.tenantId):void 0);v.useEffect(()=>{C(F.TENANT_FETCHING),r(o)},[o]),v.useEffect(()=>{if(J!=null&&f!=null){const t=J.params.selectedPeriod;if(t!=null){const U=t.split("-");if(U.length===2){const d=ms(Number(U[0])),s=Number(U[1]),u=_s(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();u.isAfter(Z,"month")===!1?j(ps(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,f]),v.useEffect(()=>{w||(He(!0),C(F.TENANT_FETCHING)),re.current?re.current=!1:!As(ae,z)&&D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s){if(ge(U?.userId,U?.zeniSessionId,t.tenantId),d(Os(!0)),d(xe(t.tenantId)),t.tenantId!=null&&_.clearTenant(t.tenantId),t.tenantId!=null){const u=D.getSignedInUserTenantWithId(t.tenantId);s&&Re.updateAppLocaleID(Ys(s)),u?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(u?.tenantEmailDomain)}t.userId!=null?K.identify(t.userId,{tenant_id:t.tenantId}):K.resetUserIdentity()}(z,I,j,Ve))},[z,ae,I,j,D]),v.useEffect(()=>{D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s,u,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&u?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(W&&ss){k(xe(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(u?.userId,u?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)))}else W&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),W&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)));if(W){K.identify(u.userId,{tenant_id:s});const q=s==null||s!=null&&(U==="Completed"||U==="Error");t==="Completed"||U!=="Not-Started"&&U!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ps(u.userId,s,u.zeniSessionId))),q&&(t==="Not-Started"||t==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(he(u.userId,u.zeniSessionId)))}}(R,T,i,f,I,C,j))},[f,T]),v.useEffect(()=>{D.isSignedIn()&&R==="Completed"&&Y.tenantsBaseInOrder.length>0&&(N(F.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),I!=null&&Ue(I,i,S,void 0,Y.tenantsBaseInOrder))},[Y,R,i,I]),v.useEffect(()=>{T==="In-Progress"&&C(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):T==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),N(F.TENANT_FETCHING),N(F.TENANT_SWITCHING))),R!=="Completed"&&R!=="Error"||(R==="Completed"?_.markAllTenantsFetchCompleted():R==="Error"&&_.markAllTenantsFetchFailed())},[T,R,f,w]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&T==="Completed"&&w&&(oe.current=!0,function(t=qs,U=3e3){setTimeout(()=>{const d=s=>{if(s>=t.length)return;const u=t[s],Z=Ws[u];Z!=null?Z().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},U)}())},[T,w]);const H=i?.userRole!=null&&gs(i?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ne=i?.userRole!=null&&i.userRole.includes("charge_card_user"),we=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&Ae(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!H,ce=Fe&&!H,Ze=xs(p?.loggedInUserRoleMap),Me=i.externalConnections?.accounting[0]?.isValid,de=i.company?.companyOnboardingInfo.isOnboardingCompleted,ue=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!H,me=ue&&Is(p?.loggedInUserRoleMap),_e=ve&&!H,ze=i.company!=null&&Ts(i.company),Ge=Oe&&ze===!0&&!H,$e=le&&js(p?.loggedInUserRoleMap),Ye=ce&&Rs(p?.loggedInUserRoleMap),We=_e&&Us(p?.loggedInUserRoleMap),qe=Ds(p?.loggedInUserRoleMap),Qe=bs(p?.loggedInUserRoleMap),A=ys(p?.loggedInUserRoleMap),h=fs(p?.loggedInUserRoleMap),Xe=Cs(p?.loggedInUserRoleMap),g=Hs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),Ee=le&&g,pe=ue&&x,Je=_e&&A,Ke=Ge&&h,m=ce&&Xe,es=i.excludedResources?.resources?.find(t=>t.resource==="/invites")!=null||Be===!0||Ze===!0||qe===!0||Qe===!0;return D.isSignedIn()?f==null?R==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&R!=="In-Progress"&&j(he(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||R==="Completed"?(de===!0||se&&!ie)&&Me===!1&&E===!1&&Q===!1?(r(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!w||de!==!1||ie||se?w&&i?.userRole&&E!=null&&Q!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx($s,{}),children:[e.jsx(a,{path:"/",element:e.jsx(hn,{isDashboardAccess:P,isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(tn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Qs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"people/*",element:es||P?e.jsx(Js,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(a,{path:"transaction/*",element:P&&H===!1||Ne||we?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"transactions/*",element:P&&H===!1?e.jsx(ln,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"customer/*",element:P&&H===!1?e.jsx(De,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,isUserHasTreasuryAccess:h,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"vendor/*",element:P&&H===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"tasks",element:e.jsx(An,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(En,{})}),e.jsx(a,{path:"address/*",element:$e||me||We||Ye?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"checking/*",element:Je?e.jsx(rn,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:Ke?e.jsx(on,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:ne===!0?e.jsx(un,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:ne===!0&&H===!1?e.jsx(mn,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(a,{path:"vendors/*",element:ke?e.jsx(sn,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"settings/*",element:Le?e.jsx(an,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(pn,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(r(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),r(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const hn=({isDashboardAccess:r,isUserHasZeniAccountsAccess:j,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:C,isTenantCardsOnly:O,showChargeCardRoute:N})=>C===!0&&j?e.jsx(c,{to:"checking"}):O===!0&&N?e.jsx(c,{to:"cards"}):r?e.jsx(c,{to:"dashboard"}):j?e.jsx(c,{to:"checking"}):S?e.jsx(c,{to:"treasury"}):N?e.jsx(c,{to:"cards"}):V?e.jsx(c,{to:"bills"}):o?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:r,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:o,isTenantBankingOnly:S,showChargeCardRoute:C,tenantEmailDomain:O})=>S===!0||r?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(In,{tenantEmailDomain:O}):C?e.jsx(jn,{tenantEmailDomain:O}):j?e.jsx(xn,{tenantEmailDomain:O}):V?e.jsx(gn,{tenantEmailDomain:O}):e.jsx(y,{}),gn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/reimbursements`}),xn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/bills`}),In=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/treasury`}),Tn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/checking`}),jn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/cards`}),Ce=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/dashboard`});export{b as FallBackRoute,Nn as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-eNF287fs.js","assets/sentry-CEfOando.js","assets/core-D6ttr5iw.js","assets/zeni-epic-state-Cl3jFj7z.js","assets/index-BGtgXdBV.js","assets/mui-vLo47rlo.js","assets/analytics-Ba6zmRos.js","assets/utils-DKj7mVPA.js","assets/withTransactionSidePanel-R0O15XnS.js","assets/useAskAiCfoHostNavButtonProps-re9SKSxV.js","assets/TransactionDetailScreen-L3SyvDDw.js","assets/decodeURIComponentSafe-D0vQ4d1Q.js","assets/routePaths-DZDk8gbY.js","assets/NotFoundScreen-DUKrEDOk.js","assets/useInitialThreadRequest-CmTGqSIj.js","assets/analyticsHelper-F9bkDfUR.js","assets/CompanyPassportScreen-DetGWMZx.js","assets/MobileAppDrawer-BI_hKtLW.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D6zsFuCp.js","assets/FeaturePreviewScreen-heeivM6W.js","assets/ReferralListScreen-DyC1Khln.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-Os14xiVD.js","assets/AddressScreen-DV4gK_4i.js","assets/DomesticWireDetailScreen-BMyfqSTi.js","assets/DrawerScreen--Suq3tvT.js","assets/SetupPagesScreen-Duc28IO6.js","assets/BusinessVerificationPageScreen-BKvR8fKs.js","assets/BillPayApprovalRoutes-Dz2xD1tC.js","assets/ReimbursementApprovalRuleDetailScreen-ClRq5kCS.js","assets/getLocaleForTenant-YNgm3b7A.js","assets/ReimbursementRoutes-4pQ7nHpz.js","assets/ReimbursementApprovalRoutes-Bks_7P4u.js","assets/TransactionListRoutes-yd5cXXN9.js","assets/ZeniAccountStatementScreen-B1x9Ll2M.js","assets/SettingsRoutes-CN__-GS9.js","assets/accountMappingHelper-s2xO6MjH.js","assets/useEmailConnectResultRefresh-CdPAtb7K.js","assets/QBOConnectionScreen-BaZwNX6H.js","assets/empty-B81gHGCB.js","assets/index-pFVjg2n3.js","assets/url-BQNo9gT5.js","assets/index-lXh6fiHl.js","assets/ReportsRoutes-BOrBSfD8.js","assets/ChargeCardRoutes-DDxAQjwA.js","assets/useChargeCardPusherEvents-DxT609il.js","assets/PeopleRoutes-2kLgkUle.js","assets/ExpenseAutomationRoutes-ByFBxCiw.js","assets/TreasuryRoutes-idT6t3yc.js","assets/useCashManagementBanner-DoVCCRms.js","assets/VendorsRoutes-Cv1guWUA.js","assets/pathToGoBack-CkJN8BOO.js","assets/ZeniAccountRoutes-Bmxg5Hu_.js","assets/AddressRoutes-C8E4I-UT.js","assets/PandLWithForecastRoutes-Dt90QdCw.js","assets/CustomerOnboardingRoutes-CXBEVGX4.js","assets/TransactionDetailRoutes-DMGvj5pX.js","assets/EntityDetailRoutes-BGhUBNO_.js","assets/NotificationRoutes-D64xsn7f.js","assets/PerformanceRoutes-CKlQ6rou.js","assets/RewardsRoutes-kDqXZQmp.js","assets/TaskRoutes-D7b5hUHG.js","assets/TaskListScreen-gPJk_aPE.js","assets/AiCfoScreen-CJQFw07R.js","assets/CardsAiCfoScreen-DTFvzHIL.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as as,eX as rs,fE as is,fC as os,gl as ls,fr as cs,cU as Ae,cA as ds,fU as us,cs as ms,bE as _s,bo as Es,fZ as ps,v as As,LX as hs,bs as gs,LY as xs,bK as Is,fW as Ts,bJ as js,bt as Rs,co as Us,LZ as Ds,L_ as bs,cQ as ys,cT as fs,cS as Cs,cz as Hs,cG as vs,oa as he,fA as ge,gv as Os,g1 as xe,gs as Ie,gt as Te,g2 as Ps}from"./zeni-epic-state-Cl3jFj7z.js";import{j as e}from"./liveblocks-CS0rfBBF.js";import{a as v}from"./sentry-CEfOando.js";import{u as Fs,h as Ls,i as ks,g as Bs,j as G,l as je,N as c,o as Vs,p as a}from"./core-D6ttr5iw.js";import{m as Ss,u as Ns,z as D,Q as ws,c as Zs,T as Ms,d as B,i as zs,I as Gs,L as F,a as Re,t as _,P as $s,e as K,l}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{f as Ue}from"./analyticsHelper-F9bkDfUR.js";import{t as Ys}from"./getLocaleForTenant-YNgm3b7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new r.Error().stack;j&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[j]="f82ecb94-1a4f-4a10-a990-a5703ddf5add",r._sentryDebugIdIdentifier="sentry-dbid-f82ecb94-1a4f-4a10-a990-a5703ddf5add")}catch{}})();const Ws={dashboard:()=>n(()=>import("./DashboardRoutes-eNF287fs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-Os14xiVD.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-4pQ7nHpz.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-yd5cXXN9.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-CN__-GS9.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-BOrBSfD8.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DDxAQjwA.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>n(()=>import("./PeopleRoutes-2kLgkUle.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-ByFBxCiw.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-idT6t3yc.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-Cv1guWUA.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-Bmxg5Hu_.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=r=>{"requestIdleCallback"in window?requestIdleCallback(r):setTimeout(r,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-BOrBSfD8.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Xs=l(()=>n(()=>import("./AddressRoutes-C8E4I-UT.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Js=l(()=>n(()=>import("./PeopleRoutes-2kLgkUle.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),Ks=l(()=>n(()=>import("./PandLWithForecastRoutes-Dt90QdCw.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-CXBEVGX4.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-Cv1guWUA.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-DMGvj5pX.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>n(()=>import("./EntityDetailRoutes-BGhUBNO_.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),tn=l(()=>n(()=>import("./DashboardRoutes-eNF287fs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),be=l(()=>n(()=>import("./BillPayRoutes-Os14xiVD.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),an=l(()=>n(()=>import("./SettingsRoutes-CN__-GS9.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>n(()=>import("./ReimbursementRoutes-4pQ7nHpz.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-Bmxg5Hu_.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-idT6t3yc.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-yd5cXXN9.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-DDxAQjwA.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-D64xsn7f.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),un=l(()=>n(()=>import("./PerformanceRoutes-CKlQ6rou.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mn=l(()=>n(()=>import("./ExpenseAutomationRoutes-ByFBxCiw.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-kDqXZQmp.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),En=l(()=>n(()=>import("./TaskRoutes-D7b5hUHG.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-CJQFw07R.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>n(()=>import("./CardsAiCfoScreen-DTFvzHIL.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>n(()=>import("./NotFoundScreen-DUKrEDOk.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),An=l(()=>n(()=>import("./TaskListScreen-gPJk_aPE.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:r}){const j=Fs(),V=Ls(),{tenantEmailDomain:o}=ks(),S=Ss().mode,{setLoading:C,clearAllLoading:O,clearLoading:N}=Ns(),f=D.getSignedInUserTenant(o)?.tenantId,I=D.getSignedInUser(),se=as(I),$=Bs(),[w,He]=v.useState(!1),i=G(t=>rs(t)),{useFeatureGate:L}=ws(),M=Zs(),ne=Ms(),{isFeatureEnabled:ve}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Oe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Pe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),R=G(t=>t.tenantState.fetchState),T=G(t=>t.tenantState.activeTenantFetchState.fetchState),E=T==="Completed"||R==="Completed"?is(te,i):void 0,Q=T==="Completed"||R==="Completed"?os(i):void 0,Fe=zs(i,Pe,te),{isFeatureEnabled:Le}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=L(B.isAiCfoFileUploadEnabled),Y=G(t=>ls(t));if(o!=null){const t=D.getSignedInUserTenant(o);I!=null&&t!=null&&Ue(I,i,S)}const z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ae=cs(),p=Gs(),ke=i.company==null||p?.loggedInUserRoleMap!=null&&Ae(p.loggedInUserRole),Be=ds(p?.loggedInUserRoleMap),re=v.useRef(!0),ie=je("/:tenantEmailDomain/onboarding/*")!==null,J=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(t=>z.tenantId!=null?us(t,z.tenantId):void 0);v.useEffect(()=>{C(F.TENANT_FETCHING),r(o)},[o]),v.useEffect(()=>{if(J!=null&&f!=null){const t=J.params.selectedPeriod;if(t!=null){const U=t.split("-");if(U.length===2){const d=ms(Number(U[0])),s=Number(U[1]),u=_s(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();u.isAfter(Z,"month")===!1?j(ps(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,f]),v.useEffect(()=>{w||(He(!0),C(F.TENANT_FETCHING)),re.current?re.current=!1:!As(ae,z)&&D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s){if(ge(U?.userId,U?.zeniSessionId,t.tenantId),d(Os(!0)),d(xe(t.tenantId)),t.tenantId!=null&&_.clearTenant(t.tenantId),t.tenantId!=null){const u=D.getSignedInUserTenantWithId(t.tenantId);s&&Re.updateAppLocaleID(Ys(s)),u?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(u?.tenantEmailDomain)}t.userId!=null?K.identify(t.userId,{tenant_id:t.tenantId}):K.resetUserIdentity()}(z,I,j,Ve))},[z,ae,I,j,D]),v.useEffect(()=>{D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s,u,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&u?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(W&&ss){k(xe(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(u?.userId,u?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)))}else W&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),W&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)));if(W){K.identify(u.userId,{tenant_id:s});const q=s==null||s!=null&&(U==="Completed"||U==="Error");t==="Completed"||U!=="Not-Started"&&U!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ps(u.userId,s,u.zeniSessionId))),q&&(t==="Not-Started"||t==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(he(u.userId,u.zeniSessionId)))}}(R,T,i,f,I,C,j))},[f,T]),v.useEffect(()=>{D.isSignedIn()&&R==="Completed"&&Y.tenantsBaseInOrder.length>0&&(N(F.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),I!=null&&Ue(I,i,S,void 0,Y.tenantsBaseInOrder))},[Y,R,i,I]),v.useEffect(()=>{T==="In-Progress"&&C(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):T==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),N(F.TENANT_FETCHING),N(F.TENANT_SWITCHING))),R!=="Completed"&&R!=="Error"||(R==="Completed"?_.markAllTenantsFetchCompleted():R==="Error"&&_.markAllTenantsFetchFailed())},[T,R,f,w]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&T==="Completed"&&w&&(oe.current=!0,function(t=qs,U=3e3){setTimeout(()=>{const d=s=>{if(s>=t.length)return;const u=t[s],Z=Ws[u];Z!=null?Z().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},U)}())},[T,w]);const H=i?.userRole!=null&&gs(i?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ne=i?.userRole!=null&&i.userRole.includes("charge_card_user"),we=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&Ae(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!H,ce=Fe&&!H,Ze=xs(p?.loggedInUserRoleMap),Me=i.externalConnections?.accounting[0]?.isValid,de=i.company?.companyOnboardingInfo.isOnboardingCompleted,ue=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!H,me=ue&&Is(p?.loggedInUserRoleMap),_e=ve&&!H,ze=i.company!=null&&Ts(i.company),Ge=Oe&&ze===!0&&!H,$e=le&&js(p?.loggedInUserRoleMap),Ye=ce&&Rs(p?.loggedInUserRoleMap),We=_e&&Us(p?.loggedInUserRoleMap),qe=Ds(p?.loggedInUserRoleMap),Qe=bs(p?.loggedInUserRoleMap),A=ys(p?.loggedInUserRoleMap),h=fs(p?.loggedInUserRoleMap),Xe=Cs(p?.loggedInUserRoleMap),g=Hs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),Ee=le&&g,pe=ue&&x,Je=_e&&A,Ke=Ge&&h,m=ce&&Xe,es=i.excludedResources?.resources?.find(t=>t.resource==="/invites")!=null||Be===!0||Ze===!0||qe===!0||Qe===!0;return D.isSignedIn()?f==null?R==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&R!=="In-Progress"&&j(he(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||R==="Completed"?(de===!0||se&&!ie)&&Me===!1&&E===!1&&Q===!1?(r(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!w||de!==!1||ie||se?w&&i?.userRole&&E!=null&&Q!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx($s,{}),children:[e.jsx(a,{path:"/",element:e.jsx(hn,{isDashboardAccess:P,isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(tn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Qs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"people/*",element:es||P?e.jsx(Js,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(a,{path:"transaction/*",element:P&&H===!1||Ne||we?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"transactions/*",element:P&&H===!1?e.jsx(ln,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"customer/*",element:P&&H===!1?e.jsx(De,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,isUserHasTreasuryAccess:h,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"vendor/*",element:P&&H===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"tasks",element:e.jsx(An,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(En,{})}),e.jsx(a,{path:"address/*",element:$e||me||We||Ye?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"checking/*",element:Je?e.jsx(rn,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:Ke?e.jsx(on,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:ne===!0?e.jsx(un,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:ne===!0&&H===!1?e.jsx(mn,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(a,{path:"vendors/*",element:ke?e.jsx(sn,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"settings/*",element:Le?e.jsx(an,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(pn,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(r(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),r(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const hn=({isDashboardAccess:r,isUserHasZeniAccountsAccess:j,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:C,isTenantCardsOnly:O,showChargeCardRoute:N})=>C===!0&&j?e.jsx(c,{to:"checking"}):O===!0&&N?e.jsx(c,{to:"cards"}):r?e.jsx(c,{to:"dashboard"}):j?e.jsx(c,{to:"checking"}):S?e.jsx(c,{to:"treasury"}):N?e.jsx(c,{to:"cards"}):V?e.jsx(c,{to:"bills"}):o?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:r,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:o,isTenantBankingOnly:S,showChargeCardRoute:C,tenantEmailDomain:O})=>S===!0||r?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(In,{tenantEmailDomain:O}):C?e.jsx(jn,{tenantEmailDomain:O}):j?e.jsx(xn,{tenantEmailDomain:O}):V?e.jsx(gn,{tenantEmailDomain:O}):e.jsx(y,{}),gn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/reimbursements`}),xn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/bills`}),In=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/treasury`}),Tn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/checking`}),jn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/cards`}),Ce=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/dashboard`});export{b as FallBackRoute,Nn as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-CS0rfBBF.js";import{a as d}from"./sentry-CEfOando.js";import{h as z,g as Q,u as O,j as b,s as ce,n as $,i as G,o as W,p as w}from"./core-D6ttr5iw.js";import{bn as Pe,eX as D,gq as De,n0 as le,Og as Me,hG as he,O7 as Ue,qS as Te,ky as fe,mY as _e,hI as Fe,O9 as Oe,O8 as Re,Qy as Be,zj as Ve,EM as ze,Q7 as Le,Qg as Ne,c6 as ne,cL as Qe,cM as $e,M7 as Ge,Qz as He,M8 as Ze,xL as Ke,QA as qe,Hb as Ye,Es as Je,Ej as be,Eg as Xe,xP as Se,Em as ye,Ep as Ce,Ev as te,uc as ae,xO as We,ka as q,kd as Ie,QB as en,le as nn,y2 as tn,M$ as an,N0 as on,k8 as sn,QC as cn,kb as ln,rk as rn,MW as dn,MX as un,ro as pn,hr as gn,Mg as X,hj as re,hg as mn,ho as hn,Mh as fn,x$ as bn,QD as Sn,QE as yn,EJ as Cn,fC as Ee,fE as xe,QF as In,ge as En,Mq as xn,x_ as de,gj as ue,gi as An,xZ as vn,gh as wn,gg as kn,QG as jn,fH as Ae,QH as Pn,QI as Dn,y5 as Mn,xY as pe,QJ as Un,fY as Tn,xV as _n,bZ as Fn,c5 as On,c4 as Rn,b_ as Bn,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as Y,d as F,z as P,af as ve,bS as $n,e as J,g as Gn,bD as Hn,I as H,w as oe,bT as Zn,i as we,bU as Kn,aq as qn,k as ke,bV as Yn,bW as Jn,bX as Xn,Y as Wn,bY as et,s as nt,bZ as tt}from"./index-ilZtTEZn.js";import{n as B}from"./mui-vLo47rlo.js";import{M as R}from"./MobileAppDrawer-Sx7ydj7A.js";import{a as Z,g as K,m as at}from"./accountMappingHelper-s2xO6MjH.js";import{t as ot,A as st}from"./AddressScreen-ScWWmTbP.js";import N from"./NotFoundScreen-BDl5tn8o.js";import{g as it}from"./analyticsHelper-Cq2pq-lr.js";import{B as ct}from"./BusinessVerificationPageScreen-DFgVqXvI.js";import{C as lt}from"./CompanyPassportScreen-DavSJynu.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-BzWsu8a4.js";import{q as ge}from"./QBOConnectionScreen-DXq_HXCX.js";import{B as ut}from"./BillPayApprovalRoutes-CQmYX8YN.js";import{R as pt}from"./ReimbursementApprovalRoutes-BazeprVG.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./routePaths-C1rKvS5o.js";import"./empty-B81gHGCB.js";import"./pdf-lib-RRzqb1kw.js";import"./index-pFVjg2n3.js";import"./url-BQNo9gT5.js";import"./index-lXh6fiHl.js";import"./decodeURIComponentSafe-D0vQ4d1Q.js";import"./ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.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]="ed38793f-dc64-407e-b8e1-4df9f58ccbbb",e._sentryDebugIdIdentifier="sentry-dbid-ed38793f-dc64-407e-b8e1-4df9f58ccbbb")}catch{}})();const gt=B.div`
1
+ import{j as o}from"./liveblocks-CS0rfBBF.js";import{a as d}from"./sentry-CEfOando.js";import{h as z,g as Q,u as O,j as b,s as ce,n as $,i as G,o as W,p as w}from"./core-D6ttr5iw.js";import{bn as Pe,eX as D,gq as De,n0 as le,Og as Me,hG as he,O7 as Ue,qS as Te,ky as fe,mY as _e,hI as Fe,O9 as Oe,O8 as Re,Qy as Be,zj as Ve,EM as ze,Q7 as Le,Qg as Ne,c6 as ne,cL as Qe,cM as $e,M7 as Ge,Qz as He,M8 as Ze,xL as Ke,QA as qe,Hb as Ye,Es as Je,Ej as be,Eg as Xe,xP as Se,Em as ye,Ep as Ce,Ev as te,uc as ae,xO as We,ka as q,kd as Ie,QB as en,le as nn,y2 as tn,M$ as an,N0 as on,k8 as sn,QC as cn,kb as ln,rk as rn,MW as dn,MX as un,ro as pn,hr as gn,Mg as X,hj as re,hg as mn,ho as hn,Mh as fn,x$ as bn,QD as Sn,QE as yn,EJ as Cn,fC as Ee,fE as xe,QF as In,ge as En,Mq as xn,x_ as de,gj as ue,gi as An,xZ as vn,gh as wn,gg as kn,QG as jn,fH as Ae,QH as Pn,QI as Dn,y5 as Mn,xY as pe,QJ as Un,fY as Tn,xV as _n,bZ as Fn,c5 as On,c4 as Rn,b_ as Bn,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as Y,d as F,z as P,af as ve,bS as $n,e as J,g as Gn,bD as Hn,I as H,w as oe,bT as Zn,i as we,bU as Kn,aq as qn,k as ke,bV as Yn,bW as Jn,bX as Xn,Y as Wn,bY as et,s as nt,bZ as tt}from"./index-BGtgXdBV.js";import{n as B}from"./mui-vLo47rlo.js";import{M as R}from"./MobileAppDrawer-BI_hKtLW.js";import{a as Z,g as K,m as at}from"./accountMappingHelper-s2xO6MjH.js";import{t as ot,A as st}from"./AddressScreen-DV4gK_4i.js";import N from"./NotFoundScreen-DUKrEDOk.js";import{g as it}from"./analyticsHelper-F9bkDfUR.js";import{B as ct}from"./BusinessVerificationPageScreen-BKvR8fKs.js";import{C as lt}from"./CompanyPassportScreen-DetGWMZx.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-CdPAtb7K.js";import{q as ge}from"./QBOConnectionScreen-BaZwNX6H.js";import{B as ut}from"./BillPayApprovalRoutes-Dz2xD1tC.js";import{R as pt}from"./ReimbursementApprovalRoutes-Bks_7P4u.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./routePaths-DZDk8gbY.js";import"./empty-B81gHGCB.js";import"./pdf-lib-RRzqb1kw.js";import"./index-pFVjg2n3.js";import"./url-BQNo9gT5.js";import"./index-lXh6fiHl.js";import"./decodeURIComponentSafe-D0vQ4d1Q.js";import"./ReimbursementApprovalRuleDetailScreen-ClRq5kCS.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]="ed38793f-dc64-407e-b8e1-4df9f58ccbbb",e._sentryDebugIdIdentifier="sentry-dbid-ed38793f-dc64-407e-b8e1-4df9f58ccbbb")}catch{}})();const gt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CS0rfBBF.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as B,n as W,t as en}from"./core-D6ttr5iw.js";import{bJ as nn,co as Ce,PX as ye,eX as V,cA as tn,zz as Q,zj as an,Q7 as sn,Qa as on,rD as te,rr as ae,l6 as ie,tK as L,Qc as Ie,gi as $e,gh as Ge,gg as We,Qd as cn,zI as rn,Es as Ae,Ej as ke,Eg as _e,D_ as X,Em as ve,Ep as Ee,Ev as Pe,uc as Te,gx as un,cv as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qe as fn,C_ as le,DC as gn,Qf as bn,bK as Sn,FL as pe,EM as hn,Qg as Cn,Qh as In,FP as An,FT as kn,tD as _n,Kh as vn,Go as he,Ho as me,Qi as En,Qj as Pn,Qk as Tn,Ql as He,Qm as wn,MK as Dn,Pk as Un,MZ as On,Qn as Ke,E2 as Fn,M_ as Vn,E6 as xn,Qo as Oe,GK as qe,le as Bn,ru as Xe,tM as jn,bE as Re,tY as ze,cy as Rn,Qp as Je,fX as zn,G6 as Ln,Ga as Nn,Qq as Mn,Gr as Le,Qr as Zn,Qs as Qn,Qt as $n,Qu as Gn,gq as Wn,AT as Hn,Qv as Kn,AY as qn,AX as Xn}from"./zeni-epic-state-Cl3jFj7z.js";import{I as se,Q as oe,d as q,m as we,aR as J,bD as Ye,z as U,K as ce,e as O,w as De,g as $,bE as Jn,at as re,bF as x,bG as Yn,bH as et,af as Be,bI as nt,s as Ne,au as Me,Z as tt,A as at,bJ as it,bK as st,bL as ot,a8 as ct}from"./index-ilZtTEZn.js";import{a as h}from"./sentry-CEfOando.js";import{n as Fe,D as rt,S as ut}from"./mui-vLo47rlo.js";import{M as fe}from"./MobileAppDrawer-Sx7ydj7A.js";import z from"./NotFoundScreen-BDl5tn8o.js";import{a as Ze}from"./analyticsHelper-Cq2pq-lr.js";import{d as Qe}from"./routePaths-C1rKvS5o.js";import{B as Ue}from"./BusinessVerificationPageScreen-DFgVqXvI.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]="fbac2331-7bbd-4854-8664-b4bd90a90aa6",e._sentryDebugIdIdentifier="sentry-dbid-fbac2331-7bbd-4854-8664-b4bd90a90aa6")}catch{}})();const dt=Fe.div`
1
+ import{j as u}from"./liveblocks-CS0rfBBF.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as B,n as W,t as en}from"./core-D6ttr5iw.js";import{bJ as nn,co as Ce,PX as ye,eX as V,cA as tn,zz as Q,zj as an,Q7 as sn,Qa as on,rD as te,rr as ae,l6 as ie,tK as L,Qc as Ie,gi as $e,gh as Ge,gg as We,Qd as cn,zI as rn,Es as Ae,Ej as ke,Eg as _e,D_ as X,Em as ve,Ep as Ee,Ev as Pe,uc as Te,gx as un,cv as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qe as fn,C_ as le,DC as gn,Qf as bn,bK as Sn,FL as pe,EM as hn,Qg as Cn,Qh as In,FP as An,FT as kn,tD as _n,Kh as vn,Go as he,Ho as me,Qi as En,Qj as Pn,Qk as Tn,Ql as He,Qm as wn,MK as Dn,Pk as Un,MZ as On,Qn as Ke,E2 as Fn,M_ as Vn,E6 as xn,Qo as Oe,GK as qe,le as Bn,ru as Xe,tM as jn,bE as Re,tY as ze,cy as Rn,Qp as Je,fX as zn,G6 as Ln,Ga as Nn,Qq as Mn,Gr as Le,Qr as Zn,Qs as Qn,Qt as $n,Qu as Gn,gq as Wn,AT as Hn,Qv as Kn,AY as qn,AX as Xn}from"./zeni-epic-state-Cl3jFj7z.js";import{I as se,Q as oe,d as q,m as we,aR as J,bD as Ye,z as U,K as ce,e as O,w as De,g as $,bE as Jn,at as re,bF as x,bG as Yn,bH as et,af as Be,bI as nt,s as Ne,au as Me,Z as tt,A as at,bJ as it,bK as st,bL as ot,a8 as ct}from"./index-BGtgXdBV.js";import{a as h}from"./sentry-CEfOando.js";import{n as Fe,D as rt,S as ut}from"./mui-vLo47rlo.js";import{M as fe}from"./MobileAppDrawer-BI_hKtLW.js";import z from"./NotFoundScreen-DUKrEDOk.js";import{a as Ze}from"./analyticsHelper-F9bkDfUR.js";import{d as Qe}from"./routePaths-DZDk8gbY.js";import{B as Ue}from"./BusinessVerificationPageScreen-BKvR8fKs.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]="fbac2331-7bbd-4854-8664-b4bd90a90aa6",e._sentryDebugIdIdentifier="sentry-dbid-fbac2331-7bbd-4854-8664-b4bd90a90aa6")}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-CS0rfBBF.js";import{a as u,b as M,q as T}from"./sentry-CEfOando.js";import{u as A,h as z,j as c,g as D,N as j,n as O}from"./core-D6ttr5iw.js";import{u as P,z as s,m as F,e as E,a as _,f as B,g as N,h as V,j as W,U as X,k as v}from"./index-ilZtTEZn.js";import{eX as Y,LW as $,LX as q,fA as J,g1 as H,M0 as G,gp as K,cY as Q,M1 as b,M2 as R,M3 as Z,bY as y}from"./zeni-epic-state-Cl3jFj7z.js";import"./mui-vLo47rlo.js";import{u as ee}from"./useDeviceId-DISstVTH.js";import{f as te}from"./analyticsHelper-Cq2pq-lr.js";import{t as ne}from"./getLocaleForTenant-O3Y2pcaQ.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="2cdcc0c2-1dfe-4bae-aeb0-92187373afa5",t._sentryDebugIdIdentifier="sentry-dbid-2cdcc0c2-1dfe-4bae-aeb0-92187373afa5")}catch{}})();const ie=O(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(Z({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(R(n,a)))},clearSignInError:()=>{t(b())}}})(X),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:U,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=>Y(e)),I=c(e=>$(e)),m=D(),w=F().mode,C=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(q(I.tenantsInOrder),o.zeniSessionId),J(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),K().then(()=>{const e=W();e!=null&&B(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-CS0rfBBF.js";import{a as u,b as M,q as T}from"./sentry-CEfOando.js";import{u as A,h as z,j as c,g as D,N as j,n as O}from"./core-D6ttr5iw.js";import{u as P,z as s,m as F,e as E,a as _,f as B,g as N,h as V,j as W,U as X,k as v}from"./index-BGtgXdBV.js";import{eX as Y,LW as $,LX as q,fA as J,g1 as H,M0 as G,gp as K,cY as Q,M1 as b,M2 as R,M3 as Z,bY as y}from"./zeni-epic-state-Cl3jFj7z.js";import"./mui-vLo47rlo.js";import{u as ee}from"./useDeviceId-DISstVTH.js";import{f as te}from"./analyticsHelper-F9bkDfUR.js";import{t as ne}from"./getLocaleForTenant-YNgm3b7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="2cdcc0c2-1dfe-4bae-aeb0-92187373afa5",t._sentryDebugIdIdentifier="sentry-dbid-2cdcc0c2-1dfe-4bae-aeb0-92187373afa5")}catch{}})();const ie=O(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(Z({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(R(n,a)))},clearSignInError:()=>{t(b())}}})(X),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:U,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=>Y(e)),I=c(e=>$(e)),m=D(),w=F().mode,C=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(q(I.tenantsInOrder),o.zeniSessionId),J(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),K().then(()=>{const e=W();e!=null&&B(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as n}from"./sentry-CEfOando.js";import{u as d,g,h as m,N as p}from"./core-D6ttr5iw.js";import{z as c,w as b,t as y,e as f,g as h}from"./index-ilZtTEZn.js";import{gu as x,gv as I,Mi as w}from"./zeni-epic-state-Cl3jFj7z.js";import{n as v}from"./mui-vLo47rlo.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="af92a4ee-66ec-4613-bb22-abeb71ca68cc",e._sentryDebugIdIdentifier="sentry-dbid-af92a4ee-66ec-4613-bb22-abeb71ca68cc")}catch{}})();function q(){const e=d(),t=g(),a=m(),i=n.useRef(!1),l=c.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),w(),y.reset(),f.trackLogout(h.Event.logoutSuccess),f.resetUserIdentity()}catch(u){console.error("Error during sign out:",u)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(j,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const j=v.div`
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as n}from"./sentry-CEfOando.js";import{u as d,g,h as m,N as p}from"./core-D6ttr5iw.js";import{z as c,w as b,t as y,e as f,g as h}from"./index-BGtgXdBV.js";import{gu as x,gv as I,Mi as w}from"./zeni-epic-state-Cl3jFj7z.js";import{n as v}from"./mui-vLo47rlo.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="af92a4ee-66ec-4613-bb22-abeb71ca68cc",e._sentryDebugIdIdentifier="sentry-dbid-af92a4ee-66ec-4613-bb22-abeb71ca68cc")}catch{}})();function q(){const e=d(),t=g(),a=m(),i=n.useRef(!1),l=c.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),w(),y.reset(),f.trackLogout(h.Event.logoutSuccess),f.resetUserIdentity()}catch(u){console.error("Error during sign out:",u)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(j,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const j=v.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-CS0rfBBF.js";import{a as G}from"./sentry-CEfOando.js";import{h as U,u as z,g as v,j as b,i as _,n as J}from"./core-D6ttr5iw.js";import{z as R,Q as M,d as p,$ as O,K as Q,e as V,g as W,da as Z,s as g,r as q}from"./index-ilZtTEZn.js";import{eX as H,TK as F,J3 as I,TL as x,TG as X,Ir as y,TM as Y,Iz as E,HV as aa,J4 as S,TN as B,fz as ea,IW as ta,I$ as sa,IO as oa,IM as w,J0 as na,IJ as ia,TO as la,TP as ra,TQ as ca,TR as ka,TS as T,ej as ua,TT as da,TU as pa}from"./zeni-epic-state-Cl3jFj7z.js";import{n as Ta}from"./mui-vLo47rlo.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as ga}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="690b8a44-ac3a-443c-a917-651e7f50acd6",e._sentryDebugIdIdentifier="sentry-dbid-690b8a44-ac3a-443c-a917-651e7f50acd6")}catch{}})();const fa=Ta.div`
1
+ import{j as d}from"./liveblocks-CS0rfBBF.js";import{a as G}from"./sentry-CEfOando.js";import{h as U,u as z,g as v,j as b,i as _,n as J}from"./core-D6ttr5iw.js";import{z as R,Q as M,d as p,$ as O,K as Q,e as V,g as W,da as Z,s as g,r as q}from"./index-BGtgXdBV.js";import{eX as H,TK as F,J3 as I,TL as x,TG as X,Ir as y,TM as Y,Iz as E,HV as aa,J4 as S,TN as B,fz as ea,IW as ta,I$ as sa,IO as oa,IM as w,J0 as na,IJ as ia,TO as la,TP as ra,TQ as ca,TR as ka,TS as T,ej as ua,TT as da,TU as pa}from"./zeni-epic-state-Cl3jFj7z.js";import{n as Ta}from"./mui-vLo47rlo.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{M as ga}from"./MobileAppDrawer-BI_hKtLW.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="690b8a44-ac3a-443c-a917-651e7f50acd6",e._sentryDebugIdIdentifier="sentry-dbid-690b8a44-ac3a-443c-a917-651e7f50acd6")}catch{}})();const fa=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-CS0rfBBF.js";import se from"./NotFoundScreen-BDl5tn8o.js";import{a as c}from"./sentry-CEfOando.js";import{h as M,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-D6ttr5iw.js";import{I6 as Z,I9 as le,I3 as de,eX as H,TG as J,In as K,I0 as pe,IT as ue,IM as ke,TH as Y,TI as V,HY as me,HV as fe,rD as ge,rr as he,l6 as Ie,Ih as Se,TJ as Te,Iy as be,Iv as Ee,Ic as Ge,Is as Ce,Ir as De}from"./zeni-epic-state-Cl3jFj7z.js";import{z as C,d8 as xe,S as ye,Q as je,d as b,r as Q,s as w,K as ve,e as z,g as we,d9 as Re,k as A,at as Fe}from"./index-ilZtTEZn.js";import{n as Be}from"./mui-vLo47rlo.js";import{u as Pe}from"./useInitialThreadRequest-Bx57kb_d.js";import{M as Ue}from"./MobileAppDrawer-Sx7ydj7A.js";import Le from"./TaskListScreen-WRcn05lO.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-33WX5dhg.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]="0027a998-eb54-4f6b-9151-f82dd54afc26",e._sentryDebugIdIdentifier="sentry-dbid-0027a998-eb54-4f6b-9151-f82dd54afc26")}catch{}})();function $e(){const e=M(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[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 _,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Y(e,t.taskId),d=H(e),l=r.taskGroupId??u,k=l!=null?V(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.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=>V(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(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Q(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(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(K(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>H(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{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,W]=c.useState(!1),[F,X]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(W(!0),t(K(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(X(!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})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Q(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,G,l,s,e]);const $=g(i=>Y(i,r)),j=$.fetchState,N=C.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ve=Be.div`
1
+ import{j as n}from"./liveblocks-CS0rfBBF.js";import se from"./NotFoundScreen-DUKrEDOk.js";import{a as c}from"./sentry-CEfOando.js";import{h as M,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-D6ttr5iw.js";import{I6 as Z,I9 as le,I3 as de,eX as H,TG as J,In as K,I0 as pe,IT as ue,IM as ke,TH as Y,TI as V,HY as me,HV as fe,rD as ge,rr as he,l6 as Ie,Ih as Se,TJ as Te,Iy as be,Iv as Ee,Ic as Ge,Is as Ce,Ir as De}from"./zeni-epic-state-Cl3jFj7z.js";import{z as C,d8 as xe,S as ye,Q as je,d as b,r as Q,s as w,K as ve,e as z,g as we,d9 as Re,k as A,at as Fe}from"./index-BGtgXdBV.js";import{n as Be}from"./mui-vLo47rlo.js";import{u as Pe}from"./useInitialThreadRequest-CmTGqSIj.js";import{M as Ue}from"./MobileAppDrawer-BI_hKtLW.js";import Le from"./TaskListScreen-gPJk_aPE.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-re9SKSxV.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]="0027a998-eb54-4f6b-9151-f82dd54afc26",e._sentryDebugIdIdentifier="sentry-dbid-0027a998-eb54-4f6b-9151-f82dd54afc26")}catch{}})();function $e(){const e=M(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[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 _,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Y(e,t.taskId),d=H(e),l=r.taskGroupId??u,k=l!=null?V(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.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=>V(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(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Q(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(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(K(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>H(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{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,W]=c.useState(!1),[F,X]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(W(!0),t(K(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(X(!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})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Q(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,G,l,s,e]);const $=g(i=>Y(i,r)),j=$.fetchState,N=C.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ve=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-CS0rfBBF.js";import i from"./NotFoundScreen-BDl5tn8o.js";import{T as r}from"./TransactionDetailScreen-DB5lxQrk.js";import"./sentry-CEfOando.js";import{o as s,p as o}from"./core-D6ttr5iw.js";import"./zeni-epic-state-Cl3jFj7z.js";import"./recharts-BDyAk4nR.js";import"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./decodeURIComponentSafe-D0vQ4d1Q.js";import"./routePaths-C1rKvS5o.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};
1
+ import{j as t}from"./liveblocks-CS0rfBBF.js";import i from"./NotFoundScreen-DUKrEDOk.js";import{T as r}from"./TransactionDetailScreen-L3SyvDDw.js";import"./sentry-CEfOando.js";import{o as s,p as o}from"./core-D6ttr5iw.js";import"./zeni-epic-state-Cl3jFj7z.js";import"./recharts-BDyAk4nR.js";import"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import"./decodeURIComponentSafe-D0vQ4d1Q.js";import"./routePaths-DZDk8gbY.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};
@@ -1,4 +1,4 @@
1
- import{j as x}from"./liveblocks-CS0rfBBF.js";import{a as i}from"./sentry-CEfOando.js";import{u as q,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Xe}from"./core-D6ttr5iw.js";import{nP as he,eX as Q,gq as Ze,Og as et,n0 as tt,mK as at,bn as nt,cU as Ee,bs as Ie,rb as W,Nf as H,Oh as ve,Oi as oe,NF as De,kJ as Ce,Oj as ke,NK as se,NL as ce,ly as Ae,Ka as ie,N9 as M,kD as Oe,kB as Ue,kN as ot,nC as st,Ok as ct,Ol as it,vp as Y,kI as xe,Jv as we,cZ as rt,c_ as lt,Om as dt,N8 as ut,On as mt,vl as pt,Oo as ft,Op as ht,Oq as yt,Or as St,Os as gt,kM as Tt,Ot as bt,Ou as Et,Na as It,Ov as vt,Ow as Dt,Ox as Ct,Jp as kt,Jf as At,JE as Ot,kO as Ut,Kb as ye,nH as xt}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as J,d as w,z as _e,aR as Pe,m as wt,Z as _t,aS as Pt,A as Ft,r as ae,I as Vt,aT as Bt,s as ne,$ as Nt,aU as Rt,e as Fe,aV as Lt,at as zt,a3 as te}from"./index-ilZtTEZn.js";import{n as Gt,S as jt,D as $t}from"./mui-vLo47rlo.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{d as Ve}from"./decodeURIComponentSafe-D0vQ4d1Q.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-C1rKvS5o.js";import{u as Ht}from"./utils-DKj7mVPA.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]="696bb829-1557-4323-854e-6037a793626b",t._sentryDebugIdIdentifier="sentry-dbid-696bb829-1557-4323-854e-6037a793626b")}catch{}})();function Jt(t=!0){const e=q(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.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=q(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>Q(h)),b=k.companyId,U=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),X=N.current??{},K=P.current;for(const L of u)if($.has(L.accountId)&&X[L.accountId]==null&&K?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))},[r,b,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=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(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=q(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Q(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),B=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,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),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("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:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,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=wt(),c=_t(),r=q(),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($t,{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)`
1
+ import{j as x}from"./liveblocks-CS0rfBBF.js";import{a as i}from"./sentry-CEfOando.js";import{u as q,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Xe}from"./core-D6ttr5iw.js";import{nP as he,eX as Q,gq as Ze,Og as et,n0 as tt,mK as at,bn as nt,cU as Ee,bs as Ie,rb as W,Nf as H,Oh as ve,Oi as oe,NF as De,kJ as Ce,Oj as ke,NK as se,NL as ce,ly as Ae,Ka as ie,N9 as M,kD as Oe,kB as Ue,kN as ot,nC as st,Ok as ct,Ol as it,vp as Y,kI as xe,Jv as we,cZ as rt,c_ as lt,Om as dt,N8 as ut,On as mt,vl as pt,Oo as ft,Op as ht,Oq as yt,Or as St,Os as gt,kM as Tt,Ot as bt,Ou as Et,Na as It,Ov as vt,Ow as Dt,Ox as Ct,Jp as kt,Jf as At,JE as Ot,kO as Ut,Kb as ye,nH as xt}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as J,d as w,z as _e,aR as Pe,m as wt,Z as _t,aS as Pt,A as Ft,r as ae,I as Vt,aT as Bt,s as ne,$ as Nt,aU as Rt,e as Fe,aV as Lt,at as zt,a3 as te}from"./index-BGtgXdBV.js";import{n as Gt,S as jt,D as $t}from"./mui-vLo47rlo.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{d as Ve}from"./decodeURIComponentSafe-D0vQ4d1Q.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-DZDk8gbY.js";import{u as Ht}from"./utils-DKj7mVPA.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]="696bb829-1557-4323-854e-6037a793626b",t._sentryDebugIdIdentifier="sentry-dbid-696bb829-1557-4323-854e-6037a793626b")}catch{}})();function Jt(t=!0){const e=q(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.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=q(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>Q(h)),b=k.companyId,U=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),X=N.current??{},K=P.current;for(const L of u)if($.has(L.accountId)&&X[L.accountId]==null&&K?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))},[r,b,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=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(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=q(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Q(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),B=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,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),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("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:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,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=wt(),c=_t(),r=q(),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($t,{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-CS0rfBBF.js";import{h as Q,g as H,u as X,i as U,j as S,N as z,n as Z,o as ve,p as j}from"./core-D6ttr5iw.js";import{eX as K,qS as W,jX as u,RG as ee,K1 as De,bo as le,RH as be,ky as te,NH as ae,RI as ue,RJ as Pe,bE as Y,JZ as ye,RK as Ee,RL as me,RM as je,K0 as Ae,RN as xe,RO as pe,RP as Me,RQ as ge,RR as Le,RS as Ce,RT as fe,Ld as Be}from"./zeni-epic-state-Cl3jFj7z.js";import{a as de,Q as ne,d as q,e as G,cp as ce,s as V,r as oe,Y as Fe,T as Oe}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{a as g}from"./sentry-CEfOando.js";import{w as se}from"./withTransactionSidePanel-DeW-W6do.js";import{p as ie,c as re}from"./routePaths-C1rKvS5o.js";import{v as Re}from"./utils-DKj7mVPA.js";import{d as b}from"./decodeURIComponentSafe-D0vQ4d1Q.js";import{Z as Ge}from"./ZeniAccountStatementScreen-D9UEHLLF.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./TransactionDetailScreen-DB5lxQrk.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]="ef5ab729-7780-4071-9905-272b12031e96",a._sentryDebugIdIdentifier="sentry-dbid-ef5ab729-7780-4071-9905-272b12031e96")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Re(a),we=Z(function(a,e){const t=be(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=Ne(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=V(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),N=se(function({...a}){const e=Q(),t=H(),n=X(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=U(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S(r=>K(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=S(r=>W(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);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(z,{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}}},Ne=(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=Z(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=V(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),qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Ve(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,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 R&&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(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ve=(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,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=Z(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=V(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),Qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Xe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,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 R&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(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),Ze=Z(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=V(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=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=U(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(v=>K(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=We(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:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=S(v=>W(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&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)))},[P,r,c,_]);const ke=[l,m,h,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{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(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(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=H().state?.referrer,e=S(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[S(n=>K(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(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{h as Q,g as H,u as X,i as U,j as S,N as z,n as Z,o as ve,p as j}from"./core-D6ttr5iw.js";import{eX as K,qS as W,jX as u,RG as ee,K1 as De,bo as le,RH as be,ky as te,NH as ae,RI as ue,RJ as Pe,bE as Y,JZ as ye,RK as Ee,RL as me,RM as je,K0 as Ae,RN as xe,RO as pe,RP as Me,RQ as ge,RR as Le,RS as Ce,RT as fe,Ld as Be}from"./zeni-epic-state-Cl3jFj7z.js";import{a as de,Q as ne,d as q,e as G,cp as ce,s as V,r as oe,Y as Fe,T as Oe}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{a as g}from"./sentry-CEfOando.js";import{w as se}from"./withTransactionSidePanel-R0O15XnS.js";import{p as ie,c as re}from"./routePaths-DZDk8gbY.js";import{v as Re}from"./utils-DKj7mVPA.js";import{d as b}from"./decodeURIComponentSafe-D0vQ4d1Q.js";import{Z as Ge}from"./ZeniAccountStatementScreen-B1x9Ll2M.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import"./TransactionDetailScreen-L3SyvDDw.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]="ef5ab729-7780-4071-9905-272b12031e96",a._sentryDebugIdIdentifier="sentry-dbid-ef5ab729-7780-4071-9905-272b12031e96")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Re(a),we=Z(function(a,e){const t=be(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=Ne(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=V(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),N=se(function({...a}){const e=Q(),t=H(),n=X(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=U(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S(r=>K(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=S(r=>W(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);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(z,{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}}},Ne=(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=Z(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=V(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),qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Ve(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,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 R&&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(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ve=(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,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=Z(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=V(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),Qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Xe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,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 R&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(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),Ze=Z(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=V(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=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=U(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(v=>K(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=We(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:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=S(v=>W(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&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)))},[P,r,c,_]);const ke=[l,m,h,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{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(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(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=H().state?.referrer,e=S(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[S(n=>K(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(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-CS0rfBBF.js";import{h as U,g as B,u as P,i as O,j as y,N as L,n as N,o as we,p as k}from"./core-D6ttr5iw.js";import{cp as G,eX as D,Qp as R,Go as ae,fX as q,G6 as ne,Qr as Ie,Gr as ke,Qn as be,Qo as se,QE as je,Ev as Ee,uc as Ae,Qt as ve,GK as De,Qq as re,cT as Z,ys as oe,fC as Fe,fE as Le,RD as Ue,RE as Be,G7 as Pe,RF as Re,G8 as Me,Gh as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as $e,fW as ze,bt as Qe,LY as qe,cn as Ze}from"./zeni-epic-state-Cl3jFj7z.js";import{I as _,aq as He,z as E,K as $,e as b,ci as Ke,cj as We,ck as Q,Z as H,m as Je,Y as Xe,$ as Ye,Q as ie,d as A,A as et,w as tt,cl as at,at as K,s as nt,cm as st,r as W,cn as rt,F as X,co as ot,i as it}from"./index-ilZtTEZn.js";import{D as ct,n as M,S as lt}from"./mui-vLo47rlo.js";import ut from"./NotFoundScreen-BDl5tn8o.js";import{S as Y}from"./SetupPagesScreen-CVKPKeC9.js";import{a as p}from"./sentry-CEfOando.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{u as pt}from"./useInitialThreadRequest-Bx57kb_d.js";import{u as mt}from"./useCashManagementBanner-CBJfpbK7.js";import{M as ce}from"./MobileAppDrawer-Sx7ydj7A.js";import{F as ft}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as ee}from"./analyticsHelper-Cq2pq-lr.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./routePaths-C1rKvS5o.js";import"./BusinessVerificationPageScreen-DFgVqXvI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="4ea39abe-4c61-47b3-b906-656f083debcc",t._sentryDebugIdIdentifier="sentry-dbid-4ea39abe-4c61-47b3-b906-656f083debcc")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ke);function gt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=E.getSignedInUserTenant(o)?.companyId??h.companyId,C=E.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ae("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ee(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(We),St=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=E.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
1
+ import{j as e}from"./liveblocks-CS0rfBBF.js";import{h as U,g as B,u as P,i as O,j as y,N as L,n as N,o as we,p as k}from"./core-D6ttr5iw.js";import{cp as G,eX as D,Qp as R,Go as ae,fX as q,G6 as ne,Qr as Ie,Gr as ke,Qn as be,Qo as se,QE as je,Ev as Ee,uc as Ae,Qt as ve,GK as De,Qq as re,cT as Z,ys as oe,fC as Fe,fE as Le,RD as Ue,RE as Be,G7 as Pe,RF as Re,G8 as Me,Gh as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as $e,fW as ze,bt as Qe,LY as qe,cn as Ze}from"./zeni-epic-state-Cl3jFj7z.js";import{I as _,aq as He,z as E,K as $,e as b,ci as Ke,cj as We,ck as Q,Z as H,m as Je,Y as Xe,$ as Ye,Q as ie,d as A,A as et,w as tt,cl as at,at as K,s as nt,cm as st,r as W,cn as rt,F as X,co as ot,i as it}from"./index-BGtgXdBV.js";import{D as ct,n as M,S as lt}from"./mui-vLo47rlo.js";import ut from"./NotFoundScreen-DUKrEDOk.js";import{S as Y}from"./SetupPagesScreen-Duc28IO6.js";import{a as p}from"./sentry-CEfOando.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{u as pt}from"./useInitialThreadRequest-CmTGqSIj.js";import{u as mt}from"./useCashManagementBanner-DoVCCRms.js";import{M as ce}from"./MobileAppDrawer-BI_hKtLW.js";import{F as ft}from"./FeaturePreviewScreen-heeivM6W.js";import{a as ee}from"./analyticsHelper-F9bkDfUR.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./routePaths-DZDk8gbY.js";import"./BusinessVerificationPageScreen-BKvR8fKs.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="4ea39abe-4c61-47b3-b906-656f083debcc",t._sentryDebugIdIdentifier="sentry-dbid-4ea39abe-4c61-47b3-b906-656f083debcc")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ke);function gt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=E.getSignedInUserTenant(o)?.companyId??h.companyId,C=E.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ae("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ee(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(We),St=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=E.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;