@zeniai/web-app-ui 5.3.94-dev → 5.3.95-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 (121) hide show
  1. package/dist/assets/{AccountMappingScreen-DaAsvWlG.js → AccountMappingScreen-CJpxPjym.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-DsOtbvkM.js → ActualMatchingMatchDetailScreen-BI1Xbj3L.js} +1 -1
  3. package/dist/assets/AddressRoutes-27wvZSFH.js +1 -0
  4. package/dist/assets/{AddressScreen-C0JLhAcE.js → AddressScreen-Ce6wpOqL.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-BUHwXAf6.js → AiCfoScreen-baKqq38G.js} +1 -1
  6. package/dist/assets/{AppDrawer-vbC-QV57.js → AppDrawer-BAy3i2Dk.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-DzF0eyUE.js → BillPayApprovalRoutes-BLLQGNfF.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-Bi056p3z.js → BillPayRoutes-BF0qZi8Q.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-D1nbOYUs.js → BusinessVerificationPageScreen-B6gKgGKZ.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-CfZl8Gyx.js → CardsAiCfoScreen-495-iwbX.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-S3N8oI1a.js → ChargeCardRoutes-CsLMN32g.js} +6 -6
  12. package/dist/assets/{CompanyPassportScreen-Cb0WDItw.js → CompanyPassportScreen-DFOWHlG6.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-DscrSY_4.js → ConnectionAuthScreen-DcGlWxyf.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-Da1wSVu0.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-Q5YqE-pG.js → CustomerOnboardingRoutes-7Bwv09dV.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-CHLUwZtv.js → DashboardRoutes-s3deN1Di.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-BSW3FKbq.js → DefaultTenantHome-Bi2eWO-I.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BqNLFPCz.js → DomesticWireDetailScreen-CVJejZP9.js} +3 -3
  19. package/dist/assets/{DrawerScreen-CjvLDWWa.js → DrawerScreen-Bev9sxN6.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-CiuhVFP6.js → EntityDetailRoutes-DTd2OX4g.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-yHkHWhCB.js → ExpenseAutomationRoutes-BNvZ1Bwi.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-t6-81tB3.js → FeaturePreviewScreen-DETqyCpy.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-6v8VBEj0.js → HubSpotOAuthCallbackScreen-LgF5qdxr.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider--Aami2sh.js → InboxNotificationsProvider-LdTK3V9o.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-DYvbJYG6.js → InvoicingRoutes-Mbynj2-j.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-C2OazRqD.js → MagicLinkRoutes-BAL4OpO8.js} +2 -2
  27. package/dist/assets/{MagicLinkSignInScreen-Cn6GsNEp.js → MagicLinkSignInScreen-BIY2mGLo.js} +1 -1
  28. package/dist/assets/{MobileAppDrawer-CPwvCIYa.js → MobileAppDrawer-CsfNveW9.js} +1 -1
  29. package/dist/assets/NotFoundScreen-DDA41Ig7.js +1 -0
  30. package/dist/assets/{NotificationRoutes-aekj_lXX.js → NotificationRoutes-_8GAMr1Q.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-xUzU6tqX.js → OAuthConsentScreen-DrAajreS.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-DbBbI4iD.js → PandLWithForecastRoutes-BoihVLwz.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-wDbMp6EU.js → PaymentLinkScreen-QPSeahMe.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-DLFd4iV8.js → PeopleRoutes-BJ_Rsbpd.js} +3 -3
  35. package/dist/assets/{PerformanceRoutes-DgAZpNgm.js → PerformanceRoutes-BU_ssv__.js} +1 -1
  36. package/dist/assets/{Preview-9JjGFG_v.js → Preview-S6mtKRFK.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-Dn2zy1VD.js → QBOConnectionScreen-DMcsRcZG.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-y4qFEQsq.js → ReimbursementApprovalRoutes-c_eicF80.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-D0_gOHEu.js → ReimbursementApprovalRuleDetailScreen-NQbCpzYz.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-BnId3F39.js → ReimbursementRoutes-BVOB8GHt.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-DbeoJpVK.js → ReportsRoutes-BaXWnnZZ.js} +1 -1
  42. package/dist/assets/RewardsRoutes-Dr_V6CBY.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-ISVWQj5Q.js → ScheduleDetailsPrepaidExpensesScreen-OdknWRFf.js} +1 -1
  44. package/dist/assets/ScreenRoutes-MAHnboyU.js +2 -0
  45. package/dist/assets/{SettingsRoutes-tCVJI0Fg.js → SettingsRoutes-CwikuwVk.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-fiQdFdcd.js → SetupPagesScreen-B0b-Fgla.js} +1 -1
  47. package/dist/assets/{SignInScreen-DiXsocpm.js → SignInScreen-DYTURHhx.js} +1 -1
  48. package/dist/assets/{SignOutScreen-BiwH5m6t.js → SignOutScreen-Be_uJc5B.js} +1 -1
  49. package/dist/assets/{TaskListScreen-BgIlrtZe.js → TaskListScreen-adKZru26.js} +2 -2
  50. package/dist/assets/{TaskRoutes-BNd4w4Bb.js → TaskRoutes-B74sfUtJ.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-DRKjV_CD.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-BkV8Yidz.js → TransactionDetailScreen-CS9DS32g.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-Dy1QqSzY.js → TransactionListRoutes-BIufDhIc.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-Caywh1RR.js → TreasuryRoutes-Bt27xnQK.js} +5 -5
  55. package/dist/assets/{VendorsRoutes-g-EHYY2y.js → VendorsRoutes-ZMV0CecT.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-C46GF-q1.js → WiseConfirmationScreen-ZJ4gewaT.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-B6_vZk4u.js → ZeniAccountRoutes-DV3rsGFn.js} +9 -9
  58. package/dist/assets/{ZeniAccountStatementScreen-BjT0Ja6v.js → ZeniAccountStatementScreen-B-L8iMJL.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-jzkx0QiS.js → accountMappingHelper-1wM-u5pk.js} +1 -1
  60. package/dist/assets/{analytics-BE49_JfE.js → analytics-DhotUQIQ.js} +1 -1
  61. package/dist/assets/{analyticsHelper-DZVn8KPX.js → analyticsHelper-BkudU6tc.js} +1 -1
  62. package/dist/assets/{core-R1zvmcG1.js → core-B1R51LGS.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-D4d600vS.js → decodeURIComponentSafe-sNmSv15A.js} +1 -1
  64. package/dist/assets/{dnd-LSyMQh_7.js → dnd-CBDtHD8g.js} +1 -1
  65. package/dist/assets/{empty-BfAyW5rR.js → empty-1ZFG33kK.js} +1 -1
  66. package/dist/assets/{empty-CtFP9XJw.js → empty-DDVSRnUK.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-DYu9DRPv.js → emptyVideoElement-Cmgjsfjv.js} +1 -1
  68. package/dist/assets/{epic-DI5821Fd.js → epic--rTGN1ZF.js} +2 -2
  69. package/dist/assets/{expenseAutomationHelper-BlCRyV8f.js → expenseAutomationHelper-Bb1c_nBx.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-DZAPKjbH.js → getLocaleForTenant-Nj4zPyxj.js} +1 -1
  71. package/dist/assets/{index-IzH6rGRi.js → index-4kuDVIdn.js} +1 -1
  72. package/dist/assets/{index-ARkELHLC.js → index-B4fRbcqK.js} +1 -1
  73. package/dist/assets/{index-LeoAhFsn.js → index-BgCxp-PW.js} +1 -1
  74. package/dist/assets/{index-CooR7eTi.js → index-C5-029-z.js} +1 -1
  75. package/dist/assets/{index-D7BxdwHb.js → index-CmqWYVaK.js} +1 -1
  76. package/dist/assets/{index-DhHwwWlj.js → index-DUjhchTx.js} +1 -1
  77. package/dist/assets/{index-B-tyZK_L.js → index-DaxOKW2h.js} +2 -2
  78. package/dist/assets/{index-Cvus_VBr.js → index-Dp_Uc3gy.js} +1704 -1703
  79. package/dist/assets/{lexical-BG-nDmQN.js → lexical-Cft6chCX.js} +1 -1
  80. package/dist/assets/{liveblocks-DOdRxZ-H.js → liveblocks-BYqz0SWy.js} +1 -1
  81. package/dist/assets/{lottie-Z_NAxrmn.js → lottie-C4orech3.js} +1 -1
  82. package/dist/assets/{mui-ZKvbmPSP.js → mui-D-_RYGgU.js} +1 -1
  83. package/dist/assets/{pathToGoBack-DioXT2-t.js → pathToGoBack-DZ8Lgq0-.js} +1 -1
  84. package/dist/assets/{pdf-_w1KRTSP.js → pdf-DFgrdLB6.js} +3 -3
  85. package/dist/assets/{pdf-lib-Ctu1umZQ.js → pdf-lib-2bJZTByw.js} +1 -1
  86. package/dist/assets/{plaid-tDbexfSh.js → plaid-B0PWXAfV.js} +1 -1
  87. package/dist/assets/{pusher-9ZSIvZ4p.js → pusher-F6-lSe0Y.js} +1 -1
  88. package/dist/assets/{react-DofVj9Pu.js → react-BwTGo4yk.js} +1 -1
  89. package/dist/assets/{react-dAAwh8YD.js → react-CB4vP-t_.js} +1 -1
  90. package/dist/assets/{react-V1QPqCMR.js → react-CM16A7NA.js} +1 -1
  91. package/dist/assets/{react-DLfHBjuE.js → react-DUg8Ws81.js} +1 -1
  92. package/dist/assets/{react-CNq4EJHI.js → react-D_SPu3Ud.js} +1 -1
  93. package/dist/assets/{react-BwaH8vjo.js → react-DyLpv-r1.js} +1 -1
  94. package/dist/assets/{recharts-UmMlzZlF.js → recharts-By7FVN8f.js} +1 -1
  95. package/dist/assets/{routePaths-ME1g30cL.js → routePaths-BALvGXpp.js} +1 -1
  96. package/dist/assets/{sentry-DvoFEQx8.js → sentry-DjmIorbX.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-BaAbZcaB.js → stripSplatSuffix-B5IwbFj2.js} +1 -1
  98. package/dist/assets/{url-C4ptnP9R.js → url-B8llcdww.js} +1 -1
  99. package/dist/assets/{url-CxALZHMf.js → url-SyxPcinx.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-CuSDY9wd.js → useActualMatchingMatchDetail-CuDY29_K.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B-4Cv_Hc.js → useAiCfoDashboardSuggestedQuestionsChips-B5pmnrb8.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-DWkTPomv.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-Cd0ovQSz.js → useChargeCardPusherEvents-Ce-wULUB.js} +1 -1
  104. package/dist/assets/{useDeviceId-DiDVtEd4.js → useDeviceId-D6nAUa-g.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-neeIEIrq.js → useEmailConnectResultRefresh-CQX3dx0q.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-mCNzqzEf.js → useInitialThreadRequest-BaIZPAUw.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-CFJAytRv.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-D1CY3bdf.js → useTaskManagerPusherEvents-B_vM_sss.js} +1 -1
  109. package/dist/assets/{utils-D06mHID-.js → utils-iOnDyQuG.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-LlSL3tvn.js → withTransactionSidePanel-BuJ7rAhb.js} +2 -2
  111. package/dist/assets/{zeni-epic-state-Mdu-dKQU.js → zeni-epic-state-M9sMLOaG.js} +5 -5
  112. package/dist/index.html +1 -1
  113. package/package.json +3 -3
  114. package/dist/assets/AddressRoutes-DYRqLyFY.js +0 -1
  115. package/dist/assets/CustomerOnboardingAuthScreen-DZSTKSts.js +0 -1
  116. package/dist/assets/NotFoundScreen-BR0tBeJN.js +0 -1
  117. package/dist/assets/RewardsRoutes-CbVAxJ_Q.js +0 -1
  118. package/dist/assets/ScreenRoutes-BxsiowEM.js +0 -2
  119. package/dist/assets/TransactionDetailRoutes-BYsmhufD.js +0 -1
  120. package/dist/assets/useAskAiCfoHostNavButtonProps-D5Ew-Qzm.js +0 -1
  121. package/dist/assets/useTaskManagerAccess-CcPTnvTg.js +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DDA41Ig7.js","assets/sentry-DjmIorbX.js","assets/core-B1R51LGS.js","assets/zeni-epic-state-M9sMLOaG.js","assets/index-Dp_Uc3gy.js","assets/mui-D-_RYGgU.js","assets/analytics-DhotUQIQ.js","assets/utils-iOnDyQuG.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-s3deN1Di.js","assets/withTransactionSidePanel-BuJ7rAhb.js","assets/useAskAiCfoHostNavButtonProps-DWkTPomv.js","assets/TransactionDetailScreen-CS9DS32g.js","assets/decodeURIComponentSafe-sNmSv15A.js","assets/useInitialThreadRequest-BaIZPAUw.js","assets/routePaths-BALvGXpp.js","assets/expenseAutomationHelper-Bb1c_nBx.js","assets/stripSplatSuffix-B5IwbFj2.js","assets/analyticsHelper-BkudU6tc.js","assets/CompanyPassportScreen-DFOWHlG6.js","assets/MobileAppDrawer-CsfNveW9.js","assets/InboxNotificationsProvider-LdTK3V9o.js","assets/useTaskManagerAccess-CFJAytRv.js","assets/useAiCfoDashboardSuggestedQuestionsChips-B5pmnrb8.js","assets/FeaturePreviewScreen-DETqyCpy.js","assets/BillPayRoutes-BF0qZi8Q.js","assets/AddressScreen-Ce6wpOqL.js","assets/DomesticWireDetailScreen-CVJejZP9.js","assets/BusinessVerificationPageScreen-B6gKgGKZ.js","assets/DrawerScreen-Bev9sxN6.js","assets/SetupPagesScreen-B0b-Fgla.js","assets/BillPayApprovalRoutes-BLLQGNfF.js","assets/ReimbursementApprovalRuleDetailScreen-NQbCpzYz.js","assets/getLocaleForTenant-Nj4zPyxj.js","assets/ReimbursementRoutes-BVOB8GHt.js","assets/ReimbursementApprovalRoutes-c_eicF80.js","assets/TransactionListRoutes-BIufDhIc.js","assets/ZeniAccountStatementScreen-B-L8iMJL.js","assets/SettingsRoutes-CwikuwVk.js","assets/AccountMappingScreen-CJpxPjym.js","assets/QBOConnectionScreen-DMcsRcZG.js","assets/empty-DDVSRnUK.js","assets/index-DUjhchTx.js","assets/url-SyxPcinx.js","assets/index-BgCxp-PW.js","assets/accountMappingHelper-1wM-u5pk.js","assets/useEmailConnectResultRefresh-CQX3dx0q.js","assets/ReportsRoutes-BaXWnnZZ.js","assets/ChargeCardRoutes-CsLMN32g.js","assets/useChargeCardPusherEvents-Ce-wULUB.js","assets/PeopleRoutes-BJ_Rsbpd.js","assets/ExpenseAutomationRoutes-BNvZ1Bwi.js","assets/useActualMatchingMatchDetail-CuDY29_K.js","assets/ScheduleDetailsPrepaidExpensesScreen-OdknWRFf.js","assets/pathToGoBack-DZ8Lgq0-.js","assets/TreasuryRoutes-Bt27xnQK.js","assets/VendorsRoutes-ZMV0CecT.js","assets/ZeniAccountRoutes-DV3rsGFn.js","assets/AddressRoutes-27wvZSFH.js","assets/PandLWithForecastRoutes-BoihVLwz.js","assets/CustomerOnboardingRoutes-7Bwv09dV.js","assets/TransactionDetailRoutes-DRKjV_CD.js","assets/EntityDetailRoutes-DTd2OX4g.js","assets/InvoicingRoutes-Mbynj2-j.js","assets/NotificationRoutes-_8GAMr1Q.js","assets/PerformanceRoutes-BU_ssv__.js","assets/ActualMatchingMatchDetailScreen-BI1Xbj3L.js","assets/RewardsRoutes-Dr_V6CBY.js","assets/TaskRoutes-B74sfUtJ.js","assets/TaskListScreen-adKZru26.js","assets/useTaskManagerPusherEvents-B_vM_sss.js","assets/AiCfoScreen-baKqq38G.js","assets/CardsAiCfoScreen-495-iwbX.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fI as Es,e0 as ps,d$ as xs,Bo as Rs,dj as gs,c9 as Is,gM as js,gc as Ts,dg as pe,cH as As,gq as bs,cz as Ds,bF as fs,br as ys,UN as vs,v as Cs,UQ as Os,bq as Us,UR as Ps,bL as ws,bK as Fs,bu as Ls,cv as Hs,US as Vs,UT as ks,db as Ss,de as Bs,dd as Ns,cG as Ms,cN as Zs,pW as xe,gl as Re,h0 as $s,gn as ge,gO as Ie,gP as je,go as zs}from"./zeni-epic-state-M9sMLOaG.js";import{j as e}from"./liveblocks-BYqz0SWy.js";import{a as P}from"./sentry-DjmIorbX.js";import{N as u,u as Gs,h as qs,i as Ws,g as Ys,j as $,q as Te,n as Ks,o as n}from"./core-B1R51LGS.js";import{F as l,u as Qs,z as y,c as Xs,e as Js,f as et,$ as B,h as st,H as tt,V as nt,L as F,G as Ae,t as _,P as at,I as ot,l as ne}from"./index-Dp_Uc3gy.js";import{u as rt}from"./mui-D-_RYGgU.js";import{f as be}from"./analyticsHelper-BkudU6tc.js";import{t as it}from"./getLocaleForTenant-Nj4zPyxj.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="34e6767a-8525-45c2-b75a-f0852bbbc049",o._sentryDebugIdIdentifier="sentry-dbid-34e6767a-8525-45c2-b75a-f0852bbbc049")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-DDA41Ig7.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`}),De=({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:D,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(De,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(fe,{tenantEmailDomain:C}):i?e.jsx(De,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):D?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-s3deN1Di.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-BF0qZi8Q.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-BVOB8GHt.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-BIufDhIc.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-CwikuwVk.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-BaXWnnZZ.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CsLMN32g.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-BJ_Rsbpd.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-BNvZ1Bwi.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-Bt27xnQK.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-ZMV0CecT.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-DV3rsGFn.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-BaXWnnZZ.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),ht=l((()=>s((()=>import("./AddressRoutes-27wvZSFH.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-BJ_Rsbpd.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-BoihVLwz.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-7Bwv09dV.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-ZMV0CecT.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-DRKjV_CD.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-DTd2OX4g.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-s3deN1Di.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-BF0qZi8Q.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-CwikuwVk.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-Mbynj2-j.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-BVOB8GHt.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-DV3rsGFn.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])))),bt=l((()=>s((()=>import("./TreasuryRoutes-Bt27xnQK.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-BIufDhIc.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-CsLMN32g.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-_8GAMr1Q.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-BU_ssv__.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-BNvZ1Bwi.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-BI1Xbj3L.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-Dr_V6CBY.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-B74sfUtJ.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-baKqq38G.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-495-iwbX.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-DDA41Ig7.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-adKZru26.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:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:V})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(H)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return C===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):H?e.jsx(u,{to:"treasury"}):V?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 D=Gs(),N=qs(),{tenantEmailDomain:i}=Ws(),H=rt().mode,{setLoading:O,clearAllLoading:C,clearLoading:V}=Qs(),f=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),K=hs(j),z=Ys(),[L,we]=P.useState(!1),r=$((a=>Es(a))),{useFeatureGate:k}=Xs(),M=Js(),Q=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=k(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(B.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,X=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,Ve=st(r,He,oe),{isCardsHidden:ke}=tt(r?.tenantId),Se=!Ve||!!ke,{isFeatureEnabled:Be}=k(B.isSettingsFeatureEnabled),{isFeatureEnabled:J}=k(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(B.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&&be(j,r,H)}const Z={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),ze=As(E?.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?bs(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=Ds(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?D(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,D,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(ge(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,D,qe))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,S){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){S(ge(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),Re(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=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),S(zs(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,f,j,O,D))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),j!=null&&be(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),V(F.TENANT_FETCHING),V(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}=k(B.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=k(B.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Xe=Ps(E?.loggedInUserRoleMap),Je=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(E?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Hs(E?.loggedInUserRoleMap),os=Vs(E?.loggedInUserRoleMap),rs=ks(E?.loggedInUserRoleMap),is=Ss(E?.loggedInUserRoleMap),ls=Bs(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Xe===!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"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||K&&!ee)&&es&&Je!==!0&&h===!1&&X===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||K?!L||te!==!1||ee||K?L&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Qe?e.jsx(gt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(Dt,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,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(ht,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:Q===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:Q===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:Q===!0&&U===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(ft,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...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-DOdRxZ-H.js";import{a as d}from"./sentry-DvoFEQx8.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as Q,o as k}from"./core-R1zvmcG1.js";import{fI as v,_0 as je,O9 as _e,Zz as ve,ZI as Ae,c9 as Y,cU as we,cV as De,bq as Ue,df as Re,Gr as Te,_1 as Me,PC as Be,N0 as Ve,MT as de,MQ as Ne,Gv as ue,MW as pe,MZ as ge,N3 as X,CA as ee,Gu as Oe,ly as $,lB as me,_2 as Fe,mL as Le,GM as Ge,We as Ze,Wf as $e,lw as He,_3 as Ke,lz as We,uL as ze,W9 as qe,Wa as Qe,uP as Je,hZ as Ye,V8 as q,hR as ae,hO as Xe,hW as en,V9 as nn,GJ as tn,_4 as an,_5 as on,Nh as sn,m3 as rn,d$ as fe,e0 as he,_6 as ln,gF as cn,Vo as dn,GI as oe,gK as se,gJ as un,GH as pn,gI as gn,gH as mn,_7 as fn,UA as Ce,_8 as hn,_9 as Cn,_a as yn,_b as bn,_c as Sn,_d as In,GP as xn,_e as En,GG as ie,GA as Z,_f as kn,_g as Pn,_h as re,_i as jn,dU as _n,_j as vn,_k as An,_l as wn,UM as Dn,c1 as Un,c8 as Rn,c7 as Tn,c2 as Mn,_m as Bn,c5 as Vn,c4 as Nn,c6 as On,c3 as Fn}from"./zeni-epic-state-Mdu-dKQU.js";import{bR as Ln,z as _,V as G,a5 as ne,c1 as Gn,l as W,Y as te,$ as N,g as ye,H as be,c2 as Zn,j as $n,Q as Se,c3 as Hn,ag as Kn,c4 as Wn,c5 as zn,ao as qn,c6 as Qn,p as Jn,c as Ie,c7 as Yn}from"./index-Cvus_VBr.js";import{n as B}from"./mui-ZKvbmPSP.js";import{u as xe}from"./useTaskManagerAccess-CcPTnvTg.js";import{U as Xn}from"./AccountMappingScreen-DaAsvWlG.js";import{t as et,A as nt}from"./AddressScreen-C0JLhAcE.js";import O from"./NotFoundScreen-BR0tBeJN.js";import{g as tt}from"./analyticsHelper-DZVn8KPX.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-D1nbOYUs.js";import{C as st}from"./CompanyPassportScreen-Cb0WDItw.js";import{M as T}from"./MobileAppDrawer-CPwvCIYa.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-neeIEIrq.js";import{q as le}from"./QBOConnectionScreen-Dn2zy1VD.js";import{B as lt}from"./BillPayApprovalRoutes-DzF0eyUE.js";import{R as ct}from"./ReimbursementApprovalRoutes-y4qFEQsq.js";import"./recharts-UmMlzZlF.js";import"./analytics-BE49_JfE.js";import"./plaid-tDbexfSh.js";import"./dnd-LSyMQh_7.js";import"./stripe-cKAAJElX.js";import"./lottie-Z_NAxrmn.js";import"./lexical-BG-nDmQN.js";import"./pdf-_w1KRTSP.js";import"./utils-D06mHID-.js";import"./accountMappingHelper-jzkx0QiS.js";import"./routePaths-ME1g30cL.js";import"./InboxNotificationsProvider--Aami2sh.js";import"./empty-CtFP9XJw.js";import"./pdf-lib-Ctu1umZQ.js";import"./index-DhHwwWlj.js";import"./url-CxALZHMf.js";import"./index-LeoAhFsn.js";import"./decodeURIComponentSafe-D4d600vS.js";import"./ReimbursementApprovalRuleDetailScreen-D0_gOHEu.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]="184a1b50-0cd9-42fb-9b66-af0af45a4c22",e._sentryDebugIdIdentifier="sentry-dbid-184a1b50-0cd9-42fb-9b66-af0af45a4c22")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-BYqz0SWy.js";import{a as d}from"./sentry-DjmIorbX.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as Q,o as k}from"./core-B1R51LGS.js";import{fI as v,_0 as je,O9 as _e,Zz as ve,ZI as Ae,c9 as X,cU as we,cV as De,bq as Ue,df as Re,Gr as Te,_1 as Me,PC as Be,N0 as Ve,MT as de,MQ as Ne,Gv as ue,MW as pe,MZ as ge,N3 as Y,CA as ee,Gu as Oe,ly as $,lB as me,_2 as Fe,mL as Le,GM as Ge,We as Ze,Wf as $e,lw as He,_3 as Ke,lz as We,uL as ze,W9 as qe,Wa as Qe,uP as Je,hZ as Xe,V8 as q,hR as ae,hO as Ye,hW as en,V9 as nn,GJ as tn,_4 as an,_5 as on,Nh as sn,m3 as rn,d$ as fe,e0 as he,_6 as ln,gF as cn,Vo as dn,GI as oe,gK as se,gJ as un,GH as pn,gI as gn,gH as mn,_7 as fn,UA as Ce,_8 as hn,_9 as Cn,_a as yn,_b as Sn,_c as bn,_d as In,GP as xn,_e as En,GG as ie,GA as Z,_f as kn,_g as Pn,_h as re,_i as jn,dU as _n,_j as vn,_k as An,_l as wn,UM as Dn,c1 as Un,c8 as Rn,c7 as Tn,c2 as Mn,_m as Bn,c5 as Vn,c4 as Nn,c6 as On,c3 as Fn}from"./zeni-epic-state-M9sMLOaG.js";import{bR as Ln,z as _,V as G,a5 as ne,c1 as Gn,l as W,c as te,$ as N,h as ye,H as Se,c2 as Zn,j as $n,Q as be,c3 as Hn,ag as Kn,c4 as Wn,c5 as zn,ao as qn,c6 as Qn,p as Jn,d as Ie,c7 as Xn}from"./index-Dp_Uc3gy.js";import{n as B}from"./mui-D-_RYGgU.js";import{u as xe}from"./useTaskManagerAccess-CFJAytRv.js";import{U as Yn}from"./AccountMappingScreen-CJpxPjym.js";import{t as et,A as nt}from"./AddressScreen-Ce6wpOqL.js";import O from"./NotFoundScreen-DDA41Ig7.js";import{g as tt}from"./analyticsHelper-BkudU6tc.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-B6gKgGKZ.js";import{C as st}from"./CompanyPassportScreen-DFOWHlG6.js";import{M as T}from"./MobileAppDrawer-CsfNveW9.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-CQX3dx0q.js";import{q as le}from"./QBOConnectionScreen-DMcsRcZG.js";import{B as lt}from"./BillPayApprovalRoutes-BLLQGNfF.js";import{R as ct}from"./ReimbursementApprovalRoutes-c_eicF80.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.js";import"./accountMappingHelper-1wM-u5pk.js";import"./routePaths-BALvGXpp.js";import"./InboxNotificationsProvider-LdTK3V9o.js";import"./empty-DDVSRnUK.js";import"./pdf-lib-2bJZTByw.js";import"./index-DUjhchTx.js";import"./url-SyxPcinx.js";import"./index-BgCxp-PW.js";import"./decodeURIComponentSafe-sNmSv15A.js";import"./ReimbursementApprovalRuleDetailScreen-NQbCpzYz.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]="46f3ad10-b84d-4129-ab7e-7ea5d9755140",e._sentryDebugIdIdentifier="sentry-dbid-46f3ad10-b84d-4129-ab7e-7ea5d9755140")}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-DOdRxZ-H.js";import{a as d}from"./sentry-DvoFEQx
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=v(e),i=ve(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(Y(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")}}}))(Gn),pt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>v(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:b,isLoading:m}=Ln(c?.tenantId),p=c.companyId??_.getSignedInUserTenant(i)?.companyId;if(_.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const S=G();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(_e(!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(T,{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`
9
+ `,ut=K((function(e,l){const o=v(e),i=ve(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")}}}))(Gn),pt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>v(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Ln(c?.tenantId),p=c.companyId??_.getSignedInUserTenant(i)?.companyId;if(_.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=G();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(_e(!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(T,{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`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-DOdRxZ-H.js";import{a as d}from"./sentry-DvoFEQx
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=v(e);return{bankSetupView:Me(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(X(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):Ne(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")}}}))(Zn),ft=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),r=G(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(N.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(N.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,b]=d.useState(!1),m=C((A=>v(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),S=we(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),w=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=be(m?.tenantId),x=m.companyId??_.getSignedInUserTenant(i)?.companyId;if(_.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(b(!0),o(Te(!1)))}),[h,o,p]);const M=A=>{u(A)};return S||j||E||w?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:S,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:w,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(O,{})},ht=B.div`
17
+ `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=v(e);return{bankSetupView:Me(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):Ne(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")}}}))(Zn),ft=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),r=G(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(N.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(N.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>v(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=we(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),w=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??_.getSignedInUserTenant(i)?.companyId;if(_.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=A=>{u(A)};return b||j||E||w?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:w,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(O,{})},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-DOdRxZ-H.js";import{a as d}from"./sentry-DvoFEQx
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=v(e),r=l.roleMap.bill_pay_admin,n=Fe(e,o),{uiState:t}=n,s=(Y(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(X(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(Ze())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Le({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>v(P))),b=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(b.addCardPaymentSourceStatus.fetchState),S=b.addCardPaymentSourceStatus.fetchState,E=h.companyId??_.getSignedInUserTenant(i)?.companyId;if(_.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=G();d.useEffect((()=>{E!=null&&o(Oe(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 j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",bt=K((function(e){const l=Qe(e,J);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(Xe(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Ye(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(Wn),St=()=>{const e=Kn(),l=F(),o=U(),{tenantEmailDomain:i}=L(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>v(I))),u=c.companyId??_.getSignedInUserTenant(i)?.companyId,h=_.getSignedInUser(),b=G(),m=Y(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(J))}),[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))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:R,onReLoginPlaidAccount:w}=rt({companyId:u??c.companyId});return b?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{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:P,onAddPlaidAccount:R,onReLoginPlaidAccount:w,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=K((function(e,l){const{companyId:o}=l,i=v(e),r=l.roleMap.bill_pay_admin,n=Fe(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(Ze())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Le({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>v(P))),S=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??_.getSignedInUserTenant(i)?.companyId;if(_.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=G();d.useEffect((()=>{E!=null&&o(Oe(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 j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=K((function(e){const l=Qe(e,J);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(Je(J,s,r))}}}))(Wn),bt=()=>{const e=Kn(),l=F(),o=U(),{tenantEmailDomain:i}=L(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>v(I))),u=c.companyId??_.getSignedInUserTenant(i)?.companyId,h=_.getSignedInUser(),S=G(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(J))}),[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))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:R,onReLoginPlaidAccount:w}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{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:P,onAddPlaidAccount:R,onReLoginPlaidAccount:w,plaidConnectionDetails:j})]}):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-DOdRxZ-H.js";import{a as d}from"./sentry-DvoFEQx
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}=L(),[o,i]=d.useState(!1),r=C((p=>v(p))).companyId??_.getSignedInUserTenant(l)?.companyId,n=_.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(X(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(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:b,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=U(),{tenantEmailDomain:l}=L(),[o,i]=d.useState(!1),r=C((p=>v(p))).companyId??_.getSignedInUserTenant(l)?.companyId,n=_.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(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,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-DOdRxZ-H.js";import{a as d}from"./sentry-DvoFEQx
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=F(),i=H(),[r,n]=d.useState(!1),t=C((y=>v(y))),{tenantEmailDomain:s}=t,c=t.companyId??_.getSignedInUserTenant(s)?.companyId;if(_.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(N.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(N.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=C((y=>rn(y))),E=fe(t),g=he(m,t),j=!g&&S,P=ye(t,b,m),{isCardsHidden:R}=be(t?.tenantId),w=!P||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((y=>cn(y,j))),M=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(T,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:S,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:w,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{D(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const V=(function(ke,Pe){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${Pe}`),z})(s,y),Ee=Jn(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&&_.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function Pt(){const e=U(),l=C((f=>v(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]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(Z())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),w=d.useCallback(((f,D,y)=>{e(Pn({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(jn({groupId:f,frequency:_n(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(vn({groupId:f,channel:re(D),enabled:y}))}),[e]),M=d.useMemo((()=>{if(b&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:w,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[b,h,t,s,w,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(Z())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(wn()),e(Z()),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(T,{isAppContentDrawerOpen:m,handleDrawerToggle:S}),a.jsx(Yn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{S(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((S=>Ce(S))),r=C((S=>v(S))),n=G(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(N.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(Z()))}),[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(Q,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(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)})}),Nn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Fn(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(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function jt(e){return a.jsxs(Q,{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(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{da as default};
49
+ `,ce=({appContent:e})=>{const l=U(),o=F(),i=H(),[r,n]=d.useState(!1),t=C((y=>v(y))),{tenantEmailDomain:s}=t,c=t.companyId??_.getSignedInUserTenant(s)?.companyId;if(_.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(N.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(N.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),j=!g&&b,P=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),w=!P||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((y=>cn(y,j))),M=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(T,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:w,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{D(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const V=(function(ke,Pe){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${Pe}`),z})(s,y),Ee=Jn(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&&_.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function Pt(){const e=U(),l=C((f=>v(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]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(Z())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),w=d.useCallback(((f,D,y)=>{e(Pn({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(jn({groupId:f,frequency:_n(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(vn({groupId:f,channel:re(D),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:w,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,w,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(Z())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(wn()),e(Z()),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(T,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>v(b))),n=G(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(N.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(Z()))}),[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(Q,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Yn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(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)})}),Nn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Fn(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(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function jt(e){return a.jsxs(Q,{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(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{da as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DOdRxZ-H.js";import{h as Y,g as X,u as ee,i as W,j as k,N as R,l as H,t as en}from"./core-R1zvmcG1.js";import{bK as nn,fI as V,cH as tn,Ij as Q,Zz as an,ZC as sn,v2 as ne,uS as te,mD as ae,C6 as L,ZE as be,gJ as He,gI as Ge,gH as Ke,ZF as on,Is as cn,N0 as Ce,MT as he,MQ as Ie,Mv as q,MW as Ae,MZ as _e,N3 as ke,CA as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,ZG as yn,Lv as fe,M7 as fn,ZH as gn,bL as Sn,Ol as ge,O9 as bn,ZI as Cn,ZJ as hn,Op as In,Ot as An,ZK as je,B$ as _n,SV as kn,ZL as vn,ZM as Pn,ZN as Tn,ZO as Je,ZP as En,ZQ as Dn,VZ as On,YQ as Un,Wc as wn,ZR as Qe,MH as Fn,Mz as Vn,Wd as xn,MD as Bn,ZS as Ue,P9 as qe,mL as jn,uV as Ye,C8 as Rn,bF as Re,Ck as Ne,cF as Nn,ZT as Xe,O$ as we,OI as Ln,OJ as Mn,ON as Zn,ZU as zn,P2 as Le,ZV as $n,ZW as Wn,ZX as Hn,PQ as Se,ZY as Gn,gZ as Kn,JE as Jn,ZZ as Qn,JJ as qn,JI as Yn}from"./zeni-epic-state-Mdu-dKQU.js";import{ag as Pe,V as ie,Y as de,$ as J,z as E,a6 as se,l as D,a5 as Te,K as $,bO as Xn,ac as oe,bP as x,bg as Ve,bQ as et,bR as nt,bS as tt,r 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-Cvus_VBr.js";import{a as h}from"./sentry-DvoFEQx8.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-ZKvbmPSP.js";import{u as pt,d as ze,B as Oe}from"./BusinessVerificationPageScreen-D1nbOYUs.js";import{M as le}from"./MobileAppDrawer-CPwvCIYa.js";import N from"./NotFoundScreen-BR0tBeJN.js";import{a as $e}from"./analyticsHelper-DZVn8KPX.js";import{d as We}from"./routePaths-ME1g30cL.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]="8e9ab0c8-7cd1-419c-a995-5464a0c60a2b",e._sentryDebugIdIdentifier="sentry-dbid-8e9ab0c8-7cd1-419c-a995-5464a0c60a2b")}catch{}})();const mt=xe.div`
1
+ import{j as u}from"./liveblocks-BYqz0SWy.js";import{h as Y,g as X,u as ee,i as W,j as k,N as R,l as H,t as en}from"./core-B1R51LGS.js";import{bK as nn,fI as V,cH as tn,Ij as Q,Zz as an,ZC as sn,v2 as ne,uS as te,mD as ae,C6 as L,ZE as be,gJ as He,gI as Ge,gH as Ke,ZF as on,Is as cn,N0 as Ce,MT as he,MQ as Ie,Mv as q,MW as Ae,MZ as _e,N3 as ke,CA as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,ZG as yn,Lv as fe,M7 as fn,ZH as gn,bL as Sn,Ol as ge,O9 as bn,ZI as Cn,ZJ as hn,Op as In,Ot as An,ZK as je,B$ as _n,SV as kn,ZL as vn,ZM as Pn,ZN as Tn,ZO as Je,ZP as En,ZQ as Dn,VZ as On,YQ as Un,Wc as wn,ZR as Qe,MH as Fn,Mz as Vn,Wd as xn,MD as Bn,ZS as Ue,P9 as qe,mL as jn,uV as Ye,C8 as Rn,bF as Re,Ck as Ne,cF as Nn,ZT as Xe,O$ as we,OI as Ln,OJ as Mn,ON as Zn,ZU as zn,P2 as Le,ZV as $n,ZW as Wn,ZX as Hn,PQ as Se,ZY as Gn,gZ as Kn,JE as Jn,ZZ as Qn,JJ as qn,JI as Yn}from"./zeni-epic-state-M9sMLOaG.js";import{ag as Pe,V as ie,c as de,$ as J,z as E,a6 as se,l as D,a5 as Te,K as $,bO as Xn,ac as oe,bP as x,bg as Ve,bQ as et,bR as nt,bS as tt,r 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-Dp_Uc3gy.js";import{a as h}from"./sentry-DjmIorbX.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-D-_RYGgU.js";import{u as pt,d as ze,B as Oe}from"./BusinessVerificationPageScreen-B6gKgGKZ.js";import{M as le}from"./MobileAppDrawer-CsfNveW9.js";import N from"./NotFoundScreen-DDA41Ig7.js";import{a as $e}from"./analyticsHelper-BkudU6tc.js";import{d as We}from"./routePaths-BALvGXpp.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]="24434b9d-9e8f-4fc4-af7a-0f123925f5fa",e._sentryDebugIdIdentifier="sentry-dbid-24434b9d-9e8f-4fc4-af7a-0f123925f5fa")}catch{}})();const mt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as u}from"./liveblocks-DOdRxZ-H.js";import{a as f,R as T,t as A}from"./sentry-DvoFEQx8.js";import{u as z,h as D,j as l,g as M,N as O,l as P}from"./core-R1zvmcG1.js";import{u as j,z as s,l as E,G as F,J as N,K as _,M as B,N as V,O as J,Q as v}from"./index-Cvus_VBr.js";import{fI as Q,Uw as W,UQ as Y,gl as $,gn as K,UV as R,gY as G,dk as H,UW as y,UX as X,UY as q,c0 as U}from"./zeni-epic-state-Mdu-dKQU.js";import{u as Z}from"./mui-ZKvbmPSP.js";import{u as ee}from"./useDeviceId-DiDVtEd4.js";import{f as te}from"./analyticsHelper-DZVn8KPX.js";import{t as ne}from"./getLocaleForTenant-DZAPKjbH.js";import"./recharts-UmMlzZlF.js";import"./analytics-BE49_JfE.js";import"./plaid-tDbexfSh.js";import"./dnd-LSyMQh_7.js";import"./stripe-cKAAJElX.js";import"./lottie-Z_NAxrmn.js";import"./lexical-BG-nDmQN.js";import"./pdf-_w1KRTSP.js";import"./utils-D06mHID-.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]="05012694-5933-4d97-8e86-3142ba2298de",t._sentryDebugIdIdentifier="sentry-dbid-05012694-5933-4d97-8e86-3142ba2298de")}catch{}})();const ie=P((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(y())}}}))(J),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>Q(e))),I=l((e=>W(e))),m=M(),w=Z().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.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(Y(I.tenantsInOrder),o.zeniSessionId),$(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(R("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=V();e!=null&&N(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(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 u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.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?u.jsx(B,{onClose:()=>i(y()),unlockDate:L}):null]})}export{ve as default};
1
+ import{j as u}from"./liveblocks-BYqz0SWy.js";import{a as f,R as T,t as A}from"./sentry-DjmIorbX.js";import{u as z,h as D,j as l,g as M,N as O,l as P}from"./core-B1R51LGS.js";import{u as j,z as s,l as E,G as F,J as N,K as _,M as B,N as V,O as J,Q as v}from"./index-Dp_Uc3gy.js";import{fI as Q,Uw as W,UQ as Y,gl as $,gn as K,UV as R,gY as G,dk as H,UW as y,UX as X,UY as q,c0 as U}from"./zeni-epic-state-M9sMLOaG.js";import{u as Z}from"./mui-D-_RYGgU.js";import{u as ee}from"./useDeviceId-D6nAUa-g.js";import{f as te}from"./analyticsHelper-BkudU6tc.js";import{t as ne}from"./getLocaleForTenant-Nj4zPyxj.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.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]="05012694-5933-4d97-8e86-3142ba2298de",t._sentryDebugIdIdentifier="sentry-dbid-05012694-5933-4d97-8e86-3142ba2298de")}catch{}})();const ie=P((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(y())}}}))(J),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>Q(e))),I=l((e=>W(e))),m=M(),w=Z().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.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(Y(I.tenantsInOrder),o.zeniSessionId),$(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(R("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=V();e!=null&&N(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(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 u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.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?u.jsx(B,{onClose:()=>i(y()),unlockDate:L}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DOdRxZ-H.js";import{a as s}from"./sentry-DvoFEQx8.js";import{u as c,g as d,N as u}from"./core-R1zvmcG1.js";import{z as i,l as n,K as m,a5 as p}from"./index-Cvus_VBr.js";import{g$ as g,Va as b}from"./zeni-epic-state-Mdu-dKQU.js";import{n as y}from"./mui-ZKvbmPSP.js";import"./recharts-UmMlzZlF.js";import"./analytics-BE49_JfE.js";import"./plaid-tDbexfSh.js";import"./dnd-LSyMQh_7.js";import"./stripe-cKAAJElX.js";import"./lottie-Z_NAxrmn.js";import"./lexical-BG-nDmQN.js";import"./pdf-_w1KRTSP.js";import"./utils-D06mHID-.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]="a69bfbae-a3af-498a-8e4a-0bf65a5b4a3a",e._sentryDebugIdIdentifier="sentry-dbid-a69bfbae-a3af-498a-8e4a-0bf65a5b4a3a")}catch{}})();function L(){const e=c(),t=d(),r=s.useRef(!1),f=i.isSignedIn(),o=t.state?.message==="logout"||f;return s.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),i.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?a.jsx(h,{children:a.jsx(p,{fetchState:"In-Progress"})}):a.jsx(u,{to:"../",replace:!0})}const h=y.div`
1
+ import{j as a}from"./liveblocks-BYqz0SWy.js";import{a as s}from"./sentry-DjmIorbX.js";import{u as c,g as d,N as u}from"./core-B1R51LGS.js";import{z as i,l as n,K as m,a5 as p}from"./index-Dp_Uc3gy.js";import{g$ as g,Va as b}from"./zeni-epic-state-M9sMLOaG.js";import{n as y}from"./mui-D-_RYGgU.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.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]="a69bfbae-a3af-498a-8e4a-0bf65a5b4a3a",e._sentryDebugIdIdentifier="sentry-dbid-a69bfbae-a3af-498a-8e4a-0bf65a5b4a3a")}catch{}})();function L(){const e=c(),t=d(),r=s.useRef(!1),f=i.isSignedIn(),o=t.state?.message==="logout"||f;return s.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),i.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?a.jsx(h,{children:a.jsx(p,{fetchState:"In-Progress"})}):a.jsx(u,{to:"../",replace:!0})}const h=y.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as A}from"./liveblocks-DOdRxZ-H.js";import{a as u}from"./sentry-DvoFEQx8.js";import{u as H,k as J,j as G,h as Se,g as me,i as ye,l as De}from"./core-R1zvmcG1.js";import{z,Y as be,$ as I,aq as Ee,a6 as he,l as Ge,K as Ce,e4 as Ae,p as F,a2 as Ie}from"./index-Cvus_VBr.js";import{QH as Re,Rv as ve,fI as Be,a2O as ne,gQ as V,a2P as re,a2J as Le,QZ as X,a2Q as Ke,Rb as Y,QJ as we,Ql as Ue,RH as ee,a2R as ae,gk as Pe,Ry as Fe,RD as je,Rq as xe,Ro as te,RE as $e,Rl as Oe,a2S as Ne,a2T as Qe,a2U as Ze,a2V as ze,a2W as R,dy as Ve,dx as qe,a2X as Me,QG as We}from"./zeni-epic-state-Mdu-dKQU.js";import{n as He}from"./mui-ZKvbmPSP.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-D5Ew-Qzm.js";import{M as Xe}from"./MobileAppDrawer-CPwvCIYa.js";import{u as Ye}from"./useTaskManagerPusherEvents-D1CY3bdf.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]="dd42026a-5b81-4981-89d5-5b2ffa09d44b",e._sentryDebugIdIdentifier="sentry-dbid-dd42026a-5b81-4981-89d5-5b2ffa09d44b")}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`
1
+ import{j as A}from"./liveblocks-BYqz0SWy.js";import{a as u}from"./sentry-DjmIorbX.js";import{u as H,k as J,j as G,h as Se,g as me,i as ye,l as De}from"./core-B1R51LGS.js";import{z,c as Ee,$ as I,aq as be,a6 as he,l as Ge,K as Ce,e4 as Ae,p as F,a2 as Ie}from"./index-Dp_Uc3gy.js";import{QH as Re,Rv as ve,fI as Be,a2O as ne,gQ as V,a2P as re,a2J as Le,QZ as X,a2Q as Ke,Rb as Y,QJ as we,Ql as Ue,RH as ee,a2R as ae,gk as Pe,Ry as Fe,RD as je,Rq as xe,Ro as te,RE as $e,Rl as Oe,a2S as Ne,a2T as Qe,a2U as Ze,a2V as ze,a2W as R,dy as Ve,dx as qe,a2X as Me,QG as We}from"./zeni-epic-state-M9sMLOaG.js";import{n as He}from"./mui-D-_RYGgU.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-DWkTPomv.js";import{M as Xe}from"./MobileAppDrawer-CsfNveW9.js";import{u as Ye}from"./useTaskManagerPusherEvents-B_vM_sss.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]="e542a765-b5c2-4879-a615-e4c63ef01e9a",e._sentryDebugIdIdentifier="sentry-dbid-e542a765-b5c2-4879-a615-e4c63ef01e9a")}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
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as A}from"./liveblocks-DOdRxZ-H.js";import{a as u}from"./sentry-DvoFEQx
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,na=De((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,y=Le(e),f=z.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(f,a),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D}})},onReloadTasks:()=>{e(V(!0,y))},onTabChange:a=>{e(ze(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=Z(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(Ze({filters:a}))},onSearchTextChanged:a=>{e(Qe({searchText:a}))},onReloadCards:()=>{e(V(!0,y))},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(Ne({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Oe(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 D=Z(f,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(D,{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=Z(f,t.localData.defaultTaskGroupId),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${f}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=Se(),t=H(),n=me(),c=z.getSignedInUser(),p=z.isZeniUser(),y=J(),f=G((d=>Be(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=be(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:D}=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))),O=G((d=>d.taskGroupState)),B=$.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});Ee({isDataReady:B==="Completed"});const{markBoardFetchInFlight:q,requestTaskRefetch:N}=(function(d){const S=H(),r=J(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),m=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,m.current=!0}),[r]),w=u.useCallback((()=>{K(),S(Re())}),[S,K]),b=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,S(ve())}),[S,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:b()}),[w,b,r]),Q=u.useCallback((()=>{m.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(m.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"&&(!m.current||U!==L.current||h==="Error")&&(m.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"&&b()))}),[C,P,b]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:Q}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||q(),t(V(!1,s))}),[f?.tenantId,t,s,q,y]);const fe=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],S=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(f?.companyId,d),...aa(c?.userId,S)]}),[f?.companyId,c?.userId]);if(Ye({events:fe,onEvent:(d,S)=>{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})(S);if(r!=null){const T=y.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,m=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&m.add(r.created_by),!(l!=null&&m.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))),m=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=m.length===L.length&&m.every((i=>L.includes(i))),w=k.taskGroupIds??[],b=r.task_group_ids??[],E=w.length!==b.length||!w.every((i=>b.includes(i))),Q=(i,Te)=>{const M=i??[],W=Te??[];if(M.length!==W.length)return!1;const ge=new Set(W);return M.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||Q(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&E&&h&&C&&U&&P)return}}return void N()}case _.TASKS_BULK_DELETED:{const r=ta(S);return r==null?void 0:void r.task_ids.forEach((T=>t(We(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void N()}},onSubscribed:()=>{N()}}),u.useEffect((()=>{B==="Completed"&&t(re({taskGroupById:O.taskGroupById}))}),[B,O.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=>(S=>S.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:O,localData:$.localData,uiState:$.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:D,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,Z=(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=Ve(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=Me(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},Sa=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,Sa as f,ga as t};
9
+ `,na=De((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,y=Le(e),T=z.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:T,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:T}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(T,a),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D}})},onReloadTasks:()=>{e(V(!0,y))},onTabChange:a=>{e(ze(a))},onParentTaskClick:a=>{const s=se(T,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=Z(T,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(Ze({filters:a}))},onSearchTextChanged:a=>{e(Qe({searchText:a}))},onReloadCards:()=>{e(V(!0,y))},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(Ne({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Oe(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 D=Z(T,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(D,{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=Z(T,t.localData.defaultTaskGroupId),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${T}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${T}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=Se(),t=H(),n=me(),c=z.getSignedInUser(),p=z.isZeniUser(),y=J(),T=G((d=>Be(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=Ee(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:D}=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))),O=G((d=>d.taskGroupState)),B=$.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});be({isDataReady:B==="Completed"});const{markBoardFetchInFlight:q,requestTaskRefetch:N}=(function(d){const S=H(),r=J(),f=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),m=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,m.current=!0}),[r]),w=u.useCallback((()=>{K(),S(Re())}),[S,K]),E=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,S(ve())}),[S,r]),b=u.useCallback((()=>{f.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:E()}),[w,E,r]),Q=u.useCallback((()=>{m.current?(f.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,f.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(m.current=!1,b())}),6e3))):b()}),[b,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),f.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"&&(!m.current||U!==L.current||h==="Error")&&(m.current=!1,f.current&&(h!=="Completed"?h==="Error"&&(f.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):b()))}),[h,U,b]),u.useEffect((()=>{C!=="In-Progress"&&(!k.current||P!==g.current||C==="Error")&&(k.current=!1,o.current&&(o.current=!1,C!=="Error"&&E()))}),[C,P,E]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:Q}})(T?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||q(),t(V(!1,s))}),[T?.tenantId,t,s,q,y]);const Te=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],S=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(T?.companyId,d),...aa(c?.userId,S)]}),[T?.companyId,c?.userId]);if(Ye({events:Te,onEvent:(d,S)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(f=>{if(f==null||typeof f!="object")return null;const o=f,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})(S);if(r!=null){const f=y.getState(),o=r.task_id,k=o!=null?f.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,m=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&m.add(r.created_by),!(l!=null&&m.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(f.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),m=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=m.length===L.length&&m.every((i=>L.includes(i))),w=k.taskGroupIds??[],E=r.task_group_ids??[],b=w.length!==E.length||!w.every((i=>E.includes(i))),Q=(i,fe)=>{const M=i??[],W=fe??[];if(M.length!==W.length)return!1;const ge=new Set(W);return M.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||Q(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&b&&h&&C&&U&&P)return}}return void N()}case _.TASKS_BULK_DELETED:{const r=ta(S);return r==null?void 0:void r.task_ids.forEach((f=>t(We(f))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void N()}},onSubscribed:()=>{N()}}),u.useEffect((()=>{B==="Completed"&&t(re({taskGroupById:O.taskGroupById}))}),[B,O.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=>(S=>S.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:T,taskGroupId:v,taskGroupState:O,localData:$.localData,uiState:$.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:D,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,Z=(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=Ve(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=Me(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},Sa=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,Sa as f,ga as t};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-DOdRxZ-H.js";import Te from"./NotFoundScreen-BR0tBeJN.js";import{a as u}from"./sentry-DvoFEQx8.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as be,l as Ee,n as De,o as h}from"./core-R1zvmcG1.js";import{Qy as se,QB as Ie,Qv as Ce,a2I as Re,fI as te,a2J as ne,R0 as E,QP as b,Qs as _e,Rv as ye,Ro as Ge,a2K as oe,gk as ie,a2L as Y,a2M as Ae,Qo as Ue,Ql as ve,v2 as Be,uS as xe,mD as we,QN as Pe,a2N as je,RH as Ke,QJ as Le,Ra as Fe,R7 as Ne,QE as Qe,R4 as $e,QZ as Ze}from"./zeni-epic-state-Mdu-dKQU.js";import{z as D,e2 as ze,k as Oe,Y as Ve,$ as _,a2 as re,p as y,a6 as Me,l as H,K as qe,e3 as Je,Q as W,ac as Ye}from"./index-Cvus_VBr.js";import{n as He}from"./mui-ZKvbmPSP.js";import{u as We}from"./useInitialThreadRequest-mCNzqzEf.js";import{M as Xe}from"./MobileAppDrawer-CPwvCIYa.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as X,e as na}from"./TaskListScreen-BgIlrtZe.js";import{u as oa}from"./useTaskManagerPusherEvents-D1CY3bdf.js";import"./recharts-UmMlzZlF.js";import"./analytics-BE49_JfE.js";import"./plaid-tDbexfSh.js";import"./dnd-LSyMQh_7.js";import"./stripe-cKAAJElX.js";import"./lottie-Z_NAxrmn.js";import"./lexical-BG-nDmQN.js";import"./pdf-_w1KRTSP.js";import"./utils-D06mHID-.js";import"./InboxNotificationsProvider--Aami2sh.js";import"./useTaskManagerAccess-CcPTnvTg.js";import"./useAskAiCfoHostNavButtonProps-D5Ew-Qzm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="013ea7ff-810b-4e7b-9b58-c0a3bbf90604",e._sentryDebugIdIdentifier="sentry-dbid-013ea7ff-810b-4e7b-9b58-c0a3bbf90604")}catch{}})();function ia(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),k=u.useCallback((()=>{a(se())}),[a]),S=u.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=u.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:k,onSave:S})}const F=e=>e?.taskState?.taskByID,K=(e,a)=>{const n=F(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=Re([K,(e,a)=>{const n=K(e,a),c=F(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=K(e,a),c=F(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=Ee((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),k=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?Y(e.taskGroupState,S):void 0,i=D.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:B}=l,G=t.recurringSourceTaskId,x=G!=null?`${W.appUrl}/${B}/tasks/${encodeURIComponent(G)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:D.isZeniUser(),userGroupList:Ae(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ye.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${W.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((f=>Y(e.taskGroupState,f))).filter((f=>f!=null&&!f.isDeleted)).map((f=>({id:f.id,name:f.name,isDefault:f.isDefault}))),subtasks:t.subtasks,parentTaskRef:k,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:k}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e($e(n,s??k))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Qe(a.taskId))},onSnoozeTask:(s,i)=>{e(Ne(s,i))},onUnsnoozeTask:s=>{e(Fe(s))},onCreateSubtask:(s,i)=>{e(Le({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Ke({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=U(S),i=y(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(je({taskId:n}))},onDeleteTaskClick:()=>{e(Pe(n))},updateFilesEntity:s=>{e(we({files:s}))},onDeleteFile:s=>{e(xe(s))},onEditFileName:(s,i)=>{e(Be(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(E(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ue(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Je);function L(){const e=ee(),a=ae(),n=ge(),c=Oe(),{taskId:t,taskGroupId:l}=he(),k=g((o=>te(o))),S=We(k?.companyId),{useFeatureGate:s}=Ve(),{isFeatureEnabled:i}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=s(_.isTaskGroupAssigneesEnabled),[G,x]=u.useState(!1),[f,ce]=u.useState(!1),[N,le]=u.useState(!1),[Q,w]=u.useState(!1),R=u.useRef(!1),A=g((o=>o.taskListState.updateTasksFetchState.fetchState)),$=g((o=>ne(o))),Z=g((o=>o.taskGroupViewState.fetchState));u.useEffect((()=>{a(E(!1,t)),t!=null&&a(b(t))}),[a,t]);const z=D.getSignedInUser()?.userId,ke=D.isZeniUser(),de=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),O=()=>{k?.tenantEmailDomain!=null&&e(U(k.tenantEmailDomain))},V=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),O()},ue=u.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],d=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(k?.companyId,o),...sa(z,d)]}),[k?.companyId,z]);oa({events:ue,onSubscribed:()=>{t!=null&&(a(E(!0,t)),a(b(t)))},onEvent:(o,d)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((j,me,{isZeniUser:Se,storedSyncToken:fe,taskId:J})=>{if(j!==m.TASK_CREATED&&j!==m.TASK_UPDATED)return"none";const T=ea(me);return T==null?"none":T.parent_task_id===J?"refreshSubtasks":j!==m.TASK_UPDATED||T.task_id!==J?"none":T.is_deleted===!0?"leaveDeleted":T.is_private!==!0||Se?T.sync_token!=null&&T.sync_token===fe?"none":"refreshTask":"leaveNoAccess"})(o,d,{isZeniUser:ke,storedSyncToken:de,taskId:t});p==="refreshTask"?(a(E(!0,t)),a(b(t))):p==="refreshSubtasks"?a(b(t)):p==="leaveDeleted"?V():p==="leaveNoAccess"&&O();break}case m.TASKS_BULK_UPDATED:{const p=X(d);if(p==null)break;p.task_ids.includes(t)&&a(E(!0,t)),a(b(t));break}case m.TASKS_BULK_DELETED:{const p=X(d);if(p==null)break;if(p.task_ids.includes(t)){V();break}a(b(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(d)?.task_id===t&&a(E(!0,t));break}}}}),u.useEffect((()=>{f||$.fetchState==="Completed"||(ce(!0),a(_e()))}),[f,a,$.fetchState]),u.useEffect((()=>{N||Z==="Completed"||(le(!0),a(ye()))}),[N,a,Z]);const pe=u.useCallback((()=>{t!=null&&(R.current=!1,a(Ge([t],null,{isArchived:!1})),w(!0))}),[a,t]);u.useEffect((()=>{if(Q)if(A!=="In-Progress"){if(R.current){if(A==="Error")return w(!1),void(R.current=!1);if(A==="Completed"){w(!1),R.current=!1;const{tenantEmailDomain:o}=k;if(n.state?.message==="triggerBackClick"){const d=re(n.state?.pathnameStackToGoBack);e(d.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:d.newStack}})}else{const d=U(o);e(d,{state:{pathnameStackToGoBack:y(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else R.current=!0}),[Q,A,k,n,e]);const M=g((o=>oe(o,t))),P=M.fetchState,q=D.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(P==="Error"&&M.error?.code===400){const{tenantEmailDomain:o}=k,d=U(o),p=y(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(be,{to:d,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[P==="Completed"?r.jsx(Me,{analytics:H,onLoad:o=>(d=>d.trackPageLoaded(qe.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(Xe,{isAppContentDrawerOpen:G,handleDrawerToggle:o=>{x(o)}}),r.jsx(ca,{analytics:H,currentTenant:k,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:q,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:P,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:B})]})]})}const la=He.div`
1
+ import{j as r}from"./liveblocks-BYqz0SWy.js";import fe from"./NotFoundScreen-DDA41Ig7.js";import{a as u}from"./sentry-DjmIorbX.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as Ee,l as be,n as De,o as h}from"./core-B1R51LGS.js";import{Qy as se,QB as Ie,Qv as Ce,a2I as Re,fI as te,a2J as ne,R0 as b,QP as E,Qs as _e,Rv as ye,Ro as Ge,a2K as oe,gk as ie,a2L as H,a2M as Ae,Qo as Ue,Ql as ve,v2 as Be,uS as xe,mD as we,QN as Pe,a2N as je,RH as Ke,QJ as Le,Ra as Fe,R7 as Ne,QE as Qe,R4 as $e,QZ as Ze}from"./zeni-epic-state-M9sMLOaG.js";import{z as D,e2 as ze,k as Oe,c as Ve,$ as _,a2 as re,p as y,a6 as Me,l as W,K as qe,e3 as Je,Q as X,ac as He}from"./index-Dp_Uc3gy.js";import{n as We}from"./mui-D-_RYGgU.js";import{u as Xe}from"./useInitialThreadRequest-BaIZPAUw.js";import{M as Ye}from"./MobileAppDrawer-CsfNveW9.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as Y,e as na}from"./TaskListScreen-adKZru26.js";import{u as oa}from"./useTaskManagerPusherEvents-B_vM_sss.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.js";import"./InboxNotificationsProvider-LdTK3V9o.js";import"./useTaskManagerAccess-CFJAytRv.js";import"./useAskAiCfoHostNavButtonProps-DWkTPomv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="66658408-5c80-4baa-ab0b-2cea138485a1",e._sentryDebugIdIdentifier="sentry-dbid-66658408-5c80-4baa-ab0b-2cea138485a1")}catch{}})();function ia(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),k=u.useCallback((()=>{a(se())}),[a]),S=u.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=u.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:k,onSave:S})}const F=e=>e?.taskState?.taskByID,K=(e,a)=>{const n=F(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=Re([K,(e,a)=>{const n=K(e,a),c=F(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=K(e,a),c=F(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=be((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),k=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?H(e.taskGroupState,S):void 0,i=D.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:B}=l,G=t.recurringSourceTaskId,x=G!=null?`${X.appUrl}/${B}/tasks/${encodeURIComponent(G)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:D.isZeniUser(),userGroupList:Ae(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:He.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${X.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((T=>H(e.taskGroupState,T))).filter((T=>T!=null&&!T.isDeleted)).map((T=>({id:T.id,name:T.name,isDefault:T.isDefault}))),subtasks:t.subtasks,parentTaskRef:k,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:k}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e($e(n,s??k))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Qe(a.taskId))},onSnoozeTask:(s,i)=>{e(Ne(s,i))},onUnsnoozeTask:s=>{e(Fe(s))},onCreateSubtask:(s,i)=>{e(Le({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Ke({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=U(S),i=y(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(je({taskId:n}))},onDeleteTaskClick:()=>{e(Pe(n))},updateFilesEntity:s=>{e(we({files:s}))},onDeleteFile:s=>{e(xe(s))},onEditFileName:(s,i)=>{e(Be(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(b(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ue(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Je);function L(){const e=ee(),a=ae(),n=ge(),c=Oe(),{taskId:t,taskGroupId:l}=he(),k=g((o=>te(o))),S=Xe(k?.companyId),{useFeatureGate:s}=Ve(),{isFeatureEnabled:i}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=s(_.isTaskGroupAssigneesEnabled),[G,x]=u.useState(!1),[T,ce]=u.useState(!1),[N,le]=u.useState(!1),[Q,w]=u.useState(!1),R=u.useRef(!1),A=g((o=>o.taskListState.updateTasksFetchState.fetchState)),$=g((o=>ne(o))),Z=g((o=>o.taskGroupViewState.fetchState));u.useEffect((()=>{a(b(!1,t)),t!=null&&a(E(t))}),[a,t]);const z=D.getSignedInUser()?.userId,ke=D.isZeniUser(),de=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),O=()=>{k?.tenantEmailDomain!=null&&e(U(k.tenantEmailDomain))},V=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),O()},ue=u.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],d=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(k?.companyId,o),...sa(z,d)]}),[k?.companyId,z]);oa({events:ue,onSubscribed:()=>{t!=null&&(a(b(!0,t)),a(E(t)))},onEvent:(o,d)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((j,me,{isZeniUser:Se,storedSyncToken:Te,taskId:J})=>{if(j!==m.TASK_CREATED&&j!==m.TASK_UPDATED)return"none";const f=ea(me);return f==null?"none":f.parent_task_id===J?"refreshSubtasks":j!==m.TASK_UPDATED||f.task_id!==J?"none":f.is_deleted===!0?"leaveDeleted":f.is_private!==!0||Se?f.sync_token!=null&&f.sync_token===Te?"none":"refreshTask":"leaveNoAccess"})(o,d,{isZeniUser:ke,storedSyncToken:de,taskId:t});p==="refreshTask"?(a(b(!0,t)),a(E(t))):p==="refreshSubtasks"?a(E(t)):p==="leaveDeleted"?V():p==="leaveNoAccess"&&O();break}case m.TASKS_BULK_UPDATED:{const p=Y(d);if(p==null)break;p.task_ids.includes(t)&&a(b(!0,t)),a(E(t));break}case m.TASKS_BULK_DELETED:{const p=Y(d);if(p==null)break;if(p.task_ids.includes(t)){V();break}a(E(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(d)?.task_id===t&&a(b(!0,t));break}}}}),u.useEffect((()=>{T||$.fetchState==="Completed"||(ce(!0),a(_e()))}),[T,a,$.fetchState]),u.useEffect((()=>{N||Z==="Completed"||(le(!0),a(ye()))}),[N,a,Z]);const pe=u.useCallback((()=>{t!=null&&(R.current=!1,a(Ge([t],null,{isArchived:!1})),w(!0))}),[a,t]);u.useEffect((()=>{if(Q)if(A!=="In-Progress"){if(R.current){if(A==="Error")return w(!1),void(R.current=!1);if(A==="Completed"){w(!1),R.current=!1;const{tenantEmailDomain:o}=k;if(n.state?.message==="triggerBackClick"){const d=re(n.state?.pathnameStackToGoBack);e(d.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:d.newStack}})}else{const d=U(o);e(d,{state:{pathnameStackToGoBack:y(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else R.current=!0}),[Q,A,k,n,e]);const M=g((o=>oe(o,t))),P=M.fetchState,q=D.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(P==="Error"&&M.error?.code===400){const{tenantEmailDomain:o}=k,d=U(o),p=y(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(Ee,{to:d,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[P==="Completed"?r.jsx(Me,{analytics:W,onLoad:o=>(d=>d.trackPageLoaded(qe.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(Ye,{isAppContentDrawerOpen:G,handleDrawerToggle:o=>{x(o)}}),r.jsx(ca,{analytics:W,currentTenant:k,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:q,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:P,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:B})]})]})}const la=We.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as r}from"./liveblocks-DOdRxZ-H.js";import Te from"./NotFoundScreen-BR0
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,U=e=>`/${e}/tasks`;function xa(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(L,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(L,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(L,{})}),r.jsx(h,{path:"*",element:r.jsx(Te,{})})]})}export{xa as default};
9
+ `,U=e=>`/${e}/tasks`;function xa(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(L,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(L,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(L,{})}),r.jsx(h,{path:"*",element:r.jsx(fe,{})})]})}export{xa as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-BYqz0SWy.js";import i from"./NotFoundScreen-DDA41Ig7.js";import{T as r}from"./TransactionDetailScreen-CS9DS32g.js";import"./sentry-DjmIorbX.js";import{n as a,o as e}from"./core-B1R51LGS.js";import"./zeni-epic-state-M9sMLOaG.js";import"./recharts-By7FVN8f.js";import"./index-Dp_Uc3gy.js";import"./mui-D-_RYGgU.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.js";import"./useAskAiCfoHostNavButtonProps-DWkTPomv.js";import"./decodeURIComponentSafe-sNmSv15A.js";import"./useInitialThreadRequest-BaIZPAUw.js";import"./routePaths-BALvGXpp.js";import"./expenseAutomationHelper-Bb1c_nBx.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{j as _}from"./liveblocks-DOdRxZ-H.js";import{a as i}from"./sentry-DvoFEQx8.js";import{u as j,k as ot,j as g,s as ge,g as ke,h as Ce,i as Ae,N as st,l as ct}from"./core-R1zvmcG1.js";import{pz as Ie,fI as Q,gZ as it,Vh as rt,oF as lt,of as dt,E0 as se,Xv as ut,gk as mt,bn as pt,dg as _e,bq as Re,sZ as q,Wn as H,Xw as we,Xx as le,WN as Pe,me as Fe,Xy as xe,WS as de,WT as ue,n3 as Ue,SN as me,Xr as G,m8 as Le,m6 as Oe,mi as ft,pm as St,Xz as ht,XA as yt,DT as J,md as Be,S6 as Ve,cn as Tt,dm as bt,XB as gt,Xq as It,XC as vt,XD as Et,XE as Dt,XF as kt,DP as Ct,XG as At,XH as _t,XI as Rt,XJ as wt,XK as Pt,mh as Ft,XL as xt,XM as Ut,Xs as Lt,XN as Ot,XO as Bt,XP as Vt,S0 as Nt,RS as zt,Sf as Xt,mj as jt,SO as ve,pr as Mt}from"./zeni-epic-state-Mdu-dKQU.js";import{Y,$ as w,l as $,b0 as Gt,z as Ne,_ as $t,b1 as Wt,a9 as qt,a2 as ce,V as Ht,b2 as Yt,p as ie,aq as Zt,b3 as Jt,b4 as Kt,b5 as Qt,ac as en,at as oe}from"./index-Cvus_VBr.js";import{n as tn,S as nn,u as an,D as on}from"./mui-ZKvbmPSP.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-D5Ew-Qzm.js";import{d as ze}from"./decodeURIComponentSafe-D4d600vS.js";import{u as cn}from"./useInitialThreadRequest-mCNzqzEf.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-ME1g30cL.js";import{u as dn}from"./expenseAutomationHelper-BlCRyV8f.js";import{A as un}from"./utils-D06mHID-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="eeaef8ea-c795-4cbe-b94b-ff48dea42cc8",t._sentryDebugIdIdentifier="sentry-dbid-eeaef8ea-c795-4cbe-b94b-ff48dea42cc8")}catch{}})();function mn(t=!0){const e=j(),o=ot(),{useFeatureGate:n}=Y(),{isFeatureEnabled:a}=n(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function pn(t,e){const o=(function(){const d=j(),[y,S]=i.useState(!1),[k,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:h}=Y(),{configValue:v,isDynamicConfigLoading:f}=h("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,D=g((I=>Q(I))),C=D.companyId,P=g((I=>it(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:x}=g((I=>{const b=I.tenantState.currentTenantId,R=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:R?.capitalizableAccounts??null,capitalizableAccountOverrides:R?.capitalizableAccountOverrides??null,dismissedAccounts:R?.capitalizationOnboardingDismissedAccounts??null}}),ge),O=i.useRef(A);O.current=A;const U=i.useRef(F);U.current=F;const B=i.useRef(x);B.current=x;const V=g((I=>rt(I.accountState)),ge),M=i.useMemo((()=>{const I={};for(const b of V)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[V]),W=l!=null?M[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=O.current;if(b==null)return;const R=b.accounts??[],Z=new Set(I),ee=U.current??{},te=B.current;for(const z of R)if(Z.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void S(!0)}),[T]),E=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),S(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),S(!1),p(null),u(null))}),[d,C,l]);return{showPopup:y&&T,popupType:k,popupAccountId:l,popupAccountName:W,currencySymbol:P,checkAndShowPopup:N,handleSubmit:E,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const X=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,K=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Me=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),t(se(re(e,o,{outcome:"retracted"})))},On=(t,e)=>{const o=new Set(e.map(String));X.forEach(((n,a)=>{o.has(n.transactionId)&&(X.delete(a),Me(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));X.forEach(((o,n)=>{e.has(o.transactionId)&&X.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:y}=t,S=i.useCallback((u=>u.transactionId??y??""),[y]),k=i.useCallback((u=>{if(!d)return;const h=S(u);if(h==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,D,C)=>{const P=Ee(T,D,C),A=X.get(P);return A!=null&&(X.delete(P),Me(f,A.feedback,A.transactionId),!0)})(e,h,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(K(f,T))})(u,h),e(se(re(u,h,{}))))}),[d,S,e]),p=i.useCallback((u=>{if(o==null)return;const h=S(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...K(v,f),feedbackReason:T})})(o,h,u),e(se(re(o,h,{reasonText:u,skipped:!1}))),((v,f)=>{X.set(Ee(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,h),s(!0)}),[o,S,e]),l=i.useCallback((()=>{var u,h;o!=null&&(u=o,h=S(o),$.trackRecommendationFeedbackSkipped(K(u,h)),s(!1),n(null))}),[o,S]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:k,popup:o!=null?_.jsx(Gt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Ge(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Vn(t,e){const o=j(),{useFeatureGate:n}=Y(),a=g((r=>Q(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&_e(a.userRole),d=a.userRole!=null&&Re(a.userRole),{isFeatureEnabled:y}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:S}=n(w.isExpenseAutomationEnabled),k=pe(),p=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),l=g((r=>H(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,h=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=H(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Ge(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),D=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,x]=i.useState(!1),[O,U]=i.useState(!1),[B,V]=i.useState(!1);i.useEffect((()=>{x(!1),U(!1),V(!1)}),[t,e]);const M=i.useCallback((()=>{x(!1),U(!1)}),[]),[W,N]=i.useState(!1),E=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(xe({id:l.transaction.id,type:l.transaction.type})),V(!0)),f!=null&&(!s||c&&d===!1)&&(F?O||T==null||(U(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:E??T}))):(o(de()),o(ue()),x(!0),o(Ue(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,O,T,E]),i.useEffect((()=>{D.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[D.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:S,isChainOfThoughtEnabled:k,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:h,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:D,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:M,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const Sn={overlayWidth:new qt(100,100,58)},hn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),y=g((p=>le(p))),S=()=>{n()},k={vendorDetailView:a??y,onSaveSuccess:()=>{d(Oe()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return _.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:Sn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:_.jsx(yn,{onClick:p=>p.stopPropagation(),children:_.jsx(Wt,{...k})})})},yn=tn(nn)`
1
+ import{j as _}from"./liveblocks-BYqz0SWy.js";import{a as i}from"./sentry-DjmIorbX.js";import{u as j,k as ot,j as g,s as ge,g as ke,h as Ce,i as Ae,N as st,l as ct}from"./core-B1R51LGS.js";import{pz as Ie,fI as Q,gZ as it,Vh as rt,oF as lt,of as dt,E0 as se,Xv as ut,gk as mt,bn as pt,dg as _e,bq as Re,sZ as q,Wn as H,Xw as we,Xx as le,WN as Pe,me as Fe,Xy as xe,WS as de,WT as ue,n3 as Ue,SN as me,Xr as G,m8 as Le,m6 as Oe,mi as ft,pm as St,Xz as ht,XA as yt,DT as J,md as Be,S6 as Ve,cn as Tt,dm as bt,XB as gt,Xq as It,XC as vt,XD as Et,XE as Dt,XF as kt,DP as Ct,XG as At,XH as _t,XI as Rt,XJ as wt,XK as Pt,mh as Ft,XL as xt,XM as Ut,Xs as Lt,XN as Ot,XO as Bt,XP as Vt,S0 as Nt,RS as zt,Sf as Xt,mj as jt,SO as ve,pr as Mt}from"./zeni-epic-state-M9sMLOaG.js";import{c as Y,$ as w,l as $,b0 as Gt,z as Ne,_ as $t,b1 as Wt,a9 as qt,a2 as ce,V as Ht,b2 as Yt,p as ie,aq as Zt,b3 as Jt,b4 as Kt,b5 as Qt,ac as en,at as oe}from"./index-Dp_Uc3gy.js";import{n as tn,S as nn,u as an,D as on}from"./mui-D-_RYGgU.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-DWkTPomv.js";import{d as ze}from"./decodeURIComponentSafe-sNmSv15A.js";import{u as cn}from"./useInitialThreadRequest-BaIZPAUw.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-BALvGXpp.js";import{u as dn}from"./expenseAutomationHelper-Bb1c_nBx.js";import{A as un}from"./utils-iOnDyQuG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1e218da4-528d-426c-913a-6e6b0567b63c",t._sentryDebugIdIdentifier="sentry-dbid-1e218da4-528d-426c-913a-6e6b0567b63c")}catch{}})();function mn(t=!0){const e=j(),o=ot(),{useFeatureGate:n}=Y(),{isFeatureEnabled:a}=n(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function pn(t,e){const o=(function(){const d=j(),[y,S]=i.useState(!1),[k,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:h}=Y(),{configValue:v,isDynamicConfigLoading:f}=h("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,D=g((I=>Q(I))),C=D.companyId,P=g((I=>it(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:x}=g((I=>{const b=I.tenantState.currentTenantId,R=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:R?.capitalizableAccounts??null,capitalizableAccountOverrides:R?.capitalizableAccountOverrides??null,dismissedAccounts:R?.capitalizationOnboardingDismissedAccounts??null}}),ge),O=i.useRef(A);O.current=A;const U=i.useRef(F);U.current=F;const B=i.useRef(x);B.current=x;const V=g((I=>rt(I.accountState)),ge),M=i.useMemo((()=>{const I={};for(const b of V)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[V]),W=l!=null?M[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=O.current;if(b==null)return;const R=b.accounts??[],Z=new Set(I),ee=U.current??{},te=B.current;for(const z of R)if(Z.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void S(!0)}),[T]),E=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),S(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),S(!1),p(null),u(null))}),[d,C,l]);return{showPopup:y&&T,popupType:k,popupAccountId:l,popupAccountName:W,currencySymbol:P,checkAndShowPopup:N,handleSubmit:E,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const X=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,K=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Me=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),t(se(re(e,o,{outcome:"retracted"})))},On=(t,e)=>{const o=new Set(e.map(String));X.forEach(((n,a)=>{o.has(n.transactionId)&&(X.delete(a),Me(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));X.forEach(((o,n)=>{e.has(o.transactionId)&&X.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:y}=t,S=i.useCallback((u=>u.transactionId??y??""),[y]),k=i.useCallback((u=>{if(!d)return;const h=S(u);if(h==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,D,C)=>{const P=Ee(T,D,C),A=X.get(P);return A!=null&&(X.delete(P),Me(f,A.feedback,A.transactionId),!0)})(e,h,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(K(f,T))})(u,h),e(se(re(u,h,{}))))}),[d,S,e]),p=i.useCallback((u=>{if(o==null)return;const h=S(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...K(v,f),feedbackReason:T})})(o,h,u),e(se(re(o,h,{reasonText:u,skipped:!1}))),((v,f)=>{X.set(Ee(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,h),s(!0)}),[o,S,e]),l=i.useCallback((()=>{var u,h;o!=null&&(u=o,h=S(o),$.trackRecommendationFeedbackSkipped(K(u,h)),s(!1),n(null))}),[o,S]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:k,popup:o!=null?_.jsx(Gt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Ge(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Vn(t,e){const o=j(),{useFeatureGate:n}=Y(),a=g((r=>Q(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&_e(a.userRole),d=a.userRole!=null&&Re(a.userRole),{isFeatureEnabled:y}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:S}=n(w.isExpenseAutomationEnabled),k=pe(),p=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),l=g((r=>H(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,h=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=H(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Ge(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),D=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,x]=i.useState(!1),[O,U]=i.useState(!1),[B,V]=i.useState(!1);i.useEffect((()=>{x(!1),U(!1),V(!1)}),[t,e]);const M=i.useCallback((()=>{x(!1),U(!1)}),[]),[W,N]=i.useState(!1),E=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(xe({id:l.transaction.id,type:l.transaction.type})),V(!0)),f!=null&&(!s||c&&d===!1)&&(F?O||T==null||(U(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:E??T}))):(o(de()),o(ue()),x(!0),o(Ue(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,O,T,E]),i.useEffect((()=>{D.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[D.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:S,isChainOfThoughtEnabled:k,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:h,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:D,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:M,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const Sn={overlayWidth:new qt(100,100,58)},hn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),y=g((p=>le(p))),S=()=>{n()},k={vendorDetailView:a??y,onSaveSuccess:()=>{d(Oe()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return _.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:Sn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:_.jsx(yn,{onClick:p=>p.stopPropagation(),children:_.jsx(Wt,{...k})})})},yn=tn(nn)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DOdRxZ-H.js";import{h as H,g as J,u as K,i as Q,j as g,N as U,l as X,n as Me,o as M}from"./core-R1zvmcG1.js";import{fI as N,uh as Z,lj as p,eI as ee,SE as Ae,br as me,a0j as Ce,m3 as te,WP as ae,a0k as pe,a0l as Be,bF as k,SA as Se,a0m as Le,a0n as fe,a0o as Fe,SD as he,a0p as Oe,a0q as Te,a0r as ze,a0s as ge,a0t as Ge,a0u as we,a0v as De,TR as $e}from"./zeni-epic-state-Mdu-dKQU.js";import{Y as ne,$ as ce,l as L,G as Ie,db as oe,p as R,a2 as se,ao as Re,e as _e}from"./index-Cvus_VBr.js";import"./mui-ZKvbmPSP.js";import{a as y}from"./sentry-DvoFEQx8.js";import{w as ie}from"./withTransactionSidePanel-LlSL3tvn.js";import{p as re,c as de}from"./routePaths-ME1g30cL.js";import{B as Ve}from"./utils-D06mHID-.js";import{d as E}from"./decodeURIComponentSafe-D4d600vS.js";import{Z as qe}from"./ZeniAccountStatementScreen-BjT0Ja6v.js";import"./recharts-UmMlzZlF.js";import"./analytics-BE49_JfE.js";import"./plaid-tDbexfSh.js";import"./dnd-LSyMQh_7.js";import"./stripe-cKAAJElX.js";import"./lottie-Z_NAxrmn.js";import"./lexical-BG-nDmQN.js";import"./pdf-_w1KRTSP.js";import"./useAskAiCfoHostNavButtonProps-D5Ew-Qzm.js";import"./TransactionDetailScreen-BkV8Yidz.js";import"./useInitialThreadRequest-mCNzqzEf.js";import"./expenseAutomationHelper-BlCRyV8f.js";import"./stripSplatSuffix-BaAbZcaB.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="6d5db778-ab83-4358-85db-758052a19901",a._sentryDebugIdIdentifier="sentry-dbid-6d5db778-ab83-4358-85db-758052a19901")}catch{}})();const Je=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],q=a=>Ve(a),ke=()=>{const{common:a,uncategorizedTransactionList:e}=Ie.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ue=X((function(a,e){const t=Ce(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,q(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=q(e.selectedAccount.tranListType),d=He(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(pe({uiState:{dateRange:d},type:q(e.selectedAccount.tranListType)})),a(Ae(o,p(d),!1,o==="missingReceipts"?ke():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({uiState:{scrollYOffset:t},type:q(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=H(),t=J(),n=K(),c=t.pathname.split("/").find((l=>Je.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Q(),{accountType:Y,title:b,subTitle:A}=Ne(o),f="month",T=g((l=>N(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:h}=S(ce.isProjectsTransactionsEnabled),I=g((l=>Z(l)))&&h,{dataAvailable:x,initialTimeframeTick:F}=We(o,v,T.bookCloseDate),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=y.useMemo((()=>{const l=p(F);return{tranListType:o,accountType:ee(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=q(u.tranListType);n(Ae(l,u.period,!0,l==="missingReceipts"?ke():void 0))}}),[P,u,n]);let C=u;return u!=null&&j!=null&&(C={...u,period:j}),c==null||C==null?s.jsx(U,{to:"../"}):s.jsx(Ue,{firstMonthOfFY:v,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:C,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>z(l),...a})})),Ne=a=>{let e="",t="";const n=Ie.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},We=(a,e,t)=>{const n=me();let c=me().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},He=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ke=X((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ye();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Qe=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=Q(),S=E(d??""),h=E(Y??""),I=E(b??""),x=E(v??""),F=g((r=>Be(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=Xe(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=Ze(F?.dateRange,r);i={accountId:h,accountType:ee(S),classId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,b,A,f,T,v].filter((r=>r!=null));return G&&B!=null?s.jsx(Ke,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(U,{to:Ye(_.length)})})),Ye=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),et=X((function(a,e){const t=Oe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),tt=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=Q(),S=E(d??""),h=E(Y??""),I=E(b??""),x=E(v??""),F=g((r=>Fe(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=at(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=nt(F?.dateRange,r);i={accountId:h,accountType:ee(S),projectId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,b,A,f,T,v].filter((r=>r!=null));return G&&B!=null?s.jsx(et,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(U,{to:be(_.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},at=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,nt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ct=X((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=it(e.tenantEmailDomain),n=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),ye=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=Q(),S=E(d??""),h=E(Y??""),I=E(T??""),x=!(v!=null&&v==="exclude_subaccounts"),F=g((D=>ze(D.transactionListState,h,S))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((D=>N(D))),C=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const w=ot(S,h,b,A,f,I);if(w){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=st(F?.dateRange,D);m={accountId:h,accountType:ee(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&j!=null&&(i={...m,period:j});const{useFeatureGate:G}=ne(),B=y.useCallback(((D,le)=>{if(o==null)return;const ue=D.url.split(`/${o}/`)[1];if(ue==null)return;const[je,Ee]=ue.split("?"),W=new URLSearchParams(Ee??"");W.set("view","full"),W.set("thread_id",le),W.set("entity_type",D.entityType);const xe=R(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${W.toString()}`,{state:{pathnameStackToGoBack:xe}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:_}=G(ce.isProjectsTransactionsEnabled),r=g((D=>Z(D)))&&_,{areTenantIdsInSync:$}=Re();y.useEffect((()=>{!P&&m!=null&&$&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(ge(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,$]);const Pe=[d,Y,b,A,f,T].filter((D=>D!=null));return w&&i!=null?s.jsx(ct,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:C,onCommentThreadClick:B,showProjectField:r,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>z(D),...e}):s.jsx(U,{to:ve(Pe.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},ot=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,st=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),it=a=>`/${a}/transactions/${$e}/statements`;function Ct(){const a=J().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>N(n))).tenantId],t=_e();return s.jsxs(Me,{children:[s.jsx(M,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/zeni-clearing-account/statements",element:s.jsx(qe,{})}),s.jsx(M,{path:"/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/missing-receipts/*",element:t?s.jsx(U,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(M,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})}),s.jsx(M,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(tt,{referrerType:a})})]})}export{Ct as default};
1
+ import{j as s}from"./liveblocks-BYqz0SWy.js";import{h as H,g as J,u as K,i as Q,j as g,N as U,l as X,n as Me,o as M}from"./core-B1R51LGS.js";import{fI as N,uh as Z,lj as p,eI as ee,SE as Ae,br as me,a0j as Ce,m3 as te,WP as ae,a0k as pe,a0l as Be,bF as k,SA as Se,a0m as Le,a0n as fe,a0o as Fe,SD as he,a0p as Oe,a0q as Te,a0r as ze,a0s as ge,a0t as Ge,a0u as we,a0v as De,TR as $e}from"./zeni-epic-state-M9sMLOaG.js";import{c as ne,$ as ce,l as L,G as Ie,db as oe,p as R,a2 as se,ao as Re,f as _e}from"./index-Dp_Uc3gy.js";import"./mui-D-_RYGgU.js";import{a as y}from"./sentry-DjmIorbX.js";import{w as ie}from"./withTransactionSidePanel-BuJ7rAhb.js";import{p as re,c as de}from"./routePaths-BALvGXpp.js";import{B as Ve}from"./utils-iOnDyQuG.js";import{d as E}from"./decodeURIComponentSafe-sNmSv15A.js";import{Z as qe}from"./ZeniAccountStatementScreen-B-L8iMJL.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./useAskAiCfoHostNavButtonProps-DWkTPomv.js";import"./TransactionDetailScreen-CS9DS32g.js";import"./useInitialThreadRequest-BaIZPAUw.js";import"./expenseAutomationHelper-Bb1c_nBx.js";import"./stripSplatSuffix-B5IwbFj2.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="2793fb7f-9d28-42d5-9090-9a054247f252",a._sentryDebugIdIdentifier="sentry-dbid-2793fb7f-9d28-42d5-9090-9a054247f252")}catch{}})();const Je=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],q=a=>Ve(a),ke=()=>{const{common:a,uncategorizedTransactionList:e}=Ie.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ue=X((function(a,e){const t=Ce(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,q(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=q(e.selectedAccount.tranListType),d=He(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(pe({uiState:{dateRange:d},type:q(e.selectedAccount.tranListType)})),a(Ae(o,p(d),!1,o==="missingReceipts"?ke():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({uiState:{scrollYOffset:t},type:q(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=H(),t=J(),n=K(),c=t.pathname.split("/").find((l=>Je.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Q(),{accountType:Y,title:v,subTitle:A}=Ne(o),f="month",T=g((l=>N(l))),P=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:h}=S(ce.isProjectsTransactionsEnabled),I=g((l=>Z(l)))&&h,{dataAvailable:x,initialTimeframeTick:F}=We(o,P,T.bookCloseDate),[b,O]=y.useState(!1),[j,z]=y.useState(void 0),u=y.useMemo((()=>{const l=p(F);return{tranListType:o,accountType:ee(Y),title:v,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!b&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=q(u.tranListType);n(Ae(l,u.period,!0,l==="missingReceipts"?ke():void 0))}}),[b,u,n]);let C=u;return u!=null&&j!=null&&(C={...u,period:j}),c==null||C==null?s.jsx(U,{to:"../"}):s.jsx(Ue,{firstMonthOfFY:P,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:C,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>z(l),...a})})),Ne=a=>{let e="",t="";const n=Ie.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},We=(a,e,t)=>{const n=me();let c=me().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},He=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ke=X((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ye();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Qe=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:P}=Q(),S=E(d??""),h=E(Y??""),I=E(v??""),x=E(P??""),F=g((r=>Be(r.transactionListState,h,S,I))),[b,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=Xe(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=Ze(F?.dateRange,r);i={accountId:h,accountType:ee(S),classId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{b||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.classId,i.period)))}),[b,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,v,A,f,T,P].filter((r=>r!=null));return G&&B!=null?s.jsx(Ke,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(U,{to:Ye(_.length)})})),Ye=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),et=X((function(a,e){const t=Oe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),tt=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:P}=Q(),S=E(d??""),h=E(Y??""),I=E(v??""),x=E(P??""),F=g((r=>Fe(r.transactionListState,h,S,I))),[b,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=at(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=nt(F?.dateRange,r);i={accountId:h,accountType:ee(S),projectId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{b||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[b,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,v,A,f,T,P].filter((r=>r!=null));return G&&B!=null?s.jsx(et,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(U,{to:ve(_.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},at=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,nt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ct=X((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=it(e.tenantEmailDomain),n=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),ye=ie((function({referrerType:a,...e}){const t=H(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:v,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:P}=Q(),S=E(d??""),h=E(Y??""),I=E(T??""),x=!(P!=null&&P==="exclude_subaccounts"),F=g((D=>ze(D.transactionListState,h,S))),[b,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((D=>N(D))),C=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const w=ot(S,h,v,A,f,I);if(w){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=st(F?.dateRange,D);m={accountId:h,accountType:ee(S),title:I,timeframe:v,period:le}}let i=m;m!=null&&j!=null&&(i={...m,period:j});const{useFeatureGate:G}=ne(),B=y.useCallback(((D,le)=>{if(o==null)return;const ue=D.url.split(`/${o}/`)[1];if(ue==null)return;const[je,Ee]=ue.split("?"),W=new URLSearchParams(Ee??"");W.set("view","full"),W.set("thread_id",le),W.set("entity_type",D.entityType);const xe=R(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${W.toString()}`,{state:{pathnameStackToGoBack:xe}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:_}=G(ce.isProjectsTransactionsEnabled),r=g((D=>Z(D)))&&_,{areTenantIdsInSync:$}=Re();y.useEffect((()=>{!b&&m!=null&&$&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(ge(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[b,m,c,$]);const be=[d,Y,v,A,f,T].filter((D=>D!=null));return w&&i!=null?s.jsx(ct,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:C,onCommentThreadClick:B,showProjectField:r,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>z(D),...e}):s.jsx(U,{to:Pe(be.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},ot=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,st=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),it=a=>`/${a}/transactions/${$e}/statements`;function Ct(){const a=J().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>N(n))).tenantId],t=_e();return s.jsxs(Me,{children:[s.jsx(M,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/zeni-clearing-account/statements",element:s.jsx(qe,{})}),s.jsx(M,{path:"/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/missing-receipts/*",element:t?s.jsx(U,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(M,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})}),s.jsx(M,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(tt,{referrerType:a})})]})}export{Ct as default};