@zeniai/web-app-ui 5.3.49-qa → 5.3.50-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/assets/{AccountMappingScreen-Q7xW7M5J.js → AccountMappingScreen-CQ7H13AJ.js} +1 -1
  2. package/dist/assets/ActualMatchingMatchDetailScreen-CiDidq0s.js +1 -0
  3. package/dist/assets/AddressRoutes-B6YbK3vV.js +1 -0
  4. package/dist/assets/{AddressScreen-D8vDeQgw.js → AddressScreen-Bpb3fVmC.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-xhZL9MAI.js → AiCfoScreen-QnyN7vBU.js} +1 -1
  6. package/dist/assets/{AppDrawer-DZPNCAWD.js → AppDrawer-C0gwz2JB.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-DvcTgpbu.js → BillPayApprovalRoutes-3EoXz0ZY.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-B_NRduNp.js → BillPayRoutes-M6mZc5N-.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-qi4m6Iwf.js → BusinessVerificationPageScreen-Nce7icz0.js} +1 -1
  10. package/dist/assets/{CardsAiCfoScreen-B6Ly7KCD.js → CardsAiCfoScreen-DtOqwcGQ.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-DQb3RWAv.js → ChargeCardRoutes-Dd-PxeHo.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-CP4WxYKA.js → CompanyPassportScreen-49ty9VyO.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-BUbO6vCq.js → ConnectionAuthScreen-BXYkaDxo.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-ydHqVzP0.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-7sq_iREM.js → CustomerOnboardingRoutes-XyONN9ww.js} +1 -1
  16. package/dist/assets/{DashboardRoutes-BZR2-yyh.js → DashboardRoutes-dkthXH1f.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-cTUvHoos.js → DefaultTenantHome-CrymQf_N.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BDe-1BVE.js → DomesticWireDetailScreen-B7Wh2S3T.js} +1 -1
  19. package/dist/assets/{DrawerScreen-BcA0izcE.js → DrawerScreen-ClAWgRZL.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-C9WRc6kR.js → EntityDetailRoutes-Bci8_0b4.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-BbHHMGOz.js → ExpenseAutomationRoutes-CBA2iWWZ.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-BOTDjoMi.js → FeaturePreviewScreen-B5y1DAdh.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-Cae4-VGJ.js → HubSpotOAuthCallbackScreen-CxZT5Xg0.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-Dwt_tkdC.js → InboxNotificationsProvider-C4Mxy7-U.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-BUMLkBJ7.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-Df6ri2Kl.js → MagicLinkRoutes-ZSHjgrvL.js} +1 -1
  27. package/dist/assets/{MagicLinkSignInScreen-B6vdgcuk.js → MagicLinkSignInScreen-CaYKvMpE.js} +1 -1
  28. package/dist/assets/{MobileAppDrawer-kvOHgs7K.js → MobileAppDrawer-yEi_dlxO.js} +1 -1
  29. package/dist/assets/NotFoundScreen-DYgKmfND.js +1 -0
  30. package/dist/assets/{NotificationRoutes-dDtgUdSm.js → NotificationRoutes-BnRbqfhI.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-H2myTjtC.js → OAuthConsentScreen-BNUaqcAm.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-BD7uAXdK.js → PandLWithForecastRoutes-DsyrosDN.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-CNI9VcWA.js → PaymentLinkScreen-DhAsW9ww.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-D3I8r7bv.js → PeopleRoutes-Slg7y6En.js} +1 -1
  35. package/dist/assets/PerformanceRoutes-DkaD6CAf.js +1 -0
  36. package/dist/assets/{Preview-qQlP44Bb.js → Preview-D3nFS6CS.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-JAiYPx6A.js → QBOConnectionScreen-d5CTtraJ.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-bNJ7cOlD.js → ReimbursementApprovalRoutes-DJ4bkGDP.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BRScGn-s.js → ReimbursementApprovalRuleDetailScreen-CCuMPoSQ.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-dOz52Qry.js → ReimbursementRoutes-UoeOjPcY.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-B7vX60DN.js → ReportsRoutes-DLgdpJm_.js} +1 -1
  42. package/dist/assets/RewardsRoutes-C8Bk8JZD.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-Cp-bmLgB.js → ScheduleDetailsPrepaidExpensesScreen-CbzZSAqb.js} +1 -1
  44. package/dist/assets/{ScreenRoutes-BgS5NEcb.js → ScreenRoutes-BFJdqr7A.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-oYgtiH0s.js → SettingsRoutes-ssqLUH47.js} +1 -1
  46. package/dist/assets/{SetupPagesScreen-C8auoDk-.js → SetupPagesScreen-Dofrysh_.js} +1 -1
  47. package/dist/assets/{SignInScreen-BtWQTF4V.js → SignInScreen-2tgX27MZ.js} +1 -1
  48. package/dist/assets/{SignOutScreen-xTFTKHD6.js → SignOutScreen-DBUf9AUK.js} +1 -1
  49. package/dist/assets/{TaskListScreen-Ddl4-pS2.js → TaskListScreen-BvWmomDK.js} +1 -1
  50. package/dist/assets/TaskRoutes-CxfTcH7l.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-OdKQWakM.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-DEqpcfN2.js → TransactionDetailScreen-CJaRW_q2.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-D7yKkQrM.js → TransactionListRoutes-Co9yJGWM.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-eUohUJUJ.js → TreasuryRoutes-Can8ukgJ.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-CTNYoZwy.js → VendorsRoutes-CBDR6q2p.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-BPaviOwA.js → WiseConfirmationScreen-7BKBvNTr.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-Q406Y_rs.js → ZeniAccountRoutes-Btl8MnMC.js} +1 -1
  58. package/dist/assets/ZeniAccountStatementScreen-CPlmGVIe.js +9 -0
  59. package/dist/assets/{accountMappingHelper-ZA3eE2RB.js → accountMappingHelper-C49jxhGs.js} +1 -1
  60. package/dist/assets/{analytics-EJdRN0EM.js → analytics-CqtBdMPM.js} +1 -1
  61. package/dist/assets/{analyticsHelper-IpMM6iCb.js → analyticsHelper-CMH3f5Mv.js} +1 -1
  62. package/dist/assets/{core-DrG65cn7.js → core-D9_r48xZ.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-Cq-VPmfw.js → decodeURIComponentSafe-DyEaiyWX.js} +1 -1
  64. package/dist/assets/{dnd-ySxwrcGd.js → dnd-BCAK2sIw.js} +1 -1
  65. package/dist/assets/{empty-HkstFjkG.js → empty-BoonXjm8.js} +1 -1
  66. package/dist/assets/{empty-hypZVcyj.js → empty-DHCuvVpz.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-hQo6iMam.js → emptyVideoElement-DDkVcaiD.js} +1 -1
  68. package/dist/assets/epic-DVDsBNia.js +2 -0
  69. package/dist/assets/{expenseAutomationHelper-BhQOMrvk.js → expenseAutomationHelper-Bmn0IF_K.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-MjJHWv6K.js → getLocaleForTenant-CgHoQ1eD.js} +1 -1
  71. package/dist/assets/{index-CItropkZ.js → index-9Ja3Lqmf.js} +1 -1
  72. package/dist/assets/{index-CNCkAPT0.js → index-BWlvyCtM.js} +908 -908
  73. package/dist/assets/{index-DWaMzRgO.js → index-BYMHtOlo.js} +1 -1
  74. package/dist/assets/{index-CdqEwb4U.js → index-CYjuawf_.js} +1 -1
  75. package/dist/assets/{index-Csgz6JKS.js → index-DNkFQuNQ.js} +2 -2
  76. package/dist/assets/{index-CNxuKyrU.js → index-DmXcZyli.js} +1 -1
  77. package/dist/assets/{index-Cju_tsP9.js → index-bQlS7Nxz.js} +1 -1
  78. package/dist/assets/{index-D2y8Uf4E.js → index-dTLcnBHt.js} +1 -1
  79. package/dist/assets/{lexical-DsG4GgCt.js → lexical-2BO6qHmP.js} +1 -1
  80. package/dist/assets/{liveblocks-DJozFz1F.js → liveblocks-BIpuBqDU.js} +1 -1
  81. package/dist/assets/{lottie-B54UhbRD.js → lottie-CDi-6upx.js} +1 -1
  82. package/dist/assets/{mui-DqsEgFea.js → mui-81_cRiBE.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Cvep4Zpb.js → pathToGoBack-B4fU8Azr.js} +1 -1
  84. package/dist/assets/{pdf-0ccxH7eS.js → pdf-Bb_1563M.js} +3 -3
  85. package/dist/assets/{pdf-lib-CYVFTJz1.js → pdf-lib-CJ09PoKW.js} +1 -1
  86. package/dist/assets/{plaid-KeCmRFX0.js → plaid-BDcnIkZ0.js} +1 -1
  87. package/dist/assets/{pusher-63t06gfb.js → pusher-Ct1YtECO.js} +1 -1
  88. package/dist/assets/{react-DoOX0jE5.js → react-903GIdr_.js} +1 -1
  89. package/dist/assets/{react-Ca5GapOf.js → react-Ad5cTmQt.js} +1 -1
  90. package/dist/assets/{react-CjVnH7Ak.js → react-B3Wl6nG2.js} +1 -1
  91. package/dist/assets/{react-xEeg46_z.js → react-CD8gkbD7.js} +1 -1
  92. package/dist/assets/{react-BNSYzriL.js → react-CWdNL9zh.js} +1 -1
  93. package/dist/assets/{react-CAoDTuLJ.js → react-GWNxCIDF.js} +1 -1
  94. package/dist/assets/{recharts-Bmrae78L.js → recharts-D2tzVFIn.js} +1 -1
  95. package/dist/assets/{routePaths-BlVxV4y9.js → routePaths-Clggvdtc.js} +1 -1
  96. package/dist/assets/{sentry-C1W0cBeR.js → sentry-B2ljjuRI.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-Dk3dK5Wm.js → stripSplatSuffix-UCDmTxu6.js} +1 -1
  98. package/dist/assets/{url-C0aMyBCn.js → url-BpHe0UXt.js} +1 -1
  99. package/dist/assets/{url-BrtuL5Mk.js → url-DyU7tVdi.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-CBa1BLct.js → useActualMatchingMatchDetail-Cu82mAOm.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D-duBA1I.js → useAiCfoDashboardSuggestedQuestionsChips-D4jhuxYc.js} +1 -1
  102. package/dist/assets/{useAskAiCfoHostNavButtonProps-DDB7rJuC.js → useAskAiCfoHostNavButtonProps-0qWmdvwE.js} +1 -1
  103. package/dist/assets/{useChargeCardPusherEvents-CN8r0o7t.js → useChargeCardPusherEvents-Bqb5brTt.js} +1 -1
  104. package/dist/assets/{useDeviceId-BQkxGsaf.js → useDeviceId-CrjinlLp.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-DeZjyILj.js → useEmailConnectResultRefresh-BEnYjVgX.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-DjzuWq5l.js → useInitialThreadRequest-D_wVO4z2.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-D96Us8rE.js → useTaskManagerAccess-DFbLYKBq.js} +1 -1
  108. package/dist/assets/{utils-BYrZSa_o.js → utils-DajTl1fi.js} +1 -1
  109. package/dist/assets/{withTransactionSidePanel-D6eLtbjK.js → withTransactionSidePanel-CJP44IF0.js} +1 -1
  110. package/dist/assets/{zeni-epic-state-1I_oueWp.js → zeni-epic-state-D8p_bjl4.js} +6 -6
  111. package/dist/index.html +1 -1
  112. package/package.json +3 -3
  113. package/dist/assets/ActualMatchingMatchDetailScreen-XRRKXZs7.js +0 -1
  114. package/dist/assets/AddressRoutes-CZYL1zoT.js +0 -1
  115. package/dist/assets/CustomerOnboardingAuthScreen-CTDV3sHx.js +0 -1
  116. package/dist/assets/InvoicingRoutes-C6Pu_uVI.js +0 -2
  117. package/dist/assets/NotFoundScreen-DWq-K_Je.js +0 -1
  118. package/dist/assets/PerformanceRoutes-CRpgkhVO.js +0 -1
  119. package/dist/assets/RewardsRoutes-Ccx-1Ivl.js +0 -1
  120. package/dist/assets/TaskRoutes-DBXAPfzd.js +0 -9
  121. package/dist/assets/TransactionDetailRoutes-DnVLeQAr.js +0 -1
  122. package/dist/assets/ZeniAccountStatementScreen-C2TGrJJ3.js +0 -9
  123. package/dist/assets/epic-BPI4oO0H.js +0 -2
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-DJozFz1F.js";import{g as J,h as Oe,u as De,i as Ae,j as d,l as Ue,n as Pe,o as ee}from"./core-DrG65cn7.js";import{fF as q,E5 as R,UF as Ve,l$ as le,u6 as ce,uX as A,lG as Ee,lP as U,lH as P,kK as V,kB as E,kA as Le,Df as ie,v0 as Me,bq as Be,UG as ve,bn as xe,Es as ze,UH as Ge,UI as He,ci as g,D8 as Ye,UJ as ae,UK as Ne,UL as $e,UM as qe,UN as Ze,UO as Qe,UP as Ke,UQ as We,UR as Xe,US as Je,UT as ea,UU as aa,UV as sa,UW as k,UX as L,UY as M,UZ as B,U_ as v,U$ as x,V0 as z,V1 as G,V2 as H,V3 as Y,ei as ta,E6 as oa,DV as se,DW as te,Ec as na,D_ as oe,Ei as ra,V4 as la,V5 as ca,V6 as ia,V7 as da,V8 as pa,V9 as _a,Va as fa,Vb as ma,Vc as ua,Vd as ba,d_ as ha,dZ as ya}from"./zeni-epic-state-1I_oueWp.js";import{ao as wa,ap as Ca,aq as Sa,a as ga,a2 as Ia,c as de,A as N,z as pe,ar as Ra,Q as Ta,e as ka,as as ja,at as Fa,a9 as Oa,k as $,S as Da,s as Aa,p as _e,au as Ua,av as Pa,aw as Va}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import Ea from"./NotFoundScreen-DWq-K_Je.js";import{F as La}from"./FeaturePreviewScreen-BOTDjoMi.js";import{a as u}from"./sentry-C1W0cBeR.js";import{u as Ma}from"./useInitialThreadRequest-DjzuWq5l.js";import{t as ne,a as re,b as Ba}from"./routePaths-BlVxV4y9.js";import{M as va}from"./MobileAppDrawer-kvOHgs7K.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./InboxNotificationsProvider-Dwt_tkdC.js";import"./useTaskManagerAccess-D96Us8rE.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]="8d3b8af6-a9e8-4449-9eae-720235985c41",e._sentryDebugIdIdentifier="sentry-dbid-8d3b8af6-a9e8-4449-9eae-720235985c41")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ue((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Va}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Qe({classesToFilterOut:a})):e(Ke({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?E():Ye()),o.isAccountingProjectsEnabled&&e(s?U():a?V():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):U(!0):P(!0):V(!0):E(!0))}}}))(Ua);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),m=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ae(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:Q}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,ue=F.company?.companyInfo.firstMonthOfFY??1,be=Ma(Q?F?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ve(n))),{areTenantIdsInSync:b}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(A(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&C==="Completed"&&b&&(s(A(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,C,b]),u.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":S&&s(V());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(U());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,O,D,b,T,S]);const K=Ta(),Ce=K?.loggedInUserRole!=null&&Be(K?.loggedInUserRole)!==!0,[Se,ge]=u.useState(!1),W=n=>{ge(n)},Ie=ka(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:ke}=J(),X=wa(ke??"")==="reports",je=Ca(Te),Fe=u.useMemo((()=>X?xa:void 0),[X]);Sa({canFetchSuggestedQuestions:je,pageContexts:Fe})})({isDataReady:C==="Completed"}),Fa({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Aa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Q,initialOpenThreadRequest:be})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Ea,{})})]})}export{_s as default};
1
+ import{j as p}from"./liveblocks-BIpuBqDU.js";import{g as J,h as Oe,u as De,i as Ae,j as d,l as Ue,n as Pe,o as ee}from"./core-D9_r48xZ.js";import{fF as q,E5 as R,UF as Ve,l$ as le,u6 as ce,uX as A,lG as Ee,lP as U,lH as P,kK as V,kB as E,kA as Le,Df as ie,v0 as Me,bq as Be,UG as ve,bn as xe,Es as ze,UH as Ge,UI as He,ci as g,D8 as Ye,UJ as ae,UK as Ne,UL as $e,UM as qe,UN as Ze,UO as Qe,UP as Ke,UQ as We,UR as Xe,US as Je,UT as ea,UU as aa,UV as sa,UW as k,UX as L,UY as M,UZ as B,U_ as v,U$ as x,V0 as z,V1 as G,V2 as H,V3 as Y,ei as ta,E6 as oa,DV as se,DW as te,Ec as na,D_ as oe,Ei as ra,V4 as la,V5 as ca,V6 as ia,V7 as da,V8 as pa,V9 as _a,Va as fa,Vb as ma,Vc as ua,Vd as ba,d_ as ha,dZ as ya}from"./zeni-epic-state-D8p_bjl4.js";import{ao as wa,ap as Ca,aq as Sa,a as ga,a2 as Ia,c as de,A as N,z as pe,ar as Ra,Q as Ta,e as ka,as as ja,at as Fa,a9 as Oa,k as $,S as Da,s as Aa,p as _e,au as Ua,av as Pa,aw as Va}from"./index-BWlvyCtM.js";import"./mui-81_cRiBE.js";import Ea from"./NotFoundScreen-DYgKmfND.js";import{F as La}from"./FeaturePreviewScreen-B5y1DAdh.js";import{a as u}from"./sentry-B2ljjuRI.js";import{u as Ma}from"./useInitialThreadRequest-D_wVO4z2.js";import{t as ne,a as re,b as Ba}from"./routePaths-Clggvdtc.js";import{M as va}from"./MobileAppDrawer-yEi_dlxO.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.js";import"./InboxNotificationsProvider-C4Mxy7-U.js";import"./useTaskManagerAccess-DFbLYKBq.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]="8d3b8af6-a9e8-4449-9eae-720235985c41",e._sentryDebugIdIdentifier="sentry-dbid-8d3b8af6-a9e8-4449-9eae-720235985c41")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ue((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Va}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Qe({classesToFilterOut:a})):e(Ke({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?E():Ye()),o.isAccountingProjectsEnabled&&e(s?U():a?V():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):U(!0):P(!0):V(!0):E(!0))}}}))(Ua);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),m=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ae(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:Q}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,ue=F.company?.companyInfo.firstMonthOfFY??1,be=Ma(Q?F?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ve(n))),{areTenantIdsInSync:b}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(A(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&C==="Completed"&&b&&(s(A(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,C,b]),u.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":S&&s(V());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(U());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,O,D,b,T,S]);const K=Ta(),Ce=K?.loggedInUserRole!=null&&Be(K?.loggedInUserRole)!==!0,[Se,ge]=u.useState(!1),W=n=>{ge(n)},Ie=ka(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:ke}=J(),X=wa(ke??"")==="reports",je=Ca(Te),Fe=u.useMemo((()=>X?xa:void 0),[X]);Sa({canFetchSuggestedQuestions:je,pageContexts:Fe})})({isDataReady:C==="Completed"}),Fa({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Aa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Q,initialOpenThreadRequest:be})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Ea,{})})]})}export{_s as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-BIpuBqDU.js";import{z as w,a9 as N,k as u,S as k,e3 as D,c as E,A as I}from"./index-BWlvyCtM.js";import"./mui-81_cRiBE.js";import g from"./NotFoundScreen-DYgKmfND.js";import{a as m}from"./sentry-B2ljjuRI.js";import{u as C,j as h,h as F,g as L,l as P,n as T,o as f,N as y}from"./core-D9_r48xZ.js";import{fF as U,a1O as j,a1P as p,DM as _,p$ as V,a1Q as z,DK as A}from"./zeni-epic-state-D8p_bjl4.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.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]="f0851223-d1ac-46e1-ac1b-731f7ce5280d",e._sentryDebugIdIdentifier="sentry-dbid-f0851223-d1ac-46e1-ac1b-731f7ce5280d")}catch{}})();const G=P((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(A())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(D),K=()=>{const e=C(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>U(o))),c=F(),x=L(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),b=d?.firstName!=null?d.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(k.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:c,location:x,currentTenant:r,companyName:S,userName:b,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=E(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(K,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-DJozFz1F.js";import{a as A}from"./sentry-C1W0cBeR.js";import{i as G,u as Q,h as X,g as ee,j as h,l as te}from"./core-DrG65cn7.js";import{WD as Fe,WE as Ve,l$ as ae,sr as Me,sD as Ge,sT as $e,sR as Re,sU as Ke,sW as Ue,WF as We,fF as K,VC as pe,WG as Se,g_ as ne,cB as se,cC as le,Fa as ve,WH as Ce,Fe as Ye,gO as ce,su as ze,t2 as qe,dD as Ze,dC as He,S_ as fe,F8 as Qe,F2 as Xe,WI as De,EW as et,EV as tt,EQ as at,E$ as nt,Ff as st,WJ as W,WK as ge,EX as lt,VD as oe,Fv as Ae,Fo as Ie,WL as xe,sx as Te,Fi as Be,Fg as Le,WM as we,FC as Je,Fz as je,Fj as be,FB as _e}from"./zeni-epic-state-1I_oueWp.js";import{a5 as de,aZ as ie,a_ as ct,z as ot,j as dt,a8 as it,a9 as ue,k as N,aw as ut,a$ as rt,p as V,G as Ee,M as ke,b0 as ht,b1 as mt,b2 as pt}from"./index-CNCkAPT0.js";import{n as re}from"./mui-DqsEgFea.js";import{p as St}from"./pathToGoBack-Cvep4Zpb.js";import H from"./NotFoundScreen-DWq-K_Je.js";import{c as M}from"./routePaths-BlVxV4y9.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]="7a362b2f-f6a0-499d-a789-2e899f92275c",e._sentryDebugIdIdentifier="sentry-dbid-7a362b2f-f6a0-499d-a789-2e899f92275c")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=Q(),i=X(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?k.jsx(H,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(H,{}):k.jsx(ft,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(We({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
1
+ import{j as k}from"./liveblocks-BIpuBqDU.js";import{a as A}from"./sentry-B2ljjuRI.js";import{i as G,u as Q,h as X,g as ee,j as h,l as te}from"./core-D9_r48xZ.js";import{WD as Fe,WE as Ve,l$ as ae,sr as Me,sD as Ge,sT as $e,sR as Re,sU as Ke,sW as Ue,WF as We,fF as K,VC as pe,WG as Se,g_ as ne,cB as se,cC as le,Fa as ve,WH as Ce,Fe as Ye,gO as ce,su as ze,t2 as qe,dD as Ze,dC as He,S_ as fe,F8 as Qe,F2 as Xe,WI as De,EW as et,EV as tt,EQ as at,E$ as nt,Ff as st,WJ as W,WK as ge,EX as lt,VD as oe,Fv as Ae,Fo as Ie,WL as xe,sx as Te,Fi as Be,Fg as Le,WM as we,FC as Je,Fz as je,Fj as be,FB as _e}from"./zeni-epic-state-D8p_bjl4.js";import{a5 as de,aZ as ie,a_ as ct,z as ot,j as dt,a8 as it,a9 as ue,k as N,aw as ut,a$ as rt,p as V,G as Ee,M as ke,b0 as ht,b1 as mt,b2 as pt}from"./index-BWlvyCtM.js";import{n as re}from"./mui-81_cRiBE.js";import{p as St}from"./pathToGoBack-B4fU8Azr.js";import H from"./NotFoundScreen-DYgKmfND.js";import{c as M}from"./routePaths-Clggvdtc.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]="7a362b2f-f6a0-499d-a789-2e899f92275c",e._sentryDebugIdIdentifier="sentry-dbid-7a362b2f-f6a0-499d-a789-2e899f92275c")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=Q(),i=X(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?k.jsx(H,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(H,{}):k.jsx(ft,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(We({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DWq-K_Je.js","assets/sentry-C1W0cBeR.js","assets/core-DrG65cn7.js","assets/zeni-epic-state-1I_oueWp.js","assets/index-CNCkAPT0.js","assets/mui-DqsEgFea.js","assets/analytics-EJdRN0EM.js","assets/utils-BYrZSa_o.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-BZR2-yyh.js","assets/withTransactionSidePanel-D6eLtbjK.js","assets/useAskAiCfoHostNavButtonProps-DDB7rJuC.js","assets/TransactionDetailScreen-DEqpcfN2.js","assets/decodeURIComponentSafe-Cq-VPmfw.js","assets/useInitialThreadRequest-DjzuWq5l.js","assets/routePaths-BlVxV4y9.js","assets/expenseAutomationHelper-BhQOMrvk.js","assets/stripSplatSuffix-Dk3dK5Wm.js","assets/analyticsHelper-IpMM6iCb.js","assets/CompanyPassportScreen-CP4WxYKA.js","assets/MobileAppDrawer-kvOHgs7K.js","assets/InboxNotificationsProvider-Dwt_tkdC.js","assets/useTaskManagerAccess-D96Us8rE.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D-duBA1I.js","assets/FeaturePreviewScreen-BOTDjoMi.js","assets/BillPayRoutes-B_NRduNp.js","assets/AddressScreen-D8vDeQgw.js","assets/DomesticWireDetailScreen-BDe-1BVE.js","assets/BusinessVerificationPageScreen-qi4m6Iwf.js","assets/DrawerScreen-BcA0izcE.js","assets/SetupPagesScreen-C8auoDk-.js","assets/BillPayApprovalRoutes-DvcTgpbu.js","assets/ReimbursementApprovalRuleDetailScreen-BRScGn-s.js","assets/getLocaleForTenant-MjJHWv6K.js","assets/ReimbursementRoutes-dOz52Qry.js","assets/ReimbursementApprovalRoutes-bNJ7cOlD.js","assets/TransactionListRoutes-D7yKkQrM.js","assets/ZeniAccountStatementScreen-C2TGrJJ3.js","assets/SettingsRoutes-oYgtiH0s.js","assets/AccountMappingScreen-Q7xW7M5J.js","assets/QBOConnectionScreen-JAiYPx6A.js","assets/empty-hypZVcyj.js","assets/index-DWaMzRgO.js","assets/url-BrtuL5Mk.js","assets/index-CItropkZ.js","assets/accountMappingHelper-ZA3eE2RB.js","assets/useEmailConnectResultRefresh-DeZjyILj.js","assets/ReportsRoutes-B7vX60DN.js","assets/ChargeCardRoutes-DQb3RWAv.js","assets/useChargeCardPusherEvents-CN8r0o7t.js","assets/PeopleRoutes-D3I8r7bv.js","assets/ExpenseAutomationRoutes-BbHHMGOz.js","assets/useActualMatchingMatchDetail-CBa1BLct.js","assets/ScheduleDetailsPrepaidExpensesScreen-Cp-bmLgB.js","assets/pathToGoBack-Cvep4Zpb.js","assets/TreasuryRoutes-eUohUJUJ.js","assets/VendorsRoutes-CTNYoZwy.js","assets/ZeniAccountRoutes-Q406Y_rs.js","assets/AddressRoutes-CZYL1zoT.js","assets/PandLWithForecastRoutes-BD7uAXdK.js","assets/CustomerOnboardingRoutes-7sq_iREM.js","assets/TransactionDetailRoutes-DnVLeQAr.js","assets/EntityDetailRoutes-C9WRc6kR.js","assets/InvoicingRoutes-C6Pu_uVI.js","assets/NotificationRoutes-dDtgUdSm.js","assets/PerformanceRoutes-CRpgkhVO.js","assets/ActualMatchingMatchDetailScreen-XRRKXZs7.js","assets/RewardsRoutes-Ccx-1Ivl.js","assets/TaskRoutes-DBXAPfzd.js","assets/TaskListScreen-Ddl4-pS2.js","assets/AiCfoScreen-xhZL9MAI.js","assets/CardsAiCfoScreen-B6Ly7KCD.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as hs,fF as ps,d_ as xs,dZ as gs,AZ as Rs,di as Is,c8 as js,gJ as Ts,g9 as As,df as pe,cG as bs,gn as Ds,cy as ys,bE as fs,br as Cs,U3 as vs,v as Us,U6 as Os,bq as Ps,U7 as ws,bK as Fs,bJ as Ls,bt as ks,cu as Hs,U8 as Vs,U9 as Ss,da as Bs,dd as Ns,dc as Ms,cF as Zs,cM as Gs,pS as xe,gi as ge,gY as $s,gk as Re,gL as Ie,gM as je,gl as zs}from"./zeni-epic-state-1I_oueWp.js";import{j as e}from"./liveblocks-DJozFz1F.js";import{a as P}from"./sentry-C1W0cBeR.js";import{N as u,u as Ys,h as qs,i as Js,g as Ws,j as G,q as Te,n as Ks,o as n}from"./core-DrG65cn7.js";import{H as l,E as Qs,u as Xs,z as f,c as et,e as st,X as tt,A as B,g as nt,I as at,Q as ot,L as F,G as Ae,t as _,J as rt,P as it,K as lt,k as ne}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import{f as be}from"./analyticsHelper-IpMM6iCb.js";import{t as ut}from"./getLocaleForTenant-MjJHWv6K.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="84058b34-31b9-4b83-a209-867475acf170",o._sentryDebugIdIdentifier="sentry-dbid-84058b34-31b9-4b83-a209-867475acf170")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-DWq-K_Je.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(k===!0){if(o)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(U)return e.jsx(fe,{tenantEmailDomain:v})}return o?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):U?e.jsx(fe,{tenantEmailDomain:v}):D?e.jsx(mt,{tenantEmailDomain:v}):N?e.jsx(ct,{tenantEmailDomain:v}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-BZR2-yyh.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-B_NRduNp.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-dOz52Qry.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-D7yKkQrM.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-oYgtiH0s.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-B7vX60DN.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-DQb3RWAv.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-D3I8r7bv.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-BbHHMGOz.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-eUohUJUJ.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-CTNYoZwy.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-Q406Y_rs.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},Et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},ht=l((()=>s((()=>import("./ReportsRoutes-B7vX60DN.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),pt=l((()=>s((()=>import("./AddressRoutes-CZYL1zoT.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-D3I8r7bv.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-BD7uAXdK.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-7sq_iREM.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),It=l((()=>s((()=>import("./VendorsRoutes-CTNYoZwy.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),jt=l((()=>s((()=>import("./TransactionDetailRoutes-DnVLeQAr.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-C9WRc6kR.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),Tt=l((()=>s((()=>import("./DashboardRoutes-BZR2-yyh.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-B_NRduNp.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),At=l((()=>s((()=>import("./SettingsRoutes-oYgtiH0s.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),bt=l((()=>s((()=>import("./InvoicingRoutes-C6Pu_uVI.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Ue=l((()=>s((()=>import("./ReimbursementRoutes-dOz52Qry.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),Dt=l((()=>s((()=>import("./ZeniAccountRoutes-Q406Y_rs.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),yt=l((()=>s((()=>import("./TreasuryRoutes-eUohUJUJ.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-D7yKkQrM.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),Ct=l((()=>s((()=>import("./ChargeCardRoutes-DQb3RWAv.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),vt=l((()=>s((()=>import("./NotificationRoutes-dDtgUdSm.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ut=l((()=>s((()=>import("./PerformanceRoutes-CRpgkhVO.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ot=l((()=>s((()=>import("./ExpenseAutomationRoutes-BbHHMGOz.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Pt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-XRRKXZs7.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),wt=l((()=>s((()=>import("./RewardsRoutes-Ccx-1Ivl.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Ft=l((()=>s((()=>import("./TaskRoutes-DBXAPfzd.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-xhZL9MAI.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,23,54,15,8])))),Oe=l((()=>s((()=>import("./CardsAiCfoScreen-B6Ly7KCD.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-DWq-K_Je.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),kt=l((()=>s((()=>import("./TaskListScreen-Ddl4-pS2.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,8])))),Ht=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:H})=>{if(U===!0){if(D)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return v===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Ys(),N=qs(),{tenantEmailDomain:i}=Js(),k=Qs().mode,{setLoading:U,clearAllLoading:v,clearLoading:H}=Xs(),y=f.getSignedInUserTenant(i)?.tenantId,j=f.getSignedInUser(),W=hs(j),$=Ws(),[L,we]=P.useState(!1),r=G((a=>ps(a))),{useFeatureGate:V}=et(),M=st(),K=tt(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=V(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=V(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?xs(oe,r):void 0,Q=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!Is(r):void 0,He=nt(r,ke,oe),{isCardsHidden:Ve}=at(r?.tenantId),Se=!He||!!Ve,{isFeatureEnabled:Be}=V(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=V(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=V(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||lt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),z=G((a=>Ts(a)));if(i!=null){const a=f.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,k)}const Z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=As(),h=ot(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=bs(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?Ds(a,Z.tenantId):void 0));P.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const A=ys(Number(a[0])),c=Number(a[1]),t=fs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=Cs();t.isAfter(d,"month")===!1?D(vs(y,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,y]),P.useEffect((()=>{L||(we(!0),U(F.TENANT_FETCHING))}),[L,Z,ie,j,D,f]),P.useLayoutEffect((()=>{!Us(ie,Z)&&f.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=f.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(ut(t)),d?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,D,Ye))}),[y]),P.useEffect((()=>{f.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,Es=c!=null&&c.externalConnections==null;if(q&&ms){S(Re(t));const J=f.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(je(d.userId,t)))}else q&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(Ie(d.userId,t))),q&&Es&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(je(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,y,j,U,D))}),[y,p]),P.useEffect((()=>{f.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),f.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&be(j,r,k,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&U(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(v(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,y,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=Et,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=_t[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const O=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:qe}=V(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=V(B.isAccrualEnabled),We=rt(),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,de=!Se&&!O,Xe=ws(h?.loggedInUserRoleMap),es=r.externalConnections?.accounting[0]?.isValid,ss=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&Fs(h?.loggedInUserRoleMap),_e=Fe&&!O,ts=Le&&!O,ns=ue&&Ls(h?.loggedInUserRoleMap),as=de&&ks(h?.loggedInUserRoleMap),os=_e&&Hs(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),ds=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),g=Gs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&ls,I=ts&&us,m=de&&ds,cs=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Xe===!0||rs===!0||is===!0;return f.isSignedIn()?y==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&T!=="In-Progress"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&ss&&es!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(it,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Ht,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(Tt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&O===!1||Ke||Qe?e.jsx(jt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&O===!1?e.jsx(ft,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&O===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&O===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(kt,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ft,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(yt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ut,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&O===!1?e.jsx(Ot,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&O===!1&&Je===!0&&We===!0?e.jsx(Pt,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(vt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(It,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(At,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Ct,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(wt,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,zt as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DYgKmfND.js","assets/sentry-B2ljjuRI.js","assets/core-D9_r48xZ.js","assets/zeni-epic-state-D8p_bjl4.js","assets/index-BWlvyCtM.js","assets/mui-81_cRiBE.js","assets/analytics-CqtBdMPM.js","assets/utils-DajTl1fi.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-dkthXH1f.js","assets/withTransactionSidePanel-CJP44IF0.js","assets/useAskAiCfoHostNavButtonProps-0qWmdvwE.js","assets/TransactionDetailScreen-CJaRW_q2.js","assets/decodeURIComponentSafe-DyEaiyWX.js","assets/useInitialThreadRequest-D_wVO4z2.js","assets/routePaths-Clggvdtc.js","assets/expenseAutomationHelper-Bmn0IF_K.js","assets/stripSplatSuffix-UCDmTxu6.js","assets/analyticsHelper-CMH3f5Mv.js","assets/CompanyPassportScreen-49ty9VyO.js","assets/MobileAppDrawer-yEi_dlxO.js","assets/InboxNotificationsProvider-C4Mxy7-U.js","assets/useTaskManagerAccess-DFbLYKBq.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D4jhuxYc.js","assets/FeaturePreviewScreen-B5y1DAdh.js","assets/BillPayRoutes-M6mZc5N-.js","assets/AddressScreen-Bpb3fVmC.js","assets/DomesticWireDetailScreen-B7Wh2S3T.js","assets/BusinessVerificationPageScreen-Nce7icz0.js","assets/DrawerScreen-ClAWgRZL.js","assets/SetupPagesScreen-Dofrysh_.js","assets/BillPayApprovalRoutes-3EoXz0ZY.js","assets/ReimbursementApprovalRuleDetailScreen-CCuMPoSQ.js","assets/getLocaleForTenant-CgHoQ1eD.js","assets/ReimbursementRoutes-UoeOjPcY.js","assets/ReimbursementApprovalRoutes-DJ4bkGDP.js","assets/TransactionListRoutes-Co9yJGWM.js","assets/ZeniAccountStatementScreen-CPlmGVIe.js","assets/SettingsRoutes-ssqLUH47.js","assets/AccountMappingScreen-CQ7H13AJ.js","assets/QBOConnectionScreen-d5CTtraJ.js","assets/empty-DHCuvVpz.js","assets/index-BYMHtOlo.js","assets/url-DyU7tVdi.js","assets/index-9Ja3Lqmf.js","assets/accountMappingHelper-C49jxhGs.js","assets/useEmailConnectResultRefresh-BEnYjVgX.js","assets/ReportsRoutes-DLgdpJm_.js","assets/ChargeCardRoutes-Dd-PxeHo.js","assets/useChargeCardPusherEvents-Bqb5brTt.js","assets/PeopleRoutes-Slg7y6En.js","assets/ExpenseAutomationRoutes-CBA2iWWZ.js","assets/useActualMatchingMatchDetail-Cu82mAOm.js","assets/ScheduleDetailsPrepaidExpensesScreen-CbzZSAqb.js","assets/pathToGoBack-B4fU8Azr.js","assets/TreasuryRoutes-Can8ukgJ.js","assets/VendorsRoutes-CBDR6q2p.js","assets/ZeniAccountRoutes-Btl8MnMC.js","assets/AddressRoutes-B6YbK3vV.js","assets/PandLWithForecastRoutes-DsyrosDN.js","assets/CustomerOnboardingRoutes-XyONN9ww.js","assets/TransactionDetailRoutes-OdKQWakM.js","assets/EntityDetailRoutes-Bci8_0b4.js","assets/InvoicingRoutes-BUMLkBJ7.js","assets/NotificationRoutes-BnRbqfhI.js","assets/PerformanceRoutes-DkaD6CAf.js","assets/ActualMatchingMatchDetailScreen-CiDidq0s.js","assets/RewardsRoutes-C8Bk8JZD.js","assets/TaskRoutes-CxfTcH7l.js","assets/TaskListScreen-BvWmomDK.js","assets/AiCfoScreen-QnyN7vBU.js","assets/CardsAiCfoScreen-DtOqwcGQ.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fF as ps,d_ as xs,dZ as gs,AZ as Rs,di as Is,c8 as js,gJ as Ts,g9 as As,df as pe,cG as bs,gn as Ds,cy as ys,bE as fs,br as Cs,U3 as vs,v as Us,U6 as Os,bq as Ps,U7 as ws,bK as Fs,bJ as Ls,bt as ks,cu as Hs,U8 as Vs,U9 as Ss,da as Bs,dd as Ns,dc as Ms,cF as Zs,cM as Gs,pS as xe,gi as ge,gY as $s,gk as Re,gL as Ie,gM as je,gl as zs}from"./zeni-epic-state-D8p_bjl4.js";import{j as e}from"./liveblocks-BIpuBqDU.js";import{a as P}from"./sentry-B2ljjuRI.js";import{N as u,u as Ys,h as qs,i as Js,g as Ws,j as G,q as Te,n as Ks,o as n}from"./core-D9_r48xZ.js";import{H as l,E as Qs,u as Xs,z as f,c as et,e as st,X as tt,A as B,g as nt,I as at,Q as ot,L as F,G as Ae,t as _,J as rt,P as it,K as lt,k as ne}from"./index-BWlvyCtM.js";import"./mui-81_cRiBE.js";import{f as be}from"./analyticsHelper-CMH3f5Mv.js";import{t as ut}from"./getLocaleForTenant-CgHoQ1eD.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="84058b34-31b9-4b83-a209-867475acf170",o._sentryDebugIdIdentifier="sentry-dbid-84058b34-31b9-4b83-a209-867475acf170")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-DYgKmfND.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(k===!0){if(o)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(U)return e.jsx(fe,{tenantEmailDomain:v})}return o?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):U?e.jsx(fe,{tenantEmailDomain:v}):D?e.jsx(mt,{tenantEmailDomain:v}):N?e.jsx(ct,{tenantEmailDomain:v}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-dkthXH1f.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-M6mZc5N-.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-UoeOjPcY.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-Co9yJGWM.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-ssqLUH47.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-DLgdpJm_.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-Dd-PxeHo.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-Slg7y6En.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CBA2iWWZ.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-Can8ukgJ.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-CBDR6q2p.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-Btl8MnMC.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},Et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},ht=l((()=>s((()=>import("./ReportsRoutes-DLgdpJm_.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),pt=l((()=>s((()=>import("./AddressRoutes-B6YbK3vV.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-Slg7y6En.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-DsyrosDN.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-XyONN9ww.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),It=l((()=>s((()=>import("./VendorsRoutes-CBDR6q2p.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),jt=l((()=>s((()=>import("./TransactionDetailRoutes-OdKQWakM.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-Bci8_0b4.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),Tt=l((()=>s((()=>import("./DashboardRoutes-dkthXH1f.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-M6mZc5N-.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),At=l((()=>s((()=>import("./SettingsRoutes-ssqLUH47.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),bt=l((()=>s((()=>import("./InvoicingRoutes-BUMLkBJ7.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Ue=l((()=>s((()=>import("./ReimbursementRoutes-UoeOjPcY.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),Dt=l((()=>s((()=>import("./ZeniAccountRoutes-Btl8MnMC.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),yt=l((()=>s((()=>import("./TreasuryRoutes-Can8ukgJ.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-Co9yJGWM.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),Ct=l((()=>s((()=>import("./ChargeCardRoutes-Dd-PxeHo.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),vt=l((()=>s((()=>import("./NotificationRoutes-BnRbqfhI.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ut=l((()=>s((()=>import("./PerformanceRoutes-DkaD6CAf.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ot=l((()=>s((()=>import("./ExpenseAutomationRoutes-CBA2iWWZ.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Pt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-CiDidq0s.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),wt=l((()=>s((()=>import("./RewardsRoutes-C8Bk8JZD.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Ft=l((()=>s((()=>import("./TaskRoutes-CxfTcH7l.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-QnyN7vBU.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,23,54,15,8])))),Oe=l((()=>s((()=>import("./CardsAiCfoScreen-DtOqwcGQ.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-DYgKmfND.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),kt=l((()=>s((()=>import("./TaskListScreen-BvWmomDK.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,8])))),Ht=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:H})=>{if(U===!0){if(D)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return v===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Ys(),N=qs(),{tenantEmailDomain:i}=Js(),k=Qs().mode,{setLoading:U,clearAllLoading:v,clearLoading:H}=Xs(),y=f.getSignedInUserTenant(i)?.tenantId,j=f.getSignedInUser(),W=hs(j),$=Ws(),[L,we]=P.useState(!1),r=G((a=>ps(a))),{useFeatureGate:V}=et(),M=st(),K=tt(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=V(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=V(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?xs(oe,r):void 0,Q=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!Is(r):void 0,He=nt(r,ke,oe),{isCardsHidden:Ve}=at(r?.tenantId),Se=!He||!!Ve,{isFeatureEnabled:Be}=V(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=V(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=V(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||lt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),z=G((a=>Ts(a)));if(i!=null){const a=f.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,k)}const Z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=As(),h=ot(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=bs(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?Ds(a,Z.tenantId):void 0));P.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const A=ys(Number(a[0])),c=Number(a[1]),t=fs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=Cs();t.isAfter(d,"month")===!1?D(vs(y,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,y]),P.useEffect((()=>{L||(we(!0),U(F.TENANT_FETCHING))}),[L,Z,ie,j,D,f]),P.useLayoutEffect((()=>{!Us(ie,Z)&&f.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=f.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(ut(t)),d?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,D,Ye))}),[y]),P.useEffect((()=>{f.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,Es=c!=null&&c.externalConnections==null;if(q&&ms){S(Re(t));const J=f.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(je(d.userId,t)))}else q&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(Ie(d.userId,t))),q&&Es&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(je(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,y,j,U,D))}),[y,p]),P.useEffect((()=>{f.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),f.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&be(j,r,k,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&U(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(v(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,y,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=Et,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=_t[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const O=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:qe}=V(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=V(B.isAccrualEnabled),We=rt(),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,de=!Se&&!O,Xe=ws(h?.loggedInUserRoleMap),es=r.externalConnections?.accounting[0]?.isValid,ss=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&Fs(h?.loggedInUserRoleMap),_e=Fe&&!O,ts=Le&&!O,ns=ue&&Ls(h?.loggedInUserRoleMap),as=de&&ks(h?.loggedInUserRoleMap),os=_e&&Hs(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),ds=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),g=Gs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&ls,I=ts&&us,m=de&&ds,cs=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Xe===!0||rs===!0||is===!0;return f.isSignedIn()?y==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&T!=="In-Progress"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&ss&&es!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(it,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Ht,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(Tt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&O===!1||Ke||Qe?e.jsx(jt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&O===!1?e.jsx(ft,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&O===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&O===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(kt,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ft,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(yt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ut,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&O===!1?e.jsx(Ot,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&O===!1&&Je===!0&&We===!0?e.jsx(Pt,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(vt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(It,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(At,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Ct,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(wt,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,zt as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DJozFz1F.js";import{a as d}from"./sentry-C1W0cBeR.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-DrG65cn7.js";import{fF as w,Zg as ve,Nv as Pe,YQ as we,YZ as Ae,c8 as W,cT as De,cU as Ue,bq as _e,de as Te,FV as Me,Zh as Re,OY as Be,Mm as Ze,Md as de,Ma as Fe,FZ as ue,Mg as pe,Mj as ge,Mp as X,C9 as ee,FY as Ve,lu as $,lx as me,Zi as Ne,mH as Oe,Ge as Le,Vw as Ge,Vx as $e,ls as He,Zj as Ke,lv as qe,uA as ze,Vr as Qe,Vs as Ye,uE as Je,hV as We,Uq as Q,hN as ae,hK as Xe,hS as en,Ur as nn,Gb as tn,Zk as an,Zl as on,MD as sn,l$ as rn,dZ as fe,d_ as he,Zm as ln,gC as cn,UG as dn,Ga as oe,gH as se,gG as un,G9 as pn,gF as gn,gE as mn,Zn as fn,TS as Ce,Zo as hn,Zp as Cn,Zq as yn,Zr as Sn,Zs as bn,Zt as In,Gh as xn,Zu as En,G8 as ie,G2 as G,Zv as kn,Zw as jn,Zx as re,Zy as vn,dS as Pn,Zz as wn,ZA as An,ZB as Dn,U2 as Un,c0 as _n,c7 as Tn,c6 as Mn,c1 as Rn,ZC as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-1I_oueWp.js";import{bT as On,z as P,Q as L,a8 as ne,c3 as Ln,k as q,c as te,A as F,g as ye,I as Se,c4 as Gn,j as $n,_ as be,c5 as Hn,aj as Kn,c6 as qn,c7 as zn,ar as Qn,c8 as Yn,p as Jn,d as Ie,c9 as Wn}from"./index-CNCkAPT0.js";import{n as B}from"./mui-DqsEgFea.js";import{u as xe}from"./useTaskManagerAccess-D96Us8rE.js";import{U as Xn}from"./AccountMappingScreen-Q7xW7M5J.js";import{t as et,A as nt}from"./AddressScreen-D8vDeQgw.js";import V from"./NotFoundScreen-DWq-K_Je.js";import{g as tt}from"./analyticsHelper-IpMM6iCb.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-qi4m6Iwf.js";import{C as st}from"./CompanyPassportScreen-CP4WxYKA.js";import{M}from"./MobileAppDrawer-kvOHgs7K.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DeZjyILj.js";import{q as le}from"./QBOConnectionScreen-JAiYPx6A.js";import{B as lt}from"./BillPayApprovalRoutes-DvcTgpbu.js";import{R as ct}from"./ReimbursementApprovalRoutes-bNJ7cOlD.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./accountMappingHelper-ZA3eE2RB.js";import"./routePaths-BlVxV4y9.js";import"./InboxNotificationsProvider-Dwt_tkdC.js";import"./empty-hypZVcyj.js";import"./pdf-lib-CYVFTJz1.js";import"./index-DWaMzRgO.js";import"./url-BrtuL5Mk.js";import"./index-CItropkZ.js";import"./decodeURIComponentSafe-Cq-VPmfw.js";import"./ReimbursementApprovalRuleDetailScreen-BRScGn-s.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="5bf33542-57a4-43c7-9dae-15f49881bf78",e._sentryDebugIdIdentifier="sentry-dbid-5bf33542-57a4-43c7-9dae-15f49881bf78")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-BIpuBqDU.js";import{a as d}from"./sentry-B2ljjuRI.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-D9_r48xZ.js";import{fF as w,Zg as ve,Nv as Pe,YQ as we,YZ as Ae,c8 as W,cT as De,cU as Ue,bq as _e,de as Te,FV as Me,Zh as Re,OY as Be,Mm as Ze,Md as de,Ma as Fe,FZ as ue,Mg as pe,Mj as ge,Mp as X,C9 as ee,FY as Ve,lu as $,lx as me,Zi as Ne,mH as Oe,Ge as Le,Vw as Ge,Vx as $e,ls as He,Zj as Ke,lv as qe,uA as ze,Vr as Qe,Vs as Ye,uE as Je,hV as We,Uq as Q,hN as ae,hK as Xe,hS as en,Ur as nn,Gb as tn,Zk as an,Zl as on,MD as sn,l$ as rn,dZ as fe,d_ as he,Zm as ln,gC as cn,UG as dn,Ga as oe,gH as se,gG as un,G9 as pn,gF as gn,gE as mn,Zn as fn,TS as Ce,Zo as hn,Zp as Cn,Zq as yn,Zr as Sn,Zs as bn,Zt as In,Gh as xn,Zu as En,G8 as ie,G2 as G,Zv as kn,Zw as jn,Zx as re,Zy as vn,dS as Pn,Zz as wn,ZA as An,ZB as Dn,U2 as Un,c0 as _n,c7 as Tn,c6 as Mn,c1 as Rn,ZC as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-D8p_bjl4.js";import{bT as On,z as P,Q as L,a8 as ne,c3 as Ln,k as q,c as te,A as F,g as ye,I as Se,c4 as Gn,j as $n,_ as be,c5 as Hn,aj as Kn,c6 as qn,c7 as zn,ar as Qn,c8 as Yn,p as Jn,d as Ie,c9 as Wn}from"./index-BWlvyCtM.js";import{n as B}from"./mui-81_cRiBE.js";import{u as xe}from"./useTaskManagerAccess-DFbLYKBq.js";import{U as Xn}from"./AccountMappingScreen-CQ7H13AJ.js";import{t as et,A as nt}from"./AddressScreen-Bpb3fVmC.js";import V from"./NotFoundScreen-DYgKmfND.js";import{g as tt}from"./analyticsHelper-CMH3f5Mv.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-Nce7icz0.js";import{C as st}from"./CompanyPassportScreen-49ty9VyO.js";import{M}from"./MobileAppDrawer-yEi_dlxO.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-BEnYjVgX.js";import{q as le}from"./QBOConnectionScreen-d5CTtraJ.js";import{B as lt}from"./BillPayApprovalRoutes-3EoXz0ZY.js";import{R as ct}from"./ReimbursementApprovalRoutes-DJ4bkGDP.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.js";import"./accountMappingHelper-C49jxhGs.js";import"./routePaths-Clggvdtc.js";import"./InboxNotificationsProvider-C4Mxy7-U.js";import"./empty-DHCuvVpz.js";import"./pdf-lib-CJ09PoKW.js";import"./index-BYMHtOlo.js";import"./url-DyU7tVdi.js";import"./index-9Ja3Lqmf.js";import"./decodeURIComponentSafe-DyEaiyWX.js";import"./ReimbursementApprovalRuleDetailScreen-CCuMPoSQ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="5bf33542-57a4-43c7-9dae-15f49881bf78",e._sentryDebugIdIdentifier="sentry-dbid-5bf33542-57a4-43c7-9dae-15f49881bf78")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DJozFz1F.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as Y,t as Xe}from"./core-DrG65cn7.js";import{bJ as en,fF as F,cG as nn,HJ as $,YQ as tn,YT as an,uT as ne,uH as te,mz as ae,BH as R,YV as Ce,gG as He,gF as We,gE as Ye,YW as sn,HS as on,Mm as he,Md as Ie,Ma as Ae,LU as q,Mg as _e,Mj as ke,Mp as ve,C9 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,YX as mn,KU as de,Lw as yn,YY as fn,bK as gn,NH as le,Nv as Sn,YZ as bn,Y_ as Cn,NL as hn,NP as In,Y$ as je,BA as An,Sb as _n,Ol as be,Pa as pe,Z0 as kn,Z1 as vn,Z2 as Pn,Z3 as Ge,Z4 as Tn,Vf as En,Y5 as Dn,Vu as Un,Z5 as Je,LY as wn,Vv as On,M0 as Fn,Z6 as Oe,Ov as Ke,mH as Vn,uK as qe,BJ as xn,bE as Ne,BV as Re,cE as Bn,Z7 as Qe,O2 as jn,O3 as Nn,O7 as Rn,Z8 as Ln,Oo as Le,Z9 as Mn,Za as zn,Zb as Zn,Zc as $n,gV as Hn,J1 as Wn,Zd as Yn,J6 as Gn,J5 as Jn}from"./zeni-epic-state-1I_oueWp.js";import{aj as Te,Q as ie,c as me,A as K,E as Ee,z as E,a9 as se,k as D,a8 as De,S as H,bQ as Kn,af as oe,bR as V,bj as Ve,bS as qn,bT as Qn,bU as Xn,o as Be,bV as et,p as Me,aH as ze,a2 as nt,ac as tt,bW as at,bX as it,bY as st,w as ot}from"./index-CNCkAPT0.js";import{a as h}from"./sentry-C1W0cBeR.js";import{n as xe,D as ct,S as rt}from"./mui-DqsEgFea.js";import{u as ut,B as we}from"./BusinessVerificationPageScreen-qi4m6Iwf.js";import{M as ye}from"./MobileAppDrawer-kvOHgs7K.js";import N from"./NotFoundScreen-DWq-K_Je.js";import{a as Ze}from"./analyticsHelper-IpMM6iCb.js";import{d as $e}from"./routePaths-BlVxV4y9.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]="91272bb8-d2b6-46be-8a90-9b404b11eecf",e._sentryDebugIdIdentifier="sentry-dbid-91272bb8-d2b6-46be-8a90-9b404b11eecf")}catch{}})();const dt=xe.div`
1
+ import{j as u}from"./liveblocks-BIpuBqDU.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as Y,t as Xe}from"./core-D9_r48xZ.js";import{bJ as en,fF as F,cG as nn,HJ as $,YQ as tn,YT as an,uT as ne,uH as te,mz as ae,BH as R,YV as Ce,gG as He,gF as We,gE as Ye,YW as sn,HS as on,Mm as he,Md as Ie,Ma as Ae,LU as q,Mg as _e,Mj as ke,Mp as ve,C9 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,YX as mn,KU as de,Lw as yn,YY as fn,bK as gn,NH as le,Nv as Sn,YZ as bn,Y_ as Cn,NL as hn,NP as In,Y$ as je,BA as An,Sb as _n,Ol as be,Pa as pe,Z0 as kn,Z1 as vn,Z2 as Pn,Z3 as Ge,Z4 as Tn,Vf as En,Y5 as Dn,Vu as Un,Z5 as Je,LY as wn,Vv as On,M0 as Fn,Z6 as Oe,Ov as Ke,mH as Vn,uK as qe,BJ as xn,bE as Ne,BV as Re,cE as Bn,Z7 as Qe,O2 as jn,O3 as Nn,O7 as Rn,Z8 as Ln,Oo as Le,Z9 as Mn,Za as zn,Zb as Zn,Zc as $n,gV as Hn,J1 as Wn,Zd as Yn,J6 as Gn,J5 as Jn}from"./zeni-epic-state-D8p_bjl4.js";import{aj as Te,Q as ie,c as me,A as K,E as Ee,z as E,a9 as se,k as D,a8 as De,S as H,bQ as Kn,af as oe,bR as V,bj as Ve,bS as qn,bT as Qn,bU as Xn,o as Be,bV as et,p as Me,aH as ze,a2 as nt,ac as tt,bW as at,bX as it,bY as st,w as ot}from"./index-BWlvyCtM.js";import{a as h}from"./sentry-B2ljjuRI.js";import{n as xe,D as ct,S as rt}from"./mui-81_cRiBE.js";import{u as ut,B as we}from"./BusinessVerificationPageScreen-Nce7icz0.js";import{M as ye}from"./MobileAppDrawer-yEi_dlxO.js";import N from"./NotFoundScreen-DYgKmfND.js";import{a as Ze}from"./analyticsHelper-CMH3f5Mv.js";import{d as $e}from"./routePaths-Clggvdtc.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]="91272bb8-d2b6-46be-8a90-9b404b11eecf",e._sentryDebugIdIdentifier="sentry-dbid-91272bb8-d2b6-46be-8a90-9b404b11eecf")}catch{}})();const dt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-DJozFz1F.js";import{a as u,R as T,q as A}from"./sentry-C1W0cBeR.js";import{u as D,h as z,j as l,g as O,N as j,l as M}from"./core-DrG65cn7.js";import{u as F,z as s,E as P,k as w,G as _,O as N,S as B,T as V,V as $,Z as q,_ as v}from"./index-CNCkAPT0.js";import{fF as J,TO as R,U6 as W,gi as Z,gk as G,Ub as H,gU as K,dj as Q,Uc as y,Ud as X,Ue as Y,b$ as U}from"./zeni-epic-state-1I_oueWp.js";import"./mui-DqsEgFea.js";import{u as ee}from"./useDeviceId-BQkxGsaf.js";import{f as te}from"./analyticsHelper-IpMM6iCb.js";import{t as ne}from"./getLocaleForTenant-MjJHWv6K.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.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]="e82a90f2-f03f-47a7-b6ac-17f3a6678ee2",t._sentryDebugIdIdentifier="sentry-dbid-e82a90f2-f03f-47a7-b6ac-17f3a6678ee2")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(y())}}}))(q),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>J(e))),I=l((e=>R(e))),m=O(),E=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),Z(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),K().then((()=>{const e=$();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))}),2e3))}),[S,p,h,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&L!=null?f.jsx(V,{onClose:()=>i(y()),unlockDate:L}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-BIpuBqDU.js";import{a as u,R as T,q as A}from"./sentry-B2ljjuRI.js";import{u as D,h as z,j as l,g as O,N as j,l as M}from"./core-D9_r48xZ.js";import{u as F,z as s,E as P,k as w,G as _,O as N,S as B,T as V,V as $,Z as q,_ as v}from"./index-BWlvyCtM.js";import{fF as J,TO as R,U6 as W,gi as Z,gk as G,Ub as H,gU as K,dj as Q,Uc as y,Ud as X,Ue as Y,b$ as U}from"./zeni-epic-state-D8p_bjl4.js";import"./mui-81_cRiBE.js";import{u as ee}from"./useDeviceId-CrjinlLp.js";import{f as te}from"./analyticsHelper-CMH3f5Mv.js";import{t as ne}from"./getLocaleForTenant-CgHoQ1eD.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.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]="e82a90f2-f03f-47a7-b6ac-17f3a6678ee2",t._sentryDebugIdIdentifier="sentry-dbid-e82a90f2-f03f-47a7-b6ac-17f3a6678ee2")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(y())}}}))(q),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>J(e))),I=l((e=>R(e))),m=O(),E=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),Z(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),K().then((()=>{const e=$();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))}),2e3))}),[S,p,h,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&L!=null?f.jsx(V,{onClose:()=>i(y()),unlockDate:L}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-DJozFz1F.js";import{a as i}from"./sentry-C1W0cBeR.js";import{u as l,g as c,N as u}from"./core-DrG65cn7.js";import{z as n,k as a,S as m,a8 as p}from"./index-CNCkAPT0.js";import{gX as g,Us as y}from"./zeni-epic-state-1I_oueWp.js";import{n as b}from"./mui-DqsEgFea.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.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]="e78a53ed-68d3-4213-86ba-5a90f100f396",e._sentryDebugIdIdentifier="sentry-dbid-e78a53ed-68d3-4213-86ba-5a90f100f396")}catch{}})();function N(){const e=l(),t=c(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
1
+ import{j as s}from"./liveblocks-BIpuBqDU.js";import{a as i}from"./sentry-B2ljjuRI.js";import{u as l,g as c,N as u}from"./core-D9_r48xZ.js";import{z as n,k as a,S as m,a8 as p}from"./index-BWlvyCtM.js";import{gX as g,Us as y}from"./zeni-epic-state-D8p_bjl4.js";import{n as b}from"./mui-81_cRiBE.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.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]="e78a53ed-68d3-4213-86ba-5a90f100f396",e._sentryDebugIdIdentifier="sentry-dbid-e78a53ed-68d3-4213-86ba-5a90f100f396")}catch{}})();function N(){const e=l(),t=c(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as G}from"./liveblocks-DJozFz1F.js";import{a as f}from"./sentry-C1W0cBeR.js";import{h as pa,u as Ta,g as fa,k as ga,j as F,i as _a,l as ma}from"./core-DrG65cn7.js";import{aL as Da,aM as ba,z as Q,c as Sa,A as C,at as ha,a9 as Ea,k as ya,S as Aa,e8 as Ga,p as R,a5 as Ca}from"./index-CNCkAPT0.js";import{fF as Ia,a1W as Y,QZ as B,a1X as J,a1S as Ba,Ql as M,a1Y as La,Qt as W,Q3 as va,PH as Ka,Q_ as V,a1Z as q,gh as wa,QQ as Ra,QV as Ua,QI as Pa,QG as H,QW as Fa,QD as ja,a1_ as Qa,a1$ as xa,a20 as $a,a21 as Oa,a22 as I,dx as Na,dw as Za,a23 as za,Q0 as Ma}from"./zeni-epic-state-1I_oueWp.js";import{n as Wa}from"./mui-DqsEgFea.js";import{u as Va}from"./useAskAiCfoHostNavButtonProps-DDB7rJuC.js";import{M as qa}from"./MobileAppDrawer-kvOHgs7K.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]="8927f86a-a2fb-43ec-8918-5e5245012d0b",e._sentryDebugIdIdentifier="sentry-dbid-8927f86a-a2fb-43ec-8918-5e5245012d0b")}catch{}})();const d={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},Ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),U=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ya=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const o={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(o.is_private=a.is_private),U(a.assignees)&&(o.assignees=a.assignees),U(a.direct_assignees)&&(o.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(o.created_by=a.created_by),U(a.task_group_ids)&&(o.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(o.name=a.name),typeof a.parent_task_id=="string"&&(o.parent_task_id=a.parent_task_id),o},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return U(a.task_ids)?{task_ids:a.task_ids}:null},pe=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},ae=e=>{const{events:a,onEvent:n,onSubscribed:o}=e,i=Da(),g=f.useRef(n),l=f.useRef(o),_=f.useRef(0);f.useEffect((()=>{g.current=n}),[n]),f.useEffect((()=>{l.current=o}),[o]);const t=f.useMemo((()=>[...a].sort().join("|")),[a]);f.useEffect((()=>{if(i==null||a.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return a.forEach((m=>{const[D,b]=ba(m);if(b==="")return;const E=i.channel(D),y=T=>{g.current(b,T)};let k;if(E?.subscribed===!0){if(k=E,k.bind(b,y),!p.has(D)){p.add(D),S();const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{E.unbind(b,y)}))}else{if(k=E??i.subscribe(D),k.bind(b,y),!p.has(D)){p.add(D);const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{k.unbind(b,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},ee=Wa.div`
1
+ import{j as G}from"./liveblocks-BIpuBqDU.js";import{a as f}from"./sentry-B2ljjuRI.js";import{h as pa,u as Ta,g as fa,k as ga,j as F,i as _a,l as ma}from"./core-D9_r48xZ.js";import{aL as Da,aM as ba,z as Q,c as Sa,A as C,at as ha,a9 as Ea,k as ya,S as Aa,e6 as Ga,p as R,a5 as Ca}from"./index-BWlvyCtM.js";import{fF as Ia,a1W as Y,QZ as B,a1X as J,a1S as Ba,Ql as M,a1Y as La,Qt as W,Q3 as va,PH as Ka,Q_ as V,a1Z as q,gh as wa,QQ as Ra,QV as Ua,QI as Pa,QG as H,QW as Fa,QD as ja,a1_ as Qa,a1$ as xa,a20 as $a,a21 as Oa,a22 as I,dx as Na,dw as Za,a23 as za,Q0 as Ma}from"./zeni-epic-state-D8p_bjl4.js";import{n as Wa}from"./mui-81_cRiBE.js";import{u as Va}from"./useAskAiCfoHostNavButtonProps-0qWmdvwE.js";import{M as qa}from"./MobileAppDrawer-yEi_dlxO.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]="390615d2-30fc-44e6-8787-9a7bf0c8852a",e._sentryDebugIdIdentifier="sentry-dbid-390615d2-30fc-44e6-8787-9a7bf0c8852a")}catch{}})();const d={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},Ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),U=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ya=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const o={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(o.is_private=a.is_private),U(a.assignees)&&(o.assignees=a.assignees),U(a.direct_assignees)&&(o.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(o.created_by=a.created_by),U(a.task_group_ids)&&(o.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(o.name=a.name),typeof a.parent_task_id=="string"&&(o.parent_task_id=a.parent_task_id),o},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return U(a.task_ids)?{task_ids:a.task_ids}:null},pe=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},ae=e=>{const{events:a,onEvent:n,onSubscribed:o}=e,i=Da(),g=f.useRef(n),l=f.useRef(o),_=f.useRef(0);f.useEffect((()=>{g.current=n}),[n]),f.useEffect((()=>{l.current=o}),[o]);const t=f.useMemo((()=>[...a].sort().join("|")),[a]);f.useEffect((()=>{if(i==null||a.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return a.forEach((m=>{const[D,b]=ba(m);if(b==="")return;const E=i.channel(D),y=T=>{g.current(b,T)};let k;if(E?.subscribed===!0){if(k=E,k.bind(b,y),!p.has(D)){p.add(D),S();const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{E.unbind(b,y)}))}else{if(k=E??i.subscribe(D),k.bind(b,y),!p.has(D)){p.add(D);const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{k.unbind(b,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},ee=Wa.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -0,0 +1,9 @@
1
+ import{j as r}from"./liveblocks-BIpuBqDU.js";import ue from"./NotFoundScreen-DYgKmfND.js";import{a as k}from"./sentry-B2ljjuRI.js";import{h as Y,u as ee,j as b,g as de,i as ke,N as pe,l as me,n as Se,o as E}from"./core-D9_r48xZ.js";import{PU as ae,PX as fe,PR as Te,a1R as ge,fF as te,a1S as se,Qh as g,Q9 as T,PO as he,QN as Ee,QG as be,a1T as ne,gh as oe,a1U as M,PK as Ie,PH as De,uT as Ce,uH as Ge,mz as _e,Q7 as Re,a1V as Ue,Q_ as ye,Q3 as Pe,Qs as xe,Qp as Be,P_ as we,Qm as Ae,Ql as ve}from"./zeni-epic-state-D8p_bjl4.js";import{z as R,e4 as je,M as Fe,c as Le,A as G,a5 as ie,p as _,a9 as Ke,k as Z,S as $e,e5 as Qe,_ as q,af as Ne}from"./index-BWlvyCtM.js";import{n as Oe}from"./mui-81_cRiBE.js";import{u as ze}from"./useInitialThreadRequest-D_wVO4z2.js";import{M as Ve}from"./MobileAppDrawer-yEi_dlxO.js";import{b as Me,a as Ze,u as qe,T as f,t as He,c as H,d as X,e as Xe}from"./TaskListScreen-BvWmomDK.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.js";import"./InboxNotificationsProvider-C4Mxy7-U.js";import"./useTaskManagerAccess-DFbLYKBq.js";import"./useAskAiCfoHostNavButtonProps-0qWmdvwE.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]="cfdace18-37ac-42e1-93ee-1ecc565c64b0",e._sentryDebugIdIdentifier="sentry-dbid-cfdace18-37ac-42e1-93ee-1ecc565c64b0")}catch{}})();function Je(){const e=Y(),a=ee(),n=R.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(je,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,j=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},We=ge([j,(e,a)=>{const n=j(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=j(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let J,W=[];const Ye=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=We(e,a.taskId),m=s.taskGroupId??c,t=m!=null?M(e.taskGroupState,m):void 0,o=R.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},x=se(e),{tenantEmailDomain:B}=u,U=s.recurringSourceTaskId,w=U!=null?`${q.appUrl}/${B}/tasks/${encodeURIComponent(U)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:R.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==J&&(J=h,W=Object.values(h)),W),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${q.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:x,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>M(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(ve({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(Ae(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(we(a.taskId))},onSnoozeTask:(t,o)=>{e(Be(t,o))},onUnsnoozeTask:t=>{e(xe(t))},onCreateSubtask:(t,o)=>{e(Pe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(ye({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=P(m),o=_(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(Ue({taskId:n}))},onDeleteTaskClick:()=>{e(Re(n))},updateFilesEntity:t=>{e(_e({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Qe);function F(){const e=Y(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((i=>te(i))),m=ze(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=t(G.isTaskGroupAssigneesEnabled),[U,w]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[$,A]=k.useState(!1),C=k.useRef(!1),y=b((i=>i.taskListState.updateTasksFetchState.fetchState)),Q=b((i=>se(i))),N=b((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const O=R.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Me(d?.companyId,i),...Ze(O,l)]}),[d?.companyId,O]);qe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{X(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=X(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=H(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=H(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(P(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{He(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||Q.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,Q.fetchState]),k.useEffect((()=>{K||N==="Completed"||(re(!0),a(Ee()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),A(!0))}),[a,s]);k.useEffect((()=>{if($)if(y!=="In-Progress"){if(C.current){if(y==="Error")return A(!1),void(C.current=!1);if(y==="Completed"){A(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=P(i);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,y,d,n,e]);const z=b((i=>ne(i,s))),v=z.fetchState,V=R.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(v==="Error"&&z.error?.code===400){const{tenantEmailDomain:i}=d,l=P(i),p=_(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[v==="Completed"?r.jsx(Ke,{analytics:Z,onLoad:i=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(Ve,{isAppContentDrawerOpen:U,handleDrawerToggle:i=>{w(i)}}),r.jsx(Ye,{analytics:Z,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:v,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:x,isTaskGroupAssigneesEnabled:B})]})]})}const ea=Oe.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,P=e=>`/${e}/tasks`;function Da(){return r.jsxs(Se,{children:[r.jsx(E,{path:"/new",element:r.jsx(F,{})}),r.jsx(E,{path:"/new/:taskGroupId",element:r.jsx(F,{})}),r.jsx(E,{path:"/group/:taskGroupId",element:r.jsx(Xe,{})}),r.jsx(E,{path:"/quick-responses",element:r.jsx(Je,{})}),r.jsx(E,{path:"/:taskId",element:r.jsx(F,{})}),r.jsx(E,{path:"*",element:r.jsx(ue,{})})]})}export{Da as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-BIpuBqDU.js";import i from"./NotFoundScreen-DYgKmfND.js";import{T as r}from"./TransactionDetailScreen-CJaRW_q2.js";import"./sentry-B2ljjuRI.js";import{n as a,o as e}from"./core-D9_r48xZ.js";import"./zeni-epic-state-D8p_bjl4.js";import"./recharts-D2tzVFIn.js";import"./index-BWlvyCtM.js";import"./mui-81_cRiBE.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.js";import"./useAskAiCfoHostNavButtonProps-0qWmdvwE.js";import"./decodeURIComponentSafe-DyEaiyWX.js";import"./useInitialThreadRequest-D_wVO4z2.js";import"./routePaths-Clggvdtc.js";import"./expenseAutomationHelper-Bmn0IF_K.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-DJozFz1F.js";import{a as i}from"./sentry-C1W0cBeR.js";import{u as W,k as sn,j as g,s as ge,g as ke,h as Ce,i as Ae,N as cn,l as rn}from"./core-DrG65cn7.js";import{pv as Ie,fF as ee,gV as ln,Uz as dn,oB as un,ob as mn,DB as se,bn as pn,df as Re,bq as _e,sP as H,VF as Y,WN as Pe,WO as le,W3 as we,ma as Fe,WP as Ue,W8 as de,W9 as ue,m$ as xe,S4 as me,WJ as G,m4 as Ve,m2 as Be,me as fn,pi as hn,WQ as Sn,WR as yn,Ds as K,m9 as Le,Rp as Oe,cm as Tn,dl as bn,WS as gn,WI as In,WT as vn,WU as En,WV as Dn,WW as kn,Do as Cn,WX as An,WY as Rn,WZ as _n,W_ as Pn,W$ as wn,md as Fn,X0 as Un,X1 as xn,WK as Vn,X2 as Bn,X3 as Ln,X4 as On,Rj as Nn,R9 as Wn,Ry as zn,mf as jn,S5 as ve,pn as Mn}from"./zeni-epic-state-1I_oueWp.js";import{c as Q,A,k as $,b3 as Gn,z as Ne,E as $n,a2 as qn,b4 as Xn,ac as Hn,a5 as ce,Q as Yn,b5 as Qn,p as ie,at as Jn,b6 as Kn,b7 as Zn,b8 as et,af as nt,aw as oe}from"./index-CNCkAPT0.js";import{n as tt,S as at,D as ot}from"./mui-DqsEgFea.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-DDB7rJuC.js";import{d as We}from"./decodeURIComponentSafe-Cq-VPmfw.js";import{u as ct}from"./useInitialThreadRequest-DjzuWq5l.js";import{h as ze,c as je,g as it,e as rt}from"./routePaths-BlVxV4y9.js";import{u as lt}from"./expenseAutomationHelper-BhQOMrvk.js";import{v as dt}from"./utils-BYrZSa_o.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="d18cdb28-a528-49e3-9a21-abb026582092",n._sentryDebugIdIdentifier="sentry-dbid-d18cdb28-a528-49e3-9a21-abb026582092")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=Q(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=Q(),{configValue:k,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&k?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,q=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:P}=g((l=>{const E=l.tenantState.currentTenantId,D=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:D?.capitalizableAccounts??null,capitalizableAccountOverrides:D?.capitalizableAccountOverrides??null,dismissedAccounts:D?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const w=i.useRef(_);w.current=_;const V=i.useRef(P);V.current=P;const B=g((l=>dn(l.accountState)),ge),X=i.useMemo((()=>{const l={};for(const E of B)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[B]),z=r!=null?X[r]??null:null,L=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const D=E.accounts??[],M=new Set(l),J=w.current??{},ne=V.current;for(const O of D)if(M.has(O.accountId)&&J[O.accountId]==null&&ne?.[O.accountId]==null)return d(O.classificationType),S(O.accountId),void y(!0)}),[b]),j=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:q,checkAndShowPopup:L,handleSubmit:j,handleDismiss:p}})(),t=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,Z=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),Me=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(Z(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Vt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),Me(n,t.feedback,t.transactionId))}))},Bt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,k,T)=>{const b=Ee(I,k,T),v=N.get(b);return v!=null&&(N.delete(b),Me(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(Z(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...Z(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(Z(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=Q(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Lt(n,e){const o=W(),{useFeatureGate:t}=Q(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:H(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,k=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return Pe(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return we(p.trendWithTransactionsState,T,"TransactionDetail")})),q=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,P]=i.useState(!1),[x,w]=i.useState(!1),[V,B]=i.useState(!1);i.useEffect((()=>{P(!1),w(!1),B(!1)}),[n,e]);const X=i.useCallback((()=>{P(!1),w(!1)}),[]),[z,L]=i.useState(!1),j=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),B(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(w(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:j??b}))):(o(de()),o(ue()),P(!0),o(xe(T))))}),[o,V,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,j]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:q,uncategorizedAccounts:U,resetTrendIsFetchedStates:X,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:L}}const ft={overlayWidth:new Hn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=qn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Be()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Ve({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(Xn,{...f})})})},St=tt(at)`
1
+ import{j as C}from"./liveblocks-BIpuBqDU.js";import{a as i}from"./sentry-B2ljjuRI.js";import{u as W,k as sn,j as g,s as ge,g as ke,h as Ce,i as Ae,N as cn,l as rn}from"./core-D9_r48xZ.js";import{pv as Ie,fF as ee,gV as ln,Uz as dn,oB as un,ob as mn,DB as se,bn as pn,df as Re,bq as _e,sP as H,VF as Y,WN as Pe,WO as le,W3 as we,ma as Fe,WP as Ue,W8 as de,W9 as ue,m$ as xe,S4 as me,WJ as G,m4 as Ve,m2 as Be,me as fn,pi as hn,WQ as Sn,WR as yn,Ds as K,m9 as Le,Rp as Oe,cm as Tn,dl as bn,WS as gn,WI as In,WT as vn,WU as En,WV as Dn,WW as kn,Do as Cn,WX as An,WY as Rn,WZ as _n,W_ as Pn,W$ as wn,md as Fn,X0 as Un,X1 as xn,WK as Vn,X2 as Bn,X3 as Ln,X4 as On,Rj as Nn,R9 as Wn,Ry as zn,mf as jn,S5 as ve,pn as Mn}from"./zeni-epic-state-D8p_bjl4.js";import{c as Q,A,k as $,b3 as Gn,z as Ne,E as $n,a2 as qn,b4 as Xn,ac as Hn,a5 as ce,Q as Yn,b5 as Qn,p as ie,at as Jn,b6 as Kn,b7 as Zn,b8 as et,af as nt,aw as oe}from"./index-BWlvyCtM.js";import{n as tt,S as at,D as ot}from"./mui-81_cRiBE.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-0qWmdvwE.js";import{d as We}from"./decodeURIComponentSafe-DyEaiyWX.js";import{u as ct}from"./useInitialThreadRequest-D_wVO4z2.js";import{h as ze,c as je,g as it,e as rt}from"./routePaths-Clggvdtc.js";import{u as lt}from"./expenseAutomationHelper-Bmn0IF_K.js";import{v as dt}from"./utils-DajTl1fi.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="d18cdb28-a528-49e3-9a21-abb026582092",n._sentryDebugIdIdentifier="sentry-dbid-d18cdb28-a528-49e3-9a21-abb026582092")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=Q(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=Q(),{configValue:k,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&k?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,q=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:P}=g((l=>{const E=l.tenantState.currentTenantId,D=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:D?.capitalizableAccounts??null,capitalizableAccountOverrides:D?.capitalizableAccountOverrides??null,dismissedAccounts:D?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const w=i.useRef(_);w.current=_;const V=i.useRef(P);V.current=P;const B=g((l=>dn(l.accountState)),ge),X=i.useMemo((()=>{const l={};for(const E of B)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[B]),z=r!=null?X[r]??null:null,L=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const D=E.accounts??[],M=new Set(l),J=w.current??{},ne=V.current;for(const O of D)if(M.has(O.accountId)&&J[O.accountId]==null&&ne?.[O.accountId]==null)return d(O.classificationType),S(O.accountId),void y(!0)}),[b]),j=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:q,checkAndShowPopup:L,handleSubmit:j,handleDismiss:p}})(),t=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,Z=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),Me=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(Z(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Vt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),Me(n,t.feedback,t.transactionId))}))},Bt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,k,T)=>{const b=Ee(I,k,T),v=N.get(b);return v!=null&&(N.delete(b),Me(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(Z(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...Z(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(Z(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=Q(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Lt(n,e){const o=W(),{useFeatureGate:t}=Q(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:H(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,k=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return Pe(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return we(p.trendWithTransactionsState,T,"TransactionDetail")})),q=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,P]=i.useState(!1),[x,w]=i.useState(!1),[V,B]=i.useState(!1);i.useEffect((()=>{P(!1),w(!1),B(!1)}),[n,e]);const X=i.useCallback((()=>{P(!1),w(!1)}),[]),[z,L]=i.useState(!1),j=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),B(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(w(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:j??b}))):(o(de()),o(ue()),P(!0),o(xe(T))))}),[o,V,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,j]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:q,uncategorizedAccounts:U,resetTrendIsFetchedStates:X,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:L}}const ft={overlayWidth:new Hn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=qn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Be()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Ve({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(Xn,{...f})})})},St=tt(at)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DJozFz1F.js";import{h as K,g as U,u as W,i as Z,j as g,N,l as Q,n as Me,o as C}from"./core-DrG65cn7.js";import{fF as X,u6 as ee,lf as p,eE as te,RX as Se,br as pe,$z as Be,l$ as ae,W5 as ne,$A as fe,$B as Le,bE as k,RT as he,$C as Fe,$D as Te,$E as Ge,RW as ge,$F as Oe,$G as De,$H as $e,$I as Ie,$J as ze,$K as we,$L as ye,T7 as Re}from"./zeni-epic-state-1I_oueWp.js";import{c as ce,A as q,k as F,G as ke,df as oe,p as w,a5 as se,ar as _e,X as Ve}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import{a as y}from"./sentry-C1W0cBeR.js";import{w as ie}from"./withTransactionSidePanel-D6eLtbjK.js";import{p as re,c as de}from"./routePaths-BlVxV4y9.js";import{w as Je}from"./utils-BYrZSa_o.js";import{d as j}from"./decodeURIComponentSafe-Cq-VPmfw.js";import{Z as qe}from"./ZeniAccountStatementScreen-C2TGrJJ3.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./useAskAiCfoHostNavButtonProps-DDB7rJuC.js";import"./TransactionDetailScreen-DEqpcfN2.js";import"./useInitialThreadRequest-DjzuWq5l.js";import"./expenseAutomationHelper-BhQOMrvk.js";import"./stripSplatSuffix-Dk3dK5Wm.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]="170c0168-f0cc-4528-8776-395d99f00fe5",a._sentryDebugIdIdentifier="sentry-dbid-170c0168-f0cc-4528-8776-395d99f00fe5")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Je(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ne=Q((function(a,e){const t=Be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=J(e.selectedAccount.tranListType),d=Ke(t,n,c,o,e.bookCloseDate);F.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:J(e.selectedAccount.tranListType)})),a(Se(o,p(d),!1,o==="missingReceipts"?Ye():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=K(),t=U(),n=W(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Z(),{accountType:Y,title:v,subTitle:A}=Xe(o),f="month",T=g((l=>X(l))),E=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:h}=S(q.isProjectsTransactionsEnabled),I=g((l=>ee(l)))&&h,{dataAvailable:x,initialTimeframeTick:G}=He(o,E,T.bookCloseDate),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=y.useMemo((()=>{const l=p(G);return{tranListType:o,accountType:te(Y),title:v,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){O(!0),F.trackTransactionList(void 0,void 0,void 0,u.title);const l=J(u.tranListType);n(Se(l,u.period,!0,l==="missingReceipts"?Ye():void 0))}}),[P,u,n]);let M=u;return u!=null&&b!=null&&(M={...u,period:b}),c==null||M==null?s.jsx(N,{to:"../"}):s.jsx(Ne,{firstMonthOfFY:E,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:M,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>$(l),...a})})),Xe=a=>{let e="",t="";const n=ke.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;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.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},He=(a,e,t)=>{const n=pe();let c=pe().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:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ke=(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},We=Q((function(a,e){const t=Fe(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:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(he(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=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Ze=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:E}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(E??""),G=g((r=>Le(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=g((r=>X(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(q.isProjectsTransactionsEnabled),z=g((r=>ee(r)))&&m;let i;const L=Qe(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=et(G?.dateRange,r);i={accountId:h,accountType:te(S),classId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(O(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&b!=null&&(B={...i,period:b});const R=[d,Y,v,A,f,T,E].filter((r=>r!=null));return L&&B!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(N,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=Q((function(a,e){const t=Oe(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:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ee();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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(ge(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=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:E}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(E??""),G=g((r=>Ge(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=g((r=>X(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(q.isProjectsTransactionsEnabled),z=g((r=>ee(r)))&&m;let i;const L=nt(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=ct(G?.dateRange,r);i={accountId:h,accountType:te(S),projectId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(O(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&b!=null&&(B={...i,period:b});const R=[d,Y,v,A,f,T,E].filter((r=>r!=null));return L&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(N,{to:Ee(R.length)})})),Ee=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=Q((function(a,e){const t=ze(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(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=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:v,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:E}=Z(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(E!=null&&E==="exclude_subaccounts"),G=g((D=>$e(D.transactionListState,h,S))),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=g((D=>X(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const z=st(S,h,v,A,f,I);if(z){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(G?.dateRange,D);m={accountId:h,accountType:te(S),title:I,timeframe:v,period:le}}let i=m;m!=null&&b!=null&&(i={...m,period:b});const{useFeatureGate:L}=ce(),{isFeatureEnabled:B}=L(q.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),H=new URLSearchParams(xe??"");H.set("view","full"),H.set("thread_id",le),H.set("entity_type",D.entityType);const Ce=w(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${H.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=L(q.isProjectsTransactionsEnabled),_=g((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=_e();y.useEffect((()=>{!P&&m!=null&&ue&&(O(!0),F.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const be=[d,Y,v,A,f,T].filter((D=>D!=null));return z&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:_,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>$(D),...e}):s.jsx(N,{to:Pe(be.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Bt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>X(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(qe,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/missing-receipts/*",element:t?s.jsx(N,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(C,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Bt as default};
1
+ import{j as s}from"./liveblocks-BIpuBqDU.js";import{h as K,g as U,u as W,i as Z,j as g,N,l as Q,n as Me,o as C}from"./core-D9_r48xZ.js";import{fF as X,u6 as ee,lf as p,eE as te,RX as Se,br as pe,$y as Be,l$ as ae,W5 as ne,$z as fe,$A as Fe,bE as k,RT as he,$B as Le,$C as Te,$D as Ge,RW as ge,$E as Oe,$F as De,$G as $e,$H as Ie,$I as ze,$J as we,$K as ye,T7 as Re}from"./zeni-epic-state-D8p_bjl4.js";import{c as ce,A as q,k as L,G as ke,dd as oe,p as w,a5 as se,ar as _e,X as Ve}from"./index-BWlvyCtM.js";import"./mui-81_cRiBE.js";import{a as y}from"./sentry-B2ljjuRI.js";import{w as ie}from"./withTransactionSidePanel-CJP44IF0.js";import{p as re,c as de}from"./routePaths-Clggvdtc.js";import{w as Je}from"./utils-DajTl1fi.js";import{d as j}from"./decodeURIComponentSafe-DyEaiyWX.js";import{Z as qe}from"./ZeniAccountStatementScreen-CPlmGVIe.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./useAskAiCfoHostNavButtonProps-0qWmdvwE.js";import"./TransactionDetailScreen-CJaRW_q2.js";import"./useInitialThreadRequest-D_wVO4z2.js";import"./expenseAutomationHelper-Bmn0IF_K.js";import"./stripSplatSuffix-UCDmTxu6.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]="4d02ae8e-0967-4134-9653-3c23df5dd8d4",a._sentryDebugIdIdentifier="sentry-dbid-4d02ae8e-0967-4134-9653-3c23df5dd8d4")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Je(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ne=Q((function(a,e){const t=Be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=J(e.selectedAccount.tranListType),d=Ke(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:J(e.selectedAccount.tranListType)})),a(Se(o,p(d),!1,o==="missingReceipts"?Ye():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=K(),t=U(),n=W(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Z(),{accountType:Y,title:v,subTitle:A}=Xe(o),f="month",T=g((l=>X(l))),E=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:h}=S(q.isProjectsTransactionsEnabled),I=g((l=>ee(l)))&&h,{dataAvailable:x,initialTimeframeTick:G}=He(o,E,T.bookCloseDate),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=y.useMemo((()=>{const l=p(G);return{tranListType:o,accountType:te(Y),title:v,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=J(u.tranListType);n(Se(l,u.period,!0,l==="missingReceipts"?Ye():void 0))}}),[P,u,n]);let M=u;return u!=null&&b!=null&&(M={...u,period:b}),c==null||M==null?s.jsx(N,{to:"../"}):s.jsx(Ne,{firstMonthOfFY:E,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:M,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>$(l),...a})})),Xe=a=>{let e="",t="";const n=ke.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;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.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},He=(a,e,t)=>{const n=pe();let c=pe().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:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ke=(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},We=Q((function(a,e){const t=Le(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:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();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)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(he(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=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Ze=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:E}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(E??""),G=g((r=>Fe(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=g((r=>X(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(q.isProjectsTransactionsEnabled),z=g((r=>ee(r)))&&m;let i;const F=Qe(S,h,I,A,f,T,x);if(F){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=et(G?.dateRange,r);i={accountId:h,accountType:te(S),classId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&b!=null&&(B={...i,period:b});const R=[d,Y,v,A,f,T,E].filter((r=>r!=null));return F&&B!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(N,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=Q((function(a,e){const t=Oe(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:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ee();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)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(ge(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=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:E}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(E??""),G=g((r=>Ge(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=g((r=>X(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(q.isProjectsTransactionsEnabled),z=g((r=>ee(r)))&&m;let i;const F=nt(S,h,I,A,f,T,x);if(F){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=ct(G?.dateRange,r);i={accountId:h,accountType:te(S),projectId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&b!=null&&(B={...i,period:b});const R=[d,Y,v,A,f,T,E].filter((r=>r!=null));return F&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(N,{to:Ee(R.length)})})),Ee=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=Q((function(a,e){const t=ze(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();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)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(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=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:v,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:E}=Z(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(E!=null&&E==="exclude_subaccounts"),G=g((D=>$e(D.transactionListState,h,S))),[P,O]=y.useState(!1),[b,$]=y.useState(void 0),u=g((D=>X(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const z=st(S,h,v,A,f,I);if(z){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(G?.dateRange,D);m={accountId:h,accountType:te(S),title:I,timeframe:v,period:le}}let i=m;m!=null&&b!=null&&(i={...m,period:b});const{useFeatureGate:F}=ce(),{isFeatureEnabled:B}=F(q.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),H=new URLSearchParams(xe??"");H.set("view","full"),H.set("thread_id",le),H.set("entity_type",D.entityType);const Ce=w(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${H.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=F(q.isProjectsTransactionsEnabled),_=g((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=_e();y.useEffect((()=>{!P&&m!=null&&ue&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const be=[d,Y,v,A,f,T].filter((D=>D!=null));return z&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:_,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>$(D),...e}):s.jsx(N,{to:Pe(be.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Bt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>X(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(qe,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/missing-receipts/*",element:t?s.jsx(N,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(C,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Bt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-DJozFz1F.js";import{h as L,g as F,u as U,i as M,j as y,N as D,l as V,n as Te,o as k}from"./core-DrG65cn7.js";import{cv as N,fF as v,Z7 as P,Ol as ae,O2 as q,O3 as ne,Z9 as Ie,Oo as we,Z5 as Ce,Z6 as se,Zl as ke,Mp as je,C9 as Ae,Zb as be,Ov as Ee,Z8 as re,dd as H,GE as oe,dZ as ve,d_ as De,$w as Le,$x as Fe,O4 as Ue,$y as Pe,O5 as Be,Oe,bq as Re,bJ as Me,cG as Ve,bK as Ne,cu as _e,bt as Ze,U7 as $e,ct as ze}from"./zeni-epic-state-1I_oueWp.js";import{Q as _,j as Ge,z as E,a9 as Z,k as A,d8 as qe,d9 as He,da as G,a2 as W,E as We,ar as Je,at as Ke,c as ie,A as O,ac as Qe,a8 as Xe,db as Ye,af as J,p as et,dc as tt,a5 as K,dd as at,aj as nt,a0 as X,de as st,g as rt}from"./index-CNCkAPT0.js";import{D as ot,n as R,S as it}from"./mui-DqsEgFea.js";import ct from"./NotFoundScreen-DWq-K_Je.js";import{S as Y}from"./SetupPagesScreen-C8auoDk-.js";import{a as p}from"./sentry-C1W0cBeR.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DDB7rJuC.js";import{u as ut}from"./useInitialThreadRequest-DjzuWq5l.js";import{M as ce}from"./MobileAppDrawer-kvOHgs7K.js";import{F as dt}from"./FeaturePreviewScreen-BOTDjoMi.js";import{a as ee}from"./analyticsHelper-IpMM6iCb.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./BusinessVerificationPageScreen-qi4m6Iwf.js";import"./routePaths-BlVxV4y9.js";import"./InboxNotificationsProvider-Dwt_tkdC.js";import"./useTaskManagerAccess-D96Us8rE.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]="e9564f7f-7391-42c5-a61a-b26d0c0b9d61",t._sentryDebugIdIdentifier="sentry-dbid-e9564f7f-7391-42c5-a61a-b26d0c0b9d61")}catch{}})();const pt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(qe);function mt(){const t=L(),a=F(),n=U(),{tenantEmailDomain:o}=M(),i=_(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(r),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((w=>P(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,I,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const B=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!B&&e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:B,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{G(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{G(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(He),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=M(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>v(I))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>P(I,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(q()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{G(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=R.div`
1
+ import{j as e}from"./liveblocks-BIpuBqDU.js";import{h as L,g as F,u as U,i as M,j as y,N as D,l as V,n as Te,o as k}from"./core-D9_r48xZ.js";import{cv as N,fF as v,Z7 as P,Ol as ae,O2 as q,O3 as ne,Z9 as Ie,Oo as we,Z5 as Ce,Z6 as se,Zl as ke,Mp as je,C9 as Ae,Zb as be,Ov as Ee,Z8 as re,dd as H,GE as oe,dZ as ve,d_ as De,$v as Le,$w as Fe,O4 as Ue,$x as Pe,O5 as Be,Oe,bq as Re,bJ as Me,cG as Ve,bK as Ne,cu as _e,bt as Ze,U7 as $e,ct as ze}from"./zeni-epic-state-D8p_bjl4.js";import{Q as _,j as Ge,z as E,a9 as Z,k as A,d6 as qe,d7 as He,d8 as G,a2 as W,E as We,ar as Je,at as Ke,c as ie,A as O,ac as Qe,a8 as Xe,d9 as Ye,af as J,p as et,da as tt,a5 as K,db as at,aj as nt,a0 as X,dc as st,g as rt}from"./index-BWlvyCtM.js";import{D as ot,n as R,S as it}from"./mui-81_cRiBE.js";import ct from"./NotFoundScreen-DYgKmfND.js";import{S as Y}from"./SetupPagesScreen-Dofrysh_.js";import{a as p}from"./sentry-B2ljjuRI.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-0qWmdvwE.js";import{u as ut}from"./useInitialThreadRequest-D_wVO4z2.js";import{M as ce}from"./MobileAppDrawer-yEi_dlxO.js";import{F as dt}from"./FeaturePreviewScreen-B5y1DAdh.js";import{a as ee}from"./analyticsHelper-CMH3f5Mv.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.js";import"./BusinessVerificationPageScreen-Nce7icz0.js";import"./routePaths-Clggvdtc.js";import"./InboxNotificationsProvider-C4Mxy7-U.js";import"./useTaskManagerAccess-DFbLYKBq.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]="d75170e7-dce2-42b2-a720-44eae213965e",t._sentryDebugIdIdentifier="sentry-dbid-d75170e7-dce2-42b2-a720-44eae213965e")}catch{}})();const pt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(qe);function mt(){const t=L(),a=F(),n=U(),{tenantEmailDomain:o}=M(),i=_(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(r),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((w=>P(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,I,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const B=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!B&&e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:B,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{G(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{G(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(He),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=M(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>v(I))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>P(I,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(q()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{G(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=R.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;