@zeniai/web-app-ui 5.1.95-dev → 5.1.95-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-BGgBsLRh.js → AddressRoutes-Bvp69dKv.js} +1 -1
  2. package/dist/assets/{AddressScreen-BhzQLd2o.js → AddressScreen-60Qj_YsR.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-CK90zIPE.js → AiCfoScreen-Di0AIuiw.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DUR0CXqd.js → BillPayApprovalRoutes-DYpPCevA.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D1a18iDG.js → BillPayRoutes-Bu0-qZ-c.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-D7H_6Ycl.js → BusinessVerificationPageScreen-BJQI2dfg.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-D16oDYzS.js → CardsAiCfoScreen-DZM91jF5.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-COdlwnbU.js → ChargeCardRoutes-BAl2IXHY.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-BVAY4gEa.js → CompanyPassportScreen-BqFRrI6s.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-W3CoEBGV.js → ConnectionAuthScreen-BPYnoMNn.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-D644qhJo.js → CustomerOnboardingAuthScreen-CpFI1iA5.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-DdKnlwn5.js → CustomerOnboardingRoutes-BF11xENe.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-DHqNqXXm.js → DashboardRoutes-21HP5X_L.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-4ZPXNy2A.js → DefaultTenantHome-DFLplybG.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-CYNJnP1G.js → DomesticWireDetailScreen-CDRDMeDf.js} +1 -1
  16. package/dist/assets/{DrawerScreen-Dw68qJE2.js → DrawerScreen-BUPBRQzG.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-CmbxziPm.js → EntityDetailRoutes-Q3W6ugXO.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-BhSurnrx.js → ExpenseAutomationRoutes-CVoR9HYp.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-D-CcSiZr.js → FeaturePreviewScreen-Cwp5VJhY.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-CdWLUkwz.js → HubSpotOAuthCallbackScreen-EZqM5g1_.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-Cufxx_9Z.js → MagicLinkRoutes-BDpBWVZh.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-BlnwJPL_.js → MagicLinkSignInScreen-JI4681jr.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-CB-RZZ92.js → MobileAppDrawer-zPhOmrIU.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-iwRtifEl.js → NotFoundScreen-8EvUnY3z.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-Da00R-X3.js → NotificationRoutes-Cdv9W6jW.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-DRfp49Um.js → OAuthConsentScreen-CUtdcAoz.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-CgigxmZu.js → PandLWithForecastRoutes-CuuM3cYK.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-B8Qsj9Gp.js → PeopleRoutes-CphF1WML.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-CpaSU8a_.js → PerformanceRoutes-DSbitX-g.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-_UbPaBIH.js → QBOConnectionScreen-QhaMmbnN.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-9chFTKdh.js → ReferralListScreen-DTyhwsoO.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-B9au9MRY.js → ReimbursementApprovalRoutes-OfO6QOTb.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BOtH5UIX.js → ReimbursementApprovalRuleDetailScreen-C909zELF.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-BpKyNBJb.js → ReimbursementRoutes-D7NThH82.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-CLFHU_O2.js → ReportsRoutes-C3CvAXR5.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-CHL77VZM.js → RewardsRoutes-Dxy1QY7_.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-RWbD63jU.js → ScreenRoutes-Bi_xt3-M.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-CF5KYJhG.js → SettingsRoutes-Cpq8r6km.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-DNjkbEBz.js → SetupPagesScreen-BDROUOA_.js} +1 -1
  40. package/dist/assets/{SignInScreen-CRJsXgNI.js → SignInScreen-Bmr5nDta.js} +1 -1
  41. package/dist/assets/{SignOutScreen-Dbi2_r9c.js → SignOutScreen-p_VDTC3u.js} +1 -1
  42. package/dist/assets/{TaskListScreen-DZK7I68y.js → TaskListScreen-ey3bya3t.js} +1 -1
  43. package/dist/assets/{TaskRoutes-XZqLu999.js → TaskRoutes-e7xFo9Ej.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-35-dkTu-.js → TransactionDetailRoutes-DGUPG-G4.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-BTk8hKel.js → TransactionDetailScreen-BB5tBHdE.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-N6loT6Tb.js → TransactionListRoutes-D1CLAZ1r.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-C--NVOrM.js → TreasuryRoutes-Dw2aLpt8.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-DX6hUZtV.js → VendorsRoutes-D1DStejL.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-DOt-sno6.js → WiseConfirmationScreen-CqRNL2k6.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-CRKI5nAD.js → ZeniAccountRoutes-DqgQBbks.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-uYvjpFdj.js → ZeniAccountStatementScreen-DN7zMc9n.js} +1 -1
  52. package/dist/assets/{analyticsHelper-C_-TghPV.js → analyticsHelper-B5fcdQll.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-DTPQOzXV.js → getLocaleForTenant-CDIB5Rqc.js} +1 -1
  54. package/dist/assets/{index-BcXEZO_T.js → index-DW3WLCwX.js} +5 -5
  55. package/dist/assets/{routePaths-cxejtx48.js → routePaths-Bf6hqCDy.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CEM3mmbG.js → useAiCfoDashboardSuggestedQuestionsChips-BT0w9R5w.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-CybhtSUM.js → useAskAiCfoHostNavButtonProps-Dnw9TFpe.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-C_-asNx6.js → useCashManagementBanner-CY5tE-AL.js} +1 -1
  59. package/dist/assets/{useChargeCardPusherEvents-BARxawWT.js → useChargeCardPusherEvents-Kefa2Uws.js} +1 -1
  60. package/dist/assets/{useEmailConnectResultRefresh-B4uzu3-e.js → useEmailConnectResultRefresh-DQEVaDNk.js} +1 -1
  61. package/dist/assets/{useInitialThreadRequest-B3-16zoW.js → useInitialThreadRequest-Cm9uHxR_.js} +1 -1
  62. package/dist/assets/{withTransactionSidePanel-Cokro6eW.js → withTransactionSidePanel-DvXF470h.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-4Rd12v3w.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as J,l as mt,o as ct,p as C}from"./core-BSTuY0H-.js";import{eX as H,QN as ue,c6 as pe,EJ as De,kI as dt,EW as oe,EV as re,QO as ut,bn as be,gp as Ue,QP as pt,Na as bt,kx as Le,Nb as Ae,Nc as gt,js as ht,Q5 as ft,jH as St,Ex as It,ub as Rt,jz as yt,Fh as Pe,QQ as $e,QR as At,QS as kt,QT as vt,QU as Ct,QV as Et,F1 as ke,jN as wt,Qe as xt,EX as Bt,EH as Tt,QW as jt,EG as Ft,QX as Dt,EP as ve,F5 as Ut,F4 as Lt,F0 as Pt,QY as Me,Kg as $t,bq as Mt,ES as _t,Fz as Nt,QZ as Ot,Q_ as zt,Fd as Gt,Fa as Ce,PA as Qt,EE as Zt,Q$ as _e,F$ as Ee,G7 as Ht,R0 as Vt,R1 as G,R2 as Wt,R3 as Ne,R4 as Jt,R5 as Oe,R6 as ze,Fp as le,bu as qt,bK as ge,cG as he,fE as Ge,fC as Qe,R7 as Kt,fz as Xt,PN as Yt,R8 as en,R9 as Ze,PR as tn,Qz as nn,Ra as an,QM as sn,G4 as we,G3 as on,Rb as rn,Rc as ln,Rd as mn,Re as cn,Rf as dn,Qk as un,FW as pn,F_ as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,L_ as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-C1K4xiie.js";import{_ as He,J as Ve,C as ee,G as E,z as $,c1 as We,A as te,e as k,aM as xe,o as F,au as X,I as Cn,a as Je,c2 as En,v as Q,a0 as qe,c3 as wn,T as ne,c4 as xn,Y as Bn,D as Tn,B as fe,g as Ke,a9 as jn,bp as Fn,a4 as Dn,y as Xe,c5 as Un,i as Ln}from"./index-BcXEZO_T.js";import{n as N,S as Pn}from"./mui-BNQNnKUH.js";import me from"./NotFoundScreen-iwRtifEl.js";import{S as Be}from"./SetupPagesScreen-DNjkbEBz.js";import{F as Ye}from"./FeaturePreviewScreen-D-CcSiZr.js";import{a as f}from"./sentry-DNaNh7eC.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CybhtSUM.js";import{u as et}from"./useInitialThreadRequest-B3-16zoW.js";import{D as $n}from"./DrawerScreen-Dw68qJE2.js";import{M as tt}from"./MobileAppDrawer-CB-RZZ92.js";import{R as Mn}from"./ReimbursementApprovalRoutes-B9au9MRY.js";import{FallBackRoute as _n}from"./ScreenRoutes-RWbD63jU.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./analyticsHelper-C_-TghPV.js";import"./routePaths-cxejtx48.js";import"./BusinessVerificationPageScreen-D7H_6Ycl.js";import"./ReimbursementApprovalRuleDetailScreen-BOtH5UIX.js";import"./getLocaleForTenant-DTPQOzXV.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]="e803c1d9-7d1c-439e-949e-e772cd5e2bb5",e._sentryDebugIdIdentifier="sentry-dbid-e803c1d9-7d1c-439e-949e-e772cd5e2bb5")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Je.getLocalizedStrings(),On=J((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!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(ve(!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(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=Q(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=$.getSignedInUser(),I=w((p=>H(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(De(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight: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(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop: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:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
1
+ import{j as s}from"./liveblocks-4Rd12v3w.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as J,l as mt,o as ct,p as C}from"./core-BSTuY0H-.js";import{eX as H,QN as ue,c6 as pe,EJ as De,kI as dt,EW as oe,EV as re,QO as ut,bn as be,gp as Ue,QP as pt,Na as bt,kx as Le,Nb as Ae,Nc as gt,js as ht,Q5 as ft,jH as St,Ex as It,ub as Rt,jz as yt,Fh as Pe,QQ as $e,QR as At,QS as kt,QT as vt,QU as Ct,QV as Et,F1 as ke,jN as wt,Qe as xt,EX as Bt,EH as Tt,QW as jt,EG as Ft,QX as Dt,EP as ve,F5 as Ut,F4 as Lt,F0 as Pt,QY as Me,Kg as $t,bq as Mt,ES as _t,Fz as Nt,QZ as Ot,Q_ as zt,Fd as Gt,Fa as Ce,PA as Qt,EE as Zt,Q$ as _e,F$ as Ee,G7 as Ht,R0 as Vt,R1 as G,R2 as Wt,R3 as Ne,R4 as Jt,R5 as Oe,R6 as ze,Fp as le,bu as qt,bK as ge,cG as he,fE as Ge,fC as Qe,R7 as Kt,fz as Xt,PN as Yt,R8 as en,R9 as Ze,PR as tn,Qz as nn,Ra as an,QM as sn,G4 as we,G3 as on,Rb as rn,Rc as ln,Rd as mn,Re as cn,Rf as dn,Qk as un,FW as pn,F_ as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,L_ as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-C1K4xiie.js";import{_ as He,J as Ve,C as ee,G as E,z as $,c1 as We,A as te,e as k,aM as xe,o as F,au as X,I as Cn,a as Je,c2 as En,v as Q,a0 as qe,c3 as wn,T as ne,c4 as xn,Y as Bn,D as Tn,B as fe,g as Ke,a9 as jn,bp as Fn,a4 as Dn,y as Xe,c5 as Un,i as Ln}from"./index-DW3WLCwX.js";import{n as N,S as Pn}from"./mui-BNQNnKUH.js";import me from"./NotFoundScreen-8EvUnY3z.js";import{S as Be}from"./SetupPagesScreen-BDROUOA_.js";import{F as Ye}from"./FeaturePreviewScreen-Cwp5VJhY.js";import{a as f}from"./sentry-DNaNh7eC.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.js";import{u as et}from"./useInitialThreadRequest-Cm9uHxR_.js";import{D as $n}from"./DrawerScreen-BUPBRQzG.js";import{M as tt}from"./MobileAppDrawer-zPhOmrIU.js";import{R as Mn}from"./ReimbursementApprovalRoutes-OfO6QOTb.js";import{FallBackRoute as _n}from"./ScreenRoutes-Bi_xt3-M.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./analyticsHelper-B5fcdQll.js";import"./routePaths-Bf6hqCDy.js";import"./BusinessVerificationPageScreen-BJQI2dfg.js";import"./ReimbursementApprovalRuleDetailScreen-C909zELF.js";import"./getLocaleForTenant-CDIB5Rqc.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]="e803c1d9-7d1c-439e-949e-e772cd5e2bb5",e._sentryDebugIdIdentifier="sentry-dbid-e803c1d9-7d1c-439e-949e-e772cd5e2bb5")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Je.getLocalizedStrings(),On=J((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!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(ve(!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(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=Q(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=$.getSignedInUser(),I=w((p=>H(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(De(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight: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(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop: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:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-4Rd12v3w.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-BSTuY0H-.js";import{eX as v,fT as w,Mr as Te,kx as J,qR as Q,rG as O,kl as Re,jp as Me,ve as W,rL as Ae,bs as Oe,Ms as Fe,bn as ke,wn as De,Mt as Ee,Mu as je,v6 as Pe,Mv as H,Mw as ve,Mx as Le,My as Be,Mz as Ue,MA as I,MB as F,MC as k,MD as N,ME as D,MF as E,dK as Ve,w3 as xe,vT as $,vU as q,w9 as ze,vY as K,wf as Ge,MG as Ye,MH as He,MI as Ne,MJ as $e,MK as qe,fE as Ke,fC as Xe}from"./zeni-epic-state-C1K4xiie.js";import{U as Ze,V as Je,W as Qe,X as We,J as ea,C as ee,G as j,z as ae,Y as aa,T as sa,c as ta,$ as oa,a0 as na,A as ra,e as P,g as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-BcXEZO_T.js";import"./mui-BNQNnKUH.js";import fa from"./NotFoundScreen-iwRtifEl.js";import{F as ma}from"./FeaturePreviewScreen-D-CcSiZr.js";import{a as _}from"./sentry-DNaNh7eC.js";import{u as ua}from"./useInitialThreadRequest-B3-16zoW.js";import{t as X,a as Z,b as _a}from"./routePaths-cxejtx48.js";import{M as ha}from"./MobileAppDrawer-CB-RZZ92.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="fa22b3d5-b394-4dec-85fb-0f5cafb48bda",e._sentryDebugIdIdentifier="sentry-dbid-fa22b3d5-b394-4dec-85fb-0f5cafb48bda")}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(He()),e(Ne()),e($e()),e(qe())},Ca=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:Q(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(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(H({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($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(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?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(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(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>v(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>J(n))),M=d((n=>Q(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(C(!0),s(O(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!L&&g==="Completed"&&h&&(s(O(c.userId,!1,!0,!1)),te(!0))}),[i,L,g,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Oe(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Ze(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Qe({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled: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=Xe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(ga,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-4Rd12v3w.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-BSTuY0H-.js";import{eX as v,fT as w,Mr as Te,kx as J,qR as Q,rG as O,kl as Re,jp as Me,ve as W,rL as Ae,bs as Oe,Ms as Fe,bn as ke,wn as De,Mt as Ee,Mu as je,v6 as Pe,Mv as H,Mw as ve,Mx as Le,My as Be,Mz as Ue,MA as I,MB as F,MC as k,MD as N,ME as D,MF as E,dK as Ve,w3 as xe,vT as $,vU as q,w9 as ze,vY as K,wf as Ge,MG as Ye,MH as He,MI as Ne,MJ as $e,MK as qe,fE as Ke,fC as Xe}from"./zeni-epic-state-C1K4xiie.js";import{U as Ze,V as Je,W as Qe,X as We,J as ea,C as ee,G as j,z as ae,Y as aa,T as sa,c as ta,$ as oa,a0 as na,A as ra,e as P,g as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-DW3WLCwX.js";import"./mui-BNQNnKUH.js";import fa from"./NotFoundScreen-8EvUnY3z.js";import{F as ma}from"./FeaturePreviewScreen-Cwp5VJhY.js";import{a as _}from"./sentry-DNaNh7eC.js";import{u as ua}from"./useInitialThreadRequest-Cm9uHxR_.js";import{t as X,a as Z,b as _a}from"./routePaths-Bf6hqCDy.js";import{M as ha}from"./MobileAppDrawer-zPhOmrIU.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="fa22b3d5-b394-4dec-85fb-0f5cafb48bda",e._sentryDebugIdIdentifier="sentry-dbid-fa22b3d5-b394-4dec-85fb-0f5cafb48bda")}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(He()),e(Ne()),e($e()),e(qe())},Ca=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:Q(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(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(H({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($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(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?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(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(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>v(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>J(n))),M=d((n=>Q(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(C(!0),s(O(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!L&&g==="Completed"&&h&&(s(O(c.userId,!1,!0,!1)),te(!0))}),[i,L,g,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Oe(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Ze(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Qe({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled: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=Xe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(ga,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-4Rd12v3w.js";import{C as j,z as w,aS as y,A as E,e as p,g as F,d9 as P,G as T}from"./index-BcXEZO_T.js";import"./mui-BNQNnKUH.js";import m from"./NotFoundScreen-iwRtifEl.js";import{a as f}from"./sentry-DNaNh7eC.js";import{u as L,j as b,h as A,g as V,n as R,o as U,p as d}from"./core-BSTuY0H-.js";import{eX as z,TF as C,P_ as G,TG as _,vK as K,fK as Y,TH as H,vI as O}from"./zeni-epic-state-C1K4xiie.js";import{R as x}from"./ReferralListScreen-9chFTKdh.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./useAskAiCfoHostNavButtonProps-CybhtSUM.js";import"./MobileAppDrawer-CB-RZZ92.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]="b985e5ef-826d-4790-901a-7dfeebfc1791",e._sentryDebugIdIdentifier="sentry-dbid-b985e5ef-826d-4790-901a-7dfeebfc1791")}catch{}})();const X=R((function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(_()),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)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}}))(P),q=()=>{const e=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b((o=>z(o))),c=A(),v=V(),{useDynamicConfig:g}=j(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=b((o=>C(o))),D=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),k=G(S);f.useEffect((()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(K()),s(!0))}),[]),f.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))}),[l.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(X,{navigate:c,location:v,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(m,{})}),a.jsx(d,{path:"*",element:a.jsx(m,{})})]})}export{de as default};
1
+ import{j as a}from"./liveblocks-4Rd12v3w.js";import{C as j,z as w,aS as y,A as E,e as p,g as F,d9 as P,G as T}from"./index-DW3WLCwX.js";import"./mui-BNQNnKUH.js";import m from"./NotFoundScreen-8EvUnY3z.js";import{a as f}from"./sentry-DNaNh7eC.js";import{u as L,j as b,h as A,g as V,n as R,o as U,p as d}from"./core-BSTuY0H-.js";import{eX as z,TF as C,P_ as G,TG as _,vK as K,fK as Y,TH as H,vI as O}from"./zeni-epic-state-C1K4xiie.js";import{R as x}from"./ReferralListScreen-DTyhwsoO.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.js";import"./MobileAppDrawer-zPhOmrIU.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]="b985e5ef-826d-4790-901a-7dfeebfc1791",e._sentryDebugIdIdentifier="sentry-dbid-b985e5ef-826d-4790-901a-7dfeebfc1791")}catch{}})();const X=R((function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(_()),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)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}}))(P),q=()=>{const e=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b((o=>z(o))),c=A(),v=V(),{useDynamicConfig:g}=j(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=b((o=>C(o))),D=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),k=G(S);f.useEffect((()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(K()),s(!0))}),[]),f.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))}),[l.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(X,{navigate:c,location:v,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(m,{})}),a.jsx(d,{path:"*",element:a.jsx(m,{})})]})}export{de as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DHqNqXXm.js","assets/sentry-DNaNh7eC.js","assets/core-BSTuY0H-.js","assets/zeni-epic-state-C1K4xiie.js","assets/index-BcXEZO_T.js","assets/mui-BNQNnKUH.js","assets/analytics-JEmFuY6G.js","assets/utils-pxMpwT17.js","assets/withTransactionSidePanel-Cokro6eW.js","assets/useAskAiCfoHostNavButtonProps-CybhtSUM.js","assets/TransactionDetailScreen-BTk8hKel.js","assets/decodeURIComponentSafe-BNCMkOsy.js","assets/routePaths-cxejtx48.js","assets/NotFoundScreen-iwRtifEl.js","assets/useInitialThreadRequest-B3-16zoW.js","assets/analyticsHelper-C_-TghPV.js","assets/CompanyPassportScreen-BVAY4gEa.js","assets/MobileAppDrawer-CB-RZZ92.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CEM3mmbG.js","assets/FeaturePreviewScreen-D-CcSiZr.js","assets/ReferralListScreen-9chFTKdh.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-D1a18iDG.js","assets/AddressScreen-BhzQLd2o.js","assets/DomesticWireDetailScreen-CYNJnP1G.js","assets/DrawerScreen-Dw68qJE2.js","assets/SetupPagesScreen-DNjkbEBz.js","assets/BusinessVerificationPageScreen-D7H_6Ycl.js","assets/BillPayApprovalRoutes-DUR0CXqd.js","assets/ReimbursementApprovalRuleDetailScreen-BOtH5UIX.js","assets/getLocaleForTenant-DTPQOzXV.js","assets/ReimbursementRoutes-BpKyNBJb.js","assets/ReimbursementApprovalRoutes-B9au9MRY.js","assets/TransactionListRoutes-N6loT6Tb.js","assets/ZeniAccountStatementScreen-uYvjpFdj.js","assets/SettingsRoutes-CF5KYJhG.js","assets/accountMappingHelper-ut7GsrYE.js","assets/useEmailConnectResultRefresh-B4uzu3-e.js","assets/QBOConnectionScreen-_UbPaBIH.js","assets/empty-DnsKiXU9.js","assets/index-kHgGJTZG.js","assets/url-QenweuSk.js","assets/index-BVB9LccC.js","assets/ReportsRoutes-CLFHU_O2.js","assets/ChargeCardRoutes-COdlwnbU.js","assets/useChargeCardPusherEvents-BARxawWT.js","assets/PeopleRoutes-B8Qsj9Gp.js","assets/ExpenseAutomationRoutes-BhSurnrx.js","assets/TreasuryRoutes-C--NVOrM.js","assets/useCashManagementBanner-C_-asNx6.js","assets/VendorsRoutes-DX6hUZtV.js","assets/pathToGoBack-ujlITM0J.js","assets/ZeniAccountRoutes-CRKI5nAD.js","assets/AddressRoutes-BGgBsLRh.js","assets/PandLWithForecastRoutes-CgigxmZu.js","assets/CustomerOnboardingRoutes-DdKnlwn5.js","assets/TransactionDetailRoutes-35-dkTu-.js","assets/EntityDetailRoutes-CmbxziPm.js","assets/NotificationRoutes-Da00R-X3.js","assets/PerformanceRoutes-CpaSU8a_.js","assets/RewardsRoutes-CHL77VZM.js","assets/TaskRoutes-XZqLu999.js","assets/TaskListScreen-DZK7I68y.js","assets/AiCfoScreen-CK90zIPE.js","assets/CardsAiCfoScreen-D16oDYzS.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,bn as ls,eX as us,fE as cs,fC as ds,gk as ms,fr as _s,cU as pe,cA as hs,fU as Es,cs as ps,bE as Rs,bo as xs,fY as gs,v as Is,LZ as Ts,bs as js,L_ as As,bK as fs,bJ as Ds,bt as ys,co as bs,L$ as Cs,M0 as vs,cQ as Us,cT as ws,cS as Os,cz as Ps,cG as Fs,o9 as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as Te,g1 as ks}from"./zeni-epic-state-C1K4xiie.js";import{j as e}from"./liveblocks-4Rd12v3w.js";import{a as O}from"./sentry-DNaNh7eC.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-BSTuY0H-.js";import{y as Zs,u as Ms,z as D,C as Gs,c as zs,d as $s,G as z,i as Ys,Z as Ws,T as qs,L as F,a as Ae,t as _,P as Js,e as X,l}from"./index-BcXEZO_T.js";import"./mui-BNQNnKUH.js";import{f as fe}from"./analyticsHelper-C_-TghPV.js";import{t as Ks}from"./getLocaleForTenant-DTPQOzXV.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="c32b8ac3-7fb1-4c31-9655-607b75963e97",o._sentryDebugIdIdentifier="sentry-dbid-c32b8ac3-7fb1-4c31-9655-607b75963e97")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-DHqNqXXm.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t((()=>import("./BillPayRoutes-D1a18iDG.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-BpKyNBJb.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t((()=>import("./TransactionListRoutes-N6loT6Tb.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t((()=>import("./SettingsRoutes-CF5KYJhG.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t((()=>import("./ReportsRoutes-CLFHU_O2.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-COdlwnbU.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t((()=>import("./PeopleRoutes-B8Qsj9Gp.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-BhSurnrx.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t((()=>import("./TreasuryRoutes-C--NVOrM.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t((()=>import("./VendorsRoutes-DX6hUZtV.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-CRKI5nAD.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-CLFHU_O2.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])))),st=l((()=>t((()=>import("./AddressRoutes-BGgBsLRh.js")),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21])))),tt=l((()=>t((()=>import("./PeopleRoutes-B8Qsj9Gp.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CgigxmZu.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-DdKnlwn5.js")),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21])))),ot=l((()=>t((()=>import("./VendorsRoutes-DX6hUZtV.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-35-dkTu-.js")),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21])))),De=l((()=>t((()=>import("./EntityDetailRoutes-CmbxziPm.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21])))),it=l((()=>t((()=>import("./DashboardRoutes-DHqNqXXm.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])))),ye=l((()=>t((()=>import("./BillPayRoutes-D1a18iDG.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])))),lt=l((()=>t((()=>import("./SettingsRoutes-CF5KYJhG.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])))),be=l((()=>t((()=>import("./ReimbursementRoutes-BpKyNBJb.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])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-CRKI5nAD.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21])))),ct=l((()=>t((()=>import("./TreasuryRoutes-C--NVOrM.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])))),dt=l((()=>t((()=>import("./TransactionListRoutes-N6loT6Tb.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-COdlwnbU.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])))),_t=l((()=>t((()=>import("./NotificationRoutes-Da00R-X3.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21])))),ht=l((()=>t((()=>import("./PerformanceRoutes-CpaSU8a_.js")),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-BhSurnrx.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])))),pt=l((()=>t((()=>import("./RewardsRoutes-CHL77VZM.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21])))),Rt=l((()=>t((()=>import("./TaskRoutes-XZqLu999.js")),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21])))),xt=l((()=>t((()=>import("./AiCfoScreen-CK90zIPE.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-D16oDYzS.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,21])))),b=l((()=>t((()=>import("./NotFoundScreen-iwRtifEl.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,21])))),gt=l((()=>t((()=>import("./TaskListScreen-DZK7I68y.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21]))));function St({setTenantEmailDomain:o}){const j=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),Z=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),T=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?cs(ne,r):void 0,J=T==="Completed"||A==="Completed"?ds(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>M.tenantId!=null?Es(n,M.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const c=ps(Number(f[0])),s=Number(f[1]),d=Rs(`01-${c<10?`0${c}`:c}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();d.isAfter(S,"month")===!1?j(gs(v,{month:c,year:s})):B("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,c,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),c(Ls(!0)),c(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const d=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),d?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(M,I,j,Me))}),[M,ae,I,j,D]),O.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,c,s,d,S,H){if(c==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&d?.zeniSessionId!=null,os=c==null||c.tenantId!==s,rs=c!=null&&c.excludedResources==null,is=c!=null&&c.externalConnections==null;if(W&&os){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(d?.userId,d?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(d.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(d.userId,s)));if(W){X.identify(d.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(d.userId,s,d.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(d.userId,d.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),O.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(Ts(Y.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,A,r,I]),O.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=Xs,f=3e3){setTimeout((()=>{const c=s=>{if(s>=n.length)return;const d=n[s],S=Qs[d];S!=null?S().then((()=>ee((()=>c(s+1))))).catch((()=>ee((()=>c(s+1))))):c(s+1)};ee((()=>c(0)))}),f)})())}),[T,V]);const w=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,ce=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=de&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&ys(E?.loggedInUserRoleMap),Qe=_e&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=de&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ze===!0||Ye===!0||Xe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(ce===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||ce!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(dt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):j?e.jsx(jt,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-21HP5X_L.js","assets/sentry-DNaNh7eC.js","assets/core-BSTuY0H-.js","assets/zeni-epic-state-C1K4xiie.js","assets/index-DW3WLCwX.js","assets/mui-BNQNnKUH.js","assets/analytics-JEmFuY6G.js","assets/utils-pxMpwT17.js","assets/withTransactionSidePanel-DvXF470h.js","assets/useAskAiCfoHostNavButtonProps-Dnw9TFpe.js","assets/TransactionDetailScreen-BB5tBHdE.js","assets/decodeURIComponentSafe-BNCMkOsy.js","assets/routePaths-Bf6hqCDy.js","assets/NotFoundScreen-8EvUnY3z.js","assets/useInitialThreadRequest-Cm9uHxR_.js","assets/analyticsHelper-B5fcdQll.js","assets/CompanyPassportScreen-BqFRrI6s.js","assets/MobileAppDrawer-zPhOmrIU.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BT0w9R5w.js","assets/FeaturePreviewScreen-Cwp5VJhY.js","assets/ReferralListScreen-DTyhwsoO.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-Bu0-qZ-c.js","assets/AddressScreen-60Qj_YsR.js","assets/DomesticWireDetailScreen-CDRDMeDf.js","assets/DrawerScreen-BUPBRQzG.js","assets/SetupPagesScreen-BDROUOA_.js","assets/BusinessVerificationPageScreen-BJQI2dfg.js","assets/BillPayApprovalRoutes-DYpPCevA.js","assets/ReimbursementApprovalRuleDetailScreen-C909zELF.js","assets/getLocaleForTenant-CDIB5Rqc.js","assets/ReimbursementRoutes-D7NThH82.js","assets/ReimbursementApprovalRoutes-OfO6QOTb.js","assets/TransactionListRoutes-D1CLAZ1r.js","assets/ZeniAccountStatementScreen-DN7zMc9n.js","assets/SettingsRoutes-Cpq8r6km.js","assets/accountMappingHelper-ut7GsrYE.js","assets/useEmailConnectResultRefresh-DQEVaDNk.js","assets/QBOConnectionScreen-QhaMmbnN.js","assets/empty-DnsKiXU9.js","assets/index-kHgGJTZG.js","assets/url-QenweuSk.js","assets/index-BVB9LccC.js","assets/ReportsRoutes-C3CvAXR5.js","assets/ChargeCardRoutes-BAl2IXHY.js","assets/useChargeCardPusherEvents-Kefa2Uws.js","assets/PeopleRoutes-CphF1WML.js","assets/ExpenseAutomationRoutes-CVoR9HYp.js","assets/TreasuryRoutes-Dw2aLpt8.js","assets/useCashManagementBanner-CY5tE-AL.js","assets/VendorsRoutes-D1DStejL.js","assets/pathToGoBack-ujlITM0J.js","assets/ZeniAccountRoutes-DqgQBbks.js","assets/AddressRoutes-Bvp69dKv.js","assets/PandLWithForecastRoutes-CuuM3cYK.js","assets/CustomerOnboardingRoutes-BF11xENe.js","assets/TransactionDetailRoutes-DGUPG-G4.js","assets/EntityDetailRoutes-Q3W6ugXO.js","assets/NotificationRoutes-Cdv9W6jW.js","assets/PerformanceRoutes-DSbitX-g.js","assets/RewardsRoutes-Dxy1QY7_.js","assets/TaskRoutes-e7xFo9Ej.js","assets/TaskListScreen-ey3bya3t.js","assets/AiCfoScreen-Di0AIuiw.js","assets/CardsAiCfoScreen-DZM91jF5.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as ls,eX as us,fE as cs,fC as ds,gk as ms,fr as _s,cU as pe,cA as hs,fU as Es,cs as ps,bE as Rs,bo as xs,fY as gs,v as Is,LZ as Ts,bs as js,L_ as As,bK as fs,bJ as Ds,bt as ys,co as bs,L$ as Cs,M0 as vs,cQ as Us,cT as ws,cS as Os,cz as Ps,cG as Fs,o9 as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as Te,g1 as ks}from"./zeni-epic-state-C1K4xiie.js";import{j as e}from"./liveblocks-4Rd12v3w.js";import{a as O}from"./sentry-DNaNh7eC.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-BSTuY0H-.js";import{y as Zs,u as Ms,z as D,C as Gs,c as zs,d as $s,G as z,i as Ys,Z as Ws,T as qs,L as F,a as Ae,t as _,P as Js,e as X,l}from"./index-DW3WLCwX.js";import"./mui-BNQNnKUH.js";import{f as fe}from"./analyticsHelper-B5fcdQll.js";import{t as Ks}from"./getLocaleForTenant-CDIB5Rqc.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="c32b8ac3-7fb1-4c31-9655-607b75963e97",o._sentryDebugIdIdentifier="sentry-dbid-c32b8ac3-7fb1-4c31-9655-607b75963e97")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-21HP5X_L.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t((()=>import("./BillPayRoutes-Bu0-qZ-c.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-D7NThH82.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t((()=>import("./TransactionListRoutes-D1CLAZ1r.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t((()=>import("./SettingsRoutes-Cpq8r6km.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t((()=>import("./ReportsRoutes-C3CvAXR5.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-BAl2IXHY.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t((()=>import("./PeopleRoutes-CphF1WML.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-CVoR9HYp.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t((()=>import("./TreasuryRoutes-Dw2aLpt8.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t((()=>import("./VendorsRoutes-D1DStejL.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-DqgQBbks.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-C3CvAXR5.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])))),st=l((()=>t((()=>import("./AddressRoutes-Bvp69dKv.js")),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21])))),tt=l((()=>t((()=>import("./PeopleRoutes-CphF1WML.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CuuM3cYK.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-BF11xENe.js")),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21])))),ot=l((()=>t((()=>import("./VendorsRoutes-D1DStejL.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-DGUPG-G4.js")),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21])))),De=l((()=>t((()=>import("./EntityDetailRoutes-Q3W6ugXO.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21])))),it=l((()=>t((()=>import("./DashboardRoutes-21HP5X_L.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])))),ye=l((()=>t((()=>import("./BillPayRoutes-Bu0-qZ-c.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])))),lt=l((()=>t((()=>import("./SettingsRoutes-Cpq8r6km.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])))),be=l((()=>t((()=>import("./ReimbursementRoutes-D7NThH82.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])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-DqgQBbks.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21])))),ct=l((()=>t((()=>import("./TreasuryRoutes-Dw2aLpt8.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])))),dt=l((()=>t((()=>import("./TransactionListRoutes-D1CLAZ1r.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-BAl2IXHY.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])))),_t=l((()=>t((()=>import("./NotificationRoutes-Cdv9W6jW.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21])))),ht=l((()=>t((()=>import("./PerformanceRoutes-DSbitX-g.js")),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-CVoR9HYp.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])))),pt=l((()=>t((()=>import("./RewardsRoutes-Dxy1QY7_.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21])))),Rt=l((()=>t((()=>import("./TaskRoutes-e7xFo9Ej.js")),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21])))),xt=l((()=>t((()=>import("./AiCfoScreen-Di0AIuiw.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-DZM91jF5.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,21])))),b=l((()=>t((()=>import("./NotFoundScreen-8EvUnY3z.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,21])))),gt=l((()=>t((()=>import("./TaskListScreen-ey3bya3t.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21]))));function St({setTenantEmailDomain:o}){const j=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),Z=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),T=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?cs(ne,r):void 0,J=T==="Completed"||A==="Completed"?ds(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>M.tenantId!=null?Es(n,M.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const c=ps(Number(f[0])),s=Number(f[1]),d=Rs(`01-${c<10?`0${c}`:c}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();d.isAfter(S,"month")===!1?j(gs(v,{month:c,year:s})):B("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,c,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),c(Ls(!0)),c(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const d=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),d?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(M,I,j,Me))}),[M,ae,I,j,D]),O.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,c,s,d,S,H){if(c==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&d?.zeniSessionId!=null,os=c==null||c.tenantId!==s,rs=c!=null&&c.excludedResources==null,is=c!=null&&c.externalConnections==null;if(W&&os){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(d?.userId,d?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(d.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(d.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(d.userId,s)));if(W){X.identify(d.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(d.userId,s,d.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(d.userId,d.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),O.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(Ts(Y.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,A,r,I]),O.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=Xs,f=3e3){setTimeout((()=>{const c=s=>{if(s>=n.length)return;const d=n[s],S=Qs[d];S!=null?S().then((()=>ee((()=>c(s+1))))).catch((()=>ee((()=>c(s+1))))):c(s+1)};ee((()=>c(0)))}),f)})())}),[T,V]);const w=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,ce=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=de&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&ys(E?.loggedInUserRoleMap),Qe=_e&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=de&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ze===!0||Ye===!0||Xe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(ce===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||ce!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(dt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):j?e.jsx(jt,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7eC.js";import{h as L,g as Q,u as U,j as S,s as le,n as Z,i as H,o as ne,p as v}from"./core-BSTuY0H-.js";import{bn as De,eX as P,gp as Me,m$ as re,Oi as Te,hF as he,O9 as Ue,qR as _e,kx as be,mX as Re,hH as Be,Ob as Fe,Oa as Oe,QB as Ve,zl as ze,EO as Le,Qa as Ne,Qj as $e,c6 as ae,cL as Qe,cM as Ze,bs as He,Ma as Ge,xN as Ke,QC as Xe,Hd as qe,Eu as Je,El as Se,Ei as Ye,xR as ye,Eo as Ce,Er as Ie,Ex as oe,ub as se,xQ as We,k9 as J,kc as Ee,QD as en,ld as nn,y4 as tn,N1 as an,N2 as on,k7 as sn,QE as cn,ka as ln,rj as rn,MY as dn,MZ as un,rn as pn,hq as gn,Mi as ee,hi as de,hf as mn,hn as fn,Mj as hn,y1 as bn,QF as Sn,QG as yn,EL as Cn,fC as Ae,fE as xe,QH as In,gd as En,Ms as An,y0 as ue,gi as pe,gh as xn,x$ as vn,gg as wn,gf as kn,QI as jn,fH as ve,QJ as Pn,QK as Dn,y7 as Mn,x_ as ge,QL as Tn,fX as Un,xX as _n,bZ as Rn,c5 as Bn,c4 as Fn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-C1K4xiie.js";import{C as Y,G as O,z as k,ag as we,bT as Qn,e as G,g as Zn,bE as Hn,T as K,B as ie,bU as Gn,i as ke,Z as je,bV as Kn,ar as Xn,m as Pe,bW as qn,bX as Jn,bY as Yn,Y as Wn,bZ as et,v as nt,b_ as tt}from"./index-BcXEZO_T.js";import{n as V}from"./mui-BNQNnKUH.js";import{M as B}from"./MobileAppDrawer-CB-RZZ92.js";import{a as X,g as q,m as at}from"./accountMappingHelper-ut7GsrYE.js";import{t as ot,A as st}from"./AddressScreen-BhzQLd2o.js";import $ from"./NotFoundScreen-iwRtifEl.js";import{g as it}from"./analyticsHelper-C_-TghPV.js";import{B as ct}from"./BusinessVerificationPageScreen-D7H_6Ycl.js";import{C as lt}from"./CompanyPassportScreen-BVAY4gEa.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-B4uzu3-e.js";import{q as me}from"./QBOConnectionScreen-_UbPaBIH.js";import{B as ut}from"./BillPayApprovalRoutes-DUR0CXqd.js";import{R as pt}from"./ReimbursementApprovalRoutes-B9au9MRY.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./routePaths-cxejtx48.js";import"./empty-DnsKiXU9.js";import"./pdf-lib-BsIrhPFz.js";import"./index-kHgGJTZG.js";import"./url-QenweuSk.js";import"./index-BVB9LccC.js";import"./decodeURIComponentSafe-BNCMkOsy.js";import"./ReimbursementApprovalRuleDetailScreen-BOtH5UIX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="1b52ba8d-c41c-4d64-952d-3dcbbd87f18a",e._sentryDebugIdIdentifier="sentry-dbid-1b52ba8d-c41c-4d64-952d-3dcbbd87f18a")}catch{}})();const gt=V.div`
1
+ import{j as o}from"./liveblocks-4Rd12v3w.js";import{a as u}from"./sentry-DNaNh7eC.js";import{h as L,g as Q,u as U,j as S,s as le,n as Z,i as H,o as ne,p as v}from"./core-BSTuY0H-.js";import{bn as De,eX as P,gp as Me,m$ as re,Oi as Te,hF as he,O9 as Ue,qR as _e,kx as be,mX as Re,hH as Be,Ob as Fe,Oa as Oe,QB as Ve,zl as ze,EO as Le,Qa as Ne,Qj as $e,c6 as ae,cL as Qe,cM as Ze,bs as He,Ma as Ge,xN as Ke,QC as Xe,Hd as qe,Eu as Je,El as Se,Ei as Ye,xR as ye,Eo as Ce,Er as Ie,Ex as oe,ub as se,xQ as We,k9 as J,kc as Ee,QD as en,ld as nn,y4 as tn,N1 as an,N2 as on,k7 as sn,QE as cn,ka as ln,rj as rn,MY as dn,MZ as un,rn as pn,hq as gn,Mi as ee,hi as de,hf as mn,hn as fn,Mj as hn,y1 as bn,QF as Sn,QG as yn,EL as Cn,fC as Ae,fE as xe,QH as In,gd as En,Ms as An,y0 as ue,gi as pe,gh as xn,x$ as vn,gg as wn,gf as kn,QI as jn,fH as ve,QJ as Pn,QK as Dn,y7 as Mn,x_ as ge,QL as Tn,fX as Un,xX as _n,bZ as Rn,c5 as Bn,c4 as Fn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-C1K4xiie.js";import{C as Y,G as O,z as k,ag as we,bT as Qn,e as G,g as Zn,bE as Hn,T as K,B as ie,bU as Gn,i as ke,Z as je,bV as Kn,ar as Xn,m as Pe,bW as qn,bX as Jn,bY as Yn,Y as Wn,bZ as et,v as nt,b_ as tt}from"./index-DW3WLCwX.js";import{n as V}from"./mui-BNQNnKUH.js";import{M as B}from"./MobileAppDrawer-zPhOmrIU.js";import{a as X,g as q,m as at}from"./accountMappingHelper-ut7GsrYE.js";import{t as ot,A as st}from"./AddressScreen-60Qj_YsR.js";import $ from"./NotFoundScreen-8EvUnY3z.js";import{g as it}from"./analyticsHelper-B5fcdQll.js";import{B as ct}from"./BusinessVerificationPageScreen-BJQI2dfg.js";import{C as lt}from"./CompanyPassportScreen-BqFRrI6s.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-DQEVaDNk.js";import{q as me}from"./QBOConnectionScreen-QhaMmbnN.js";import{B as ut}from"./BillPayApprovalRoutes-DYpPCevA.js";import{R as pt}from"./ReimbursementApprovalRoutes-OfO6QOTb.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./routePaths-Bf6hqCDy.js";import"./empty-DnsKiXU9.js";import"./pdf-lib-BsIrhPFz.js";import"./index-kHgGJTZG.js";import"./url-QenweuSk.js";import"./index-BVB9LccC.js";import"./decodeURIComponentSafe-BNCMkOsy.js";import"./ReimbursementApprovalRuleDetailScreen-C909zELF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="1b52ba8d-c41c-4d64-952d-3dcbbd87f18a",e._sentryDebugIdIdentifier="sentry-dbid-1b52ba8d-c41c-4d64-952d-3dcbbd87f18a")}catch{}})();const gt=V.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-4Rd12v3w.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-BSTuY0H-.js";import{bJ as nn,co as Ce,P_ as ye,eX as V,cA as tn,zB as Q,zl as an,Qa as sn,Qd as on,rC as te,rq as ae,l5 as ie,tJ as z,Qf as Ie,gh as $e,gg as Ge,gf as We,Qg as cn,zK as rn,Eu as Ae,El as ke,Ei as _e,E0 as J,Eo as Ee,Er as ve,Ex as Pe,ub as Te,gw as un,cv as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qh as fn,D0 as le,DE as gn,Qi as Sn,bK as bn,FN as pe,EO as hn,Qj as Cn,Qk as In,FR as An,FV as kn,tC as _n,Kj as En,Gq as he,Hq as me,Ql as vn,Qm as Pn,Qn as Tn,Qo as He,Qp as wn,MM as Dn,Pn as Un,M$ as On,Qq as qe,E4 as Fn,N0 as Vn,E8 as xn,Qr as Oe,GM as Ke,ld as Bn,rt as Je,tL as jn,bE as Re,tX as Ne,cy as Rn,Qs as Xe,fW as Nn,G8 as zn,Gc as Ln,Qt as Mn,Gt as ze,Qu as Zn,Qv as Qn,Qw as $n,Qx as Gn,gp as Wn,AV as Hn,Qy as qn,A_ as Kn,AZ as Jn}from"./zeni-epic-state-C1K4xiie.js";import{T as se,C as oe,G as K,y as we,aS as X,bE as Ye,z as U,A as ce,e as O,B as De,g as $,bF as Xn,au as re,bG as x,bH as Yn,bI as et,ag as Be,bJ as nt,v as Le,av as Me,J as tt,D as at,bK as it,bL as st,bM as ot,a9 as ct}from"./index-BcXEZO_T.js";import{a as h}from"./sentry-DNaNh7eC.js";import{n as Fe,D as rt,S as ut}from"./mui-BNQNnKUH.js";import{M as fe}from"./MobileAppDrawer-CB-RZZ92.js";import N from"./NotFoundScreen-iwRtifEl.js";import{a as Ze}from"./analyticsHelper-C_-TghPV.js";import{d as Qe}from"./routePaths-cxejtx48.js";import{B as Ue}from"./BusinessVerificationPageScreen-D7H_6Ycl.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]="892aeb0f-6b49-4e1c-9afe-51343ea62ce4",e._sentryDebugIdIdentifier="sentry-dbid-892aeb0f-6b49-4e1c-9afe-51343ea62ce4")}catch{}})();const dt=Fe.div`
1
+ import{j as u}from"./liveblocks-4Rd12v3w.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-BSTuY0H-.js";import{bJ as nn,co as Ce,P_ as ye,eX as V,cA as tn,zB as Q,zl as an,Qa as sn,Qd as on,rC as te,rq as ae,l5 as ie,tJ as z,Qf as Ie,gh as $e,gg as Ge,gf as We,Qg as cn,zK as rn,Eu as Ae,El as ke,Ei as _e,E0 as J,Eo as Ee,Er as ve,Ex as Pe,ub as Te,gw as un,cv as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qh as fn,D0 as le,DE as gn,Qi as Sn,bK as bn,FN as pe,EO as hn,Qj as Cn,Qk as In,FR as An,FV as kn,tC as _n,Kj as En,Gq as he,Hq as me,Ql as vn,Qm as Pn,Qn as Tn,Qo as He,Qp as wn,MM as Dn,Pn as Un,M$ as On,Qq as qe,E4 as Fn,N0 as Vn,E8 as xn,Qr as Oe,GM as Ke,ld as Bn,rt as Je,tL as jn,bE as Re,tX as Ne,cy as Rn,Qs as Xe,fW as Nn,G8 as zn,Gc as Ln,Qt as Mn,Gt as ze,Qu as Zn,Qv as Qn,Qw as $n,Qx as Gn,gp as Wn,AV as Hn,Qy as qn,A_ as Kn,AZ as Jn}from"./zeni-epic-state-C1K4xiie.js";import{T as se,C as oe,G as K,y as we,aS as X,bE as Ye,z as U,A as ce,e as O,B as De,g as $,bF as Xn,au as re,bG as x,bH as Yn,bI as et,ag as Be,bJ as nt,v as Le,av as Me,J as tt,D as at,bK as it,bL as st,bM as ot,a9 as ct}from"./index-DW3WLCwX.js";import{a as h}from"./sentry-DNaNh7eC.js";import{n as Fe,D as rt,S as ut}from"./mui-BNQNnKUH.js";import{M as fe}from"./MobileAppDrawer-zPhOmrIU.js";import N from"./NotFoundScreen-8EvUnY3z.js";import{a as Ze}from"./analyticsHelper-B5fcdQll.js";import{d as Qe}from"./routePaths-Bf6hqCDy.js";import{B as Ue}from"./BusinessVerificationPageScreen-BJQI2dfg.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]="892aeb0f-6b49-4e1c-9afe-51343ea62ce4",e._sentryDebugIdIdentifier="sentry-dbid-892aeb0f-6b49-4e1c-9afe-51343ea62ce4")}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-4Rd12v3w.js";import{a as u,b as M,q as T}from"./sentry-DNaNh7eC.js";import{u as A,h as z,j as c,g as D,N as j,n as O}from"./core-BSTuY0H-.js";import{u as P,z as s,y as F,e as E,a as B,f as _,g as N,h as Y,j as V,k as $,m as v}from"./index-BcXEZO_T.js";import{eX as q,LY as J,LZ as W,fA as X,g0 as Z,M2 as H,go as G,cY as K,M3 as b,M4 as Q,M5 as R,bY as y}from"./zeni-epic-state-C1K4xiie.js";import"./mui-BNQNnKUH.js";import{u as ee}from"./useDeviceId-DKhHygcY.js";import{f as te}from"./analyticsHelper-C_-TghPV.js";import{t as ne}from"./getLocaleForTenant-DTPQOzXV.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="6e2de7a4-dce7-47e8-998a-5ff75c0c95b5",t._sentryDebugIdIdentifier="sentry-dbid-6e2de7a4-dce7-47e8-998a-5ff75c0c95b5")}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(R({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(Q(n,a)))},clearSignInError:()=>{t(b())}}}))($),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),k=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>q(e))),I=c((e=>J(e))),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=V();e!=null&&_(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,k,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:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(Y,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-4Rd12v3w.js";import{a as u,b as M,q as T}from"./sentry-DNaNh7eC.js";import{u as A,h as z,j as c,g as D,N as j,n as O}from"./core-BSTuY0H-.js";import{u as P,z as s,y as F,e as E,a as B,f as _,g as N,h as Y,j as V,k as $,m as v}from"./index-DW3WLCwX.js";import{eX as q,LY as J,LZ as W,fA as X,g0 as Z,M2 as H,go as G,cY as K,M3 as b,M4 as Q,M5 as R,bY as y}from"./zeni-epic-state-C1K4xiie.js";import"./mui-BNQNnKUH.js";import{u as ee}from"./useDeviceId-DKhHygcY.js";import{f as te}from"./analyticsHelper-B5fcdQll.js";import{t as ne}from"./getLocaleForTenant-CDIB5Rqc.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="6e2de7a4-dce7-47e8-998a-5ff75c0c95b5",t._sentryDebugIdIdentifier="sentry-dbid-6e2de7a4-dce7-47e8-998a-5ff75c0c95b5")}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(R({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(Q(n,a)))},clearSignInError:()=>{t(b())}}}))($),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),k=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>q(e))),I=c((e=>J(e))),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=V();e!=null&&_(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,k,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:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(Y,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-4Rd12v3w.js";import{a as i}from"./sentry-DNaNh7eC.js";import{u as l,g as c,N as u}from"./core-BSTuY0H-.js";import{z as a,e as n,g as m,B as g}from"./index-BcXEZO_T.js";import{gt as p,Mk as y}from"./zeni-epic-state-C1K4xiie.js";import{n as b}from"./mui-BNQNnKUH.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="9ee5fea3-aa3d-48a1-85f1-d40bb7e27c04",e._sentryDebugIdIdentifier="sentry-dbid-9ee5fea3-aa3d-48a1-85f1-d40bb7e27c04")}catch{}})();function M(){const e=l(),t=c(),r=i.useRef(!1),f=a.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(p()),y(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),a.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(g,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
1
+ import{j as s}from"./liveblocks-4Rd12v3w.js";import{a as i}from"./sentry-DNaNh7eC.js";import{u as l,g as c,N as u}from"./core-BSTuY0H-.js";import{z as a,e as n,g as m,B as g}from"./index-DW3WLCwX.js";import{gt as p,Mk as y}from"./zeni-epic-state-C1K4xiie.js";import{n as b}from"./mui-BNQNnKUH.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="9ee5fea3-aa3d-48a1-85f1-d40bb7e27c04",e._sentryDebugIdIdentifier="sentry-dbid-9ee5fea3-aa3d-48a1-85f1-d40bb7e27c04")}catch{}})();function M(){const e=l(),t=c(),r=i.useRef(!1),f=a.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(p()),y(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),a.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(g,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-4Rd12v3w.js";import{a as G}from"./sentry-DNaNh7eC.js";import{h as v,u as z,g as K,j as b,i as J,n as O}from"./core-BSTuY0H-.js";import{z as R,C as _,G as p,a0 as M,A as Q,e as V,g as W,dc as X,v as g,s as Z}from"./index-BcXEZO_T.js";import{eX as q,TM as F,J5 as I,TN as A,TI as H,It as y,TO as Y,IB as E,HX as aa,J6 as S,TP as B,fz as ea,IY as ta,J1 as sa,IQ as oa,IO as w,J2 as na,IL as ia,TQ as la,TR as ra,TS as ca,TT as ka,TU as T,ej as da,TV as ua,TW as pa}from"./zeni-epic-state-C1K4xiie.js";import{n as Ta}from"./mui-BNQNnKUH.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-CybhtSUM.js";import{M as ga}from"./MobileAppDrawer-CB-RZZ92.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="df3e5a19-6e24-4361-86b1-78b0c40cd343",e._sentryDebugIdIdentifier="sentry-dbid-df3e5a19-6e24-4361-86b1-78b0c40cd343")}catch{}})();const fa=Ta.div`
1
+ import{j as u}from"./liveblocks-4Rd12v3w.js";import{a as G}from"./sentry-DNaNh7eC.js";import{h as v,u as z,g as K,j as b,i as J,n as O}from"./core-BSTuY0H-.js";import{z as R,C as _,G as p,a0 as M,A as Q,e as V,g as W,dc as X,v as g,s as Z}from"./index-DW3WLCwX.js";import{eX as q,TM as F,J5 as I,TN as A,TI as H,It as y,TO as Y,IB as E,HX as aa,J6 as S,TP as B,fz as ea,IY as ta,J1 as sa,IQ as oa,IO as w,J2 as na,IL as ia,TQ as la,TR as ra,TS as ca,TT as ka,TU as T,ej as da,TV as ua,TW as pa}from"./zeni-epic-state-C1K4xiie.js";import{n as Ta}from"./mui-BNQNnKUH.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.js";import{M as ga}from"./MobileAppDrawer-zPhOmrIU.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.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]="df3e5a19-6e24-4361-86b1-78b0c40cd343",e._sentryDebugIdIdentifier="sentry-dbid-df3e5a19-6e24-4361-86b1-78b0c40cd343")}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-4Rd12v3w.js";import se from"./NotFoundScreen-iwRtifEl.js";import{a as l}from"./sentry-DNaNh7eC.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as le,p as f}from"./core-BSTuY0H-.js";import{I8 as H,Ib as ce,I5 as de,eX as M,TI as X,Ip as J,I2 as pe,IV as ue,IO as ke,TJ as K,TK as N,H_ as me,HX as fe,rC as ge,rq as he,l5 as Ie,Ij as Se,TL as Te,IA as be,Ix as Ce,Ie as Ee,Iu as Ge,It as De}from"./zeni-epic-state-C1K4xiie.js";import{z as G,da as xe,_ as je,C as ye,G as b,s as Q,v as w,A as ve,e as V,g as we,db as Re,m as _,au as Fe}from"./index-BcXEZO_T.js";import{n as Be}from"./mui-BNQNnKUH.js";import{u as Pe}from"./useInitialThreadRequest-B3-16zoW.js";import{M as Ue}from"./MobileAppDrawer-CB-RZZ92.js";import Le from"./TaskListScreen-DZK7I68y.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./useAskAiCfoHostNavButtonProps-CybhtSUM.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]="7adeb20f-6d81-41e5-9959-6f939b467b46",e._sentryDebugIdIdentifier="sentry-dbid-7adeb20f-6d81-41e5-9959-6f939b467b46")}catch{}})();function $e(){const e=O(),t=Z(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),c=l.useCallback((()=>{t(H())}),[t]),k=l.useCallback(((o,h,I)=>{t(ce({name:o,content:h,cannedResponseId:I}))}),[t]),a=l.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:c,onSave:k})}let z,q=[];const Ae=re((function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=M(e),c=r.taskGroupId??u,k=c!=null?N(e.taskGroupState,c):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=X(e),{tenantEmailDomain:D}=d,C=r.recurringSourceTaskId,x=C!=null?`${_.appUrl}/${D}/tasks/${encodeURIComponent(C)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==z&&(z=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${_.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:c!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>N(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:c}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??c))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ce(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(J(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(H())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function v(){const e=O(),t=Z(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),c=g((i=>M(i))),k=Pe(c?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:C}=a(b.isTaskGroupAssigneesEnabled),[x,S]=l.useState(!1),[p,W]=l.useState(!1),[F,Y]=l.useState(!1),[B,ee]=l.useState(!1),[P,j]=l.useState(!1),T=l.useRef(!1),E=g((i=>i.taskListState.updateTasksFetchState.fetchState)),U=g((i=>X(i))),L=g((i=>i.taskGroupViewState.fetchState));l.useEffect((()=>{p||(W(!0),t(J(!1,r)))}),[p,t]),l.useEffect((()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))}),[F,t,U.fetchState]),l.useEffect((()=>{B||L==="Completed"||(ee(!0),t(ue()))}),[B,t,L]);const ae=l.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))}),[t,r]);l.useEffect((()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return j(!1),void(T.current=!1);if(E==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=c;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,E,c,s,e]);const $=g((i=>K(i,r))),y=$.fetchState,A=G.getSignedInUser();if(A==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=c,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:[y==="Completed"?n.jsx(ve,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ae,{analytics:V,currentTenant:c,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:A,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:C})]})]})}const Ne=Be.div`
1
+ import{j as n}from"./liveblocks-4Rd12v3w.js";import se from"./NotFoundScreen-8EvUnY3z.js";import{a as l}from"./sentry-DNaNh7eC.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as le,p as f}from"./core-BSTuY0H-.js";import{I8 as H,Ib as ce,I5 as de,eX as M,TI as X,Ip as J,I2 as pe,IV as ue,IO as ke,TJ as K,TK as N,H_ as me,HX as fe,rC as ge,rq as he,l5 as Ie,Ij as Se,TL as Te,IA as be,Ix as Ce,Ie as Ee,Iu as Ge,It as De}from"./zeni-epic-state-C1K4xiie.js";import{z as G,da as xe,_ as je,C as ye,G as b,s as Q,v as w,A as ve,e as V,g as we,db as Re,m as _,au as Fe}from"./index-DW3WLCwX.js";import{n as Be}from"./mui-BNQNnKUH.js";import{u as Pe}from"./useInitialThreadRequest-Cm9uHxR_.js";import{M as Ue}from"./MobileAppDrawer-zPhOmrIU.js";import Le from"./TaskListScreen-ey3bya3t.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.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]="7adeb20f-6d81-41e5-9959-6f939b467b46",e._sentryDebugIdIdentifier="sentry-dbid-7adeb20f-6d81-41e5-9959-6f939b467b46")}catch{}})();function $e(){const e=O(),t=Z(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),c=l.useCallback((()=>{t(H())}),[t]),k=l.useCallback(((o,h,I)=>{t(ce({name:o,content:h,cannedResponseId:I}))}),[t]),a=l.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:c,onSave:k})}let z,q=[];const Ae=re((function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=M(e),c=r.taskGroupId??u,k=c!=null?N(e.taskGroupState,c):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=X(e),{tenantEmailDomain:D}=d,C=r.recurringSourceTaskId,x=C!=null?`${_.appUrl}/${D}/tasks/${encodeURIComponent(C)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==z&&(z=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${_.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:c!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>N(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:c}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??c))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ce(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(J(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(H())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function v(){const e=O(),t=Z(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),c=g((i=>M(i))),k=Pe(c?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:C}=a(b.isTaskGroupAssigneesEnabled),[x,S]=l.useState(!1),[p,W]=l.useState(!1),[F,Y]=l.useState(!1),[B,ee]=l.useState(!1),[P,j]=l.useState(!1),T=l.useRef(!1),E=g((i=>i.taskListState.updateTasksFetchState.fetchState)),U=g((i=>X(i))),L=g((i=>i.taskGroupViewState.fetchState));l.useEffect((()=>{p||(W(!0),t(J(!1,r)))}),[p,t]),l.useEffect((()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))}),[F,t,U.fetchState]),l.useEffect((()=>{B||L==="Completed"||(ee(!0),t(ue()))}),[B,t,L]);const ae=l.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))}),[t,r]);l.useEffect((()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return j(!1),void(T.current=!1);if(E==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=c;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,E,c,s,e]);const $=g((i=>K(i,r))),y=$.fetchState,A=G.getSignedInUser();if(A==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=c,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:[y==="Completed"?n.jsx(ve,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ae,{analytics:V,currentTenant:c,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:A,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:C})]})]})}const Ne=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-4Rd12v3w.js";import i from"./NotFoundScreen-iwRtifEl.js";import{T as r}from"./TransactionDetailScreen-BTk8hKel.js";import"./sentry-DNaNh7eC.js";import{o as s,p as o}from"./core-BSTuY0H-.js";import"./zeni-epic-state-C1K4xiie.js";import"./recharts-DWt5pa4F.js";import"./index-BcXEZO_T.js";import"./mui-BNQNnKUH.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./useAskAiCfoHostNavButtonProps-CybhtSUM.js";import"./decodeURIComponentSafe-BNCMkOsy.js";import"./routePaths-cxejtx48.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-4Rd12v3w.js";import i from"./NotFoundScreen-8EvUnY3z.js";import{T as r}from"./TransactionDetailScreen-BB5tBHdE.js";import"./sentry-DNaNh7eC.js";import{o as s,p as o}from"./core-BSTuY0H-.js";import"./zeni-epic-state-C1K4xiie.js";import"./recharts-DWt5pa4F.js";import"./index-DW3WLCwX.js";import"./mui-BNQNnKUH.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.js";import"./decodeURIComponentSafe-BNCMkOsy.js";import"./routePaths-Bf6hqCDy.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 U}from"./liveblocks-4Rd12v3w.js";import{a as i}from"./sentry-DNaNh7eC.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as be,N as Xe,n as Ze}from"./core-BSTuY0H-.js";import{nO as he,eX as X,gp as Qe,Oi as et,m$ as tt,mJ as at,bn as nt,cU as Ee,bs as ve,ra as q,Nh as H,Oj as Ie,Ok as oe,NH as De,kI as Ce,Ol as ke,NM as se,NN as ce,lx as Ae,Kc as ie,Nb as M,kC as Oe,kA as xe,kM as ot,nB as st,Om as ct,On as it,vr as K,kH as Ue,Jx as we,cZ as rt,c_ as lt,Oo as dt,Na as ut,Op as mt,vn as pt,Oq as ft,Or as ht,Os as yt,Ot as St,Ou as gt,kL as Tt,Ov as bt,Ow as Et,Nc as vt,Ox as It,Oy as Dt,Oz as Ct,Jr as kt,Jh as At,JG as Ot,kN as xt,Kd as ye,nG as Ut}from"./zeni-epic-state-C1K4xiie.js";import{C as J,G as w,z as _e,aS as Pe,y as wt,J as _t,aT as Pt,D as Ft,s as ae,T as Vt,aU as Nt,v as ne,a0 as Bt,aV as zt,e as Fe,aW as Lt,au as Rt,a4 as te}from"./index-BcXEZO_T.js";import{n as Gt,S as jt,D as $t}from"./mui-BNQNnKUH.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-CybhtSUM.js";import{d as Ve}from"./decodeURIComponentSafe-BNCMkOsy.js";import{h as Ne,c as Be,g as Wt,e as qt}from"./routePaths-cxejtx48.js";import{u as Ht}from"./utils-pxMpwT17.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]="3528d59b-c530-4fab-aff7-45b206d6a6a2",t._sentryDebugIdIdentifier="sentry-dbid-3528d59b-c530-4fab-aff7-45b206d6a6a2")}catch{}})();function Jt(t=!0){const e=W(),s=Ke(),{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 Yt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S((h=>X(h))),b=k.companyId,x=S((h=>Qe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:_,capitalizableAccountOverrides:N,dismissedAccounts:R}=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 B=i.useRef(N);B.current=N;const P=i.useRef(R);P.current=R;const z=S((h=>et(h.accountState)),fe),v=i.useMemo((()=>{const h={};for(const E of z)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h}),[z]),l=m!=null?v[m]??null:null,j=i.useCallback((h=>{if(!I)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Z=B.current??{},Y=P.current;for(const L of u)if($.has(L.accountId)&&Z[L.accountId]==null&&Y?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)}),[I]),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&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:x,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 ze(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S((u=>X(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&&ve(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:q(e)})),[t,e]),f=S((u=>H(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,I=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"?ze(f?.transaction):void 0),[f?.fetchState,f?.transaction]),x=S((u=>{if(b!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")})),_=S((u=>oe(u))),N=S((u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")})),R=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[B,P]=i.useState(!1),[z,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{P(!1),v(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{P(!1),v(!1)}),[]),[F,h]=i.useState(!1),E=N?.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)&&(B?z||x==null||(v(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??x}))):(s(se()),s(ce()),P(!0),s(Ae(b))))}),[s,l,f?.fetchState,f?.transaction,b,c,r,p,B,z,x,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:I,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:x,vendorViewDetails:_,uiState:N,firstMonthOfFY:R,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Xt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(xe()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return U.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:U.jsx(Zt,{onClick:y=>y.stopPropagation(),children:U.jsx(Pt,{...A})})})},Zt=Gt(jt)`
1
+ import{j as U}from"./liveblocks-4Rd12v3w.js";import{a as i}from"./sentry-DNaNh7eC.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as be,N as Xe,n as Ze}from"./core-BSTuY0H-.js";import{nO as he,eX as X,gp as Qe,Oi as et,m$ as tt,mJ as at,bn as nt,cU as Ee,bs as ve,ra as q,Nh as H,Oj as Ie,Ok as oe,NH as De,kI as Ce,Ol as ke,NM as se,NN as ce,lx as Ae,Kc as ie,Nb as M,kC as Oe,kA as xe,kM as ot,nB as st,Om as ct,On as it,vr as K,kH as Ue,Jx as we,cZ as rt,c_ as lt,Oo as dt,Na as ut,Op as mt,vn as pt,Oq as ft,Or as ht,Os as yt,Ot as St,Ou as gt,kL as Tt,Ov as bt,Ow as Et,Nc as vt,Ox as It,Oy as Dt,Oz as Ct,Jr as kt,Jh as At,JG as Ot,kN as xt,Kd as ye,nG as Ut}from"./zeni-epic-state-C1K4xiie.js";import{C as J,G as w,z as _e,aS as Pe,y as wt,J as _t,aT as Pt,D as Ft,s as ae,T as Vt,aU as Nt,v as ne,a0 as Bt,aV as zt,e as Fe,aW as Lt,au as Rt,a4 as te}from"./index-DW3WLCwX.js";import{n as Gt,S as jt,D as $t}from"./mui-BNQNnKUH.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.js";import{d as Ve}from"./decodeURIComponentSafe-BNCMkOsy.js";import{h as Ne,c as Be,g as Wt,e as qt}from"./routePaths-Bf6hqCDy.js";import{u as Ht}from"./utils-pxMpwT17.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]="3528d59b-c530-4fab-aff7-45b206d6a6a2",t._sentryDebugIdIdentifier="sentry-dbid-3528d59b-c530-4fab-aff7-45b206d6a6a2")}catch{}})();function Jt(t=!0){const e=W(),s=Ke(),{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 Yt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S((h=>X(h))),b=k.companyId,x=S((h=>Qe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:_,capitalizableAccountOverrides:N,dismissedAccounts:R}=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 B=i.useRef(N);B.current=N;const P=i.useRef(R);P.current=R;const z=S((h=>et(h.accountState)),fe),v=i.useMemo((()=>{const h={};for(const E of z)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h}),[z]),l=m!=null?v[m]??null:null,j=i.useCallback((h=>{if(!I)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Z=B.current??{},Y=P.current;for(const L of u)if($.has(L.accountId)&&Z[L.accountId]==null&&Y?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)}),[I]),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&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:x,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 ze(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S((u=>X(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&&ve(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:q(e)})),[t,e]),f=S((u=>H(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,I=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"?ze(f?.transaction):void 0),[f?.fetchState,f?.transaction]),x=S((u=>{if(b!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")})),_=S((u=>oe(u))),N=S((u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")})),R=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[B,P]=i.useState(!1),[z,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{P(!1),v(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{P(!1),v(!1)}),[]),[F,h]=i.useState(!1),E=N?.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)&&(B?z||x==null||(v(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??x}))):(s(se()),s(ce()),P(!0),s(Ae(b))))}),[s,l,f?.fetchState,f?.transaction,b,c,r,p,B,z,x,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:I,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:x,vendorViewDetails:_,uiState:N,firstMonthOfFY:R,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Xt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(xe()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return U.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:U.jsx(Zt,{onClick:y=>y.stopPropagation(),children:U.jsx(Pt,{...A})})})},Zt=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-4Rd12v3w.js";import{h as Q,g as U,u as W,i as H,j as h,N as z,n as X,o as ve,p as j}from"./core-BSTuY0H-.js";import{eX as K,qR as Z,jW as u,RI as ee,K3 as De,bo as le,RJ as be,kx as te,NJ as ae,RK as ue,RL as Pe,bE as Y,J$ as ye,RM as Ee,RN as me,RO as je,K2 as Ae,RP as xe,RQ as pe,RR as Me,RS as ge,RT as Le,RU as Ce,RV as fe,Lf as Be}from"./zeni-epic-state-C1K4xiie.js";import{a as de,C as ne,G as q,e as G,cq as ce,v as V,s as oe,Y as Re,d as Fe}from"./index-BcXEZO_T.js";import"./mui-BNQNnKUH.js";import{a as g}from"./sentry-DNaNh7eC.js";import{w as se}from"./withTransactionSidePanel-Cokro6eW.js";import{p as ie,c as re}from"./routePaths-cxejtx48.js";import{v as Oe}from"./utils-pxMpwT17.js";import{d as b}from"./decodeURIComponentSafe-BNCMkOsy.js";import{Z as Ge}from"./ZeniAccountStatementScreen-uYvjpFdj.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./useAskAiCfoHostNavButtonProps-CybhtSUM.js";import"./TransactionDetailScreen-BTk8hKel.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]="f21ffd4d-719b-481b-8c34-037829b65d45",a._sentryDebugIdIdentifier="sentry-dbid-f21ffd4d-719b-481b-8c34-037829b65d45")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Oe(a),we=X((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(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=N(e.selectedAccount.tranListType),m=Je(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:N(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:N(e.selectedAccount.tranListType)}))}}}))(ce),J=se((function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find((r=>ze.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=H(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h((r=>Z(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[R,F]=g.useState(void 0),f=g.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,S,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(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&&R!=null&&(M={...f,period:R}),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=>F(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}}},Je=(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},Ne=X((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??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(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=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>Pe(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h((d=>Z(d)))&&r;let i;const O=Ve(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{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,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:he($.length)})})),he=(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,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=X((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??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(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=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>je(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h((d=>Z(d)))&&r;let i;const O=We(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(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,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:Se($.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(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),Xe=X((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=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=H(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h((v=>Me(v.transactionListState,A,p))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((v=>K(v))),f=F.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=F.company?.companyInfo.firstMonthOfFY??1;let r;const w=Ze(p,A,S,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:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(q.isProjectsTransactionsEnabled),d=h((v=>Z(v)))&&$,{areTenantIdsInSync:_}=Re();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,S,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>R(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},Ze=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[h((n=>K(n))).tenantId],t=Fe();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(J,{})}),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(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),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(J,{})}),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(J,{})}),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-4Rd12v3w.js";import{h as Q,g as U,u as W,i as H,j as h,N as z,n as X,o as ve,p as j}from"./core-BSTuY0H-.js";import{eX as K,qR as Z,jW as u,RI as ee,K3 as De,bo as le,RJ as be,kx as te,NJ as ae,RK as ue,RL as Pe,bE as Y,J$ as ye,RM as Ee,RN as me,RO as je,K2 as Ae,RP as xe,RQ as pe,RR as Me,RS as ge,RT as Le,RU as Ce,RV as fe,Lf as Be}from"./zeni-epic-state-C1K4xiie.js";import{a as de,C as ne,G as q,e as G,cq as ce,v as V,s as oe,Y as Re,d as Fe}from"./index-DW3WLCwX.js";import"./mui-BNQNnKUH.js";import{a as g}from"./sentry-DNaNh7eC.js";import{w as se}from"./withTransactionSidePanel-DvXF470h.js";import{p as ie,c as re}from"./routePaths-Bf6hqCDy.js";import{v as Oe}from"./utils-pxMpwT17.js";import{d as b}from"./decodeURIComponentSafe-BNCMkOsy.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DN7zMc9n.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.js";import"./TransactionDetailScreen-BB5tBHdE.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]="f21ffd4d-719b-481b-8c34-037829b65d45",a._sentryDebugIdIdentifier="sentry-dbid-f21ffd4d-719b-481b-8c34-037829b65d45")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Oe(a),we=X((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(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=N(e.selectedAccount.tranListType),m=Je(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:N(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:N(e.selectedAccount.tranListType)}))}}}))(ce),J=se((function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find((r=>ze.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=H(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h((r=>Z(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[R,F]=g.useState(void 0),f=g.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,S,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(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&&R!=null&&(M={...f,period:R}),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=>F(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}}},Je=(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},Ne=X((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??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(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=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>Pe(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h((d=>Z(d)))&&r;let i;const O=Ve(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{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,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:he($.length)})})),he=(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,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=X((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??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(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=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>je(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h((d=>Z(d)))&&r;let i;const O=We(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(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,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:Se($.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(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),Xe=X((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=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=H(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h((v=>Me(v.transactionListState,A,p))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((v=>K(v))),f=F.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=F.company?.companyInfo.firstMonthOfFY??1;let r;const w=Ze(p,A,S,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:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(q.isProjectsTransactionsEnabled),d=h((v=>Z(v)))&&$,{areTenantIdsInSync:_}=Re();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,S,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>R(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},Ze=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[h((n=>K(n))).tenantId],t=Fe();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(J,{})}),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(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),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(J,{})}),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(J,{})}),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-4Rd12v3w.js";import{h as F,g as L,u as B,i as O,j as g,N as D,n as G,o as we,p as k}from"./core-BSTuY0H-.js";import{cp as N,eX as E,Qs as U,Gq as ae,fW as Q,G8 as ne,Qu as Ie,Gt as ke,Qq as je,Qr as se,QG as Ae,Ex as be,ub as Ee,Qw as ve,GM as De,Qt as re,cT as q,yu as oe,fC as Fe,fE as Le,RF as Be,RG as Ue,G9 as Pe,RH as Re,Ga as Me,Gj as Ve,bs as Oe,bJ as Ge,cA as Ne,bK as _e,co as ze,bt as $e,L_ as He,cn as Qe}from"./zeni-epic-state-C1K4xiie.js";import{T as _,ar as qe,z as b,A as z,e as j,cj as Ze,ck as We,cl as H,J as Z,y as Je,Y as Ke,a0 as Xe,C as ie,G as v,D as Ye,B as et,cm as tt,au as W,v as at,cn as nt,s as J,co as st,H as X,cp as rt,i as ot}from"./index-BcXEZO_T.js";import{D as it,n as R,S as ct}from"./mui-BNQNnKUH.js";import lt from"./NotFoundScreen-iwRtifEl.js";import{S as Y}from"./SetupPagesScreen-DNjkbEBz.js";import{a as p}from"./sentry-DNaNh7eC.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-CybhtSUM.js";import{u as dt}from"./useInitialThreadRequest-B3-16zoW.js";import{u as pt}from"./useCashManagementBanner-C_-asNx6.js";import{M as ce}from"./MobileAppDrawer-CB-RZZ92.js";import{F as mt}from"./FeaturePreviewScreen-D-CcSiZr.js";import{a as ee}from"./analyticsHelper-C_-TghPV.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./routePaths-cxejtx48.js";import"./BusinessVerificationPageScreen-D7H_6Ycl.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]="feb79885-04ca-494c-a6ce-0df18819370f",t._sentryDebugIdIdentifier="sentry-dbid-feb79885-04ca-494c-a6ce-0df18819370f")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}}))(Ze);function yt(){const t=F(),a=L(),n=B(),{tenantEmailDomain:r}=O(),m=_(),s=g((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=qe(s),o=N(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,T]=p.useState(!1),[c,l]=p.useState(!1),S=g((I=>E(I))),y=b.getSignedInUserTenant(r)?.companyId??S.companyId,x=b.getSignedInUser(),h=g((I=>U(I,y))),w=g((I=>I.treasurySetupViewState.fetchState)),C=g((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||w!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,w,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(Q()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(T(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=G((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ae(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{H(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{H(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(be(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(We),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=B(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,T]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=b.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),w=g((C=>U(C,x)));if(b.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(Q()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(T(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{H(j,"review",h.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
1
+ import{j as e}from"./liveblocks-4Rd12v3w.js";import{h as F,g as L,u as B,i as O,j as g,N as D,n as G,o as we,p as k}from"./core-BSTuY0H-.js";import{cp as N,eX as E,Qs as U,Gq as ae,fW as Q,G8 as ne,Qu as Ie,Gt as ke,Qq as je,Qr as se,QG as Ae,Ex as be,ub as Ee,Qw as ve,GM as De,Qt as re,cT as q,yu as oe,fC as Fe,fE as Le,RF as Be,RG as Ue,G9 as Pe,RH as Re,Ga as Me,Gj as Ve,bs as Oe,bJ as Ge,cA as Ne,bK as _e,co as ze,bt as $e,L_ as He,cn as Qe}from"./zeni-epic-state-C1K4xiie.js";import{T as _,ar as qe,z as b,A as z,e as j,cj as Ze,ck as We,cl as H,J as Z,y as Je,Y as Ke,a0 as Xe,C as ie,G as v,D as Ye,B as et,cm as tt,au as W,v as at,cn as nt,s as J,co as st,H as X,cp as rt,i as ot}from"./index-DW3WLCwX.js";import{D as it,n as R,S as ct}from"./mui-BNQNnKUH.js";import lt from"./NotFoundScreen-8EvUnY3z.js";import{S as Y}from"./SetupPagesScreen-BDROUOA_.js";import{a as p}from"./sentry-DNaNh7eC.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-Dnw9TFpe.js";import{u as dt}from"./useInitialThreadRequest-Cm9uHxR_.js";import{u as pt}from"./useCashManagementBanner-CY5tE-AL.js";import{M as ce}from"./MobileAppDrawer-zPhOmrIU.js";import{F as mt}from"./FeaturePreviewScreen-Cwp5VJhY.js";import{a as ee}from"./analyticsHelper-B5fcdQll.js";import"./recharts-DWt5pa4F.js";import"./analytics-JEmFuY6G.js";import"./plaid-CR_panTl.js";import"./dnd-dl03JNeH.js";import"./stripe-cKAAJElX.js";import"./lottie-ljbmWmMi.js";import"./lexical-Dh5_f1t7.js";import"./pdf-ZOuFxOIc.js";import"./utils-pxMpwT17.js";import"./routePaths-Bf6hqCDy.js";import"./BusinessVerificationPageScreen-BJQI2dfg.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]="feb79885-04ca-494c-a6ce-0df18819370f",t._sentryDebugIdIdentifier="sentry-dbid-feb79885-04ca-494c-a6ce-0df18819370f")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}}))(Ze);function yt(){const t=F(),a=L(),n=B(),{tenantEmailDomain:r}=O(),m=_(),s=g((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=qe(s),o=N(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,T]=p.useState(!1),[c,l]=p.useState(!1),S=g((I=>E(I))),y=b.getSignedInUserTenant(r)?.companyId??S.companyId,x=b.getSignedInUser(),h=g((I=>U(I,y))),w=g((I=>I.treasurySetupViewState.fetchState)),C=g((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||w!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,w,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(Q()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(T(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=G((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ae(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{H(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{H(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(be(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(We),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=B(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,T]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=b.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),w=g((C=>U(C,x)));if(b.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(Q()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(T(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{H(j,"review",h.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;