@zeniai/web-app-ui 5.3.92-dev → 5.3.93-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/assets/{AccountMappingScreen-Bh9jl7Ef.js → AccountMappingScreen-BTR8uKQK.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-DjOPlh3J.js → ActualMatchingMatchDetailScreen-DpaCOnCM.js} +1 -1
  3. package/dist/assets/AddressRoutes-GFLqbgTr.js +1 -0
  4. package/dist/assets/AddressScreen-DWZzKMEw.js +9 -0
  5. package/dist/assets/AiCfoScreen-Dd__YIWm.js +22 -0
  6. package/dist/assets/{AppDrawer-BQB31RFD.js → AppDrawer-D2Tl26uq.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-C0zm6ZLS.js → BillPayApprovalRoutes-DV_p_SQ2.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-kQgV7FX8.js → BillPayRoutes-sNvDS-kN.js} +6 -6
  9. package/dist/assets/{BusinessVerificationPageScreen-BSguq-g2.js → BusinessVerificationPageScreen-CVijkaE8.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-nH8-GKOx.js → CardsAiCfoScreen-DO_HCVwI.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-C_cRa3L-.js → ChargeCardRoutes-mt2g3Jg0.js} +1 -1
  12. package/dist/assets/CompanyPassportScreen-_f68duti.js +1 -0
  13. package/dist/assets/{ConnectionAuthScreen-ByV6yTTU.js → ConnectionAuthScreen-oPVi82Cx.js} +2 -2
  14. package/dist/assets/CustomerOnboardingAuthScreen-C3FMpb4J.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BUkw8ab2.js → CustomerOnboardingRoutes-BLRE7IK-.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-DEx1rH65.js → DashboardRoutes-mQvE4jJ0.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-BPLwTBZP.js → DefaultTenantHome-Dh5bAcpG.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-pkS3AD2d.js +18 -0
  19. package/dist/assets/{DrawerScreen-Du8hsTKk.js → DrawerScreen-DI4gxsFO.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-BH8_jvsw.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-DXUAGmqA.js → ExpenseAutomationRoutes-_6qCRlW0.js} +7 -7
  22. package/dist/assets/FeaturePreviewScreen-kue3YUvW.js +1 -0
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-BkrFKuyY.js → HubSpotOAuthCallbackScreen-D64pI0iU.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-B5M0qdMl.js → InboxNotificationsProvider-DrljtAmN.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-DJ09h0-W.js → InvoicingRoutes-D6QJ-LnU.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-BTzEpPhB.js → MagicLinkRoutes-DFwRCGOM.js} +20 -20
  27. package/dist/assets/MagicLinkSignInScreen-DaNmJtKR.js +12 -0
  28. package/dist/assets/MobileAppDrawer-D9iwyW6E.js +1 -0
  29. package/dist/assets/NotFoundScreen-DHpPkJUq.js +1 -0
  30. package/dist/assets/{NotificationRoutes-BxisUoq4.js → NotificationRoutes-CNN0JO68.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-DVdmzuPK.js → OAuthConsentScreen-CMQBCmUq.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-Deg1E66Q.js → PandLWithForecastRoutes-BhMRDGc1.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-C9O2KV8I.js → PaymentLinkScreen-DstzeuhJ.js} +9 -9
  34. package/dist/assets/{PeopleRoutes-DiFR5w2N.js → PeopleRoutes-6Eq28etR.js} +9 -9
  35. package/dist/assets/{PerformanceRoutes-QyQRVdnM.js → PerformanceRoutes-DkxGB8dS.js} +1 -1
  36. package/dist/assets/{Preview-DUYMZtKt.js → Preview-Dfugi26f.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen--OQu_pq8.js → QBOConnectionScreen-DNwlxY3R.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-CzKIB6lB.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BJcgs97q.js → ReimbursementApprovalRuleDetailScreen-C0oxxTC0.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-BAWywZO-.js → ReimbursementRoutes-C2uBm8Jr.js} +7 -7
  41. package/dist/assets/{ReportsRoutes-DFArxL2E.js → ReportsRoutes-CmRsRF1m.js} +1 -1
  42. package/dist/assets/RewardsRoutes-cYws_8FH.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-D_ls3-hC.js → ScheduleDetailsPrepaidExpensesScreen-DKDzHrf0.js} +5 -5
  44. package/dist/assets/ScreenRoutes-Cd2fvUao.js +2 -0
  45. package/dist/assets/{SettingsRoutes-BbvIIMXV.js → SettingsRoutes-DBJKrFxG.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-RWtDE1DO.js → SetupPagesScreen-C70xRnVo.js} +1 -1
  47. package/dist/assets/SignInScreen-DB64sQry.js +1 -0
  48. package/dist/assets/SignOutScreen-RkBhfYpP.js +9 -0
  49. package/dist/assets/TaskListScreen-DW7e6ef_.js +9 -0
  50. package/dist/assets/{TaskRoutes-CjSgWf1E.js → TaskRoutes-BRKcMi_T.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-BFBaFYFk.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-DGElbhCa.js → TransactionDetailScreen-DPKP2gGJ.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-Db86k9iu.js → TransactionListRoutes-CDs1-rA6.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-DxWgKInd.js → TreasuryRoutes-BbsVM2lE.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-DHlhSQpH.js → VendorsRoutes-B18gUSfI.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-CMvlKiZq.js → WiseConfirmationScreen-CMKnfyei.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-BMjC17N2.js → ZeniAccountRoutes-CWU7HNHh.js} +9 -9
  58. package/dist/assets/{ZeniAccountStatementScreen-BAIxCUhh.js → ZeniAccountStatementScreen-BcWZ9nqz.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-CDFl9gNv.js → accountMappingHelper-PEq3iFwb.js} +1 -1
  60. package/dist/assets/{analytics-K5kCmXhx.js → analytics-wUVBNE2n.js} +1 -1
  61. package/dist/assets/{analyticsHelper-Cb3EUyBw.js → analyticsHelper-C8wUoU5C.js} +1 -1
  62. package/dist/assets/{core-CJLU9TYG.js → core-DtSa7_zJ.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-Cai8T7ud.js → decodeURIComponentSafe-CxfS79yY.js} +1 -1
  64. package/dist/assets/{dnd-BvQSnOXX.js → dnd-BRHUZ8LO.js} +1 -1
  65. package/dist/assets/{empty-CYTi1vUC.js → empty--RCTsu0x.js} +1 -1
  66. package/dist/assets/{empty-cTsBa_MX.js → empty-TXY6nS9o.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-CkuydE4W.js → emptyVideoElement-jsNpgByF.js} +1 -1
  68. package/dist/assets/{epic-B7sSwFQr.js → epic-NcSj2eco.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-AFTT-GAh.js → expenseAutomationHelper-BUiYzGxA.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-Bc7hFfBK.js → getLocaleForTenant-D03DEBIE.js} +1 -1
  71. package/dist/assets/{index-BcoLz164.js → index-BfiunY7r.js} +1 -1
  72. package/dist/assets/{index-DSH2m0Ax.js → index-Bfr7Ew4h.js} +1 -1
  73. package/dist/assets/{index-BTdRxzeE.js → index-BgQKS1TL.js} +1 -1
  74. package/dist/assets/{index-C6CmvTKV.js → index-CABDWa_r.js} +2 -2
  75. package/dist/assets/{index-Bac0_7La.js → index-CJhgQFRI.js} +13423 -13425
  76. package/dist/assets/{index-BjN-UlqP.js → index-CeI_n1Jv.js} +1 -1
  77. package/dist/assets/{index-C5DdgWE0.js → index-Cz1UMaoE.js} +1 -1
  78. package/dist/assets/{index-DqcV3YMG.js → index-DxlUZLeR.js} +1 -1
  79. package/dist/assets/{lexical-G-6YJUO1.js → lexical-CV0PpHfb.js} +1 -1
  80. package/dist/assets/{liveblocks-D0aPwrEa.js → liveblocks-CZZ7TQJf.js} +1 -1
  81. package/dist/assets/{lottie-CRpndHoM.js → lottie-_8fQYf62.js} +1 -1
  82. package/dist/assets/{mui-BTK8WNHw.js → mui-hHF2bYsV.js} +1 -1
  83. package/dist/assets/{pathToGoBack-DSav9J7K.js → pathToGoBack-sBV6PqT4.js} +1 -1
  84. package/dist/assets/{pdf-BlY1D9V4.js → pdf-DcTPEGUQ.js} +3 -3
  85. package/dist/assets/{pdf-lib-DubKZfxI.js → pdf-lib-DvlP1tZv.js} +1 -1
  86. package/dist/assets/{plaid-BWaZTH4h.js → plaid-l93gkere.js} +1 -1
  87. package/dist/assets/{pusher-NgljFe4c.js → pusher-Chl1DxG2.js} +1 -1
  88. package/dist/assets/{react-BdvVU4nA.js → react-B6u5wAGC.js} +1 -1
  89. package/dist/assets/{react-CXfU0Dfi.js → react-BPJWvFAw.js} +1 -1
  90. package/dist/assets/{react-Cd_9VlyA.js → react-BXuuk3m7.js} +1 -1
  91. package/dist/assets/{react-CJTAFFom.js → react-Ct10qt1E.js} +1 -1
  92. package/dist/assets/{react-XHCeVOeB.js → react-DvOc8dL3.js} +1 -1
  93. package/dist/assets/{react-BlKvPBUN.js → react-UkV3Bwgo.js} +1 -1
  94. package/dist/assets/{recharts-BEqM6zw3.js → recharts-DHYb1iJa.js} +1 -1
  95. package/dist/assets/{routePaths-CFVcdQVU.js → routePaths-66PPW-xS.js} +1 -1
  96. package/dist/assets/{sentry-Bh_Qiwsv.js → sentry-7oL5NFUY.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-Ba8pyF0x.js → stripSplatSuffix-Cj4hZLSk.js} +1 -1
  98. package/dist/assets/{url-YPAxZIuQ.js → url-AXfPza2U.js} +1 -1
  99. package/dist/assets/{url-CqXRBT9H.js → url-yW-1Hcty.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-Bo3l1zUQ.js → useActualMatchingMatchDetail-Bv7_wq27.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BqbEtXbA.js → useAiCfoDashboardSuggestedQuestionsChips-B0543FEo.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-C0sjuZuZ.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-IP7jEgbI.js → useChargeCardPusherEvents-DLwmfLZC.js} +1 -1
  104. package/dist/assets/{useDeviceId-BqYCCa6B.js → useDeviceId-DpOlnzI_.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-B2CM-p2n.js → useEmailConnectResultRefresh-DWBnl6oa.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-Byaj949Q.js → useInitialThreadRequest-Cf6qZ2C0.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-zRd8th0q.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-xfS6T84X.js → useTaskManagerPusherEvents-CtTv0DPD.js} +1 -1
  109. package/dist/assets/{utils-DnIJUuGb.js → utils-D3PNq8pk.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-BOFkm0Uk.js → withTransactionSidePanel-DVXJCqK3.js} +1 -1
  111. package/dist/assets/{zeni-epic-state-DN1FMHPE.js → zeni-epic-state-DIQk-W8f.js} +3 -3
  112. package/dist/index.html +1 -1
  113. package/package.json +2 -2
  114. package/dist/assets/AddressRoutes-DiDhvZrH.js +0 -1
  115. package/dist/assets/AddressScreen-Djrv0IMM.js +0 -9
  116. package/dist/assets/AiCfoScreen-B4bDfb8M.js +0 -22
  117. package/dist/assets/CompanyPassportScreen-CMKrSOCe.js +0 -1
  118. package/dist/assets/CustomerOnboardingAuthScreen-Dr98fTM4.js +0 -1
  119. package/dist/assets/DomesticWireDetailScreen-CIlj8F4w.js +0 -18
  120. package/dist/assets/EntityDetailRoutes-BLSf8EBB.js +0 -1
  121. package/dist/assets/FeaturePreviewScreen-ae3ytT_c.js +0 -1
  122. package/dist/assets/MagicLinkSignInScreen-CyF3xUpa.js +0 -12
  123. package/dist/assets/MobileAppDrawer-Gq4sfjI3.js +0 -1
  124. package/dist/assets/NotFoundScreen-DVwEy2Nc.js +0 -1
  125. package/dist/assets/ReimbursementApprovalRoutes-Bu6Pn9AT.js +0 -1
  126. package/dist/assets/RewardsRoutes-CMb9MJ3w.js +0 -1
  127. package/dist/assets/ScreenRoutes-CjbhngRf.js +0 -2
  128. package/dist/assets/SignInScreen-5nP2m4Sd.js +0 -1
  129. package/dist/assets/SignOutScreen-C6DXPIPI.js +0 -9
  130. package/dist/assets/TaskListScreen-CLnMNKvr.js +0 -9
  131. package/dist/assets/TransactionDetailRoutes-CEyEoaOq.js +0 -1
  132. package/dist/assets/useAskAiCfoHostNavButtonProps-CkY97uj-.js +0 -1
  133. package/dist/assets/useTaskManagerAccess-CUawSS4F.js +0 -1
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-D0aPwrEa.js";import{g as Q,h as ke,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-CJLU9TYG.js";import{fI as q,Ev as R,Vf as Pe,m3 as ne,uh as re,v6 as D,lK as Ee,lT as A,lL as P,kO as E,kF as L,kE as Le,DD as le,vb as Me,bq as Be,Vg as ve,bn as Ue,ES as xe,Vh as ze,Vi as Ge,cj as S,Dw as He,Vj as X,Vk as Ne,Vl as Ye,Vm as qe,Vn as $e,Vo as Ke,Vp as Ze,Vq as Je,Vr as Qe,Vs as We,Vt as Xe,Vu as ea,Vv as aa,Vw as T,Vx as M,Vy as B,Vz as v,VA as U,VB as x,VC as z,VD as G,VE as H,VF as N,ek as sa,Ew as ta,Ej as ee,Ek as ae,EC as oa,Eo as se,EI as na,VG as ra,VH as la,VI as ca,VJ as ia,VK as da,VL as pa,VM as _a,VN as fa,VO as ma,VP as ba,e0 as ua,d$ as ha}from"./zeni-epic-state-DN1FMHPE.js";import{al as ya,am as wa,an as Ca,a as Ia,$ as Sa,W as ce,A as ie,z as de,ao as ga,V as Ra,d as Va,ap as Ta,aq as ja,a6 as ka,j as Y,N as Fa,s as Oa,p as pe,ar as Da,as as Aa,at as Pa}from"./index-Bac0_7La.js";import"./mui-BTK8WNHw.js";import Ea from"./NotFoundScreen-DVwEy2Nc.js";import{F as La}from"./FeaturePreviewScreen-ae3ytT_c.js";import{a as b}from"./sentry-Bh_Qiwsv.js";import{u as Ma}from"./useInitialThreadRequest-Byaj949Q.js";import{t as te,a as oe,b as Ba}from"./routePaths-CFVcdQVU.js";import{M as va}from"./MobileAppDrawer-Gq4sfjI3.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./utils-DnIJUuGb.js";import"./InboxNotificationsProvider-B5M0qdMl.js";import"./useTaskManagerAccess-CUawSS4F.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]="2ae3be02-aca8-4449-ae45-01478b3fb69b",e._sentryDebugIdIdentifier="sentry-dbid-2ae3be02-aca8-4449-ae45-01478b3fb69b")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba())},za=De((function(e){const o=de.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:Y,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(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(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(T(a)),(g(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(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?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(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(N({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(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({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(N({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(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({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=g(t),l=S(t);l?(e(Je({viewMode:a})),e(Qe({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(T(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(T(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(T(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Ze({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ia(),_=Sa(),m=Aa(_),a=ke(),s=Fe(),t=Q(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=b.useState(!1),[$,_e]=b.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>q(n))),fe=k.masterTOSInfo?.isMasterTOSAccepted??!1,me=k.company?.companyInfo.firstMonthOfFY??1,be=Ma(k?.companyId),C=d((n=>R(n).fetchState)),ue=d((n=>Pe(n))),{areTenantIdsInSync:u}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>ne(n))),I=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!$&&C==="Completed"&&u&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,u]),b.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":I&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":V&&s(L());break;case"balance_sheet_by_projects":I&&s(E());break;case"cash_flow_by_classes":V&&s(P());break;case"cash_flow_by_projects":I&&s(A());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,F,O,u,V,I]);const K=Ra(),we=K?.loggedInUserRole!=null&&Be(K?.loggedInUserRole)!==!0,[Ce,Ie]=b.useState(!1),Z=n=>{Ie(n)},Se=Va(),ge=Ta();return(function(n){const{isDataReady:Re}=n,{pathname:Ve}=Q(),J=ya(Ve??"")==="reports",Te=wa(Re),je=b.useMemo((()=>J?Ua:void 0),[J]);Ca({canFetchSuggestedQuestions:Te,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ka,{analytics:Y,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Z}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:Y,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:I,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Z,reportsResyncFetchState:ue.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Se&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,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 ps(){const e=d((s=>q(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ua(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
1
+ import{j as p}from"./liveblocks-CZZ7TQJf.js";import{g as Q,h as je,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-DtSa7_zJ.js";import{fI as q,Ev as R,Vf as Pe,m3 as ne,uh as re,v6 as D,lK as Ee,lT as A,lL as P,kO as E,kF as L,kE as Le,DD as le,vb as Me,bq as ve,Vg as Be,bn as Ue,ES as xe,Vh as ze,Vi as Ge,cj as S,Dw as He,Vj as X,Vk as Ye,Vl as Ne,Vm as qe,Vn as $e,Vo as Ke,Vp as Ze,Vq as Je,Vr as Qe,Vs as We,Vt as Xe,Vu as ea,Vv as aa,Vw as T,Vx as M,Vy as v,Vz as B,VA as U,VB as x,VC as z,VD as G,VE as H,VF as Y,ek as sa,Ew as ta,Ej as ee,Ek as ae,EC as oa,Eo as se,EI as na,VG as ra,VH as la,VI as ca,VJ as ia,VK as da,VL as pa,VM as _a,VN as fa,VO as ma,VP as ba,e0 as ua,d$ as ha}from"./zeni-epic-state-DIQk-W8f.js";import{al as ya,am as wa,an as Ca,a as Ia,$ as Sa,W as ce,c as ie,z as de,ao as ga,M as Ra,e as Va,ap as Ta,aq as ka,a6 as ja,k as N,R as Fa,v as Oa,p as pe,ar as Da,as as Aa,at as Pa}from"./index-CJhgQFRI.js";import"./mui-hHF2bYsV.js";import Ea from"./NotFoundScreen-DHpPkJUq.js";import{F as La}from"./FeaturePreviewScreen-kue3YUvW.js";import{a as b}from"./sentry-7oL5NFUY.js";import{u as Ma}from"./useInitialThreadRequest-Cf6qZ2C0.js";import{t as te,a as oe,b as va}from"./routePaths-66PPW-xS.js";import{M as Ba}from"./MobileAppDrawer-D9iwyW6E.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";import"./InboxNotificationsProvider-DrljtAmN.js";import"./useTaskManagerAccess-zRd8th0q.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]="ec6bf424-f456-4720-b2dd-57b79609b600",e._sentryDebugIdIdentifier="sentry-dbid-ec6bf424-f456-4720-b2dd-57b79609b600")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=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(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(v({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Be(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:N,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(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(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(T(a)),(g(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(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(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(v({scrollPosition:s}));break;case"cash_flow":e(M({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(U({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(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({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=g(t),l=S(t);l?(e(Je({viewMode:a})),e(Qe({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(T(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(T(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(T(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Ze({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ia(),_=Sa(),m=Aa(_),a=je(),s=Fe(),t=Q(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=b.useState(!1),[$,_e]=b.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const j=d((n=>q(n))),fe=j.masterTOSInfo?.isMasterTOSAccepted??!1,me=j.company?.companyInfo.firstMonthOfFY??1,be=Ma(j?.companyId),C=d((n=>R(n).fetchState)),ue=d((n=>Pe(n))),{areTenantIdsInSync:u}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>ne(n))),I=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!$&&C==="Completed"&&u&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,u]),b.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":I&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":V&&s(L());break;case"balance_sheet_by_projects":I&&s(E());break;case"cash_flow_by_classes":V&&s(P());break;case"cash_flow_by_projects":I&&s(A());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,F,O,u,V,I]);const K=Ra(),we=K?.loggedInUserRole!=null&&ve(K?.loggedInUserRole)!==!0,[Ce,Ie]=b.useState(!1),Z=n=>{Ie(n)},Se=Va(),ge=Ta();return(function(n){const{isDataReady:Re}=n,{pathname:Ve}=Q(),J=ya(Ve??"")==="reports",Te=wa(Re),ke=b.useMemo((()=>J?Ua:void 0),[J]);Ca({canFetchSuggestedQuestions:Te,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ja,{analytics:N,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Ba,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Z}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:N,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:I,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Z,reportsResyncFetchState:ue.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Se&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:be})]})}const k=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 ps(){const e=d((s=>q(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ua(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-CZZ7TQJf.js";import{z as b,a6 as N,k as f,R as S,e0 as k,W as I,c as C}from"./index-CJhgQFRI.js";import"./mui-hHF2bYsV.js";import g from"./NotFoundScreen-DHpPkJUq.js";import{a as c}from"./sentry-7oL5NFUY.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as d,N as y}from"./core-DtSa7_zJ.js";import{fI as _,a2v as w,a2w as p,Ea as P,q3 as V,a2x as R,E8 as q}from"./zeni-epic-state-DIQk-W8f.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.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]="d3a708d1-1790-41c8-8b7e-2b798813265a",e._sentryDebugIdIdentifier="sentry-dbid-d3a708d1-1790-41c8-8b7e-2b798813265a")}catch{}})();const z=T((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),f.trackInviteEmailClicked("send",s,r,s.length)}e(q())},onUpdateInviteFormLocalData:s=>{e(R({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&f.trackInviteEmailClicked("cancel")}}}))(k),G=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),x=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),j=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:f,onLoad:o=>(E=>E.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:l,location:x,currentTenant:r,companyName:v,userName:j,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as E}from"./liveblocks-D0aPwrEa.js";import{a as A}from"./sentry-Bh_Qiwsv.js";import{i as M,u as H,h as Q,g as ee,j as h,l as te}from"./core-CJLU9TYG.js";import{Xd as Fe,Xe as Ve,m3 as ae,sB as Ge,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xf as Ye,fI as K,Wc as pe,Xg as Se,h2 as ne,cC as le,cD as se,FA as ve,Xh as Ce,FE as Xe,gS as ce,sE as ze,td as Ze,dE as qe,dD as We,TA as fe,Fy as He,Fs as Qe,Xi as De,Fk as et,Fj as tt,Fe as at,Fp as nt,FF as lt,Xj as Y,Xk as ge,Fl as st,Wd as oe,FV as Ae,FO as Ie,Xl as xe,sH as Te,FI as Be,FG as Le,Xm as Je,G0 as je,FZ as we,FJ as be,F$ as Ne}from"./zeni-epic-state-DN1FMHPE.js";import{a2 as de,aW as ie,aX as ct,z as ot,h as dt,a5 as it,a6 as ue,j as _,at as ut,aY as rt,p as V,G as ye,Z as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-Bac0_7La.js";import{n as re}from"./mui-BTK8WNHw.js";import{p as St}from"./pathToGoBack-DSav9J7K.js";import W from"./NotFoundScreen-DVwEy2Nc.js";import{c as G}from"./routePaths-CFVcdQVU.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]="218f8770-bc50-4b0c-8b86-171ff645a3dd",e._sentryDebugIdIdentifier="sentry-dbid-218f8770-bc50-4b0c-8b86-171ff645a3dd")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,s??""))),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((()=>{s!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ge(s))}),[s,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(W,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(s,u,r))},onSkip:(u,r)=>{n($e(s,u,r))}})})}const ft=re.div`
1
+ import{j as y}from"./liveblocks-CZZ7TQJf.js";import{a as A}from"./sentry-7oL5NFUY.js";import{i as M,u as H,h as Q,g as ee,j as h,l as te}from"./core-DtSa7_zJ.js";import{Xd as Fe,Xe as Ve,m3 as ae,sB as Ge,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xf as Ye,fI as K,Wc as pe,Xg as Se,h2 as ne,cC as le,cD as se,FA as ve,Xh as Ce,FE as Xe,gS as ce,sE as ze,td as Ze,dE as qe,dD as We,TA as fe,Fy as He,Fs as Qe,Xi as De,Fk as et,Fj as tt,Fe as at,Fp as nt,FF as lt,Xj as Y,Xk as ge,Fl as st,Wd as oe,FV as Ae,FO as Ie,Xl as xe,sH as Te,FI as Be,FG as Le,Xm as Je,G0 as je,FZ as we,FJ as be,F$ as Ne}from"./zeni-epic-state-DIQk-W8f.js";import{a2 as de,aW as ie,aX as ct,z as ot,j as dt,a5 as it,a6 as ue,k as _,at as ut,aY as rt,p as V,G as ke,Z as ye,aZ as ht,a_ as mt,a$ as pt}from"./index-CJhgQFRI.js";import{n as re}from"./mui-hHF2bYsV.js";import{p as St}from"./pathToGoBack-sBV6PqT4.js";import W from"./NotFoundScreen-DHpPkJUq.js";import{c as G}from"./routePaths-66PPW-xS.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]="39132dff-537b-4854-a8df-b19c074e419d",e._sentryDebugIdIdentifier="sentry-dbid-39132dff-537b-4854-a8df-b19c074e419d")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,s??""))),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((()=>{s!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ge(s))}),[s,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?y.jsx(W,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?y.jsx(ie,{}):y.jsx(W,{}):y.jsx(ft,{children:y.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(s,u,r))},onSkip:(u,r)=>{n($e(s,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as E}from"./liveblocks-D0aPwrEa.js";import{a as A}from"./sentry-Bh_Qiws
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Dt=ye.getLocalizedStrings(),gt=te((function(e,t){const c=Se(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:l}=t;return{onTransactionSelect(s){e(Ce({selectedTransaction:s}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(Xe()),c("..",{relative:"path"})},onTransactionClick:s=>{const n=`${G(s,t.tenantEmailDomain)}`,i=V(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Kt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:l,tenantEmailDomain:s}=M(),{scheduleType:n}=M();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=h((g=>K(g))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=h((g=>Se(g,a))),m=o.selectedJELinkRowIndex,I=h((g=>ne(g,i.companyId))),p=dt(o.updateStatus.fetchState);A.useEffect((()=>{p==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[p,o.updateStatus.fetchState]),A.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),A.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&m!=null?E.jsxs(E.Fragment,{children:[C===!0?E.jsx(ue,{analytics:_,onLoad:()=>{yt(o,a,I)}}):null,E.jsx(gt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:_,controllerUserDetails:I,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},_e=e=>{const t=Dt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},yt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:i}=e.linkBillExpenseView,a=i.some((m=>m.isRecommendedTransaction===!0)),d=le(c.controllers),o=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{..._e(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function ke({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:l}){const s=H(),{ignoreStatusById:n,revertStatusById:i}=h((I=>ce(I).jeSchedules)),a=A.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=A.useRef(!1),m=A.useRef(l);return m.current=l,A.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,m.current())}),[d]),{onScheduleDecision:A.useCallback(((I,p,C)=>{if(t!=null){if(I==="ignore")return(function(g){return qe.includes(g)})(p)?(o.current=!0,a.current="ignore",void s(ze(t,c,p,C))):void 0;e!=null&&(function(g){return We.includes(g)})(p)&&(o.current=!0,a.current="revert",s(Ze(e,t,c,p,C)))}}),[s,e,t,c]),scheduleDecisionStatus:d}}const Et=re.div`
9
+ `,Dt=ke.getLocalizedStrings(),gt=te((function(e,t){const c=Se(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:l}=t;return{onTransactionSelect(s){e(Ce({selectedTransaction:s}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(Xe()),c("..",{relative:"path"})},onTransactionClick:s=>{const n=`${G(s,t.tenantEmailDomain)}`,i=V(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Kt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:l,tenantEmailDomain:s}=M(),{scheduleType:n}=M();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=h((g=>K(g))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=h((g=>Se(g,a))),m=o.selectedJELinkRowIndex,I=h((g=>ne(g,i.companyId))),p=dt(o.updateStatus.fetchState);A.useEffect((()=>{p==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[p,o.updateStatus.fetchState]),A.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),A.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return y.jsx(y.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?y.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&m!=null?y.jsxs(y.Fragment,{children:[C===!0?y.jsx(ue,{analytics:_,onLoad:()=>{kt(o,a,I)}}):null,y.jsx(gt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:_,controllerUserDetails:I,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},_e=e=>{const t=Dt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},kt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:i}=e.linkBillExpenseView,a=i.some((m=>m.isRecommendedTransaction===!0)),d=le(c.controllers),o=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{..._e(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function Ee({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:l}){const s=H(),{ignoreStatusById:n,revertStatusById:i}=h((I=>ce(I).jeSchedules)),a=A.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=A.useRef(!1),m=A.useRef(l);return m.current=l,A.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,m.current())}),[d]),{onScheduleDecision:A.useCallback(((I,p,C)=>{if(t!=null){if(I==="ignore")return(function(g){return qe.includes(g)})(p)?(o.current=!0,a.current="ignore",void s(ze(t,c,p,C))):void 0;e!=null&&(function(g){return We.includes(g)})(p)&&(o.current=!0,a.current="revert",s(Ze(e,t,c,p,C)))}}),[s,e,t,c]),scheduleDecisionStatus:d}}const yt=re.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as E}from"./liveblocks-D0aPwrEa.js";import{a as A}from"./sentry-Bh_Qiws
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,l=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:c,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(l.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(s,n))},onDelete:n=>{e(st(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(lt(s,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,J=I?.selectedOption;e(et({scheduleType:s,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||J==null||e(tt({scheduleType:s}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:l,onPanelCloseAfterDecision:s,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=Ee(),{tenantEmailDomain:g}=M(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=M(),v=l??r;let D;v!=="new"&&(D=v);const J=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),j="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),w=h((L=>fe(L))),b=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),N=w!=="Completed"||b!=="Completed";A.useEffect((()=>{f===!1&&N?(p(He(j,D)),u(!0)):N===!1&&f===!1&&v!=="new"&&(p(Qe(j,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",X=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:Z}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:j,onDecided:()=>{if(s==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=X;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else s()}}),F=k.fetchState,$=k.allAccountList,q=k.allClassList,y=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(J!==!0||k.fetchState==="Error")return E.jsx(W,{});const R=F==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?E.jsxs(Et,{children:[R===!0?E.jsx(ue,{analytics:_,onLoad:()=>{vt(k,j,T)}}):null,E.jsx(kt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:Z,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:I,navigate:m,classList:q,accountList:$,shouldNavigateBack:d,accruedAccountList:y,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:_,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=le(c.controllers),n=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{..._e(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},At=re.div`
17
+ `,Et=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,l=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:c,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(l.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(s,n))},onDelete:n=>{e(st(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(lt(s,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,J=I?.selectedOption;e(et({scheduleType:s,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||J==null||e(tt({scheduleType:s}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:l,onPanelCloseAfterDecision:s,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=ye(),{tenantEmailDomain:g}=M(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=M(),v=l??r;let D;v!=="new"&&(D=v);const J=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),j="accrued_expenses",E=h((L=>Se(L,"accrued_expenses"))),w=h((L=>fe(L))),b=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),N=w!=="Completed"||b!=="Completed";A.useEffect((()=>{f===!1&&N?(p(He(j,D)),u(!0)):N===!1&&f===!1&&v!=="new"&&(p(Qe(j,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",X=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:Z}=Ee({jeScheduleId:E.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:E.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:j,onDecided:()=>{if(s==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=X;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else s()}}),F=E.fetchState,$=E.allAccountList,q=E.allClassList,k=E.allAccruedAccountList,S=E.scheduleAccruedDetailsLocalData;if(J!==!0||E.fetchState==="Error")return y.jsx(W,{});const R=F==="Completed"&&f===!0,Oe=E.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?y.jsxs(yt,{children:[R===!0?y.jsx(ue,{analytics:_,onLoad:()=>{vt(E,j,T)}}):null,y.jsx(Et,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:Z,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:E,location:I,navigate:m,classList:q,accountList:$,shouldNavigateBack:d,accruedAccountList:k,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:E.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:_,controllerUserDetails:T,isAccountingClassesEnabled:x,status:E.selectedJEAccruedSchedule?.status.code})]}):y.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=le(c.controllers),n=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{..._e(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},At=re.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as E}from"./liveblocks-D0aPwrEa.js";import{a as A}from"./sentry-Bh_Qiws
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(be(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(je(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,J=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},j=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,b=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),N=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:r,selectedMonths:b,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:N,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&j?.classId==null||r==null||b==null||P!==!0&&N==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:l}={})=>{const s=Q(),n=ee(),i=H(),a=Ee(),{tenantEmailDomain:d}=M(),[o,m]=A.useState(!1),{scheduleDetailId:I}=M(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((y=>y.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||s("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((y=>oe(y,u))),v=h((y=>y.entityAutoCompleteState.autoCompleteText.common)),D=h((y=>De(y,"common"))),J=h((y=>fe(y))),B=h((y=>y.classListState.fetchState)),j=h((y=>ae(y))),k=h((y=>ce(y).selectedPeriod)),w=J!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&w?(i(Ae(u,F,!0)),m(!0)):w===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:y,year:S}=k;s(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else s("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const b=h((y=>K(y))),x=h((y=>ne(y,b.companyId))),N=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)s("../schedules/fixed_assets");else{const{month:y,year:S}=k;s(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else c()}}),O=r.fetchState,X=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,Z=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return E.jsx(W,{});const $=O==="Completed"&&o===!0,q=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&q?E.jsxs(At,{children:[$===!0?E.jsx(ue,{analytics:_,onLoad:()=>{Bt(r,u,x)}}):null,E.jsx(It,{onScheduleDecision:N?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:l,location:n,navigate:s,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(y,S)=>{i(Te(y,S))},accountList:X,depAccountList:z,scheduleLocalData:Z,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:_,controllerUserDetails:x,isAccountingClassesEnabled:j,status:r.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
25
+ `,he=ke.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(be(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(je(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,J=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},j=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,E=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,b=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),N=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:E?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:r,selectedMonths:b,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:N,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||E?.accountId==null||t.isAccountingClassesEnabled!==!1&&j?.classId==null||r==null||b==null||P!==!0&&N==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:l}={})=>{const s=Q(),n=ee(),i=H(),a=ye(),{tenantEmailDomain:d}=M(),[o,m]=A.useState(!1),{scheduleDetailId:I}=M(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((k=>k.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||s("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((k=>oe(k,u))),v=h((k=>k.entityAutoCompleteState.autoCompleteText.common)),D=h((k=>De(k,"common"))),J=h((k=>fe(k))),B=h((k=>k.classListState.fetchState)),j=h((k=>ae(k))),E=h((k=>ce(k).selectedPeriod)),w=J!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&w?(i(Ae(u,F,!0)),m(!0)):w===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:k,year:S}=E;s(`../../month_end_close_checks/review/je_schedules/${k}-${S}`)}else s("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const b=h((k=>K(k))),x=h((k=>ne(k,b.companyId))),N=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=Ee({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)s("../schedules/fixed_assets");else{const{month:k,year:S}=E;s(`../../month_end_close_checks/review/je_schedules/${k}-${S}`)}else c()}}),O=r.fetchState,X=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,Z=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return y.jsx(W,{});const $=O==="Completed"&&o===!0,q=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&q?y.jsxs(At,{children:[$===!0?y.jsx(ue,{analytics:_,onLoad:()=>{Bt(r,u,x)}}):null,y.jsx(It,{onScheduleDecision:N?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:l,location:n,navigate:s,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:E,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(k,S)=>{i(Te(k,S))},accountList:X,depAccountList:z,scheduleLocalData:Z,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:_,controllerUserDetails:x,isAccountingClassesEnabled:j,status:r.selectedJEScheduleTransaction?.status.code})]}):y.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  width: 100%;
@@ -30,4 +30,4 @@ import{j as E}from"./liveblocks-D0aPwrEa.js";import{a as A}from"./sentry-Bh_Qiws
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Jt=te((function(e,t){const c=K(e),l=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Ne(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(be(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,J=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,j=m.map(((x,N)=>({...t.scheduleLocalData.jeScheduleDetails[N],amount:{...t.scheduleLocalData.jeScheduleDetails[N].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,w=f.type==="lastDayOfMonth"||void 0,b={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:j,lastDayOfMonth:w,selectedVendor:v,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:b,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||w!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Xt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:l,onPanelNavigateBack:s}={})=>{const n=Q(),i=ee(),a=H(),d=Ee(),{tenantEmailDomain:o}=M(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=M(),f=t??g,u=jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),J=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),j=h((S=>fe(S))),k=h((S=>S.classListState.fetchState)),w=h((S=>ae(S))),b=h((S=>ce(S).selectedPeriod)),x=j!=="Completed"||k!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,$,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const N=h((S=>K(S))),P=h((S=>ne(S,N.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:X}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(l==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else l()}}),U=D.fetchState,z=D.allAccountList,Z=D.allClassList,F=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return E.jsx(W,{});const q=U==="Completed"&&m===!0,y=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&y?E.jsxs(Lt,{children:[q===!0?E.jsx(ue,{analytics:_,onLoad:()=>{bt(D,v,P)}}):null,E.jsx(Jt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:X,isRenderedInPanel:e,onPanelNavigateBack:s,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:b,navigate:n,classList:Z,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:_,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},jt=(e,t)=>pe(e)!=null&&t!=null,wt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...wt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Yt as S,Ut as a,Xt as b,Kt as c};
33
+ `,me=ke.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Jt=te((function(e,t){const c=K(e),l=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Ne(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(be(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,J=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,j=m.map(((x,N)=>({...t.scheduleLocalData.jeScheduleDetails[N],amount:{...t.scheduleLocalData.jeScheduleDetails[N].amount,amount:x.amount}}))),E=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,w=f.type==="lastDayOfMonth"||void 0,b={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:j,lastDayOfMonth:w,selectedVendor:v,selectedDayOfMonth:E};e(Be({scheduleType:t.scheduleTab,localData:b,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||w!==!0&&E==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Xt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:l,onPanelNavigateBack:s}={})=>{const n=Q(),i=ee(),a=H(),d=ye(),{tenantEmailDomain:o}=M(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=M(),f=t??g,u=jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),J=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),j=h((S=>fe(S))),E=h((S=>S.classListState.fetchState)),w=h((S=>ae(S))),b=h((S=>ce(S).selectedPeriod)),x=j!=="Completed"||E!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,$,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const N=h((S=>K(S))),P=h((S=>ne(S,N.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:X}=Ee({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(l==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else l()}}),U=D.fetchState,z=D.allAccountList,Z=D.allClassList,F=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return y.jsx(W,{});const q=U==="Completed"&&m===!0,k=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&k?y.jsxs(Lt,{children:[q===!0?y.jsx(ue,{analytics:_,onLoad:()=>{bt(D,v,P)}}):null,y.jsx(Jt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:X,isRenderedInPanel:e,onPanelNavigateBack:s,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:b,navigate:n,classList:Z,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:_,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):y.jsx(ie,{})},jt=(e,t)=>pe(e)!=null&&t!=null,wt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...wt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Yt as S,Ut as a,Xt as b,Kt as c};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DHpPkJUq.js","assets/sentry-7oL5NFUY.js","assets/core-DtSa7_zJ.js","assets/zeni-epic-state-DIQk-W8f.js","assets/index-CJhgQFRI.js","assets/mui-hHF2bYsV.js","assets/analytics-wUVBNE2n.js","assets/utils-D3PNq8pk.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-mQvE4jJ0.js","assets/withTransactionSidePanel-DVXJCqK3.js","assets/useAskAiCfoHostNavButtonProps-C0sjuZuZ.js","assets/TransactionDetailScreen-DPKP2gGJ.js","assets/decodeURIComponentSafe-CxfS79yY.js","assets/useInitialThreadRequest-Cf6qZ2C0.js","assets/routePaths-66PPW-xS.js","assets/expenseAutomationHelper-BUiYzGxA.js","assets/stripSplatSuffix-Cj4hZLSk.js","assets/analyticsHelper-C8wUoU5C.js","assets/CompanyPassportScreen-_f68duti.js","assets/MobileAppDrawer-D9iwyW6E.js","assets/InboxNotificationsProvider-DrljtAmN.js","assets/useTaskManagerAccess-zRd8th0q.js","assets/useAiCfoDashboardSuggestedQuestionsChips-B0543FEo.js","assets/FeaturePreviewScreen-kue3YUvW.js","assets/BillPayRoutes-sNvDS-kN.js","assets/AddressScreen-DWZzKMEw.js","assets/DomesticWireDetailScreen-pkS3AD2d.js","assets/BusinessVerificationPageScreen-CVijkaE8.js","assets/DrawerScreen-DI4gxsFO.js","assets/SetupPagesScreen-C70xRnVo.js","assets/BillPayApprovalRoutes-DV_p_SQ2.js","assets/ReimbursementApprovalRuleDetailScreen-C0oxxTC0.js","assets/getLocaleForTenant-D03DEBIE.js","assets/ReimbursementRoutes-C2uBm8Jr.js","assets/ReimbursementApprovalRoutes-CzKIB6lB.js","assets/TransactionListRoutes-CDs1-rA6.js","assets/ZeniAccountStatementScreen-BcWZ9nqz.js","assets/SettingsRoutes-DBJKrFxG.js","assets/AccountMappingScreen-BTR8uKQK.js","assets/QBOConnectionScreen-DNwlxY3R.js","assets/empty--RCTsu0x.js","assets/index-DxlUZLeR.js","assets/url-yW-1Hcty.js","assets/index-Cz1UMaoE.js","assets/accountMappingHelper-PEq3iFwb.js","assets/useEmailConnectResultRefresh-DWBnl6oa.js","assets/ReportsRoutes-CmRsRF1m.js","assets/ChargeCardRoutes-mt2g3Jg0.js","assets/useChargeCardPusherEvents-DLwmfLZC.js","assets/PeopleRoutes-6Eq28etR.js","assets/ExpenseAutomationRoutes-_6qCRlW0.js","assets/useActualMatchingMatchDetail-Bv7_wq27.js","assets/ScheduleDetailsPrepaidExpensesScreen-DKDzHrf0.js","assets/pathToGoBack-sBV6PqT4.js","assets/TreasuryRoutes-BbsVM2lE.js","assets/VendorsRoutes-B18gUSfI.js","assets/ZeniAccountRoutes-CWU7HNHh.js","assets/AddressRoutes-GFLqbgTr.js","assets/PandLWithForecastRoutes-BhMRDGc1.js","assets/CustomerOnboardingRoutes-BLRE7IK-.js","assets/TransactionDetailRoutes-BFBaFYFk.js","assets/EntityDetailRoutes-BH8_jvsw.js","assets/InvoicingRoutes-D6QJ-LnU.js","assets/NotificationRoutes-CNN0JO68.js","assets/PerformanceRoutes-DkxGB8dS.js","assets/ActualMatchingMatchDetailScreen-DpaCOnCM.js","assets/RewardsRoutes-cYws_8FH.js","assets/TaskRoutes-BRKcMi_T.js","assets/TaskListScreen-DW7e6ef_.js","assets/useTaskManagerPusherEvents-CtTv0DPD.js","assets/AiCfoScreen-Dd__YIWm.js","assets/CardsAiCfoScreen-DO_HCVwI.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as Es,fI as hs,e0 as ps,d$ as xs,Bl as gs,dj as Rs,c9 as Is,gM as js,gc as Ts,dg as pe,cH as As,gq as Ds,cz as bs,bF as fs,br as ys,UF as vs,v as Cs,UI as Os,bq as Us,UJ as Ps,bL as ws,bK as Fs,bu as Ls,cv as Hs,UK as ks,UL as Vs,db as Bs,de as Ss,dd as Ns,cG as Ms,cN as Zs,pW as xe,gl as ge,h0 as $s,gn as Re,gO as Ie,gP as je,go as zs}from"./zeni-epic-state-DIQk-W8f.js";import{j as e}from"./liveblocks-CZZ7TQJf.js";import{a as P}from"./sentry-7oL5NFUY.js";import{N as u,u as Gs,h as qs,i as Ws,g as Ks,j as $,q as Te,n as Ys,o as n}from"./core-DtSa7_zJ.js";import{J as l,u as Js,z as y,W as Qs,e as Xs,H as et,c as S,g as st,K as tt,M as nt,L as F,G as Ae,t as _,P as at,N as ot,k as ne}from"./index-CJhgQFRI.js";import{u as rt}from"./mui-hHF2bYsV.js";import{f as De}from"./analyticsHelper-C8wUoU5C.js";import{t as it}from"./getLocaleForTenant-D03DEBIE.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new o.Error().stack;b&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[b]="9d96dc90-04c8-4995-854f-0e45d2d64e4c",o._sentryDebugIdIdentifier="sentry-dbid-9d96dc90-04c8-4995-854f-0e45d2d64e4c")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-DHpPkJUq.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:b,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(H===!0){if(o)return e.jsx(fe,{tenantEmailDomain:C});if(i)return e.jsx(be,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(fe,{tenantEmailDomain:C}):i?e.jsx(be,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):b?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-mQvE4jJ0.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-sNvDS-kN.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-C2uBm8Jr.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-CDs1-rA6.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-DBJKrFxG.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-CmRsRF1m.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-mt2g3Jg0.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-6Eq28etR.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-_6qCRlW0.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-BbsVM2lE.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-B18gUSfI.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-CWU7HNHh.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]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-CmRsRF1m.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-GFLqbgTr.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-6Eq28etR.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-BhMRDGc1.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-BLRE7IK-.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-B18gUSfI.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-BFBaFYFk.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-BH8_jvsw.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-mQvE4jJ0.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])))),Ce=l((()=>s((()=>import("./BillPayRoutes-sNvDS-kN.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])))),jt=l((()=>s((()=>import("./SettingsRoutes-DBJKrFxG.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])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-D6QJ-LnU.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-C2uBm8Jr.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])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-CWU7HNHh.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])))),Dt=l((()=>s((()=>import("./TreasuryRoutes-BbsVM2lE.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),bt=l((()=>s((()=>import("./TransactionListRoutes-CDs1-rA6.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),ft=l((()=>s((()=>import("./ChargeCardRoutes-mt2g3Jg0.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-CNN0JO68.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-DkxGB8dS.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-_6qCRlW0.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])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-DpaCOnCM.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-cYws_8FH.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-BRKcMi_T.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-Dd__YIWm.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-DO_HCVwI.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),D=l((()=>s((()=>import("./NotFoundScreen-DHpPkJUq.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-DW7e6ef_.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(O===!0){if(b)return e.jsx(u,{to:"checking"});if(H)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):b?e.jsx(u,{to:"checking"}):H?e.jsx(u,{to:"treasury"}):k?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`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const b=Gs(),N=qs(),{tenantEmailDomain:i}=Ws(),H=rt().mode,{setLoading:O,clearAllLoading:C,clearLoading:k}=Js(),f=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),Y=Es(j),z=Ks(),[L,we]=P.useState(!1),r=$((a=>hs(a))),{useFeatureGate:V}=Qs(),M=Xs(),J=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=V(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=V(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,Q=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,ke=st(r,He,oe),{isCardsHidden:Ve}=tt(r?.tenantId),Be=!ke||!!Ve,{isFeatureEnabled:Se}=V(S.isSettingsFeatureEnabled),{isFeatureEnabled:X}=V(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=V(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),G=$((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&De(j,r,H)}const Z={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),h=nt(),$e=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),ze=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?Ds(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&f!=null){const a=se.split("-");if(a.length===2){const A=bs(Number(a[0])),c=Number(a[1]),t=fs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?b(vs(f,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,b,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(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=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,b,qe))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){B(Re(t));const K=y.getSignedInUserTenantWithId(t);K?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(K?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const K=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(zs(d.userId,t,d.zeniSessionId))),K&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,f,j,O,b))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),j!=null&&De(j,r,H,void 0,G.tenantsBaseInOrder))}),[G,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(C(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:We}=V(S.isReferralFeatureEnabled),{isFeatureEnabled:Ke}=V(S.isAccrualEnabled),Ye=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Je=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,Qe=Ps(h?.loggedInUserRoleMap),Xe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Hs(h?.loggedInUserRoleMap),os=ks(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Bs(h?.loggedInUserRoleMap),ls=Ss(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Qe===!0||os===!0||rs===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(j!=null&&T!=="In-Progress"&&b(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||Y&&!ee)&&es&&Xe!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||Y?!L||te!==!1||ee||Y?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ys,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{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(It,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ye||Je?e.jsx(Rt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(bt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(D,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(Dt,{}):e.jsx(D,{})}),e.jsx(n,{path:"performance",element:J===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:J===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:J===!0&&U===!1&&Ke===!0?e.jsx(Ot,{}):e.jsx(D,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(gt,{}):e.jsx(D,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(D,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(D,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(D,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(D,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(ft,{}):e.jsx(D,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Ut,{}):e.jsx(D,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(D,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(D,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:X}):e.jsx(D,{})}),e.jsx(n,{path:"*",element:e.jsx(D,{})})]})}):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:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,$t as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-D0aPwrEa.js";import{a as d}from"./sentry-Bh_Qiwsv.js";import{h as L,g as H,u as U,i as N,j as C,l as K,n as J,o as k}from"./core-CJLU9TYG.js";import{fI as w,ZU as Pe,O1 as ve,Zr as we,ZA as Ae,c9 as X,cU as _e,cV as De,bq as Ue,df as Re,Gj as Me,ZV as Te,Pu as Be,MU as Ve,ML as de,MI as Oe,Gn as ue,MO as pe,MR as ge,MX as Y,Cx as ee,Gm as Fe,ly as $,lB as me,ZW as Le,mL as Ne,GE as Ze,W6 as Ge,W7 as $e,lw as He,ZX as Ke,lz as We,uL as ze,W1 as qe,W2 as Je,uP as Qe,hZ as Xe,V0 as q,hR as ae,hO as Ye,hW as en,V1 as nn,GB as tn,ZY as an,ZZ as on,N9 as sn,m3 as rn,d$ as fe,e0 as he,Z_ as ln,gF as cn,Vg as dn,GA as oe,gK as se,gJ as un,Gz as pn,gI as gn,gH as mn,Z$ as fn,Us as Ce,_0 as hn,_1 as Cn,_2 as yn,_3 as Sn,_4 as bn,_5 as In,GH as xn,_6 as En,Gy as ie,Gs as G,_7 as kn,_8 as jn,_9 as re,_a as Pn,dU as vn,_b as wn,_c as An,_d as _n,UE as Dn,c1 as Un,c8 as Rn,c7 as Mn,c2 as Tn,_e as Bn,c5 as Vn,c4 as On,c6 as Fn,c3 as Ln}from"./zeni-epic-state-DN1FMHPE.js";import{bR as Nn,z as v,V as Z,a5 as ne,c1 as Zn,j as W,W as te,A as O,g as ye,H as Se,c2 as Gn,h as $n,U as be,c3 as Hn,ag as Kn,c4 as Wn,c5 as zn,ao as qn,c6 as Jn,p as Qn,c as Ie,c7 as Xn}from"./index-Bac0_7La.js";import{n as B}from"./mui-BTK8WNHw.js";import{u as xe}from"./useTaskManagerAccess-CUawSS4F.js";import{U as Yn}from"./AccountMappingScreen-Bh9jl7Ef.js";import{t as et,A as nt}from"./AddressScreen-Djrv0IMM.js";import F from"./NotFoundScreen-DVwEy2Nc.js";import{g as tt}from"./analyticsHelper-Cb3EUyBw.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BSguq-g2.js";import{C as st}from"./CompanyPassportScreen-CMKrSOCe.js";import{M}from"./MobileAppDrawer-Gq4sfjI3.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-B2CM-p2n.js";import{q as le}from"./QBOConnectionScreen--OQu_pq8.js";import{B as lt}from"./BillPayApprovalRoutes-C0zm6ZLS.js";import{R as ct}from"./ReimbursementApprovalRoutes-Bu6Pn9AT.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./utils-DnIJUuGb.js";import"./accountMappingHelper-CDFl9gNv.js";import"./routePaths-CFVcdQVU.js";import"./InboxNotificationsProvider-B5M0qdMl.js";import"./empty-CYTi1vUC.js";import"./pdf-lib-DubKZfxI.js";import"./index-DqcV3YMG.js";import"./url-CqXRBT9H.js";import"./index-C5DdgWE0.js";import"./decodeURIComponentSafe-Cai8T7ud.js";import"./ReimbursementApprovalRuleDetailScreen-BJcgs97q.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]="69817462-ee6b-43d3-be76-f57322e142e9",e._sentryDebugIdIdentifier="sentry-dbid-69817462-ee6b-43d3-be76-f57322e142e9")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-CZZ7TQJf.js";import{a as d}from"./sentry-7oL5NFUY.js";import{h as L,g as H,u as U,i as N,j as C,l as K,n as J,o as k}from"./core-DtSa7_zJ.js";import{fI as w,ZU as Pe,O1 as ve,Zr as we,ZA as Ae,c9 as X,cU as _e,cV as De,bq as Ue,df as Re,Gj as Me,ZV as Te,Pu as Be,MU as Ve,ML as de,MI as Oe,Gn as ue,MO as pe,MR as ge,MX as Y,Cx as ee,Gm as Fe,ly as $,lB as me,ZW as Le,mL as Ne,GE as Ze,W6 as Ge,W7 as $e,lw as He,ZX as Ke,lz as We,uL as ze,W1 as qe,W2 as Je,uP as Qe,hZ as Xe,V0 as q,hR as ae,hO as Ye,hW as en,V1 as nn,GB as tn,ZY as an,ZZ as on,N9 as sn,m3 as rn,d$ as fe,e0 as he,Z_ as ln,gF as cn,Vg as dn,GA as oe,gK as se,gJ as un,Gz as pn,gI as gn,gH as mn,Z$ as fn,Us as Ce,_0 as hn,_1 as Cn,_2 as yn,_3 as bn,_4 as Sn,_5 as In,GH as xn,_6 as En,Gy as ie,Gs as G,_7 as kn,_8 as jn,_9 as re,_a as Pn,dU as vn,_b as wn,_c as An,_d as _n,UE as Dn,c1 as Un,c8 as Rn,c7 as Mn,c2 as Tn,_e as Bn,c5 as Vn,c4 as On,c6 as Fn,c3 as Ln}from"./zeni-epic-state-DIQk-W8f.js";import{bR as Nn,z as v,M as Z,a5 as ne,c1 as Zn,k as W,W as te,c as O,g as ye,K as be,c2 as Gn,j as $n,V as Se,c3 as Hn,ag as Kn,c4 as Wn,c5 as zn,ao as qn,c6 as Jn,p as Qn,d as Ie,c7 as Xn}from"./index-CJhgQFRI.js";import{n as B}from"./mui-hHF2bYsV.js";import{u as xe}from"./useTaskManagerAccess-zRd8th0q.js";import{U as Yn}from"./AccountMappingScreen-BTR8uKQK.js";import{t as et,A as nt}from"./AddressScreen-DWZzKMEw.js";import F from"./NotFoundScreen-DHpPkJUq.js";import{g as tt}from"./analyticsHelper-C8wUoU5C.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-CVijkaE8.js";import{C as st}from"./CompanyPassportScreen-_f68duti.js";import{M}from"./MobileAppDrawer-D9iwyW6E.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DWBnl6oa.js";import{q as le}from"./QBOConnectionScreen-DNwlxY3R.js";import{B as lt}from"./BillPayApprovalRoutes-DV_p_SQ2.js";import{R as ct}from"./ReimbursementApprovalRoutes-CzKIB6lB.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";import"./accountMappingHelper-PEq3iFwb.js";import"./routePaths-66PPW-xS.js";import"./InboxNotificationsProvider-DrljtAmN.js";import"./empty--RCTsu0x.js";import"./pdf-lib-DvlP1tZv.js";import"./index-DxlUZLeR.js";import"./url-yW-1Hcty.js";import"./index-Cz1UMaoE.js";import"./decodeURIComponentSafe-CxfS79yY.js";import"./ReimbursementApprovalRuleDetailScreen-C0oxxTC0.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]="b51a9f1b-15ce-4d2d-a797-7932eed43fb0",e._sentryDebugIdIdentifier="sentry-dbid-b51a9f1b-15ce-4d2d-a797-7932eed43fb0")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-D0aPwrEa.js";import{a as d}from"./sentry-Bh_Qiws
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Zn),pt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=Z();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Zn),pt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:b,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const S=Z();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,b)))}),[t,u,m,b,c?.tenantId,o]);const E=g=>{n(g)};return S?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:S.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-D0aPwrEa.js";import{a as d}from"./sentry-Bh_Qiws
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(Y(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Oe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ve(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),r=Z(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(O.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=_e(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),_=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Me(!1)))}),[h,o,p]);const T=A=>{u(A)};return b||P||E||_?a.jsxs(gt,{children:[a.jsx(M,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:_,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(F,{})},ht=B.div`
17
+ `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(Y(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Oe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ve(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),r=Z(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(O.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,b]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),S=_e(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),_=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=be(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(b(!0),o(Me(!1)))}),[h,o,p]);const T=A=>{u(A)};return S||P||E||_?a.jsxs(gt,{children:[a.jsx(M,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:S,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:_,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(F,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-D0aPwrEa.js";import{a as d}from"./sentry-Bh_Qiws
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Le(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(Y(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=Z();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",St=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Ye(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Wn),bt=()=>{const e=Kn(),l=L(),o=U(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=Z(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(M,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Le(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Se.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(Y(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),b=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(b.addCardPaymentSourceStatus.fetchState),S=b.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=Z();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&S==="Completed"&&o($())}),[p,S]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",bt=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const b="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(b)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Ye(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Wn),St=()=>{const e=Kn(),l=L(),o=U(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),b=Z(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,S]=d.useState(!1);d.useEffect((()=>{p||(S(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_}=rt({companyId:u??c.companyId});return b?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(M,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(bt,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-D0aPwrEa.js";import{a as d}from"./sentry-Bh_Qiws
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=U(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(Y(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(M,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=U(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),b=d.useCallback((p=>{e(Y(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(M,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:b,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-D0aPwrEa.js";import{a as d}from"./sentry-Bh_Qiws
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=U(),o=L(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(O.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(O.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&b,j=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),_=!j||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:_,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{D(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const V=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(V,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const V={...x.myProfileLocalData,phone:y};l(oe({localData:V})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,V)=>{l(un(y,V,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=U(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),_=d.useCallback(((f,D,y)=>{e(jn({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(Pn({groupId:f,frequency:vn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(wn({groupId:f,channel:re(D),enabled:y}))}),[e]),T=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:_,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,_,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(_n()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(M,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:R,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=Z(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(O.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Un(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Yn,{})}),Mn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Vn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),On(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Ln(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function Pt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{da as default};
49
+ `,ce=({appContent:e})=>{const l=U(),o=L(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:b}=u(O.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(O.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&S,j=ye(t,b,m),{isCardsHidden:R}=be(t?.tenantId),_=!j||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:S,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:_,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{D(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const V=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(V,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const V={...x.myProfileLocalData,phone:y};l(oe({localData:V})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,V)=>{l(un(y,V,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=U(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:b}=xe(u),[m,p]=d.useState(!1),S=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(bn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(Sn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),_=d.useCallback(((f,D,y)=>{e(jn({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(Pn({groupId:f,frequency:vn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(wn({groupId:f,channel:re(D),enabled:y}))}),[e]),T=d.useMemo((()=>{if(b&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:_,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[b,h,t,s,_,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(_n()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(M,{isAppContentDrawerOpen:m,handleDrawerToggle:S}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{S(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:R,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((S=>Ce(S))),r=C((S=>w(S))),n=Z(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(O.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),b=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||b!==!0?Un(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Yn,{})}),Mn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Vn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),On(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Ln(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(St,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),b&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function Pt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{da as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-D0aPwrEa.js";import{h as Y,g as X,u as ee,i as W,j as _,N as R,l as H,t as en}from"./core-CJLU9TYG.js";import{bK as nn,fI as x,cH as tn,Ib as q,Zr as an,Zu as sn,v2 as ne,uS as te,mD as ae,C3 as N,Zw as be,gJ as He,gI as Ge,gH as Ke,Zx as on,Ik as cn,MU as Ce,ML as he,MI as Ie,Mn as Q,MO as Ae,MR as ke,MX as _e,Cx as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,Zy as yn,Ln as fe,L$ as fn,Zz as gn,bL as Sn,Od as ge,O1 as bn,ZA as Cn,ZB as hn,Oh as In,Ol as An,ZC as je,BY as kn,SN as _n,ZD as vn,ZE as Pn,ZF as Tn,ZG as Je,ZH as En,ZI as Dn,VR as On,YI as Un,W4 as wn,ZJ as qe,Mz as Fn,Mr as xn,W5 as Vn,Mv as Bn,ZK as Ue,P1 as Qe,mL as jn,uV as Ye,C5 as Rn,bF as Re,Ch as Le,cF as Ln,ZL as Xe,OT as we,OA as Nn,OB as Mn,OF as zn,ZM as Zn,OW as Ne,ZN as $n,ZO as Wn,ZP as Hn,PI as Se,ZQ as Gn,gZ as Kn,Jw as Jn,ZR as qn,JB as Qn,JA as Yn}from"./zeni-epic-state-DN1FMHPE.js";import{ag as Pe,V as ie,W as de,A as J,z as E,a6 as se,j as D,a5 as Te,N as $,bO as Xn,ac as oe,bP as V,bg as xe,bQ as et,bR as nt,bS as tt,n as Be,bT as at,p as Me,aE as ze,$ as it,a9 as st,bU as ot,bV as ct,bW as rt,w as ut}from"./index-Bac0_7La.js";import{a as h}from"./sentry-Bh_Qiwsv.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-BTK8WNHw.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-BSguq-g2.js";import{M as le}from"./MobileAppDrawer-Gq4sfjI3.js";import L from"./NotFoundScreen-DVwEy2Nc.js";import{a as $e}from"./analyticsHelper-Cb3EUyBw.js";import{d as We}from"./routePaths-CFVcdQVU.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]="3c44910c-54f1-48e9-84e2-f41dc6a369d4",e._sentryDebugIdIdentifier="sentry-dbid-3c44910c-54f1-48e9-84e2-f41dc6a369d4")}catch{}})();const mt=Ve.div`
1
+ import{j as u}from"./liveblocks-CZZ7TQJf.js";import{h as Y,g as X,u as ee,i as W,j as _,N as R,l as H,t as en}from"./core-DtSa7_zJ.js";import{bK as nn,fI as x,cH as tn,Ib as q,Zr as an,Zu as sn,v2 as ne,uS as te,mD as ae,C3 as N,Zw as be,gJ as He,gI as Ge,gH as Ke,Zx as on,Ik as cn,MU as Ce,ML as he,MI as Ie,Mn as Q,MO as Ae,MR as ke,MX as _e,Cx as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,Zy as yn,Ln as fe,L$ as fn,Zz as gn,bL as Sn,Od as ge,O1 as bn,ZA as Cn,ZB as hn,Oh as In,Ol as An,ZC as je,BY as kn,SN as _n,ZD as vn,ZE as Pn,ZF as Tn,ZG as Je,ZH as En,ZI as Dn,VR as On,YI as Un,W4 as wn,ZJ as qe,Mz as Fn,Mr as xn,W5 as Vn,Mv as Bn,ZK as Ue,P1 as Qe,mL as jn,uV as Ye,C5 as Rn,bF as Re,Ch as Le,cF as Ln,ZL as Xe,OT as we,OA as Nn,OB as Mn,OF as zn,ZM as Zn,OW as Ne,ZN as $n,ZO as Wn,ZP as Hn,PI as Se,ZQ as Gn,gZ as Kn,Jw as Jn,ZR as qn,JB as Qn,JA as Yn}from"./zeni-epic-state-DIQk-W8f.js";import{ag as Pe,M as ie,W as de,c as J,z as E,a6 as se,k as D,a5 as Te,R as $,bO as Xn,ac as oe,bP as V,bg as xe,bQ as et,bR as nt,bS as tt,o as Be,bT as at,p as Me,aE as ze,$ as it,a9 as st,bU as ot,bV as ct,bW as rt,w as ut}from"./index-CJhgQFRI.js";import{a as h}from"./sentry-7oL5NFUY.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-hHF2bYsV.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-CVijkaE8.js";import{M as le}from"./MobileAppDrawer-D9iwyW6E.js";import L from"./NotFoundScreen-DHpPkJUq.js";import{a as $e}from"./analyticsHelper-C8wUoU5C.js";import{d as We}from"./routePaths-66PPW-xS.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]="ea1d275b-00e6-4298-8443-48cca6e1659e",e._sentryDebugIdIdentifier="sentry-dbid-ea1d275b-00e6-4298-8443-48cca6e1659e")}catch{}})();const mt=Ve.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-CZZ7TQJf.js";import{a as u,R as T,t as A}from"./sentry-7oL5NFUY.js";import{u as z,h as D,j as c,g as M,N as O,l as P}from"./core-DtSa7_zJ.js";import{u as j,z as s,k as E,G as F,Q as _,R as N,S as B,T as V,U as Q,V as v}from"./index-CJhgQFRI.js";import{fI as R,Uo as $,UI as J,gl as W,gn as Y,UN as G,gY as H,dk as q,UO as y,UP as K,UQ as X,c0 as U}from"./zeni-epic-state-DIQk-W8f.js";import{u as Z}from"./mui-hHF2bYsV.js";import{u as ee}from"./useDeviceId-DpOlnzI_.js";import{f as te}from"./analyticsHelper-C8wUoU5C.js";import{t as ne}from"./getLocaleForTenant-D03DEBIE.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.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]="f946c313-ff09-45c3-9b85-bcb3548ea55e",t._sentryDebugIdIdentifier="sentry-dbid-f946c313-ff09-45c3-9b85-bcb3548ea55e")}catch{}})();const ie=P((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(l),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(K(n,a)))},clearSignInError:()=>{t(y())}}}))(Q),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:L}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),h=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>R(e))),I=c((e=>$(e))),m=M(),w=Z().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[k.fetchState,l]),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(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),H().then((()=>{const e=V();e!=null&&_(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",q(r.productSettings))}),2e3))}),[S,p,h,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&L!=null?f.jsx(B,{onClose:()=>i(y()),unlockDate:L}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-CZZ7TQJf.js";import{a as i}from"./sentry-7oL5NFUY.js";import{u as c,g as d,N as u}from"./core-DtSa7_zJ.js";import{z as n,k as a,R as m,a5 as p}from"./index-CJhgQFRI.js";import{g$ as g,V2 as y}from"./zeni-epic-state-DIQk-W8f.js";import{n as b}from"./mui-hHF2bYsV.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.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]="69f5be72-5f13-40ae-9970-fedcf34af98a",e._sentryDebugIdIdentifier="sentry-dbid-69f5be72-5f13-40ae-9970-fedcf34af98a")}catch{}})();function L(){const e=c(),t=d(),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(l){console.error("Error during sign out:",l)}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
+ display: flex;
3
+ height: 100vh;
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
+ `;export{L as default};
@@ -0,0 +1,9 @@
1
+ import{j as A}from"./liveblocks-CZZ7TQJf.js";import{a as u}from"./sentry-7oL5NFUY.js";import{u as H,k as J,j as G,h as me,g as Se,i as be,l as ye}from"./core-DtSa7_zJ.js";import{z as M,W as De,c as I,aq as Ee,a6 as he,k as Ge,R as Ce,e3 as Ae,p as F,a2 as Ie}from"./index-CJhgQFRI.js";import{Qz as Re,Rn as ve,fI as Be,a2E as ne,gQ as Z,a2F as re,a2z as Le,QR as X,a2G as Ke,R3 as Y,QB as we,Qd as Ue,Rz as ee,a2H as ae,gk as Pe,Rq as Fe,Rv as je,Ri as xe,Rg as te,Rw as $e,Rd as Ne,a2I as Oe,a2J as ze,a2K as Qe,a2L as Me,a2M as R,dy as Ze,dx as qe,a2N as Ve,Qy as We}from"./zeni-epic-state-DIQk-W8f.js";import{n as He}from"./mui-hHF2bYsV.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.js";import{M as Xe}from"./MobileAppDrawer-D9iwyW6E.js";import{u as Ye}from"./useTaskManagerPusherEvents-CtTv0DPD.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]="8fb0b1a1-c48f-4bd6-b8c6-0b8860254b02",e._sentryDebugIdIdentifier="sentry-dbid-8fb0b1a1-c48f-4bd6-b8c6-0b8860254b02")}catch{}})();const _={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"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.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
+ `,na=ye((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,b=Le(e),f=M.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:b,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:b}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(f,a),y=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:y}})},onReloadTasks:()=>{e(Z(!0,b))},onTabChange:a=>{e(Me(a))},onParentTaskClick:a=>{const s=se(f,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=Q(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(ae({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(Qe({filters:a}))},onSearchTextChanged:a=>{e(ze({searchText:a}))},onReloadCards:()=>{e(Z(!0,b))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const a=Ie(p.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:a.newStack}})}else n("../")},updateLocalData:a=>{e(Oe({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Ne(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(te(t.localData.selectedTaskIds,a,$e(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(xe(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=oa(v,a);e(X({taskDetailLocalData:s}));const y=Q(f,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(y,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(je(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(Fe(a,s))},onTimeSpentUpdate:(a,s)=>{e(ee({task:a,updates:s}))},onShowToast:a=>{e(Pe(a))},onGroupByFilterChange:a=>{e(ae({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(ee({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(Ue(a,s))},onSubtaskCreation:(a,s)=>{e(we({...s,parentTaskId:a}))},handleGroupTemplateClick:a=>{e(Y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(Y(a,[s]))},handleNewTaskInitialization:a=>{if(e(X({taskDetailLocalData:{...Ke,name:a}})),t.localData.defaultTaskGroupId!=null){const s=Q(f,t.localData.defaultTaskGroupId),y=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:y,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${f}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=me(),t=H(),n=Se(),c=M.getSignedInUser(),p=M.isZeniUser(),b=J(),f=G((d=>Be(d))),{taskGroupId:v}=be(),{useFeatureGate:a}=De(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:y}=a(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=a(I.isTaskCategorizationEnabled),{isFeatureEnabled:ie}=a(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:le}=a(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ue}=a(I.isTaskRecurringParentEnabled),[ce,de]=u.useState(!1),$=G((d=>ne(d,s))),N=G((d=>d.taskGroupState)),B=$.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});Ee({isDataReady:B==="Completed"});const{markBoardFetchInFlight:q,requestTaskRefetch:O}=(function(d){const m=H(),r=J(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Re())}),[m,K]),D=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(ve())}),[m,r]),E=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:D()}),[w,D,r]),z=u.useCallback((()=>{S.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,E())}),6e3))):E()}),[E,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=G((i=>i.taskListState.fetchState)),C=G((i=>i.taskGroupViewState.fetchState)),U=G((i=>i.taskListState.byTab.live)),P=G((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==L.current||h==="Error")&&(S.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):E()))}),[h,U,E]),u.useEffect((()=>{C!=="In-Progress"&&(!k.current||P!==g.current||C==="Error")&&(k.current=!1,o.current&&(o.current=!1,C!=="Error"&&D()))}),[C,P,D]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:z}})(f?.tenantId);u.useEffect((()=>{b.getState().taskListState.hasValidState()||q(),t(Z(!1,s))}),[f?.tenantId,t,s,q,b]);const fe=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(f?.companyId,d),...aa(c?.userId,m)]}),[f?.companyId,c?.userId]);if(Ye({events:fe,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oe(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const T=b.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===L.length&&S.every((i=>L.includes(i))),w=k.taskGroupIds??[],D=r.task_group_ids??[],E=w.length!==D.length||!w.every((i=>D.includes(i))),z=(i,Te)=>{const V=i??[],W=Te??[];if(V.length!==W.length)return!1;const ge=new Set(W);return V.every((_e=>ge.has(_e)))},h=r.name==null||r.name===k.name,C=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||z(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&E&&h&&C&&U&&P)return}}return void O()}case _.TASKS_BULK_DELETED:{const r=ta(m);return r==null?void 0:void r.task_ids.forEach((T=>t(We(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void O()}},onSubscribed:()=>{O()}}),u.useEffect((()=>{B==="Completed"&&t(re({taskGroupById:N.taskGroupById}))}),[B,N.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[B==="Completed"?A.jsx(he,{analytics:Ge,onLoad:d=>(m=>m.trackPageLoaded(Ce.Event.taskListPage))(d)}):null,A.jsxs(sa,{children:[A.jsx(Xe,{isAppContentDrawerOpen:ce,handleDrawerToggle:d=>{de(d)}}),A.jsx(na,{location:n,navigate:e,currentTenant:f,taskGroupId:v,taskGroupState:N,localData:$.localData,uiState:$.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:y,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,Q=(e,t)=>`/${e}/tasks/new/${t}`,oa=(e,t)=>{if(e==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Ze(t);return{...R.taskDetailLocalData,priority:n}}if(e==="status"){const n=qe(t);return{...R.taskDetailLocalData,status:n}}if(e==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Ve(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},ma=Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}));export{_ as T,aa as a,ea as b,_a as c,ta as d,ra as e,ma as f,ga as t};