@zeniai/web-app-ui 5.0.92-delhi → 5.0.92-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/assets/{AddressRoutes-CE6qbSGk.js → AddressRoutes-CojtNX27.js} +1 -1
  2. package/dist/assets/{AddressScreen-DkNGrVnB.js → AddressScreen-CuGNy3IM.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-CBgoj8T3.js → AiCfoScreen-C9ttZvTj.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-C1lNadBd.js → BillPayApprovalRoutes-CL6D_7dw.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-XB7I7eUG.js → BillPayRoutes-fvhaclgV.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen--jb-_NEK.js → BusinessVerificationPageScreen-Lfv0XtEV.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-DOEHpyTj.js → ChargeCardRoutes-D1tC8X9c.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-D7ikOuXi.js → CompanyPassportScreen-BwKa_LUc.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-DwfBvaYz.js → ConnectionAuthScreen-DcxIu2av.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-CBQd1E02.js → CustomerOnboardingAuthScreen-D76H2W7e.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-BWaOo9Cx.js → CustomerOnboardingRoutes-BjxUysyp.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-dcyTNBEG.js → DashboardRoutes-DSV2c9Hg.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-Dhg7vrEu.js → DefaultTenantHome-BM5doKP0.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-CWJhFUWD.js → DomesticWireDetailScreen-XA3QzAyw.js} +1 -1
  15. package/dist/assets/{DrawerScreen-si6Z3FY7.js → DrawerScreen-2PFFQiRL.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-BWGTBran.js → EntityDetailRoutes-Cpm2zn0V.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-Dx7-sEdk.js → ExpenseAutomationRoutes-BXsX48QL.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-RHOSmVgb.js → FeaturePreviewScreen-DBbU3hyx.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-DX72NDGu.js → HubSpotOAuthCallbackScreen-mukQpBXO.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-DhknIQ1P.js → MagicLinkRoutes-DKenhM-1.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-Csd_nalm.js → MagicLinkSignInScreen-0g7D-J_c.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-L1vMrpyU.js → MobileAppDrawer-C1owD1l4.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-DNyI2qP0.js → NotFoundScreen-CDTENjn3.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-BebZvEZ8.js → NotificationRoutes-CKh3SMt4.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-yciwdWjI.js → OAuthConsentScreen-28eY7N8v.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-BUDeznHk.js → PandLWithForecastRoutes-BRmUZUjI.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-DRqZK4c2.js → PeopleRoutes-DhjKygIO.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-Cw2gpkuZ.js → PerformanceRoutes-CnVEsdqq.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-Diwd8goY.js → QBOConnectionScreen-WmVdfC19.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-FRlmT8bW.js → ReferralListScreen-PEBFhlmP.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-hbP66Q4T.js → ReimbursementApprovalRoutes-BkLIE_PW.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-r2EHynjx.js → ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-CJ0Iu1Bq.js → ReimbursementRoutes-BiXGzoNt.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-Cmgp5c3c.js → ReportsRoutes-C6YTBKT9.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-CoU5gCUm.js → RewardsRoutes-CvorIu5L.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-jHX_ty3K.js → ScreenRoutes-Dk4hXC7S.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-Bc8cfpu9.js → SettingsRoutes-D8oriWAW.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-_y1NMEC2.js → SetupPagesScreen-BHZjOSHJ.js} +1 -1
  39. package/dist/assets/{SignInScreen-CynYCo01.js → SignInScreen-Y6BuxpSu.js} +1 -1
  40. package/dist/assets/{SignOutScreen-Ce_OJMih.js → SignOutScreen-CdkUNxjq.js} +1 -1
  41. package/dist/assets/{TaskListScreen-BCZoyA5m.js → TaskListScreen-DuuYXRRr.js} +1 -1
  42. package/dist/assets/{TaskRoutes-CY23LK4j.js → TaskRoutes-BMtkIWCF.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-CK2GDeKW.js → TransactionDetailRoutes-C3Fb8KbQ.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-Cx-HHzFa.js → TransactionDetailScreen-CUNFX6ex.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-BE9BuMAQ.js → TransactionListRoutes-C4xg5Sow.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-Bd287a7a.js → TreasuryRoutes-DJhXjsa5.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-BrpUXe7d.js → VendorsRoutes-WEkjdTRS.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-BOCW2491.js → WiseConfirmationScreen-B3-p2tMs.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-C8WqQUrk.js → ZeniAccountRoutes-C9ludMke.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-HdIES2jY.js → ZeniAccountStatementScreen-BOPEKBSK.js} +1 -1
  51. package/dist/assets/{analyticsHelper-DXH2vTTa.js → analyticsHelper-Dc1kU1of.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-BM3MG3N6.js → getLocaleForTenant-CXwRfDGi.js} +1 -1
  53. package/dist/assets/{index-MRloqTru.js → index-DWCyzMUX.js} +5 -5
  54. package/dist/assets/{routePaths-Dmzz0h9N.js → routePaths-aWjSXoc2.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CNrlO2ie.js → useAiCfoDashboardSuggestedQuestionsChips-D5XSlLnm.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-DVBsWNa4.js → useAskAiCfoHostNavButtonProps-DbBvDdaC.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-DA9qj7yj.js → useInitialThreadRequest-DS5F5QV2.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-B7h02ghb.js → withTransactionSidePanel-Bsk-acAb.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-dcyTNBEG.js","assets/sentry-CH2pQ4tM.js","assets/core-BeBBWfga.js","assets/zeni-epic-state-5fEaVO5b.js","assets/index-MRloqTru.js","assets/mui-CnlqDSRv.js","assets/analytics-DYzLSwIZ.js","assets/utils-C2zbYn9G.js","assets/withTransactionSidePanel-B7h02ghb.js","assets/useAskAiCfoHostNavButtonProps-DVBsWNa4.js","assets/TransactionDetailScreen-Cx-HHzFa.js","assets/decodeURIComponentSafe-OtMMCMcE.js","assets/routePaths-Dmzz0h9N.js","assets/NotFoundScreen-DNyI2qP0.js","assets/useInitialThreadRequest-DA9qj7yj.js","assets/analyticsHelper-DXH2vTTa.js","assets/CompanyPassportScreen-D7ikOuXi.js","assets/MobileAppDrawer-L1vMrpyU.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CNrlO2ie.js","assets/FeaturePreviewScreen-RHOSmVgb.js","assets/ReferralListScreen-FRlmT8bW.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-XB7I7eUG.js","assets/AddressScreen-DkNGrVnB.js","assets/DomesticWireDetailScreen-CWJhFUWD.js","assets/DrawerScreen-si6Z3FY7.js","assets/SetupPagesScreen-_y1NMEC2.js","assets/BusinessVerificationPageScreen--jb-_NEK.js","assets/BillPayApprovalRoutes-C1lNadBd.js","assets/ReimbursementApprovalRuleDetailScreen-r2EHynjx.js","assets/getLocaleForTenant-BM3MG3N6.js","assets/ReimbursementRoutes-CJ0Iu1Bq.js","assets/ReimbursementApprovalRoutes-hbP66Q4T.js","assets/TransactionListRoutes-BE9BuMAQ.js","assets/ZeniAccountStatementScreen-HdIES2jY.js","assets/SettingsRoutes-Bc8cfpu9.js","assets/accountMappingHelper-DWvcSK1C.js","assets/QBOConnectionScreen-Diwd8goY.js","assets/empty-BaCT02t1.js","assets/index-DS8xe4Yw.js","assets/url-BcTKj4a2.js","assets/index-_ohVjyws.js","assets/ReportsRoutes-Cmgp5c3c.js","assets/ChargeCardRoutes-DOEHpyTj.js","assets/PeopleRoutes-DRqZK4c2.js","assets/ExpenseAutomationRoutes-Dx7-sEdk.js","assets/TreasuryRoutes-Bd287a7a.js","assets/VendorsRoutes-BrpUXe7d.js","assets/pathToGoBack-CHG8tIif.js","assets/ZeniAccountRoutes-C8WqQUrk.js","assets/AddressRoutes-CE6qbSGk.js","assets/PandLWithForecastRoutes-BUDeznHk.js","assets/CustomerOnboardingRoutes-BWaOo9Cx.js","assets/TransactionDetailRoutes-CK2GDeKW.js","assets/EntityDetailRoutes-BWGTBran.js","assets/NotificationRoutes-BebZvEZ8.js","assets/PerformanceRoutes-Cw2gpkuZ.js","assets/RewardsRoutes-CoU5gCUm.js","assets/TaskRoutes-CY23LK4j.js","assets/TaskListScreen-BCZoyA5m.js","assets/AiCfoScreen-CBgoj8T3.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eQ as ls,eY as cs,eW as ds,eX as ms,fH as us,eR as _s,cQ as Ee,cx as Es,fd as As,cp as ps,bE as xs,bq as Is,fi as gs,v as Ts,Jm as hs,bv as js,Jn as Us,bG as Hs,ff as Rs,bF as bs,bs as Ds,cl as ys,Jo as fs,Jp as Cs,cN as vs,cP as Os,cO as Ps,cw as Fs,cC as Ls,mT as Ae,eU as pe,fR as Bs,fm as xe,fO as Ie,fP as ge,fn as ks}from"./zeni-epic-state-5fEaVO5b.js";import{j as e}from"./liveblocks-BNlilBXq.js";import{a as v}from"./sentry-CH2pQ4tM.js";import{h as Vs,l as Ss,i as Ns,u as Ms,g as G,k as Te,N as c,o as Zs,p as t}from"./core-BeBBWfga.js";import{m as ws,u as Gs,z as R,a as zs,c as $s,P as Ys,I as L,d as Js,L as B,O as he,t as _,e as Ws,f as K,l}from"./index-MRloqTru.js";import"./mui-CnlqDSRv.js";import{f as je}from"./analyticsHelper-DXH2vTTa.js";import{t as qs}from"./getLocaleForTenant-BM3MG3N6.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="c50daf91-0bf8-4694-a138-15e39a9a183e",i._sentryDebugIdIdentifier="sentry-dbid-c50daf91-0bf8-4694-a138-15e39a9a183e")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-dcyTNBEG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-XB7I7eUG.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-CJ0Iu1Bq.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-BE9BuMAQ.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-Bc8cfpu9.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-Cmgp5c3c.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DOEHpyTj.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-DRqZK4c2.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-Dx7-sEdk.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-Bd287a7a.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-BrpUXe7d.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-C8WqQUrk.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>n(()=>import("./ReportsRoutes-Cmgp5c3c.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-CE6qbSGk.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-DRqZK4c2.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-BUDeznHk.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-BWaOo9Cx.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-BrpUXe7d.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-CK2GDeKW.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-BWGTBran.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-dcyTNBEG.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]))),He=l(()=>n(()=>import("./BillPayRoutes-XB7I7eUG.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]))),ln=l(()=>n(()=>import("./SettingsRoutes-Bc8cfpu9.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),Re=l(()=>n(()=>import("./ReimbursementRoutes-CJ0Iu1Bq.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]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-C8WqQUrk.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-Bd287a7a.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-BE9BuMAQ.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-DOEHpyTj.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-BebZvEZ8.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),En=l(()=>n(()=>import("./PerformanceRoutes-Cw2gpkuZ.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-Dx7-sEdk.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-CoU5gCUm.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),xn=l(()=>n(()=>import("./TaskRoutes-CY23LK4j.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),In=l(()=>n(()=>import("./AiCfoScreen-CBgoj8T3.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-DNyI2qP0.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gn=l(()=>n(()=>import("./TaskListScreen-BCZoyA5m.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),D=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),q=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),Q=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=G(a=>us(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Js(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&D!=null){const a=X.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=xs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(gs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,D]),v.useEffect(()=>{N||(De(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(xe(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(qs(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?K.identify(a.userId,{tenant_id:a.tenantId}):K.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const J=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(J&&ts){k(xe(s));const W=R.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)))}else J&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),J&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)));if(J){K.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,D,h,f,U))},[D,A]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):A==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Xs,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Rs(r.company),Je=Pe&&Ye===!0&&!C,We=re&&bs(E?.loggedInUserRoleMap),qe=oe&&Ds(E?.loggedInUserRoleMap),Qe=me&&ys(E?.loggedInUserRoleMap),Xe=fs(E?.loggedInUserRoleMap),Ke=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),x=Os(E?.loggedInUserRoleMap),I=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&g,_e=ce&&T,es=me&&p,ss=Je&&x,ns=oe&&I,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Xe===!0||Ke===!0;return R.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(gn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xn,{})}),e.jsx(t,{path:"address/*",element:We||de||Qe||qe?e.jsx(en,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(In,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Rn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Rn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),be=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{b as FallBackRoute,wn as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DSV2c9Hg.js","assets/sentry-CH2pQ4tM.js","assets/core-BeBBWfga.js","assets/zeni-epic-state-5fEaVO5b.js","assets/index-DWCyzMUX.js","assets/mui-CnlqDSRv.js","assets/analytics-DYzLSwIZ.js","assets/utils-C2zbYn9G.js","assets/withTransactionSidePanel-Bsk-acAb.js","assets/useAskAiCfoHostNavButtonProps-DbBvDdaC.js","assets/TransactionDetailScreen-CUNFX6ex.js","assets/decodeURIComponentSafe-OtMMCMcE.js","assets/routePaths-aWjSXoc2.js","assets/NotFoundScreen-CDTENjn3.js","assets/useInitialThreadRequest-DS5F5QV2.js","assets/analyticsHelper-Dc1kU1of.js","assets/CompanyPassportScreen-BwKa_LUc.js","assets/MobileAppDrawer-C1owD1l4.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D5XSlLnm.js","assets/FeaturePreviewScreen-DBbU3hyx.js","assets/ReferralListScreen-PEBFhlmP.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-fvhaclgV.js","assets/AddressScreen-CuGNy3IM.js","assets/DomesticWireDetailScreen-XA3QzAyw.js","assets/DrawerScreen-2PFFQiRL.js","assets/SetupPagesScreen-BHZjOSHJ.js","assets/BusinessVerificationPageScreen-Lfv0XtEV.js","assets/BillPayApprovalRoutes-CL6D_7dw.js","assets/ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js","assets/getLocaleForTenant-CXwRfDGi.js","assets/ReimbursementRoutes-BiXGzoNt.js","assets/ReimbursementApprovalRoutes-BkLIE_PW.js","assets/TransactionListRoutes-C4xg5Sow.js","assets/ZeniAccountStatementScreen-BOPEKBSK.js","assets/SettingsRoutes-D8oriWAW.js","assets/accountMappingHelper-DWvcSK1C.js","assets/QBOConnectionScreen-WmVdfC19.js","assets/empty-BaCT02t1.js","assets/index-DS8xe4Yw.js","assets/url-BcTKj4a2.js","assets/index-_ohVjyws.js","assets/ReportsRoutes-C6YTBKT9.js","assets/ChargeCardRoutes-D1tC8X9c.js","assets/PeopleRoutes-DhjKygIO.js","assets/ExpenseAutomationRoutes-BXsX48QL.js","assets/TreasuryRoutes-DJhXjsa5.js","assets/VendorsRoutes-WEkjdTRS.js","assets/pathToGoBack-CHG8tIif.js","assets/ZeniAccountRoutes-C9ludMke.js","assets/AddressRoutes-CojtNX27.js","assets/PandLWithForecastRoutes-BRmUZUjI.js","assets/CustomerOnboardingRoutes-BjxUysyp.js","assets/TransactionDetailRoutes-C3Fb8KbQ.js","assets/EntityDetailRoutes-Cpm2zn0V.js","assets/NotificationRoutes-CKh3SMt4.js","assets/PerformanceRoutes-CnVEsdqq.js","assets/RewardsRoutes-CvorIu5L.js","assets/TaskRoutes-BMtkIWCF.js","assets/TaskListScreen-DuuYXRRr.js","assets/AiCfoScreen-C9ttZvTj.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eQ as ls,eY as cs,eW as ds,eX as ms,fH as us,eR as _s,cQ as Ee,cx as Es,fd as As,cp as ps,bE as xs,bq as Is,fi as gs,v as Ts,Jm as hs,bv as js,Jn as Us,bG as Hs,ff as Rs,bF as bs,bs as Ds,cl as ys,Jo as fs,Jp as Cs,cN as vs,cP as Os,cO as Ps,cw as Fs,cC as Ls,mT as Ae,eU as pe,fR as Bs,fm as xe,fO as Ie,fP as ge,fn as ks}from"./zeni-epic-state-5fEaVO5b.js";import{j as e}from"./liveblocks-BNlilBXq.js";import{a as v}from"./sentry-CH2pQ4tM.js";import{h as Vs,l as Ss,i as Ns,u as Ms,g as G,k as Te,N as c,o as Zs,p as t}from"./core-BeBBWfga.js";import{m as ws,u as Gs,z as R,a as zs,c as $s,P as Ys,I as L,d as Js,L as B,O as he,t as _,e as Ws,f as K,l}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import{f as je}from"./analyticsHelper-Dc1kU1of.js";import{t as qs}from"./getLocaleForTenant-CXwRfDGi.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="c50daf91-0bf8-4694-a138-15e39a9a183e",i._sentryDebugIdIdentifier="sentry-dbid-c50daf91-0bf8-4694-a138-15e39a9a183e")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-DSV2c9Hg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-fvhaclgV.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-BiXGzoNt.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-C4xg5Sow.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-D8oriWAW.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-C6YTBKT9.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-D1tC8X9c.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-DhjKygIO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-BXsX48QL.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-DJhXjsa5.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-WEkjdTRS.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-C9ludMke.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>n(()=>import("./ReportsRoutes-C6YTBKT9.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-CojtNX27.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-DhjKygIO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-BRmUZUjI.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-BjxUysyp.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-WEkjdTRS.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-C3Fb8KbQ.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-Cpm2zn0V.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-DSV2c9Hg.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]))),He=l(()=>n(()=>import("./BillPayRoutes-fvhaclgV.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]))),ln=l(()=>n(()=>import("./SettingsRoutes-D8oriWAW.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),Re=l(()=>n(()=>import("./ReimbursementRoutes-BiXGzoNt.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]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-C9ludMke.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-DJhXjsa5.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-C4xg5Sow.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-D1tC8X9c.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-CKh3SMt4.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),En=l(()=>n(()=>import("./PerformanceRoutes-CnVEsdqq.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-BXsX48QL.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-CvorIu5L.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),xn=l(()=>n(()=>import("./TaskRoutes-BMtkIWCF.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),In=l(()=>n(()=>import("./AiCfoScreen-C9ttZvTj.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-CDTENjn3.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gn=l(()=>n(()=>import("./TaskListScreen-DuuYXRRr.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),D=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),q=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),Q=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=G(a=>us(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Js(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&D!=null){const a=X.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=xs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(gs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,D]),v.useEffect(()=>{N||(De(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(xe(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(qs(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?K.identify(a.userId,{tenant_id:a.tenantId}):K.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const J=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(J&&ts){k(xe(s));const W=R.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)))}else J&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),J&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)));if(J){K.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,D,h,f,U))},[D,A]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):A==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Xs,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Rs(r.company),Je=Pe&&Ye===!0&&!C,We=re&&bs(E?.loggedInUserRoleMap),qe=oe&&Ds(E?.loggedInUserRoleMap),Qe=me&&ys(E?.loggedInUserRoleMap),Xe=fs(E?.loggedInUserRoleMap),Ke=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),x=Os(E?.loggedInUserRoleMap),I=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&g,_e=ce&&T,es=me&&p,ss=Je&&x,ns=oe&&I,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Xe===!0||Ke===!0;return R.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(gn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xn,{})}),e.jsx(t,{path:"address/*",element:We||de||Qe||qe?e.jsx(en,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(In,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Rn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Rn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),be=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{b as FallBackRoute,wn as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BNlilBXq.js";import{a as p}from"./sentry-CH2pQ4tM.js";import{l as _,u as R,h as P,g as h,n as B,i as F,o as q,p as C}from"./core-BeBBWfga.js";import{bn as xe,eQ as j,gK as de,Lr as Ee,py as Ae,jD as ue,lW as we,gM as je,Lt as ke,Ls as Pe,NS as ve,xL as De,Ce as Me,Nr as Ue,NA as _e,c2 as X,cH as Te,cI as Re,Jy as Be,NT as Fe,Jz as Ve,wb as Oe,NU as Ne,Eu as Le,BW as $e,BN as pe,BK as Ke,wf as ge,BQ as me,BT as fe,BZ as ee,sM as ne,we as He,jf as Q,ji as he,NV as Je,kj as ze,wu as Ge,Km as Ze,Kn as We,jd as qe,NW as Qe,jg as Ye,ra as Xe,NX as en,NY as nn,re as tn,gm as an,JH as se,gt as sn,JI as on,wr as cn,NZ as rn,N_ as ln,Cb as dn,eW as be,eY as Se,N$ as un,fA as pn,JR as gn,wq as oe,fF as ie,fE as mn,wp as fn,fD as hn,fC as bn,O0 as Sn,e$ as Ie,O1 as In,O2 as yn,wx as Cn,wo as ce,O3 as xn,fh as En,wl as An,bV as wn,c1 as jn,c0 as kn,bW as Pn,b_ as vn,bZ as Dn,bY as Mn,b$ as Un,bX as _n}from"./zeni-epic-state-5fEaVO5b.js";import{a as te,I as M,z as x,af as ye,bG as Tn,f as K,h as Rn,d as V,B as ae,bH as Bn,bI as Fn,aq as Vn,j as Ce,bJ as On,bK as Nn,bL as Ln,a9 as $n,V as Kn,bM as Hn,q as Jn,bN as zn}from"./index-MRloqTru.js";import{n as U}from"./mui-CnlqDSRv.js";import{M as v}from"./MobileAppDrawer-L1vMrpyU.js";import{a as L,g as $,m as Gn}from"./accountMappingHelper-DWvcSK1C.js";import{t as Zn,A as Wn}from"./AddressScreen-DkNGrVnB.js";import T from"./NotFoundScreen-DNyI2qP0.js";import{g as qn}from"./analyticsHelper-DXH2vTTa.js";import{B as Qn}from"./BusinessVerificationPageScreen--jb-_NEK.js";import{C as Yn}from"./CompanyPassportScreen-D7ikOuXi.js";import{q as re}from"./QBOConnectionScreen-Diwd8goY.js";import{B as Xn}from"./BillPayApprovalRoutes-C1lNadBd.js";import{R as et}from"./ReimbursementApprovalRoutes-hbP66Q4T.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./routePaths-Dmzz0h9N.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.js";import"./ReimbursementApprovalRuleDetailScreen-r2EHynjx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4f6d1257-73ff-4b21-ad68-16ef577347a1",e._sentryDebugIdIdentifier="sentry-dbid-4f6d1257-73ff-4b21-ad68-16ef577347a1")}catch{}})();const nt=U.div`
1
+ import{j as a}from"./liveblocks-BNlilBXq.js";import{a as p}from"./sentry-CH2pQ4tM.js";import{l as _,u as R,h as P,g as h,n as B,i as F,o as q,p as C}from"./core-BeBBWfga.js";import{bn as xe,eQ as j,gK as de,Lr as Ee,py as Ae,jD as ue,lW as we,gM as je,Lt as ke,Ls as Pe,NS as ve,xL as De,Ce as Me,Nr as Ue,NA as _e,c2 as X,cH as Te,cI as Re,Jy as Be,NT as Fe,Jz as Ve,wb as Oe,NU as Ne,Eu as Le,BW as $e,BN as pe,BK as Ke,wf as ge,BQ as me,BT as fe,BZ as ee,sM as ne,we as He,jf as Q,ji as he,NV as Je,kj as ze,wu as Ge,Km as Ze,Kn as We,jd as qe,NW as Qe,jg as Ye,ra as Xe,NX as en,NY as nn,re as tn,gm as an,JH as se,gt as sn,JI as on,wr as cn,NZ as rn,N_ as ln,Cb as dn,eW as be,eY as Se,N$ as un,fA as pn,JR as gn,wq as oe,fF as ie,fE as mn,wp as fn,fD as hn,fC as bn,O0 as Sn,e$ as Ie,O1 as In,O2 as yn,wx as Cn,wo as ce,O3 as xn,fh as En,wl as An,bV as wn,c1 as jn,c0 as kn,bW as Pn,b_ as vn,bZ as Dn,bY as Mn,b$ as Un,bX as _n}from"./zeni-epic-state-5fEaVO5b.js";import{a as te,I as M,z as x,af as ye,bG as Tn,f as K,h as Rn,d as V,B as ae,bH as Bn,bI as Fn,aq as Vn,j as Ce,bJ as On,bK as Nn,bL as Ln,a9 as $n,V as Kn,bM as Hn,q as Jn,bN as zn}from"./index-DWCyzMUX.js";import{n as U}from"./mui-CnlqDSRv.js";import{M as v}from"./MobileAppDrawer-C1owD1l4.js";import{a as L,g as $,m as Gn}from"./accountMappingHelper-DWvcSK1C.js";import{t as Zn,A as Wn}from"./AddressScreen-CuGNy3IM.js";import T from"./NotFoundScreen-CDTENjn3.js";import{g as qn}from"./analyticsHelper-Dc1kU1of.js";import{B as Qn}from"./BusinessVerificationPageScreen-Lfv0XtEV.js";import{C as Yn}from"./CompanyPassportScreen-BwKa_LUc.js";import{q as re}from"./QBOConnectionScreen-WmVdfC19.js";import{B as Xn}from"./BillPayApprovalRoutes-CL6D_7dw.js";import{R as et}from"./ReimbursementApprovalRoutes-BkLIE_PW.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./routePaths-aWjSXoc2.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.js";import"./ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4f6d1257-73ff-4b21-ad68-16ef577347a1",e._sentryDebugIdIdentifier="sentry-dbid-4f6d1257-73ff-4b21-ad68-16ef577347a1")}catch{}})();const nt=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BNlilBXq.js";import{l as J,u as X,h as Y,i as W,g as E,N as j,n as H,s as Xe}from"./core-BeBBWfga.js";import{bF as Ye,cl as Ie,Nf as ye,eQ as F,cx as en,xW as Z,xL as nn,Nr as tn,Nu as an,qc as ee,q0 as ne,kb as te,si as R,Nw as Ae,fE as $e,fD as We,fC as He,Nx as sn,y3 as on,BW as ke,BN as _e,BK as ve,BB as K,BQ as Pe,BT as Ee,BZ as we,sM as De,fT as cn,cs as rn,eY as un,eW as dn,eX as ln,bs as pn,Ny as mn,AD as le,Bf as yn,Nz as fn,bG as gn,Da as pe,Ce as Sn,NA as bn,NB as hn,De as Cn,Di as In,sb as An,HH as kn,DP as Ce,EI as me,NC as _n,ND as vn,NE as Pn,NF as Ge,NG as En,K9 as wn,ME as Dn,Kl as Tn,NH as qe,NI as xe,E1 as Ke,kj as Un,q3 as Qe,sk as On,bE as Ne,sw as je,cv as Bn,NJ as Je,fg as xn,Dx as Fn,DB as Vn,NK as Nn,DS as ze,NL as jn,NM as zn,NN as Rn,NO as Ln,fM as Mn,ze as Zn,NP as $n,zj as Wn,zi as Hn}from"./zeni-epic-state-5fEaVO5b.js";import{d as ae,a as ie,I as de,m as Te,aN as Q,z as D,v as se,f as w,B as Ue,h as $,bv as Gn,at as oe,bw as V,bx as qn,by as Kn,af as Ve,bz as Qn,q as Re,au as Le,K as Jn,w as Xn,bA as Yn,bB as et,bC as nt,a6 as tt}from"./index-MRloqTru.js";import{a as C}from"./sentry-CH2pQ4tM.js";import{n as Fe,D as at,S as it}from"./mui-CnlqDSRv.js";import{M as fe}from"./MobileAppDrawer-L1vMrpyU.js";import z from"./NotFoundScreen-DNyI2qP0.js";import{a as Me}from"./analyticsHelper-DXH2vTTa.js";import{d as Ze}from"./routePaths-Dmzz0h9N.js";import{B as Be}from"./BusinessVerificationPageScreen--jb-_NEK.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]="89b78f8d-b848-4c83-bc8c-04d531081014",e._sentryDebugIdIdentifier="sentry-dbid-89b78f8d-b848-4c83-bc8c-04d531081014")}catch{}})();const st=Fe.div`
1
+ import{j as u}from"./liveblocks-BNlilBXq.js";import{l as J,u as X,h as Y,i as W,g as E,N as j,n as H,s as Xe}from"./core-BeBBWfga.js";import{bF as Ye,cl as Ie,Nf as ye,eQ as F,cx as en,xW as Z,xL as nn,Nr as tn,Nu as an,qc as ee,q0 as ne,kb as te,si as R,Nw as Ae,fE as $e,fD as We,fC as He,Nx as sn,y3 as on,BW as ke,BN as _e,BK as ve,BB as K,BQ as Pe,BT as Ee,BZ as we,sM as De,fT as cn,cs as rn,eY as un,eW as dn,eX as ln,bs as pn,Ny as mn,AD as le,Bf as yn,Nz as fn,bG as gn,Da as pe,Ce as Sn,NA as bn,NB as hn,De as Cn,Di as In,sb as An,HH as kn,DP as Ce,EI as me,NC as _n,ND as vn,NE as Pn,NF as Ge,NG as En,K9 as wn,ME as Dn,Kl as Tn,NH as qe,NI as xe,E1 as Ke,kj as Un,q3 as Qe,sk as On,bE as Ne,sw as je,cv as Bn,NJ as Je,fg as xn,Dx as Fn,DB as Vn,NK as Nn,DS as ze,NL as jn,NM as zn,NN as Rn,NO as Ln,fM as Mn,ze as Zn,NP as $n,zj as Wn,zi as Hn}from"./zeni-epic-state-5fEaVO5b.js";import{d as ae,a as ie,I as de,m as Te,aN as Q,z as D,v as se,f as w,B as Ue,h as $,bv as Gn,at as oe,bw as V,bx as qn,by as Kn,af as Ve,bz as Qn,q as Re,au as Le,K as Jn,w as Xn,bA as Yn,bB as et,bC as nt,a6 as tt}from"./index-DWCyzMUX.js";import{a as C}from"./sentry-CH2pQ4tM.js";import{n as Fe,D as at,S as it}from"./mui-CnlqDSRv.js";import{M as fe}from"./MobileAppDrawer-C1owD1l4.js";import z from"./NotFoundScreen-CDTENjn3.js";import{a as Me}from"./analyticsHelper-Dc1kU1of.js";import{d as Ze}from"./routePaths-aWjSXoc2.js";import{B as Be}from"./BusinessVerificationPageScreen-Lfv0XtEV.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]="89b78f8d-b848-4c83-bc8c-04d531081014",e._sentryDebugIdIdentifier="sentry-dbid-89b78f8d-b848-4c83-bc8c-04d531081014")}catch{}})();const st=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-BNlilBXq.js";import{a as u,b as T,q as A}from"./sentry-CH2pQ4tM.js";import{h as z,l as D,g as c,u as J,N as M,n as O}from"./core-BeBBWfga.js";import{u as P,z as s,m as j,f as E,O as F,g as _,h as B,J as N,i as V,M as $,j as v}from"./index-MRloqTru.js";import{eQ as q,Jl as Q,Jm as W,eU as G,fm as H,Jr as K,fL as R,cU as X,Js as b,Jt as Y,Ju as Z,bT as y}from"./zeni-epic-state-5fEaVO5b.js";import"./mui-CnlqDSRv.js";import{u as ee}from"./useDeviceId-W860NCQ9.js";import{f as te}from"./analyticsHelper-DXH2vTTa.js";import{t as ne}from"./getLocaleForTenant-BM3MG3N6.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="19470acf-36a9-417f-9d2b-c5c0a5f208b7",t._sentryDebugIdIdentifier="sentry-dbid-19470acf-36a9-417f-9d2b-c5c0a5f208b7")}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)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>q(e)),I=c(e=>Q(e)),m=J(),w=j().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),R().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-BNlilBXq.js";import{a as u,b as T,q as A}from"./sentry-CH2pQ4tM.js";import{h as z,l as D,g as c,u as J,N as M,n as O}from"./core-BeBBWfga.js";import{u as P,z as s,m as j,f as E,O as F,g as _,h as B,J as N,i as V,M as $,j as v}from"./index-DWCyzMUX.js";import{eQ as q,Jl as Q,Jm as W,eU as G,fm as H,Jr as K,fL as R,cU as X,Js as b,Jt as Y,Ju as Z,bT as y}from"./zeni-epic-state-5fEaVO5b.js";import"./mui-CnlqDSRv.js";import{u as ee}from"./useDeviceId-W860NCQ9.js";import{f as te}from"./analyticsHelper-Dc1kU1of.js";import{t as ne}from"./getLocaleForTenant-CXwRfDGi.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="19470acf-36a9-417f-9d2b-c5c0a5f208b7",t._sentryDebugIdIdentifier="sentry-dbid-19470acf-36a9-417f-9d2b-c5c0a5f208b7")}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)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>q(e)),I=c(e=>Q(e)),m=J(),w=j().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),R().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BNlilBXq.js";import{a as n}from"./sentry-CH2pQ4tM.js";import{h as u,u as m,l as p,N as g}from"./core-BeBBWfga.js";import{z as c,B as y,t as h,f as d,h as b}from"./index-MRloqTru.js";import{fQ as x,fR as I,JJ as j}from"./zeni-epic-state-5fEaVO5b.js";import{n as w}from"./mui-CnlqDSRv.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="a7a5119d-a465-4b08-819e-7d0c1c6408ca",e._sentryDebugIdIdentifier="sentry-dbid-a7a5119d-a465-4b08-819e-7d0c1c6408ca")}catch{}})();function U(){const e=u(),t=m(),a=p(),i=n.useRef(!1),f=c.isSignedIn(),r=t.state?.message==="logout",o=r||f;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),j(),h.reset(),d.trackLogout(b.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
1
+ import{j as s}from"./liveblocks-BNlilBXq.js";import{a as n}from"./sentry-CH2pQ4tM.js";import{h as u,u as m,l as p,N as g}from"./core-BeBBWfga.js";import{z as c,B as y,t as h,f as d,h as b}from"./index-DWCyzMUX.js";import{fQ as x,fR as I,JJ as j}from"./zeni-epic-state-5fEaVO5b.js";import{n as w}from"./mui-CnlqDSRv.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="a7a5119d-a465-4b08-819e-7d0c1c6408ca",e._sentryDebugIdIdentifier="sentry-dbid-a7a5119d-a465-4b08-819e-7d0c1c6408ca")}catch{}})();function U(){const e=u(),t=m(),a=p(),i=n.useRef(!1),f=c.isSignedIn(),r=t.state?.message==="logout",o=r||f;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),j(),h.reset(),d.trackLogout(b.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as U,h as _,u as z,g as b,i as Z,n as q}from"./core-BeBBWfga.js";import{z as Q,a as M,I as p,Z as O,v as V,f as W,h as H,cN as J,q as f,p as X}from"./index-MRloqTru.js";import{eQ as Y,QA as R,Ge as E,QB as A,Qw as aa,FG as S,QC as ea,FK as I,Fd as ta,Gf as B,QD as w,gQ as sa,G5 as oa,Ga as na,FZ as ia,FX as F,Gb as la,FU as ra,QE as ca,QF as ka,QG as ua,QH as da,QI as m,ec as pa,QJ as ma,QK as Ta}from"./zeni-epic-state-5fEaVO5b.js";import{n as ga}from"./mui-CnlqDSRv.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import{M as Ga}from"./MobileAppDrawer-L1vMrpyU.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="459a6c43-7c8f-45a0-a97e-d4591324c5f8",e._sentryDebugIdIdentifier="sentry-dbid-459a6c43-7c8f-45a0-a97e-d4591324c5f8")}catch{}})();const ha=ga.div`
1
+ import{j as d}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as U,h as _,u as z,g as b,i as Z,n as q}from"./core-BeBBWfga.js";import{z as Q,a as M,I as p,Z as O,v as V,f as W,h as H,cN as J,q as f,p as X}from"./index-DWCyzMUX.js";import{eQ as Y,QA as R,Ge as E,QB as A,Qw as aa,FG as S,QC as ea,FK as I,Fd as ta,Gf as B,QD as w,gQ as sa,G5 as oa,Ga as na,FZ as ia,FX as F,Gb as la,FU as ra,QE as ca,QF as ka,QG as ua,QH as da,QI as m,ec as pa,QJ as ma,QK as Ta}from"./zeni-epic-state-5fEaVO5b.js";import{n as ga}from"./mui-CnlqDSRv.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{M as Ga}from"./MobileAppDrawer-C1owD1l4.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="459a6c43-7c8f-45a0-a97e-d4591324c5f8",e._sentryDebugIdIdentifier="sentry-dbid-459a6c43-7c8f-45a0-a97e-d4591324c5f8")}catch{}})();const ha=ga.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-BNlilBXq.js";import se from"./NotFoundScreen-DNyI2qP0.js";import{a as c}from"./sentry-CH2pQ4tM.js";import{l as _,h as M,g,u as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-BeBBWfga.js";import{Gi as O,Gl as le,Go as de,eQ as Z,Qw as H,FC as X,Fk as pe,G2 as ue,FX as ke,Qx as W,Qy as z,Fg as me,Fd as fe,qc as ge,q0 as he,kb as Se,Fs as Ie,Qz as Te,Fx as be,Fu as Ge,Fn as Ee,FH as Ce,FG as De}from"./zeni-epic-state-5fEaVO5b.js";import{z as C,cL as Fe,R as xe,a as ye,I as b,p as Y,q as w,v as je,f as N,h as we,cM as ve,j as V,at as Re}from"./index-MRloqTru.js";import{n as Be}from"./mui-CnlqDSRv.js";import{u as Pe}from"./useInitialThreadRequest-DA9qj7yj.js";import{M as Ue}from"./MobileAppDrawer-L1vMrpyU.js";import Le from"./TaskListScreen-BCZoyA5m.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-DVBsWNa4.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]="39f72b5b-a8c0-47f1-94d3-9f7651f173da",e._sentryDebugIdIdentifier="sentry-dbid-39f72b5b-a8c0-47f1-94d3-9f7651f173da")}catch{}})();function $e(){const e=_(),t=M(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(Fe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,Q=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:D}=d,G=r.recurringSourceTaskId,F=G!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,Q=Object.values(I)),Q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:F,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>z(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function j(){const e=_(),t=M(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(b.isTaskGroupAssigneesEnabled),[F,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(X(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return x(!1),void(T.current=!1);if(E==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const $=g(i=>W(i,r)),y=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=v(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(je,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:F,handleDrawerToggle:i=>{I(i)}}),n.jsx(qe,{analytics:N,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:q,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:G})]})]})}const ze=Be.div`
1
+ import{j as n}from"./liveblocks-BNlilBXq.js";import se from"./NotFoundScreen-CDTENjn3.js";import{a as c}from"./sentry-CH2pQ4tM.js";import{l as _,h as M,g,u as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-BeBBWfga.js";import{Gi as O,Gl as le,Go as de,eQ as Z,Qw as H,FC as X,Fk as pe,G2 as ue,FX as ke,Qx as W,Qy as z,Fg as me,Fd as fe,qc as ge,q0 as he,kb as Se,Fs as Ie,Qz as Te,Fx as be,Fu as Ge,Fn as Ee,FH as Ce,FG as De}from"./zeni-epic-state-5fEaVO5b.js";import{z as C,cL as Fe,R as xe,a as ye,I as b,p as Y,q as w,v as je,f as N,h as we,cM as ve,j as V,at as Re}from"./index-DWCyzMUX.js";import{n as Be}from"./mui-CnlqDSRv.js";import{u as Pe}from"./useInitialThreadRequest-DS5F5QV2.js";import{M as Ue}from"./MobileAppDrawer-C1owD1l4.js";import Le from"./TaskListScreen-DuuYXRRr.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-DbBvDdaC.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]="39f72b5b-a8c0-47f1-94d3-9f7651f173da",e._sentryDebugIdIdentifier="sentry-dbid-39f72b5b-a8c0-47f1-94d3-9f7651f173da")}catch{}})();function $e(){const e=_(),t=M(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(Fe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,Q=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:D}=d,G=r.recurringSourceTaskId,F=G!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,Q=Object.values(I)),Q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:F,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>z(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function j(){const e=_(),t=M(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(b.isTaskGroupAssigneesEnabled),[F,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(X(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return x(!1),void(T.current=!1);if(E==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const $=g(i=>W(i,r)),y=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=v(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(je,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:F,handleDrawerToggle:i=>{I(i)}}),n.jsx(qe,{analytics:N,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:q,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:G})]})]})}const ze=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-BNlilBXq.js";import i from"./NotFoundScreen-DNyI2qP0.js";import{T as r}from"./TransactionDetailScreen-Cx-HHzFa.js";import"./sentry-CH2pQ4tM.js";import{o as a,p as o}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./index-MRloqTru.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import"./decodeURIComponentSafe-OtMMCMcE.js";import"./routePaths-Dmzz0h9N.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{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-BNlilBXq.js";import i from"./NotFoundScreen-CDTENjn3.js";import{T as r}from"./TransactionDetailScreen-CUNFX6ex.js";import"./sentry-CH2pQ4tM.js";import{o as a,p as o}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import"./decodeURIComponentSafe-OtMMCMcE.js";import"./routePaths-aWjSXoc2.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{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 k}from"./liveblocks-BNlilBXq.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{h as G,g as S,u as re,l as le,i as de,N as Ge,n as je}from"./core-BeBBWfga.js";import{bn as $e,eQ as K,cQ as ue,bv as me,pT as Q,Kz as w,LA as pe,LB as Y,KZ as he,jO as fe,LC as ge,L2 as Z,L3 as J,kD as Se,Hz as X,Kt as x,jI as Te,jG as ye,jS as He,LD as Me,LE as We,tR as N,jN as ve,GR as Ee,cV as qe,cW as Ke,LF as Qe,Ks as Ye,LG as Ze,tV as Je,LH as Xe,LI as ea,LJ as aa,LK as ta,LL as na,jR as oa,LM as sa,LN as ia,Ku as ca,LO as ra,LP as la,LQ as da,GL as ua,Gz as ma,H1 as pa,jT as ha,HA as ie,GI as fa}from"./zeni-epic-state-5fEaVO5b.js";import{z as De,a as ee,I as L,aN as be,m as ga,K as Sa,aO as Ta,w as ya,p as W,d as va,aP as Ea,q,Z as Da,f as Ce,aQ as ba,at as Ca,a1 as M}from"./index-MRloqTru.js";import{n as Ia,S as ka,D as La}from"./mui-CnlqDSRv.js";import{u as Aa}from"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import{d as Ie}from"./decodeURIComponentSafe-OtMMCMcE.js";import{h as ke,g as Ua,e as xa,c as _a}from"./routePaths-Dmzz0h9N.js";import{t as Va}from"./utils-C2zbYn9G.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]="90238570-3ad4-4b12-88a4-1212c4813c95",a._sentryDebugIdIdentifier="sentry-dbid-90238570-3ad4-4b12-88a4-1212c4813c95")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(L.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Le(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ya(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>K(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:C}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(be.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,A=ae(),y=d.useMemo(()=>({id:a,type:Q(e)}),[a,e]),m=S(u=>w(u,y)),b=S(u=>{const z=w(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return z==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[z]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Le(m?.transaction):void 0,[m?.fetchState,m?.transaction]),v=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),U=S(u=>Y(u)),_=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[F,V]=d.useState(!1),[O,P]=d.useState(!1),[E,c]=d.useState(!1);d.useEffect(()=>{V(!1),P(!1),c(!1)},[a,e]);const H=d.useCallback(()=>{V(!1),P(!1)},[]),[D,I]=d.useState(!1),B=_?.selectedPeriod?.timePeriod;return d.useEffect(()=>{E||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),c(!0)),p!=null&&(!i||l&&g===!1)&&(F?O||v==null||(P(!0),s(X(p,"TransactionDetail",{timeframe:"month",timePeriod:B??v}))):(s(Z()),s(J()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,F,O,v,B]),d.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?I(!0):I(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(x("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:C,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:A,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:b,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:U,uiState:_,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:D,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Ba=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Y(h)),T=()=>{t()},C={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(He("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return k.jsx(La,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:k.jsx(wa,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...C})})})},wa=Ia(ka)`
1
+ import{j as k}from"./liveblocks-BNlilBXq.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{h as G,g as S,u as re,l as le,i as de,N as Ge,n as je}from"./core-BeBBWfga.js";import{bn as $e,eQ as K,cQ as ue,bv as me,pT as Q,Kz as w,LA as pe,LB as Y,KZ as he,jO as fe,LC as ge,L2 as Z,L3 as J,kD as Se,Hz as X,Kt as x,jI as Te,jG as ye,jS as He,LD as Me,LE as We,tR as N,jN as ve,GR as Ee,cV as qe,cW as Ke,LF as Qe,Ks as Ye,LG as Ze,tV as Je,LH as Xe,LI as ea,LJ as aa,LK as ta,LL as na,jR as oa,LM as sa,LN as ia,Ku as ca,LO as ra,LP as la,LQ as da,GL as ua,Gz as ma,H1 as pa,jT as ha,HA as ie,GI as fa}from"./zeni-epic-state-5fEaVO5b.js";import{z as De,a as ee,I as L,aN as be,m as ga,K as Sa,aO as Ta,w as ya,p as W,d as va,aP as Ea,q,Z as Da,f as Ce,aQ as ba,at as Ca,a1 as M}from"./index-DWCyzMUX.js";import{n as Ia,S as ka,D as La}from"./mui-CnlqDSRv.js";import{u as Aa}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{d as Ie}from"./decodeURIComponentSafe-OtMMCMcE.js";import{h as ke,g as Ua,e as xa,c as _a}from"./routePaths-aWjSXoc2.js";import{t as Va}from"./utils-C2zbYn9G.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]="90238570-3ad4-4b12-88a4-1212c4813c95",a._sentryDebugIdIdentifier="sentry-dbid-90238570-3ad4-4b12-88a4-1212c4813c95")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(L.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Le(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ya(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>K(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:C}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(be.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,A=ae(),y=d.useMemo(()=>({id:a,type:Q(e)}),[a,e]),m=S(u=>w(u,y)),b=S(u=>{const z=w(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return z==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[z]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Le(m?.transaction):void 0,[m?.fetchState,m?.transaction]),v=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),U=S(u=>Y(u)),_=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[F,V]=d.useState(!1),[O,P]=d.useState(!1),[E,c]=d.useState(!1);d.useEffect(()=>{V(!1),P(!1),c(!1)},[a,e]);const H=d.useCallback(()=>{V(!1),P(!1)},[]),[D,I]=d.useState(!1),B=_?.selectedPeriod?.timePeriod;return d.useEffect(()=>{E||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),c(!0)),p!=null&&(!i||l&&g===!1)&&(F?O||v==null||(P(!0),s(X(p,"TransactionDetail",{timeframe:"month",timePeriod:B??v}))):(s(Z()),s(J()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,F,O,v,B]),d.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?I(!0):I(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(x("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:C,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:A,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:b,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:U,uiState:_,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:D,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Ba=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Y(h)),T=()=>{t()},C={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(He("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return k.jsx(La,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:k.jsx(wa,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...C})})})},wa=Ia(ka)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BNlilBXq.js";import{l as Q,u as N,h as K,i as W,g as h,N as G,n as X,o as Pe,p as j}from"./core-BeBBWfga.js";import{eQ as U,py as ee,j0 as p,OY as te,Hq as De,bq as le,OZ as ve,jD as ae,K$ as ne,O_ as ue,O$ as Ee,bE as Y,Hm as ye,P0 as be,P1 as me,P2 as je,Hn as Ae,P3 as xe,P4 as pe,P5 as Me,P6 as ge,P7 as Le,P8 as Fe,P9 as fe,ID as Ce,bn as Be}from"./zeni-epic-state-5fEaVO5b.js";import{O as de,a as Z,I as _,f as w,cb as ce,q as H,p as oe,V as Oe,z as ze}from"./index-MRloqTru.js";import"./mui-CnlqDSRv.js";import{a as S}from"./sentry-CH2pQ4tM.js";import{w as se}from"./withTransactionSidePanel-B7h02ghb.js";import{p as ie,c as re}from"./routePaths-Dmzz0h9N.js";import{u as we}from"./utils-C2zbYn9G.js";import{d as v}from"./decodeURIComponentSafe-OtMMCMcE.js";import{Z as Ge}from"./ZeniAccountStatementScreen-HdIES2jY.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import"./TransactionDetailScreen-Cx-HHzFa.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]="e1f32005-3e23-44ea-8f23-e5e1a5107901",a._sentryDebugIdIdentifier="sentry-dbid-e1f32005-3e23-44ea-8f23-e5e1a5107901")}catch{}})();const _e=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>we(a),Re=X(function(a,e){const t=ve(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),u=qe(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:J(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),q=se(function({...a}){const e=Q(),t=N(),n=K(),c=t.pathname.split("/").find(r=>_e.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=W(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>U(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=Z(),{isFeatureEnabled:k}=g(_.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:F,initialTimeframeTick:E}=Ve(o,f,I.bookCloseDate),[C,b]=S.useState(!1),[B,O]=S.useState(void 0),T=S.useMemo(()=>{const r=p(E);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,F]);S.useEffect(()=>{if(!C&&T!=null){b(!0),w.trackTransactionList(void 0,void 0,void 0,T.title);const r=J(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[C,T,n]);let M=T;return T!=null&&B!=null&&(M={...T,period:B}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:F,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),$e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},Ve=(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}}},qe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=X(function(a,e){const t=be(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),w.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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),He=se(function({referrerType:a,...e}){const t=Q(),n=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=W(),f=v(l??""),g=v(u??""),k=v(m??""),x=v(I??""),F=h(d=>Ee(d.transactionListState,g,f,k)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(d=>U(d)),T=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const z=Ne(f,g,k,D,y,A,x);if(z){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Ue(F?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{E||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Je,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(G,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Ze=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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),w.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=W(),f=v(l??""),g=v(u??""),k=v(m??""),x=v(I??""),F=h(d=>je(d.transactionListState,g,f,k)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(d=>U(d)),T=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const z=Ke(f,g,k,D,y,A,x);if(z){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=We(F?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{E||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Ze,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(G,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(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&&Fe(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(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)}`),w.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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=at(e.tenantEmailDomain),n=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=W(),f=v(l??""),g=v(u??""),k=v(A??""),x=!(I!=null&&I==="exclude_subaccounts"),F=h(P=>Me(P.transactionListState,g,f)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(P=>U(P)),T=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=et(f,g,m,D,y,k);if(R){const P={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},Ye=tt(F?.dateRange,P);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&b!=null&&(i={...r,period:b});const{useFeatureGate:z}=Z(),{isFeatureEnabled:L}=z(_.isTransactionCommentingEnabled),{isFeatureEnabled:V}=z(_.isProjectsTransactionsEnabled),d=h(P=>ee(P))&&V,{areTenantIdsInSync:$}=Oe();S.useEffect(()=>{!E&&r!=null&&$&&(C(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[E,r,c,$]);const ke=[l,u,m,D,y,A].filter(P=>P!=null);return R&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:P=>B(P),...e}):s.jsx(G,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(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,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Ce}/statements`;function Yt(){const a=N().state?.referrer,e=ze.getSignedInUser(),t=Be(e),{useFeatureGate:n}=Z(),{isFeatureEnabled:c}=n(_.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>U(m)).tenantId],{isFeatureEnabled:l}=n(_.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(Pe,{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(q,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(q,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{Yt as default};
1
+ import{j as s}from"./liveblocks-BNlilBXq.js";import{l as Q,u as N,h as K,i as W,g as h,N as G,n as X,o as Pe,p as j}from"./core-BeBBWfga.js";import{eQ as U,py as ee,j0 as p,OY as te,Hq as De,bq as le,OZ as ve,jD as ae,K$ as ne,O_ as ue,O$ as Ee,bE as Y,Hm as ye,P0 as be,P1 as me,P2 as je,Hn as Ae,P3 as xe,P4 as pe,P5 as Me,P6 as ge,P7 as Le,P8 as Fe,P9 as fe,ID as Ce,bn as Be}from"./zeni-epic-state-5fEaVO5b.js";import{O as de,a as Z,I as _,f as w,cb as ce,q as H,p as oe,V as Oe,z as ze}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import{a as S}from"./sentry-CH2pQ4tM.js";import{w as se}from"./withTransactionSidePanel-Bsk-acAb.js";import{p as ie,c as re}from"./routePaths-aWjSXoc2.js";import{u as we}from"./utils-C2zbYn9G.js";import{d as v}from"./decodeURIComponentSafe-OtMMCMcE.js";import{Z as Ge}from"./ZeniAccountStatementScreen-BOPEKBSK.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import"./TransactionDetailScreen-CUNFX6ex.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]="e1f32005-3e23-44ea-8f23-e5e1a5107901",a._sentryDebugIdIdentifier="sentry-dbid-e1f32005-3e23-44ea-8f23-e5e1a5107901")}catch{}})();const _e=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>we(a),Re=X(function(a,e){const t=ve(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),u=qe(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:J(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),q=se(function({...a}){const e=Q(),t=N(),n=K(),c=t.pathname.split("/").find(r=>_e.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=W(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>U(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=Z(),{isFeatureEnabled:k}=g(_.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:F,initialTimeframeTick:E}=Ve(o,f,I.bookCloseDate),[C,b]=S.useState(!1),[B,O]=S.useState(void 0),T=S.useMemo(()=>{const r=p(E);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,F]);S.useEffect(()=>{if(!C&&T!=null){b(!0),w.trackTransactionList(void 0,void 0,void 0,T.title);const r=J(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[C,T,n]);let M=T;return T!=null&&B!=null&&(M={...T,period:B}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:F,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),$e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},Ve=(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}}},qe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=X(function(a,e){const t=be(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),w.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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),He=se(function({referrerType:a,...e}){const t=Q(),n=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=W(),f=v(l??""),g=v(u??""),k=v(m??""),x=v(I??""),F=h(d=>Ee(d.transactionListState,g,f,k)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(d=>U(d)),T=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const z=Ne(f,g,k,D,y,A,x);if(z){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Ue(F?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{E||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Je,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(G,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Ze=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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),w.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=W(),f=v(l??""),g=v(u??""),k=v(m??""),x=v(I??""),F=h(d=>je(d.transactionListState,g,f,k)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(d=>U(d)),T=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const z=Ke(f,g,k,D,y,A,x);if(z){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=We(F?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{E||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Ze,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(G,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(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&&Fe(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(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)}`),w.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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=at(e.tenantEmailDomain),n=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=W(),f=v(l??""),g=v(u??""),k=v(A??""),x=!(I!=null&&I==="exclude_subaccounts"),F=h(P=>Me(P.transactionListState,g,f)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(P=>U(P)),T=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=et(f,g,m,D,y,k);if(R){const P={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},Ye=tt(F?.dateRange,P);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&b!=null&&(i={...r,period:b});const{useFeatureGate:z}=Z(),{isFeatureEnabled:L}=z(_.isTransactionCommentingEnabled),{isFeatureEnabled:V}=z(_.isProjectsTransactionsEnabled),d=h(P=>ee(P))&&V,{areTenantIdsInSync:$}=Oe();S.useEffect(()=>{!E&&r!=null&&$&&(C(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[E,r,c,$]);const ke=[l,u,m,D,y,A].filter(P=>P!=null);return R&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:P=>B(P),...e}):s.jsx(G,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(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,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Ce}/statements`;function Yt(){const a=N().state?.referrer,e=ze.getSignedInUser(),t=Be(e),{useFeatureGate:n}=Z(),{isFeatureEnabled:c}=n(_.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>U(m)).tenantId],{isFeatureEnabled:l}=n(_.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(Pe,{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(q,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(q,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{Yt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-BNlilBXq.js";import{l as U,u as B,h as P,i as O,g as f,N as L,n as V,o as Ie,p as k}from"./core-BeBBWfga.js";import{cm as M,eQ as D,NJ as R,DP as ae,fg as Z,Dx as ne,NL as Te,DS as we,NH as Ce,NI as se,N_ as ke,BZ as je,sM as be,NN as Ae,E1 as Ee,NK as re,cP as H,wU as oe,eW as ve,eY as De,OV as Fe,OW as Le,Dy as Ue,OX as Be,Dz as Pe,DI as Re,bv as Ne,bF as Oe,cx as Ve,bG as Me,cl as _e,ff as ze,bs as Ge,Jn as $e,ck as qe}from"./zeni-epic-state-5fEaVO5b.js";import{d as _,aq as Ze,z as A,v as z,f as j,c4 as He,c5 as Ke,c6 as q,K,m as We,V as Je,Z as Qe,a as ie,I as v,w as Xe,B as Ye,c7 as et,at as W,q as tt,c8 as at,p as J,c9 as nt,T as X,ca as st,a9 as rt}from"./index-MRloqTru.js";import{D as ot,n as N,S as it}from"./mui-CnlqDSRv.js";import ct from"./NotFoundScreen-DNyI2qP0.js";import{S as Y}from"./SetupPagesScreen-_y1NMEC2.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import{u as ut}from"./useInitialThreadRequest-DA9qj7yj.js";import{M as ce}from"./MobileAppDrawer-L1vMrpyU.js";import{F as dt}from"./FeaturePreviewScreen-RHOSmVgb.js";import{a as ee}from"./analyticsHelper-DXH2vTTa.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./routePaths-Dmzz0h9N.js";import"./BusinessVerificationPageScreen--jb-_NEK.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]="51578642-23ea-49dd-b6dd-f98f612f4540",t._sentryDebugIdIdentifier="sentry-dbid-51578642-23ea-49dd-b6dd-f98f612f4540")}catch{}})();const pt=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Te(r))}}})(He);function mt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=Ze(r),s=M(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,w]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,I=A.getSignedInUser(),S=f(C=>R(C,y)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(I==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,T,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(Z()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(w(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{q(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),yt=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,w]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),I=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),T=f(x=>R(x,I));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||I==null||(s(!0),o(ae(I,!0,!1)))},[m,u,I,o]),d.useEffect(()=>{l||c!=="Not-Started"||I==null||(i(!0),o(Z()))},[l,c,I,o]),d.useEffect(()=>{g||h!=="Not-Started"||I==null||(w(!0),o(ne()))},[g,h,I,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{q(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=N.div`
1
+ import{j as e}from"./liveblocks-BNlilBXq.js";import{l as U,u as B,h as P,i as O,g as f,N as L,n as V,o as Ie,p as k}from"./core-BeBBWfga.js";import{cm as M,eQ as D,NJ as R,DP as ae,fg as Z,Dx as ne,NL as Te,DS as we,NH as Ce,NI as se,N_ as ke,BZ as je,sM as be,NN as Ae,E1 as Ee,NK as re,cP as H,wU as oe,eW as ve,eY as De,OV as Fe,OW as Le,Dy as Ue,OX as Be,Dz as Pe,DI as Re,bv as Ne,bF as Oe,cx as Ve,bG as Me,cl as _e,ff as ze,bs as Ge,Jn as $e,ck as qe}from"./zeni-epic-state-5fEaVO5b.js";import{d as _,aq as Ze,z as A,v as z,f as j,c4 as He,c5 as Ke,c6 as q,K,m as We,V as Je,Z as Qe,a as ie,I as v,w as Xe,B as Ye,c7 as et,at as W,q as tt,c8 as at,p as J,c9 as nt,T as X,ca as st,a9 as rt}from"./index-DWCyzMUX.js";import{D as ot,n as N,S as it}from"./mui-CnlqDSRv.js";import ct from"./NotFoundScreen-CDTENjn3.js";import{S as Y}from"./SetupPagesScreen-BHZjOSHJ.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{u as ut}from"./useInitialThreadRequest-DS5F5QV2.js";import{M as ce}from"./MobileAppDrawer-C1owD1l4.js";import{F as dt}from"./FeaturePreviewScreen-DBbU3hyx.js";import{a as ee}from"./analyticsHelper-Dc1kU1of.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./routePaths-aWjSXoc2.js";import"./BusinessVerificationPageScreen-Lfv0XtEV.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]="51578642-23ea-49dd-b6dd-f98f612f4540",t._sentryDebugIdIdentifier="sentry-dbid-51578642-23ea-49dd-b6dd-f98f612f4540")}catch{}})();const pt=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Te(r))}}})(He);function mt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=Ze(r),s=M(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,w]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,I=A.getSignedInUser(),S=f(C=>R(C,y)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(I==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,T,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(Z()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(w(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{q(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),yt=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,w]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),I=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),T=f(x=>R(x,I));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||I==null||(s(!0),o(ae(I,!0,!1)))},[m,u,I,o]),d.useEffect(()=>{l||c!=="Not-Started"||I==null||(i(!0),o(Z()))},[l,c,I,o]),d.useEffect(()=>{g||h!=="Not-Started"||I==null||(w(!0),o(ne()))},[g,h,I,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{q(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as J,u as Y,i as R,g as S,n as K,h as z,o as at,p as B,N as G}from"./core-BeBBWfga.js";import{eQ as V,Kp as Ee,Kq as Ue,fT as X,cs as Ie,ct as be,vt as St,Kr as nt,vx as zt,Iu as ee,jD as te,vr as Yt,vl as qt,Ks as Ne,vd as Ht,vc as Wt,v6 as Qt,vi as Zt,vy as Xt,Kt as he,Ku as Me,ve as ea,Kv as pe,f1 as ft,vN as gt,vG as vt,Kw as xt,op as Tt,vB as yt,vz as Dt,Kx as Ct,vU as Et,vR as It,vC as bt,vT as Je,GR as kt,Ky as ta,Kz as aa,cv as na,KA as sa,KB as oa,KC as me,KD as ie,KE as ke,Iv as Ke,w7 as ye,It as De,vW as wt,vu as Ge,KF as la,Iw as H,KG as $e,vo as ia,KH as ca,KI as da,KJ as ze,KK as Ye,KL as qe,KM as He,w1 as we,KN as At,vK as jt,KO as ra,KP as ua,KQ as ha,KR as pa,KS as ma,KT as Sa,KU as fa,KV as ga,sY as va,sZ as xa,HA as je,KW as Ta,KX as ya,j0 as Fe,bq as Da,KY as Ca,KZ as Ea,kB as Ia,kK as ba,Hz as Le,bE as st,K_ as Ft,He as Lt,K$ as ka,L0 as wa,L1 as Aa,kM as ja,L2 as ot,L3 as lt,L4 as it,L5 as ct,L6 as Fa,kI as La,L7 as Pa,kL as _a,L8 as Va,L9 as Pt,HW as _t,j$ as Ba,La as Oa,Lb as Pe,Lc as Vt,HU as Bt,yk as Ra,Ld as Ua,Le as Na,kj as Ot,Lf as Ma,Lg as Ja,I6 as Ka,qx as Ga,Lh as Rt,Li as dt,I3 as _e,Lj as rt,Lk as $a,I8 as za,Ll as Ya,Lm as qa,Ln as Ha,Lo as Wa,Lp as Qa,qA as Za,Lq as Xa,Ix as en,Lr as tn,HN as Ve,gM as an,Ls as nn,Lt as sn,gK as on,Lu as ln,Lv as cn,yo as dn,Lw as rn,Lx as un,Ly as hn,Lz as pn,k3 as mn,bn as Sn,eY as fn,eW as gn}from"./zeni-epic-state-5fEaVO5b.js";import{z as U,aq as Be,B as Ut,v as Q,f as j,a1 as Z,aw as vn,q as M,O as Ce,R as ce,ax as We,ay as xn,az as Tn,p as Qe,aA as yn,m as Dn,K as de,w as Ze,a as ae,I as $,aB as Cn,j as Xe,Z as Se,aC as En,aD as Nt,V as In,aE as bn,d as kn,aF as wn,at as Mt,aG as An,o as W,S as jn,y as Jt,Y as Fn,aH as Ln,aI as Pn,h as et,aJ as _n,aK as Vn,_ as Bn,aL as On,aM as Rn}from"./index-MRloqTru.js";import{n as N,D as Un,S as Kt}from"./mui-CnlqDSRv.js";import{t as Nn,A as Mn}from"./AddressScreen-DkNGrVnB.js";import le from"./NotFoundScreen-DNyI2qP0.js";import{F as Jn}from"./FeaturePreviewScreen-RHOSmVgb.js";import{c as q,v as tt,d as Kn}from"./routePaths-Dmzz0h9N.js";import{p as Gt}from"./pathToGoBack-CHG8tIif.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import{M as ge}from"./MobileAppDrawer-L1vMrpyU.js";import{D as Gn}from"./DrawerScreen-si6Z3FY7.js";import{g as $n,m as zn}from"./accountMappingHelper-DWvcSK1C.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="b42c488e-280c-4374-a4e6-81e0d06759b5",e._sentryDebugIdIdentifier="sentry-dbid-b42c488e-280c-4374-a4e6-81e0d06759b5")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=K(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=R(),{scheduleType:o}=R();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>V(f)),r=Ee(o)??"accrued_expenses",h=U.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},$t=e=>{const a=Yn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=Ie(s.controllers),i=be(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=N.div`
1
+ import{j as l}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as J,u as Y,i as R,g as S,n as K,h as z,o as at,p as B,N as G}from"./core-BeBBWfga.js";import{eQ as V,Kp as Ee,Kq as Ue,fT as X,cs as Ie,ct as be,vt as St,Kr as nt,vx as zt,Iu as ee,jD as te,vr as Yt,vl as qt,Ks as Ne,vd as Ht,vc as Wt,v6 as Qt,vi as Zt,vy as Xt,Kt as he,Ku as Me,ve as ea,Kv as pe,f1 as ft,vN as gt,vG as vt,Kw as xt,op as Tt,vB as yt,vz as Dt,Kx as Ct,vU as Et,vR as It,vC as bt,vT as Je,GR as kt,Ky as ta,Kz as aa,cv as na,KA as sa,KB as oa,KC as me,KD as ie,KE as ke,Iv as Ke,w7 as ye,It as De,vW as wt,vu as Ge,KF as la,Iw as H,KG as $e,vo as ia,KH as ca,KI as da,KJ as ze,KK as Ye,KL as qe,KM as He,w1 as we,KN as At,vK as jt,KO as ra,KP as ua,KQ as ha,KR as pa,KS as ma,KT as Sa,KU as fa,KV as ga,sY as va,sZ as xa,HA as je,KW as Ta,KX as ya,j0 as Fe,bq as Da,KY as Ca,KZ as Ea,kB as Ia,kK as ba,Hz as Le,bE as st,K_ as Ft,He as Lt,K$ as ka,L0 as wa,L1 as Aa,kM as ja,L2 as ot,L3 as lt,L4 as it,L5 as ct,L6 as Fa,kI as La,L7 as Pa,kL as _a,L8 as Va,L9 as Pt,HW as _t,j$ as Ba,La as Oa,Lb as Pe,Lc as Vt,HU as Bt,yk as Ra,Ld as Ua,Le as Na,kj as Ot,Lf as Ma,Lg as Ja,I6 as Ka,qx as Ga,Lh as Rt,Li as dt,I3 as _e,Lj as rt,Lk as $a,I8 as za,Ll as Ya,Lm as qa,Ln as Ha,Lo as Wa,Lp as Qa,qA as Za,Lq as Xa,Ix as en,Lr as tn,HN as Ve,gM as an,Ls as nn,Lt as sn,gK as on,Lu as ln,Lv as cn,yo as dn,Lw as rn,Lx as un,Ly as hn,Lz as pn,k3 as mn,bn as Sn,eY as fn,eW as gn}from"./zeni-epic-state-5fEaVO5b.js";import{z as U,aq as Be,B as Ut,v as Q,f as j,a1 as Z,aw as vn,q as M,O as Ce,R as ce,ax as We,ay as xn,az as Tn,p as Qe,aA as yn,m as Dn,K as de,w as Ze,a as ae,I as $,aB as Cn,j as Xe,Z as Se,aC as En,aD as Nt,V as In,aE as bn,d as kn,aF as wn,at as Mt,aG as An,o as W,S as jn,y as Jt,Y as Fn,aH as Ln,aI as Pn,h as et,aJ as _n,aK as Vn,_ as Bn,aL as On,aM as Rn}from"./index-DWCyzMUX.js";import{n as N,D as Un,S as Kt}from"./mui-CnlqDSRv.js";import{t as Nn,A as Mn}from"./AddressScreen-CuGNy3IM.js";import le from"./NotFoundScreen-CDTENjn3.js";import{F as Jn}from"./FeaturePreviewScreen-DBbU3hyx.js";import{c as q,v as tt,d as Kn}from"./routePaths-aWjSXoc2.js";import{p as Gt}from"./pathToGoBack-CHG8tIif.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{M as ge}from"./MobileAppDrawer-C1owD1l4.js";import{D as Gn}from"./DrawerScreen-2PFFQiRL.js";import{g as $n,m as zn}from"./accountMappingHelper-DWvcSK1C.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="b42c488e-280c-4374-a4e6-81e0d06759b5",e._sentryDebugIdIdentifier="sentry-dbid-b42c488e-280c-4374-a4e6-81e0d06759b5")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=K(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=R(),{scheduleType:o}=R();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>V(f)),r=Ee(o)??"accrued_expenses",h=U.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},$t=e=>{const a=Yn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=Ie(s.controllers),i=be(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-BNlilBXq.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{s as u,h,g as y,N as I}from"./core-BeBBWfga.js";import{JG as w,eU as b,zF as x}from"./zeni-epic-state-5fEaVO5b.js";import{z as l,B as j,y as S,Y as D}from"./index-MRloqTru.js";import{n as g}from"./mui-CnlqDSRv.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="8a15a74e-4dd7-4a96-90e6-539ff4e65133",e._sentryDebugIdIdentifier="sentry-dbid-8a15a74e-4dd7-4a96-90e6-539ff4e65133")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",p=e.get("profileId")??"",[n,m]=f.useState(!1),a=h(),s=y(c=>w(c)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(i);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return b(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(m(!0),a(x(t,p,i)))},[n,a]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=g.div`
1
+ import{j as o}from"./liveblocks-BNlilBXq.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{s as u,h,g as y,N as I}from"./core-BeBBWfga.js";import{JG as w,eU as b,zF as x}from"./zeni-epic-state-5fEaVO5b.js";import{z as l,B as j,y as S,Y as D}from"./index-DWCyzMUX.js";import{n as g}from"./mui-CnlqDSRv.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="8a15a74e-4dd7-4a96-90e6-539ff4e65133",e._sentryDebugIdIdentifier="sentry-dbid-8a15a74e-4dd7-4a96-90e6-539ff4e65133")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",p=e.get("profileId")??"",[n,m]=f.useState(!1),a=h(),s=y(c=>w(c)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(i);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return b(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(m(!0),a(x(t,p,i)))},[n,a]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=g.div`
2
2
  display: flex;
3
3
  width: 100%;
4
4
  height: 100vh;
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-BNlilBXq.js";import{l as Y,u as K,h as z,i as Z,g as w,n as q,N as ne,o as Ve,p as k}from"./core-BeBBWfga.js";import{eQ as M,OA as Ce,OB as $e,cl as te,cm as Ne,ff as Ze,wS as ke,B3 as Ge,wM as Tn,OC as On,OD as Bn,wP as Fn,wW as fe,wJ as Rn,wG as Ln,Nm as le,OE as Un,En as zn,Ks as Mn,Ep as _n,kk as Oe,OF as Vn,qc as He,q0 as We,kb as Ye,ke as Be,Kt as Fe,Ku as $n,OG as Nn,kd as Zn,kA as Gn,k2 as Hn,iB as Wn,iA as Yn,OH as Kn,OI as ye,E4 as qn,OJ as Jn,OK as Qn,Nf as we,OL as Re,OM as Xn,EA as et,N_ as nt,BZ as Ke,sM as qe,ON as tt,Ex as at,OO as Je,cN as Ae,EE as Qe,fg as ot,eW as Xe,eY as De,EC as st,BT as rt,Eu as it,OP as en,OQ as nn,E6 as tn,Eg as Le,OR as ct,Ea as lt,OS as dt,NO as ut,EF as pt,bv as mt,bF as ht,cx as gt,bG as ft,bs as yt,Jn as xt}from"./zeni-epic-state-5fEaVO5b.js";import{d as ae,a as $,z as D,I as O,m as _,B as de,bU as Ct,a1 as Ie,K as V,w as J,p as an,aq as kt,af as Ue,f as R,bV as wt,at as Se,bW as At,v as ue,bX as Dt,h as be,aN as W,bY as It,V as St,Z as on,ac as bt,bZ as ze,b_ as Et,q as ee,b$ as vt,c0 as Pt,c1 as jt,c2 as Tt,a9 as Ot,o as Bt}from"./index-MRloqTru.js";import{n as L,D as Q,S as X}from"./mui-CnlqDSRv.js";import ce from"./NotFoundScreen-DNyI2qP0.js";import{S as Me}from"./SetupPagesScreen-_y1NMEC2.js";import{F as sn}from"./FeaturePreviewScreen-RHOSmVgb.js";import{a as u}from"./sentry-CH2pQ4tM.js";import{M as pe}from"./MobileAppDrawer-L1vMrpyU.js";import{A as Ft,D as Rt,V as Lt}from"./DomesticWireDetailScreen-CWJhFUWD.js";import{A as Ut}from"./AddressScreen-DkNGrVnB.js";import{u as rn}from"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import{Z as zt}from"./ZeniAccountStatementScreen-HdIES2jY.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./analyticsHelper-DXH2vTTa.js";import"./routePaths-Dmzz0h9N.js";import"./BusinessVerificationPageScreen--jb-_NEK.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]="3c04d025-5a4b-4263-9330-85c9ddce8884",e._sentryDebugIdIdentifier="sentry-dbid-3c04d025-5a4b-4263-9330-85c9ddce8884")}catch{}})();const Mt=L.div`
1
+ import{j as n}from"./liveblocks-BNlilBXq.js";import{l as Y,u as K,h as z,i as Z,g as w,n as q,N as ne,o as Ve,p as k}from"./core-BeBBWfga.js";import{eQ as M,OA as Ce,OB as $e,cl as te,cm as Ne,ff as Ze,wS as ke,B3 as Ge,wM as Tn,OC as On,OD as Bn,wP as Fn,wW as fe,wJ as Rn,wG as Ln,Nm as le,OE as Un,En as zn,Ks as Mn,Ep as _n,kk as Oe,OF as Vn,qc as He,q0 as We,kb as Ye,ke as Be,Kt as Fe,Ku as $n,OG as Nn,kd as Zn,kA as Gn,k2 as Hn,iB as Wn,iA as Yn,OH as Kn,OI as ye,E4 as qn,OJ as Jn,OK as Qn,Nf as we,OL as Re,OM as Xn,EA as et,N_ as nt,BZ as Ke,sM as qe,ON as tt,Ex as at,OO as Je,cN as Ae,EE as Qe,fg as ot,eW as Xe,eY as De,EC as st,BT as rt,Eu as it,OP as en,OQ as nn,E6 as tn,Eg as Le,OR as ct,Ea as lt,OS as dt,NO as ut,EF as pt,bv as mt,bF as ht,cx as gt,bG as ft,bs as yt,Jn as xt}from"./zeni-epic-state-5fEaVO5b.js";import{d as ae,a as $,z as D,I as O,m as _,B as de,bU as Ct,a1 as Ie,K as V,w as J,p as an,aq as kt,af as Ue,f as R,bV as wt,at as Se,bW as At,v as ue,bX as Dt,h as be,aN as W,bY as It,V as St,Z as on,ac as bt,bZ as ze,b_ as Et,q as ee,b$ as vt,c0 as Pt,c1 as jt,c2 as Tt,a9 as Ot,o as Bt}from"./index-DWCyzMUX.js";import{n as L,D as Q,S as X}from"./mui-CnlqDSRv.js";import ce from"./NotFoundScreen-CDTENjn3.js";import{S as Me}from"./SetupPagesScreen-BHZjOSHJ.js";import{F as sn}from"./FeaturePreviewScreen-DBbU3hyx.js";import{a as u}from"./sentry-CH2pQ4tM.js";import{M as pe}from"./MobileAppDrawer-C1owD1l4.js";import{A as Ft,D as Rt,V as Lt}from"./DomesticWireDetailScreen-XA3QzAyw.js";import{A as Ut}from"./AddressScreen-CuGNy3IM.js";import{u as rn}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{Z as zt}from"./ZeniAccountStatementScreen-BOPEKBSK.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./analyticsHelper-Dc1kU1of.js";import"./routePaths-aWjSXoc2.js";import"./BusinessVerificationPageScreen-Lfv0XtEV.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]="3c04d025-5a4b-4263-9330-85c9ddce8884",e._sentryDebugIdIdentifier="sentry-dbid-3c04d025-5a4b-4263-9330-85c9ddce8884")}catch{}})();const Mt=L.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-BNlilBXq.js";import{a as u}from"./sentry-CH2pQ4tM.js";import{l as x,h as B,u as C,i as T,g as p}from"./core-BeBBWfga.js";import{ID as s,IC as $,OT as v,eQ as D,OU as j}from"./zeni-epic-state-5fEaVO5b.js";import{K as z,at as g,m as E,z as L,B as P,c3 as U,p as N}from"./index-MRloqTru.js";import{n as _}from"./mui-CnlqDSRv.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]="51d8c556-fe46-46f6-a20f-8ff29f1c8a78",e._sentryDebugIdIdentifier="sentry-dbid-51d8c556-fe46-46f6-a20f-8ff29f1c8a78")}catch{}})();const G=_.div`
1
+ import{j as i}from"./liveblocks-BNlilBXq.js";import{a as u}from"./sentry-CH2pQ4tM.js";import{l as x,h as B,u as C,i as T,g as p}from"./core-BeBBWfga.js";import{ID as s,IC as $,OT as v,eQ as D,OU as j}from"./zeni-epic-state-5fEaVO5b.js";import{K as z,at as g,m as E,z as L,B as P,c3 as U,p as N}from"./index-DWCyzMUX.js";import{n as _}from"./mui-CnlqDSRv.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]="51d8c556-fe46-46f6-a20f-8ff29f1c8a78",e._sentryDebugIdIdentifier="sentry-dbid-51d8c556-fe46-46f6-a20f-8ff29f1c8a78")}catch{}})();const G=_.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{cH as m,cI as l,Jy as _,Jz as d}from"./zeni-epic-state-5fEaVO5b.js";import{f as u}from"./index-MRloqTru.js";import"./sentry-CH2pQ4tM.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]="f95ea1f7-3122-49a2-afd3-873eb994ccb3",e._sentryDebugIdIdentifier="sentry-dbid-f95ea1f7-3122-49a2-afd3-873eb994ccb3")}catch{}})();const b=e=>{switch(e){case"this_month_to_date":case"this_week_to_date":case"this_year_to_date":case"last_year":case"last_week":case"last_month":case"last_6_months":case"last_3_months":case"last_12_months":case"free_range":return e;case"month":default:return"months";case"quarter":return"quarters";case"year":return"years"}},h=(e,a,o,i,s)=>{const r=[],c=[];let t=[];s?.forEach(n=>{r.push(n.companyId),c.push(n.companyName),t=t.concat(n.userRole)}),u.identify(e.userId,{tenant_id:a.tenantId,tenant_email_domain:a.tenantEmailDomain,company_id:a.companyId,company_name:a.companyName,user_role:a.userRole,chargebee_customer_id:i,$email:e.userEmail,user_email_domain:e.userEmailDomain,$first_name:e.firstName,$last_name:e.lastName,company_ids:s!=null?r:void 0,company_names:s!=null?c:void 0,user_roles:s!=null?t:void 0,app_type:"web",appearance:o})},g=(e,a)=>m(e,a)?"bill_pay":l(e,a)?"reimbursement":_(e,a)?"zeni_accounts":d(e,a)?"charge_cards":"bill_pay",I=e=>Object.values(e.allocation).map(String).join("-");export{I as a,h as f,g,b as t};
1
+ import{cH as m,cI as l,Jy as _,Jz as d}from"./zeni-epic-state-5fEaVO5b.js";import{f as u}from"./index-DWCyzMUX.js";import"./sentry-CH2pQ4tM.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]="f95ea1f7-3122-49a2-afd3-873eb994ccb3",e._sentryDebugIdIdentifier="sentry-dbid-f95ea1f7-3122-49a2-afd3-873eb994ccb3")}catch{}})();const b=e=>{switch(e){case"this_month_to_date":case"this_week_to_date":case"this_year_to_date":case"last_year":case"last_week":case"last_month":case"last_6_months":case"last_3_months":case"last_12_months":case"free_range":return e;case"month":default:return"months";case"quarter":return"quarters";case"year":return"years"}},h=(e,a,o,i,s)=>{const r=[],c=[];let t=[];s?.forEach(n=>{r.push(n.companyId),c.push(n.companyName),t=t.concat(n.userRole)}),u.identify(e.userId,{tenant_id:a.tenantId,tenant_email_domain:a.tenantEmailDomain,company_id:a.companyId,company_name:a.companyName,user_role:a.userRole,chargebee_customer_id:i,$email:e.userEmail,user_email_domain:e.userEmailDomain,$first_name:e.firstName,$last_name:e.lastName,company_ids:s!=null?r:void 0,company_names:s!=null?c:void 0,user_roles:s!=null?t:void 0,app_type:"web",appearance:o})},g=(e,a)=>m(e,a)?"bill_pay":l(e,a)?"reimbursement":_(e,a)?"zeni_accounts":d(e,a)?"charge_cards":"bill_pay",I=e=>Object.values(e.allocation).map(String).join("-");export{I as a,h as f,g,b as t};
@@ -1 +1 @@
1
- import{U as a}from"./index-MRloqTru.js";import"./mui-CnlqDSRv.js";import"./sentry-CH2pQ4tM.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]="ba62256a-a25e-4a91-8577-afe9acf121aa",e._sentryDebugIdIdentifier="sentry-dbid-ba62256a-a25e-4a91-8577-afe9acf121aa")}catch{}})();function f(e){if(e.companyLocaleInfo!=null&&e.companyLocaleInfo.languageCode.length>0&&e.companyLocaleInfo.companyIncCountryCode.length>0){const o=`${e.companyLocaleInfo.languageCode.toLowerCase()}-${e.companyLocaleInfo.companyIncCountryCode.toUpperCase()}`;return console.warn(`localeID ${o}`),a(o)??"en"}return"en"}export{f as t};
1
+ import{U as a}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import"./sentry-CH2pQ4tM.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]="ba62256a-a25e-4a91-8577-afe9acf121aa",e._sentryDebugIdIdentifier="sentry-dbid-ba62256a-a25e-4a91-8577-afe9acf121aa")}catch{}})();function f(e){if(e.companyLocaleInfo!=null&&e.companyLocaleInfo.languageCode.length>0&&e.companyLocaleInfo.companyIncCountryCode.length>0){const o=`${e.companyLocaleInfo.languageCode.toLowerCase()}-${e.companyLocaleInfo.companyIncCountryCode.toUpperCase()}`;return console.warn(`localeID ${o}`),a(o)??"en"}return"en"}export{f as t};