@zeniai/web-app-ui 5.3.53-qa → 5.3.54-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/assets/{AccountMappingScreen-B05quPfB.js → AccountMappingScreen-BlrRRyYK.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-D94Dqvel.js → ActualMatchingMatchDetailScreen-KBRWoEoc.js} +1 -1
  3. package/dist/assets/AddressRoutes-Coz5Rzvv.js +1 -0
  4. package/dist/assets/AddressScreen-DWOW-12j.js +9 -0
  5. package/dist/assets/{AiCfoScreen-Dj6jKppq.js → AiCfoScreen-DcDfH2LH.js} +1 -1
  6. package/dist/assets/{AppDrawer-DB1lzCTO.js → AppDrawer-ODeNF0Av.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-vJIdZGym.js → BillPayApprovalRoutes-CwQ70Jsb.js} +1 -1
  8. package/dist/assets/BillPayRoutes-DkWEe87D.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-Bh9Wow-A.js → BusinessVerificationPageScreen-fkSKuDKx.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-Hsh2FpvU.js → CardsAiCfoScreen-D2h73Hql.js} +2 -2
  11. package/dist/assets/{ChargeCardRoutes-0m2CNq4x.js → ChargeCardRoutes-BPu1nuyG.js} +8 -8
  12. package/dist/assets/{CompanyPassportScreen-Cvbu6LUT.js → CompanyPassportScreen-DFwJSL9V.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-CRvnQSlr.js → ConnectionAuthScreen-rwpCK8vj.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-CsmvVXX5.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-kZOJ1QhA.js → CustomerOnboardingRoutes-2FuFx1YW.js} +1 -1
  16. package/dist/assets/DashboardRoutes-CsVUKDom.js +20 -0
  17. package/dist/assets/{DefaultTenantHome-CTOQPic5.js → DefaultTenantHome-EK1ZTLpJ.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-DgaHcUL_.js → DomesticWireDetailScreen-B2sK3gnq.js} +3 -3
  19. package/dist/assets/{DrawerScreen-BeSv1Aix.js → DrawerScreen-Cxs0fLXJ.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-D5eIJPR7.js → EntityDetailRoutes-J1t-f_rN.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-DHppK74x.js → ExpenseAutomationRoutes-CdYiuFY6.js} +1 -1
  22. package/dist/assets/FeaturePreviewScreen-DWnnuRXB.js +1 -0
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-CThBYwg5.js → HubSpotOAuthCallbackScreen-BKy1DBij.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-D6QvVVj8.js → InboxNotificationsProvider-B8qyHdbE.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-DvFmEcE9.js → InvoicingRoutes-_2bztMtp.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-B1yYt0y7.js → MagicLinkRoutes-BMUhHQh1.js} +8 -8
  27. package/dist/assets/MagicLinkSignInScreen-BWBaBqgd.js +12 -0
  28. package/dist/assets/{MobileAppDrawer-D3MVdjfj.js → MobileAppDrawer-DEHTsboI.js} +1 -1
  29. package/dist/assets/NotFoundScreen-tLaFUNLQ.js +1 -0
  30. package/dist/assets/{NotificationRoutes-3MhigWw8.js → NotificationRoutes-CbQ2m8ON.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-Br6J-Kjw.js → OAuthConsentScreen-CDpRBEpx.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-BT242PEu.js → PandLWithForecastRoutes-DA-gkwnG.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-D304LK9q.js → PaymentLinkScreen-BRzaAbpf.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-Cs1oFIJn.js → PeopleRoutes-DFwhgdPC.js} +3 -3
  35. package/dist/assets/PerformanceRoutes-D0mskpFQ.js +1 -0
  36. package/dist/assets/{Preview-CDuSXomS.js → Preview-BBxDhQ0O.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-CXR9MUeu.js → QBOConnectionScreen-BajGDFuL.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-CADwX7m0.js → ReimbursementApprovalRoutes-BTAP_qed.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C__AcyMO.js → ReimbursementApprovalRuleDetailScreen-DJEm2XXH.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-DE9--ARn.js → ReimbursementRoutes-BgavHl4p.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-B_EvlWob.js → ReportsRoutes-C93h6574.js} +1 -1
  42. package/dist/assets/RewardsRoutes-CjIMfvYV.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-270QQSkr.js → ScheduleDetailsPrepaidExpensesScreen-bMBkbiJF.js} +4 -4
  44. package/dist/assets/ScreenRoutes-HNN5txks.js +2 -0
  45. package/dist/assets/{SettingsRoutes-DjTGDDEp.js → SettingsRoutes-CslaKFsZ.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-mQ33CI-8.js → SetupPagesScreen-BknhxMJr.js} +1 -1
  47. package/dist/assets/SignInScreen-DDXFdnmo.js +1 -0
  48. package/dist/assets/SignOutScreen-CdohYlzt.js +9 -0
  49. package/dist/assets/{TaskListScreen-_mHmu42Q.js → TaskListScreen-BamiN5-8.js} +2 -2
  50. package/dist/assets/{TaskRoutes-DRFV_DYt.js → TaskRoutes-B2KOXvdP.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-VLp4TIB7.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-Dmc1SB66.js → TransactionDetailScreen-DUQhWS53.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-2uPIfsci.js → TransactionListRoutes-BiDSTFZP.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-C62UHGaV.js → TreasuryRoutes-B0bQBu4a.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-Dp-COjet.js → VendorsRoutes-CyexNe36.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-DEQwqZwF.js → WiseConfirmationScreen-BsFUJuRp.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-DjudE9ka.js → ZeniAccountRoutes-Bn27iI8z.js} +1 -1
  58. package/dist/assets/ZeniAccountStatementScreen-DnKhFx6b.js +9 -0
  59. package/dist/assets/{accountMappingHelper-DNRaFM1C.js → accountMappingHelper-y0E9h6aC.js} +1 -1
  60. package/dist/assets/{analytics-Y9Rn1Gu7.js → analytics-BDCkEq_I.js} +1 -1
  61. package/dist/assets/{analyticsHelper-Czpx502m.js → analyticsHelper-HN-E8Xpa.js} +1 -1
  62. package/dist/assets/{core-Dh_SHcAD.js → core-B2JcUSRu.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-B9wRnGXi.js → decodeURIComponentSafe-CIM8Yd6k.js} +1 -1
  64. package/dist/assets/{dnd-CwwWYFuT.js → dnd-BAPMa4RJ.js} +1 -1
  65. package/dist/assets/{empty-BT_7GI6y.js → empty-D7vR8z68.js} +1 -1
  66. package/dist/assets/{empty-XI8MiQF0.js → empty-M8CZcWYb.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-JNmKZqZz.js → emptyVideoElement-nUJqd2nB.js} +1 -1
  68. package/dist/assets/{epic-COW9EFJg.js → epic-IH41xxG2.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-jy143DnO.js → expenseAutomationHelper-Dd7fQN5z.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-BTnTjmTv.js → getLocaleForTenant-CHied7Hb.js} +1 -1
  71. package/dist/assets/{index-8Q8Cb_pA.js → index-BTTj-4b5.js} +1 -1
  72. package/dist/assets/{index-D_bKIveY.js → index-DKVU_IvY.js} +2 -2
  73. package/dist/assets/{index-C4rZANm7.js → index-DKZ4YAZy.js} +1 -1
  74. package/dist/assets/{index-CHaKE3QQ.js → index-DoNDPHnj.js} +14545 -14423
  75. package/dist/assets/{index-DTprL6g9.js → index-P1XHqiT-.js} +1 -1
  76. package/dist/assets/{index-D3h8toFn.js → index-PCu_2P3b.js} +1 -1
  77. package/dist/assets/{index-DOYaY83A.js → index-dmkrZYpO.js} +1 -1
  78. package/dist/assets/{index-B23hmQHl.js → index-gjFAkOOB.js} +1 -1
  79. package/dist/assets/{lexical-CaftfZ9D.js → lexical-DGZ06Yv6.js} +1 -1
  80. package/dist/assets/{liveblocks-DR8KfETq.js → liveblocks-DXYs6rwe.js} +1 -1
  81. package/dist/assets/{lottie-ODKvpFjz.js → lottie-C9Rxpkwh.js} +1 -1
  82. package/dist/assets/{mui-BYn_Ugho.js → mui-BLmtkCLd.js} +1 -1
  83. package/dist/assets/{pathToGoBack-BiqpVJeS.js → pathToGoBack-DqGGHSwL.js} +1 -1
  84. package/dist/assets/{pdf-DnQo5-Qw.js → pdf-DMCYUxGc.js} +3 -3
  85. package/dist/assets/{pdf-lib-DdZd3IiB.js → pdf-lib-D7-8SdHl.js} +1 -1
  86. package/dist/assets/{plaid-Dw8l1kdg.js → plaid-DHQC2tsw.js} +1 -1
  87. package/dist/assets/{pusher-CewboUYG.js → pusher-C76wt9sK.js} +1 -1
  88. package/dist/assets/{react-gSPYEWZo.js → react-B2hEGyNu.js} +1 -1
  89. package/dist/assets/{react-CWd2ZkNi.js → react-BX0k_7jA.js} +1 -1
  90. package/dist/assets/{react-8By583h-.js → react-D7gGxl9M.js} +1 -1
  91. package/dist/assets/{react-B8IvMjeE.js → react-Dvat3Ckm.js} +1 -1
  92. package/dist/assets/{react-BgmP_PBP.js → react-DzK6xFD8.js} +1 -1
  93. package/dist/assets/{react-ygIo2ccY.js → react-Y6cTJufT.js} +1 -1
  94. package/dist/assets/{recharts-BTL88W4R.js → recharts-UN7cJOXN.js} +1 -1
  95. package/dist/assets/{routePaths-DXpM4tZj.js → routePaths-V2hUGG4a.js} +1 -1
  96. package/dist/assets/{sentry-FwaDhTzy.js → sentry-BmkYxd02.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CvpfThkG.js → stripSplatSuffix-DXBpTroJ.js} +1 -1
  98. package/dist/assets/{url-DHu7Ejzz.js → url-Cjk2PJJX.js} +1 -1
  99. package/dist/assets/{url-DybJ-sxa.js → url-DgDGkycQ.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-uLKulkDS.js → useActualMatchingMatchDetail-RtuBBjbC.js} +1 -1
  101. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Bn69qFOr.js +1 -0
  102. package/dist/assets/{useAskAiCfoHostNavButtonProps-PLm72Ozi.js → useAskAiCfoHostNavButtonProps-qSqQpxG4.js} +1 -1
  103. package/dist/assets/{useChargeCardPusherEvents-LUqnb4UF.js → useChargeCardPusherEvents-BPnD4KLb.js} +1 -1
  104. package/dist/assets/{useDeviceId-CUJxM_KE.js → useDeviceId-IlYBwHEv.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-CKnBwo84.js → useEmailConnectResultRefresh-dPGnutjz.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-DLA6PIFe.js → useInitialThreadRequest-DK2o3yi9.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-BNcDbxmw.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-DchZU-tO.js → useTaskManagerPusherEvents-DoGLBnPU.js} +1 -1
  109. package/dist/assets/{utils-DEAaFgLU.js → utils-BGWE7tXK.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-DLRTZIl6.js → withTransactionSidePanel-BJHiJX6z.js} +2 -2
  111. package/dist/assets/{zeni-epic-state-DJh0-ZeR.js → zeni-epic-state-DpjvBN7b.js} +3 -3
  112. package/dist/index.html +1 -1
  113. package/package.json +2 -2
  114. package/dist/assets/AddressRoutes-BBXKWkgP.js +0 -1
  115. package/dist/assets/AddressScreen-DkOVp1Il.js +0 -9
  116. package/dist/assets/BillPayRoutes-Ie8KE_Pm.js +0 -119
  117. package/dist/assets/CustomerOnboardingAuthScreen-SW-uc7QE.js +0 -1
  118. package/dist/assets/DashboardRoutes-DTB-wwS1.js +0 -20
  119. package/dist/assets/FeaturePreviewScreen-vWprV4-Z.js +0 -1
  120. package/dist/assets/MagicLinkSignInScreen-CZM8ZeV4.js +0 -12
  121. package/dist/assets/NotFoundScreen-BG5HsGgf.js +0 -1
  122. package/dist/assets/PerformanceRoutes-DevypuzE.js +0 -1
  123. package/dist/assets/RewardsRoutes-fsFKnuDQ.js +0 -1
  124. package/dist/assets/ScreenRoutes-B0DNEVGO.js +0 -2
  125. package/dist/assets/SignInScreen-BVOxylXT.js +0 -1
  126. package/dist/assets/SignOutScreen-BXBPUD_K.js +0 -9
  127. package/dist/assets/TransactionDetailRoutes-BqJM9clh.js +0 -1
  128. package/dist/assets/ZeniAccountStatementScreen-fuK8OSl5.js +0 -9
  129. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CJfIwtxx.js +0 -1
  130. package/dist/assets/useTaskManagerAccess-D4PJ1zkK.js +0 -1
package/dist/index.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-CHaKE3QQ.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-FwaDhTzy.js"><link rel="modulepreload" crossorigin href="/assets/core-Dh_SHcAD.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-DJh0-ZeR.js"><link rel="modulepreload" crossorigin href="/assets/mui-BYn_Ugho.js"><link rel="modulepreload" crossorigin href="/assets/analytics-Y9Rn1Gu7.js"><link rel="modulepreload" crossorigin href="/assets/utils-DEAaFgLU.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-DoNDPHnj.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-BmkYxd02.js"><link rel="modulepreload" crossorigin href="/assets/core-B2JcUSRu.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-DpjvBN7b.js"><link rel="modulepreload" crossorigin href="/assets/mui-BLmtkCLd.js"><link rel="modulepreload" crossorigin href="/assets/analytics-BDCkEq_I.js"><link rel="modulepreload" crossorigin href="/assets/utils-BGWE7tXK.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/web-app-ui",
3
- "version": "5.3.53-qa",
3
+ "version": "5.3.54-qa",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],
@@ -30,7 +30,7 @@
30
30
  "@stripe/stripe-js": "^4.4.0",
31
31
  "@zeniai/client-analytics": "2.0.92",
32
32
  "@zeniai/client-epic-state": "5.2.55",
33
- "@zeniai/web-components": "4.3.88",
33
+ "@zeniai/web-components": "4.3.89",
34
34
  "color": "3.1.3",
35
35
  "crypto-js": "4.2.0",
36
36
  "dnd-core": "^16.0.1",
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-DR8KfETq.js";import{A as i}from"./AddressScreen-DkOVp1Il.js";import s from"./NotFoundScreen-BG5HsGgf.js";import"./sentry-FwaDhTzy.js";import{n as d,o as r}from"./core-Dh_SHcAD.js";import"./zeni-epic-state-DJh0-ZeR.js";import"./recharts-BTL88W4R.js";import"./index-CHaKE3QQ.js";import"./mui-BYn_Ugho.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="81cbb5c1-1b56-4d87-a240-ae6c03b91825",t._sentryDebugIdIdentifier="sentry-dbid-81cbb5c1-1b56-4d87-a240-ae6c03b91825")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,9 +0,0 @@
1
- import{j as n}from"./liveblocks-DR8KfETq.js";import{a as b}from"./sentry-FwaDhTzy.js";import{h as T,u as P,g as j,i as E,j as B,l as M}from"./core-Dh_SHcAD.js";import{a2 as $,E as D,z as L,Q as V,a8 as K,a9 as F,j as _,S,a4 as z,_ as h,a5 as N}from"./index-CHaKE3QQ.js";import{Vj as C,ip as R,fF as U,Vk as G,c8 as H,Vl as O,mH as q}from"./zeni-epic-state-DJh0-ZeR.js";import{n as Q}from"./mui-BYn_Ugho.js";import J from"./NotFoundScreen-BG5HsGgf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="80e5cc83-6ba3-4e8a-8cc9-941aad8b7bd1",e._sentryDebugIdIdentifier="sentry-dbid-80e5cc83-6ba3-4e8a-8cc9-941aad8b7bd1")}catch{}})();const W=Q.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,X=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=U(e),t=s.roleMap!=null&&G(s.roleMap),d=i||c==="user_address"||H(l?.userRole??[])||t?void 0:"readonly";if(o==null){const a=O(c,e);return{addressToEdit:a?.addressToCreate,loadingState:a?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=C(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=t=>{if(t==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=N(d?.pathnameStackToGoBack);let a=r.poppedPathname??k();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(a=`${a}?${g}`)}o(a,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:t=>{const d=Y(t);e(q({addressType:c,addressToCreate:d})),_?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:t.street.addressString,city:t.city,state:t.state,country:t.country.selectedOption??"",postalCode:t.postalCode,suite:t.suite,secondaryInfo:t.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(z);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const t=T(),d=P(),r=j(),{addressId:a,addressType:u}=E(),g=$(),v=D(),I=L.getSignedInUser(),[p,w]=b.useState(a==null),f=B((m=>a!=null?C(m,a).fetchState:"Not-Started")),x=V();if(I==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(a!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect((()=>{p||a==null||(w(!0),d(R(a,!1)))}),[p,a,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?n.jsx(K,{fetchState:f,style:{backgroundColor:v.colors.grey5}}):a!=null&&f==="Error"?(t(`${k(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(F,{analytics:_,onLoad:A}),n.jsx(W,{windowSize:g,children:n.jsx(X,{location:r,navigate:t,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:a,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(J,{})}const k=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{ne as A,Y as t};
@@ -1,119 +0,0 @@
1
- import{j as t}from"./liveblocks-DR8KfETq.js";import{h as K,u as le,g as X,i as ae,j as k,N as ee,l as Q,q as it,n as ot,o as f}from"./core-Dh_SHcAD.js";import{fF as Z,Yc as Ue,bq as ka,Sd as lt,bo as wa,bJ as de,Yd as Ba,GV as Ca,Ii as Ve,Hw as st,bn as Ae,Ye as rt,Yf as ct,c8 as dt,Yg as ut,l$ as xa,Yh as Aa,Yi as Ea,IM as _e,Hc as Ce,Yj as pt,GJ as ta,Yk as mt,MB as bt,GN as ht,GT as Da,Yl as Se,Ym as Me,Ij as Ne,H9 as Ta,Yn as gt,Yo as St,Im as Oe,Yp as yt,Is as ft,Yq as ja,HX as na,I0 as It,Yr as vt,Ys as ce,Yt as Pa,Yu as Fa,Yv as Ra,gV as kt,Hh as $e,cG as Va,Yw as wt,gh as Bt,Yx as Ct,Yy as xt,d_ as $a,dZ as La,Yz as Ye,YA as At,YB as Et,WN as ze,YC as Dt,WO as ie,WP as He,YD as Tt,YE as jt,YF as Pt,I2 as ia,H$ as Ft,YG as Rt,YH as Vt,YI as $t,HN as Lt,YJ as Gt,YK as Ut,cu as Ga,da as Ua,ma as _t,bO as Mt,br as _a,bP as Ma,FZ as Nt,YL as Ot,Mo as Yt,Mu as zt,C9 as Ht,Ik as Zt,IT as Wt,mn as ge,YM as qt,YN as Na,mR as Jt,mh as Oa,mC as Ya,mB as oa,bE as pe,bN as Kt,YO as Xt,YP as ye,kN as Qt,YQ as la,YR as en,kR as an,la as tn,J5 as nn,YS as on,mK as ln,IX as sn,YT as sa,I$ as rn,J4 as cn,J2 as dn,IV as un,YU as za,H2 as pn,YV as mn,YW as bn,gG as hn,gF as gn,gE as Sn,mq as yn,mI as ra,mT as fn,uT as In,mz as vn,IZ as kn,kX as wn,mY as Bn,YX as Cn,kP as xn,uK as An,YY as En,HT as Dn,bK as Tn,bt as jn,Uc as Pn,dd as Fn,dc as Rn,cF as Vn,cM as $n}from"./zeni-epic-state-DJh0-ZeR.js";import{E as ue,z as L,Q as fe,at as Ze,c as oe,A as g,bj as We,a8 as se,F as A,a9 as Ee,j,bv as Ln,a5 as H,aw as qe,p as T,a2 as Ie,bw as ca,bx as da,by as Gn,aA as Un,ag as _n,aT as Mn,ac as Ha,G as De,ah as Je,bz as Nn,af as Za,bA as On,ar as Yn,S as Wa,w as zn,bB as Hn,bC as Zn,bD as Wn,bE as qn,bF as Jn,bG as Kn,bH as Xn,bI as Qn,bJ as ei,O as ai,bK as ti,bs as ni,bL as ii,aj as oi,bM as li,g as si}from"./index-CHaKE3QQ.js";import{n as U,S as ri}from"./mui-BYn_Ugho.js";import{A as ua}from"./AddressScreen-DkOVp1Il.js";import{g as ne,a as Te,i as qa,V as Ke,b as Xe,c as ci,v as di,d as ui,A as me,D as be}from"./DomesticWireDetailScreen-DgaHcUL_.js";import{a as S}from"./sentry-FwaDhTzy.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-PLm72Ozi.js";import{u as Ja}from"./useInitialThreadRequest-DLA6PIFe.js";import{u as pi}from"./BusinessVerificationPageScreen-Bh9Wow-A.js";import xe from"./NotFoundScreen-BG5HsGgf.js";import{D as mi}from"./DrawerScreen-BeSv1Aix.js";import{M as Ka}from"./MobileAppDrawer-D3MVdjfj.js";import{F as Xa}from"./FeaturePreviewScreen-vWprV4-Z.js";import{S as je}from"./SetupPagesScreen-mQ33CI-8.js";import{B as bi}from"./BillPayApprovalRoutes-vJIdZGym.js";import{F as hi}from"./ScreenRoutes-B0DNEVGO.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./routePaths-DXpM4tZj.js";import"./InboxNotificationsProvider-D6QvVVj8.js";import"./useTaskManagerAccess-D4PJ1zkK.js";import"./analyticsHelper-Czpx502m.js";import"./ReimbursementApprovalRuleDetailScreen-C__AcyMO.js";import"./getLocaleForTenant-BTnTjmTv.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]="d4aac65a-6ff2-4604-8e64-d41a069f0eae",e._sentryDebugIdIdentifier="sentry-dbid-d4aac65a-6ff2-4604-8e64-d41a069f0eae")}catch{}})();const gi=Q((function(e,a){const l=Ue(e,a.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=H(a.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ae(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:y,isMarkAsPaidBtnVisible:h}=rt(l.billActivities,ct(a.currentTenant),n);i=y,d=h}const p=dt(a.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ut(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xa(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:a.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:a.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:m}}),(function(e,a){const{billId:l,currentTenant:n,location:c,navigate:r}=a,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=T(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Da(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ht(l,s))},onSaveRealTimeApprovals:o=>{e(bt(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(mt({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(ta(l,o.type,"")):e(ta(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=T(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=H(a.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(pt({billId:a.billId}))},onRefundPaymentClick:()=>{e(Ce(a.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ea({data:i,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Aa({billId:l}))}}}))(Ln);function Si(){const e=K(),a=le(),l=X(),{billId:n}=ae(),c=ue(),r=L.getSignedInUser(),u=fe(),o=k((z=>Z(z))),s=k((z=>Ue(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Ja(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:s.fetchState==="Completed"});const y=o?.userRole!=null&&ka(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!y,[b,I]=S.useState(!1),[E,C]=S.useState(!1),[x,_]=S.useState(!1),{useFeatureGate:D,useDynamicConfig:B}=oe(),{isFeatureEnabled:N}=D(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:V}=D(g.isBillPayCommentingEnabled),{isFeatureEnabled:W}=D(g.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=B(We.zeniAssistConfig),v=lt(o),Y=wa(o.userRole),M=h&&de(u?.loggedInUserRoleMap),$=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:q}=D(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:J}=D(g.billPaySetupShowInternationalPaymentByWise);if(S.useEffect((()=>{N&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&v===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(Y||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,Y,M,o.isZeni,v,r]),S.useEffect((()=>{n!=null&&a(Ba(n))}),[n]),S.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),a(Ca(n??"",N,$,!1)))}),[b,s,n,a]),S.useEffect((()=>{E||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),a(Ve(!1,N,$,J,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&a(st()))}),[E,s,n,a,N,$,J]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?t.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[t.jsx(Ee,{analytics:j,onLoad:z=>(G=>{n!=null&&G.trackBillPayBillDetails(n,s.isRecurring)})(z)}),t.jsx(gi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:N,location:l,navigate:e,isBillPayCommentingEnabled:V,isRealTimeApprovalEnabled:x,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Le=De.getLocalizedStrings().spendManagement.billPay.billDetails,pa=De.getLocalizedStrings().common,yi={containerWidth:new Ha(100,58)},ma=Q((function(e,a){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=a.showActionButtons,u=r&&a.file==null;return{uploadInvoiceEndPoint:`${Za.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:a.billId,file:a.file,showAutofill:a.showAutofill,analytics:j,entityId:a.billId,showTitlebarIcon:r,showTitlebar:r&&a?.file!=null,uploadStatus:a.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...a.showAutofill?{}:{backgroundColor:a.backgroundColor,paddingBottom:"128px"}}}}),(function(e,a){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(a.file!=null||a.billId!=null||a.isInitialEdit?(a.setPayload(n),a.setShowConfirmationPopup(!0)):e(Oe(n,a.isVendorRecommendationEnabled,a.billId)))},updateInvoiceUploadFetchState:n=>{e(ft({fetchState:{fetchState:n,error:void 0},billId:a.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(Ne(n))},onDeleteClick:()=>{e(yt({billId:a.billId})),j?.trackInvoiceActionClick(a.billStage??"","delete",l?.userEmail??"",null)}}}))(Mn);function w({appContent:e}){const a=le(),l=K(),{billId:n}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(g.billPaySetupShowInternationalPaymentByWise),{configValue:I}=p(We.zeniAssistConfig),E=I.user_ids!=null&&i?.userId!=null&&I.user_ids.includes(i?.userId),C=k((F=>Z(F)));pi();const[x,_]=S.useState(!1),[D,B]=S.useState(!1),[N,V]=S.useState(!1),[W,O]=S.useState(),v=k((F=>Me(F,m,h,n)));let Y=v.fetchState,M=v.file,$=v.showAutofill;const q=k((F=>Ue(F,n??"")));u===!1&&(Y=q.fetchState,M=q.transactionDetails?.attachments?.[0],$=!1);const J=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;S.useEffect((()=>{n==null&&a(Ne(!0))}),[n,a]),S.useEffect((()=>{Y==="Not-Started"&&(u&&D?B(!1):!u&&x&&_(!1))}),[n]),S.useEffect((()=>{x||n==null||u||(_(!0),a(Ca(n,y,E,!1)),a(Ta(n)),D||(B(!0),a(Ve(!1,y,E,b,n)))),u&&!D&&(B(!0),a(Ve(!1,y,E,b,n)))}),[x,D,u,n,a,y,E,b]);const z={onOkClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","yes"),a(St({replaceBillData:!0,billId:n})),a(Oe(W,m,n))},onCancelClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","no"),a(gt({file:W,billId:n}))}},G=S.useCallback((()=>{const F=H(c.state?.pathnameStackToGoBack),ve=F.poppedPathname??ne(C.tenantEmailDomain);a(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:F.newStack}})}),[c.state,C.tenantEmailDomain,n,a,l]);if(i==null)throw Error("Can't access address page without signing in...");if(Y==="Error"||q.fetchState==="Error")return t.jsx(xe,{});if(Y!="Completed")return n==null&&o!=="small"?t.jsx(ca,{fallback:G,children:t.jsxs(Pe,{windowSize:o,children:[t.jsx(ha,{}),t.jsx(Fe,{}),t.jsx(ma,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:V,setPayload:O,showActionButtons:!1,isInitialEdit:!!v.isInitialEdit,billStage:J}),t.jsx(Re,{windowSize:o,children:t.jsx(da,{isNewBill:!0})})]})}):t.jsxs(Pe,{windowSize:o,children:[o==="small"||$?null:t.jsx(ba,{children:t.jsx(Qa,{onClick:G,"data-testid":"nav-bar-back-click"})}),o!=="small"?t.jsx(Fe,{}):null,t.jsx(Gn,{}),t.jsx(Re,{windowSize:o,children:t.jsx(da,{isNewBill:n==null})})]});{const F=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;return t.jsx(ca,{fallback:G,children:t.jsxs(Pe,{windowSize:o,children:[$&&o!=="small"?t.jsx(ha,{}):null,N?t.jsx(Un,{titleComponent:t.jsx(Ci,{children:Le.overwriteTitle}),descriptionComponent:t.jsx(xi,{children:Le.overwriteDescription}),primaryButtonText:pa.yes,secondaryButtonText:pa.no,action:z,isEditPopup:!0}):null,o==="small"||$?null:t.jsx(ba,{children:t.jsx(fi,{})}),o!=="small"?t.jsx(Fe,{}):null,t.jsx(ma,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:$,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Ii(u,q,v),setShowConfirmationPopup:V,setPayload:O,showActionButtons:vi(u,v),isInitialEdit:!!v.isInitialEdit,billStage:F}),t.jsx(Re,{windowSize:o,children:e})]})})}}function fi(){const{triggerBack:e}=Nn();return t.jsx(Qa,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(e,a,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=a.transactionDetails?.recurringBillInstance,c=a.recurringBillConfigDetail?.totalPaymentCycles),a?.isRecurring===!0?t.jsxs(ki,{children:[t.jsx(wi,{children:`${Le.recurringBill.recurringCycle}
2
- ${n}/${c}`}),t.jsx(Bi,{})]}):void 0}function vi(e,a){const l=a.billActivities?.[0],n=a.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(a.billStage==="draft"||n)}const ba=U.div`
3
- margin-bottom: 20px;
4
- margin-top: 20px;
5
- margin-left: ${A.sp5};
6
- position: absolute;
7
- display: flex;
8
- align-items: center;
9
- `,ki=U.div`
10
- display: flex;
11
- justify-content: center;
12
- align-items: center;
13
- padding-top: 9px;
14
- gap: ${A.sp2};
15
- margin-bottom: -${A.sp2};
16
- `,wi=U(Je.StandardMedium)``,Bi=U((e=>S.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))))`
17
- color: ${e=>e.theme.colors.hero};
18
- height: ${A.sp3};
19
- width: ${A.sp3};
20
- `,Qa=U((e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))))`
21
- width: ${A.sp3};
22
- height: ${A.sp3};
23
- cursor: pointer;
24
- color: ${e=>e.theme.colors.champion};
25
- &:hover {
26
- color: ${e=>e.theme.colors.primary};
27
- }
28
- `,Pe=U.div`
29
- display: flex;
30
- height: 100vh;
31
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
32
- background-color: ${e=>e.theme.colors.grey4};
33
- position: relative;
34
- &::after {
35
- content: "";
36
- position: absolute;
37
- top: 57px;
38
- left: 42%;
39
- width: 1px;
40
- height: calc(100% - 57px);
41
- background-color: ${e=>e.theme.colors.grey2};
42
- pointer-events: none;
43
- z-index: 3;
44
- display: ${e=>e.windowSize==="small"?"none":"block"};
45
- }
46
- `,Fe=U.div`
47
- position: absolute;
48
- top: 56px;
49
- left: 0;
50
- width: 42%;
51
- height: 1px;
52
- background-color: ${e=>e.theme.colors.grey2};
53
- z-index: 3;
54
- `,ha=U.div`
55
- position: fixed;
56
- top: 0;
57
- left: 0;
58
- right: 0;
59
- bottom: 0;
60
- background-color: ${_n.overlayBackgroundBlack};
61
- z-index: 5;
62
- `,Re=U.div`
63
- display: flex;
64
- flex-direction: column;
65
- width: ${e=>`${yi.containerWidth.value(e.windowSize)}%`};
66
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
67
- `,Ci=U(Je.H6Regular)`
68
- margin-top: ${A.sp7};
69
- padding-left: ${A.sp8};
70
- padding-right: ${A.sp8};
71
- color: ${e=>e.theme.colors.primary};
72
- word-break: break-word;
73
- `,xi=U(Je.LargeRegularSp)`
74
- color: ${e=>e.theme.colors.hero};
75
- padding-left: ${A.sp8};
76
- padding-right: ${A.sp8};
77
- margin-bottom: 30px;
78
- margin-top: ${A.sp4};
79
- white-space: pre-line;
80
- `,Ai=Q((function(e,a){return{billsReviewView:ja(e),analytics:a.analytics}}),(function(e,a){return{onCloseOverlay:()=>{a.navigate(`/${a.tenantEmailDomain}/bills`),e(ce())},onCloseReviewItem:l=>{e(vt(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(It());break;case"approve":case"review":e(na("approved",n??""));break;case"reject":e(na("rejected",n??""))}}}}))(On);function Ei({tenantEmailDomain:e}){const a=K(),l=k((c=>c.billsBulkActionViewState.bulkSubmissionFetchState.fetchState)),{billsForReview:n}=k((c=>ja(c)));return S.useEffect((()=>{l!=="Completed"&&n.length!==0||a(`/${e}/bills`)}),[l,n.length,e]),t.jsx(Ai,{navigate:a,analytics:j,tenantEmailDomain:e})}const te=Et(),et="bulk-operation-update",Ge="bill-approval-rule-update",{common:we}=De.getLocalizedStrings(),Di=U.div`
81
- display: flex;
82
- min-height: 100%;
83
- width: 100%;
84
- flex: 1 1 auto;
85
- flex-direction: column;
86
- align-items: center;
87
- background-color: ${e=>e.theme.colors.grey4};
88
- `,Ti=Q((function(e,a){const l=L.getSignedInUser(),n=Ae(l),c=Ra(e,te,a.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;a.isUserHasOnlyBillpayAccess&&a.roleMap&&c.currentTab==="pending_approval"&&(a.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):a.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),a.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=ze(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,y=c.fetchState,h=Dt(e);return{transactionList:a.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter((b=>b.isDeleted===!1)),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:y,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:te,spendManagementEndPoint:`${qe}/spendManagement`,isShowDeletedBillsEnabled:a.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:a.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:h.affectedEntityIds}}),(function(e,a){const{navigate:l,currentTenant:n,location:c,period:r}=a,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ce()),e(Pa(o))},onSubtabChange:o=>{e(ce()),e(Fa(o))},onTransactionClick:(o,s)=>{const i=Te(u,o,s),d=T(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Pi(u),s=T(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=a.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=T(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(Gt(o))},onReloadTransactions:()=>{e($e(r,!0,a.isShowDeletedBillsEnabled,a.isInternationalWireEnabled)),e(Lt(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e($t({filters:o})),o.categories.every((s=>s.field!=null&&s.values?.length!==0))&&j.trackSpendManagmentFilterChange("bill_pay",o.categories.map((s=>`${s.field}-${JSON.stringify(s.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&j.trackSpendManagementDownloadClick("bill_pay"),e(Vt({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Rt(o))},removeAllTransactionsFromBulkActionList:()=>{e(ce())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Ft(o,s??""));break;case"send_for_approval":e(ia("send_for_approval")),a.navigate("./bulk-review");break;case"approve":e(ia("approve")),a.navigate("./bulk-review");break;case"review":e(Pt()),a.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ge)&&e(jt(!1))},onEventReceived:o=>{o===et&&e(Tt())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}}))(zn(Hn));function ji(){const e=K(),a=le(),l=X(),n=Ie(),c=l.state,r=fe(),[u,o]=S.useState(!1),[s,i]=S.useState(null),d=it("/:tenantEmailDomain/bills/bulk-review")!=null;S.useEffect((()=>(c?.tab!=null&&c?.subTab!=null&&(a(Pa(c?.tab)),a(Fa(c?.subTab))),()=>{a(ce())})),[]);const p=L.getSignedInUser(),m=k((P=>Z(P))),{areTenantIdsInSync:y}=Yn(),[h,b]=S.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:E}=I(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:C}=I(g.isBillPayCommentingEnabled),{isFeatureEnabled:x}=I(g.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=I(g.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:D}=I(g.isBillPayBulkActionEnabled),{isFeatureEnabled:B}=I(g.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:N}=I(g.isBillPayDetectInsufficientFundsEnabled),V=k((P=>Ra(P,te,D,p?.userId))),{isFeatureEnabled:W}=I(g.isDebitCardFeatureEnabled),O=V.fetchState,{isAiCfoAccessEnabled:v,onAskAiCfoClick:Y}=Qe({mobileExploreReferrer:"Bills List"});Ze({isDataReady:O==="Completed"});const M=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,$=!!m.companyBillPayInfo?.info?.isBillPayEnabled,q=k((P=>kt(P.companyState,m.companyId))),J=q?.company.featuresActivationInfo.connectedAccountProvider;if(S.useEffect((()=>{!h&&$&&y&&(b(!0),a($e(te,!0,E,B)))}),[h,te,y,a]),p==null)throw Error("Can't access address page without signing in...");const z=(P,re)=>{a(At({uiState:{sortKey:P,sortOrder:re},period:te}))},G=Va(r?.loggedInUserRoleMap),F=de(r?.loggedInUserRoleMap),ve=P=>{o(P)},{billsProcessed:ke,billsProcessing:ea}=k((P=>wt(P)));S.useEffect((()=>{ke===ea&&s!=null&&(a(Bt({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:ke>1?we.headers.bills:we.texts.bill2},{variableName:"_has_",variableValue:ke>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Ct(s)}]})),a(xt()),setTimeout((()=>{a($e(te,!0,E,!0,B))}),3e3),i(null))}),[ke,ea]);const at={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${et}`,`private-encrypted-${m.companyId}.${Ge}`]:[],eventCallback:(P,re,aa)=>{P.endsWith(Ge)?aa.onBillPayApprovalRulesEventReceived?.(P):re?.entity_type==="bill"&&(i(re.operation_type),aa.onEventReceived(P))}},tt=$a(W,m),nt=La(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?tt===!0||nt===!0?t.jsx(Xa,{}):$?t.jsxs(t.Fragment,{children:[O==="Completed"?t.jsx(Ee,{analytics:j,onLoad:P=>(re=>re.trackPageLoaded(Wa.Event.billPayHome))(P)}):null,t.jsxs(Di,{windowSize:n,children:[t.jsx(Ka,{isAppContentDrawerOpen:u,handleDrawerToggle:ve}),t.jsx(mi,{isOpen:d,drawerLeftMargin:new Ha(0,0,300,600),onClose:()=>{e(`/${m.tenantEmailDomain}/bills`),a(ce())},children:t.jsx(Fi,{onClick:P=>P.stopPropagation(),children:t.jsx(Ei,{tenantEmailDomain:m.tenantEmailDomain})})}),t.jsx(Ti,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:C,isReimbursementCommentingEnabled:x,period:te,isAdmin:!1,uiState:V.uiState,onColumnSortConfigChanged:z,isUserHasOnlyBillpayAccess:G,isShowDeletedBillsEnabled:E,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:D,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ve(!0)},isDownloadEnabled:V.isDownloadEnabled,connectedAccountProvider:J,bulkSubmissionLimit:V.billBulkSubmissionLimit,bulkSubmissionFetchState:V.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:V.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:B,isDetectInsufficientFundsEnabled:N,isAiCfoAccessEnabled:v,onAskAiCfoClick:Y,...at})]})]}):M===!0&&F===!0?t.jsx(ee,{to:"../setup"}):r!=null&&Ye(m,r.loggedInUserRoleMap)?t.jsx(ee,{to:"../promo"}):t.jsx(se,{fetchState:O}):t.jsx(xe,{})}const Pi=e=>`/${e}/bills/setup`,Fi=U(ri)`
89
- display: flex;
90
- min-height: 100%;
91
- flex-direction: column;
92
- `,{common:{currency:he},spendManagement:{billPay:{billDetails:Ri}},appName:Vi}=De.getLocalizedStrings(),$i=Q((function(e,a){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=H(a.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ae(l);a.billId!=null&&a.billDetailsView!=null&&(i=`${a.billDetailsView.createdBy?.firstName??Vi} ${a.billDetailsView.createdBy?.lastName??""}`),d||!a.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=a.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Mt(a.billDetailsView.paymentDetailsSection?.paymentType?.method),y=a.currentTenant.createTime,h=_a(),b=a.sameDayAchDisablementConfig.newTenantTenureLimitMonths,I=y.add(b,"month").isAfter(h),E=!!(a.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Ma(p,a.billDetailsView.approvalRules.allApprovalRules,l,a.billDetailsView.vendor?.id,a.billDetailsView.classId),C=Z(e);return{billDetails:a.billDetailsView,isAccountingClassesEnabled:xa(e),billId:a.billId,createdBy:i,createTime:a.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:j,showBackButton:u,isAdmin:a.isBillPayAdmin,isSuperAdmin:a.isSuperAdmin,connectedAccountProvider:C.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:E,isZeniUser:d,isNewUser:I,sameDayAchDisablementConfig:a.sameDayAchDisablementConfig}}),(function(e,a){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=a,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(oa(i));const d=Sa(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??a.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Oa(d,!1)),e(Ya({localData:{vendorName:i??a.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(oa());const p=Sa(s,void 0,l),m=T(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Oe(i,a.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Ne(i))},onSaveChangesToLocalStore:(i,d,p,m,y)=>{const h=_i(a.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:y}},p,d,a.isInternationalPaymentShaVsOurEnabled,m,a.vendor);e(Jt({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(Na("draft"))},reviewBillDetails:()=>{const i=Li(s,l),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(qt()),onClickDismiss:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=Gi(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Ui(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=qa(s,l,i),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{a.navigate("../")},deleteBill:()=>{l!=null&&e(Da(l))},onAttachmentClick:(i,d)=>{const p=Te(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=H(a.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Wt(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Jn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Zt(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ht("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(zt(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Yt(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Nt("bill_pay","bill_pay_detail")),e(Ot({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(Zn);function ga(){const e=K(),a=X(),l=le(),{billId:n,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(g.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(g.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(g.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(g.isRecurringBillsFeatureEnabled),{isFeatureEnabled:h}=r(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(g.isShaDisabled),{isFeatureEnabled:I}=r(g.isOurDisabled),{isFeatureEnabled:E}=r(g.isBillPayDetectInsufficientFundsEnabled),{configValue:C}=u(We.sameDayAchDisablementConfig),x=Ut(C),_=L.getSignedInUser(),D=k((G=>Z(G))),B=k((G=>Me(G,m,h,n))),N=Ja(D?.companyId,{clearParams:B.fetchState==="Completed"}),{isAiCfoAccessEnabled:V,onAskAiCfoClick:W}=Qe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:B.fetchState==="Completed"});const O=D.companyId??L.getSignedInUserTenant(c)?.companyId,v=fe(),Y=Ga(v?.loggedInUserRoleMap),M=Ua(v?.loggedInUserRoleMap),$=de(v?.loggedInUserRoleMap),q=wa(D.userRole);if(S.useEffect((()=>{n!=null&&l(Ba(n))}),[n]),S.useEffect((()=>{n!=null&&l(Ta(n))}),[n,l]),_==null)throw Error("Can't access address page without signing in...");const J=k((G=>_t(G.accountState,G.accountListState,"billPayAccountList"))),z={pathname:"../",search:a.search};return B.isDeleted===!0||B.billStage=="paid"||B.fetchState=="Not-Started"?t.jsx(ee,{to:z}):B.deleteStatus.fetchState==="In-Progress"||s?t.jsx(se,{fetchState:B.deleteStatus.fetchState}):t.jsxs(t.Fragment,{children:[t.jsx(Ee,{analytics:j,onLoad:G=>(F=>{n!=null&&B.deleteStatus.fetchState!=="Completed"&&F.trackBillPayEditBill(n,B.isRecurring)})(G)}),t.jsx($i,{initialOpenThreadRequest:N??void 0,location:a,navigate:e,currentTenant:D,billId:n,companyId:O,billDetailsView:B,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:J,isInternationalPaymentShaVsOurEnabled:i,vendor:B.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:I,isRecurringBillsFeatureEnabled:y,hasZeniAccountsAdminAccess:Y,isZeniAccountsUser:M,isBillPayAdmin:$,isSuperAdmin:q,isDetectInsufficientFundsEnabled:E,sameDayAchDisablementConfig:x,isAiCfoAccessEnabled:V,onAskAiCfoClick:W})]})}const Sa=(e,a,l)=>{let n=`/${e}/bill/`;return l==null?n=a!=null?n.concat(`new/vendor/${encodeURIComponent(a)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=a!=null?n.concat(`${encodeURIComponent(a)}/edit`):n.concat("create")),n},Li=(e,a)=>{let l=`/${e}/bill/`;return l=a===void 0?l.concat("new/review"):l.concat(`${a}/edit/review`),l},Gi=(e,a,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(a)}/edit/ach`),n},Ui=(e,a,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(a)}/edit/domestic`),n},R="paymentDetails",_i=(e,a,l,n,c,r,u)=>{const o={invoiceNumber:a.whatFor.invoiceNumber,memo:a.whatFor.memo,invoiceDate:a.whatFor.invoiceDate?pe(a.whatFor.invoiceDate.toString()):_a(),billDueDate:a.whatFor.billDueDate?pe(a.whatFor.billDueDate.toString()):void 0,currencyCode:a.whatFor.currency,recipientCurrencyCode:a.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:a.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:a[R]?.paymentDate?pe(a[R].paymentDate.toString()):void 0,paymentType:a[R]?.paymentType!=null?a[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===a[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:a[R]?.paymentType?.method!=null&&a[R].paymentType.method.includes(Kt)&&u?.vendorCurrencyCode===he.currencyCode&&c?a[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=a[R]?.recurringPaymentType?.selectedOption===Ri.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:a[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Xt(a[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:a[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(a[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:a[R]?.recurringPaymentDetails?.startDate?pe(a[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:a[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:a[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:a[R]?.recurringPaymentDetails?.updateRecurringBills},y=Mi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,a.lineItems,n,l),h=Object.keys(y).length>0?Wn(y):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:y,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Mi=(e,a,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=a.find((p=>p.classId===o.class.selectedOption)));const d=qn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Ni=U.div`
93
- display: flex;
94
- height: 100vh;
95
- width: 100%;
96
- flex: 1 1 auto;
97
- flex-direction: column;
98
- align-items: center;
99
- background-color: ${e=>e.theme.colors.grey4};
100
- box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
101
- `,Oi=Q((function(e,a){const{vendorId:l,billId:n}=a,c=ye(e,l),r=Me(e,a.isVendorRecommendationEnabled,a.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:a.bankAccountContext}}),(function(e,a){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=a,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(tn(s))},onSaveHandler:()=>{e(an(a.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(en({data:i}))},onCancel:()=>{(()=>{const s=H(c.state?.pathnameStackToGoBack),i=s.poppedPathname??ya();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(la())},onAddressClick:s=>{const i=Xe(o,s,l),d=T(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Qt({fetchState:"Not-Started"}));const s=H(a.location.state?.pathnameStackToGoBack),i=s.poppedPathname??ya(0);a.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(la())}}}))(Kn);function Yi(){const e=K(),a=X(),l=Ie(),{vendorId:n,billId:c}=ae(),{useFeatureGate:r}=oe(),u=ue(),o=L.getSignedInUser(),s=k((h=>Z(h))),i=H(a.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=k((h=>ye(h,n))),{isFeatureEnabled:m}=r(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(g.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):t.jsxs(Ni,{windowSize:l,children:[t.jsx(Ke,{vendorId:n,billId:c}),t.jsx(Oi,{location:a,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:y})]})}const ya=(e=2)=>{let a="../";for(let l=0;l<e;l++)a=`${a}../`;return a},zi=U.div`
102
- display: flex;
103
- height: 100vh;
104
- width: 100%;
105
- flex: 1 1 auto;
106
- flex-direction: column;
107
- align-items: center;
108
- background-color: ${e=>e.theme.colors.grey4};
109
- box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
110
- `,Hi=Q((function(e,a){const{vendorId:l}=a,n=ye(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",a.billId),u=n.editVendorState??n.newVendorState,o=a.billId!=null?e.editBillDetailViewState.editBillStateById[ln(a.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:a.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}}),(function(e,a){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=a,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(a.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(cn(s)),p&&e(dn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(rn(s,i,d,!1))},onCancel:()=>{(()=>{const s=H(c.state?.pathnameStackToGoBack),i=s.poppedPathname??fa();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(sa())},onAddressClick:s=>{const i=Xe(o,s,l),d=T(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=H(a.location.state?.pathnameStackToGoBack),i=s.poppedPathname??fa(0);a.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(sa())}}}))(Xn);function Zi(){const e=K(),a=X(),l=Ie(),{vendorId:n,billId:c}=ae(),r=le(),u=ue(),o=L.getSignedInUser(),s=k((x=>Z(x))),i=H(a.state?.pathnameStackToGoBack),[d,p]=S.useState(!1),m=k((x=>x.vendorViewState.newVendorState.fetchStatus.fetchState)),y=k((x=>n!=null?x.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started")),h=n!==void 0?y:m;S.useEffect((()=>{d===!1&&h==="Not-Started"&&n!=null&&(r(ge(!1,n)),p(!0))}),[d,h,n]);const[b,I]=S.useState(!1);S.useEffect((()=>{b||h==="In-Progress"||(I(!0),r(nn(c,n)))}),[b,h,r]);const E=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",C=k((x=>ye(x,n)));if(o==null)throw Error("Can't access international wire page without signing in...");return E==="billDetail"&&C.editVendorState?.saveStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:C.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):t.jsxs(zi,{windowSize:l,children:[t.jsx(Ke,{vendorId:n,billId:c}),t.jsx(Hi,{location:a,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:E})]})}const fa=(e=2)=>{let a="../";for(let l=0;l<e;l++)a=`${a}../`;return a},Ia=U.div`
111
- display: flex;
112
- height: 100vh;
113
- width: 100%;
114
- flex: 1 1 auto;
115
- flex-direction: column;
116
- align-items: center;
117
- background-color: ${e=>e.theme.colors.grey4};
118
- box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
119
- `,Wi=Q((function(e,a){const l=L.getSignedInUser(),n=za(e,a.billId),c=mn(e),r=Ae(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Ma(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:a.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,a){const{location:l,billId:n,currentTenant:c,navigate:r}=a,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=T(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Ea({billId:n,data:s})),e(_e(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Aa({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Na("pending_approval"))},onClickEdit:()=>{a.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Te(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{a.billId!=null&&e(Ce(a.billId,"retry"))}}}))(ei);function va(){const e=K(),a=le(),l=X(),{billId:n}=ae(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(g.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(g.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(g.isBillPayCommentingEnabled),m=H(l.state?.pathnameStackToGoBack),{poppedPathname:y}=m,{isFeatureEnabled:h}=c(g.isRecurringBillsFeatureEnabled),b=k((C=>Z(C))),I=k((C=>za(C,n))),E=I.fetchState??"Not-Started";if(S.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),S.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),S.useEffect((()=>{const C=I.vendor?.name,x=I.vendor?.id,_=I.totalAmount.amount,D=I.recipientTotalAmount.amount,B=I.invoiceNumber;C&&x&&a(pn(C,x,_,D,B,n))}),[]),y==null)return t.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return E==="In-Progress"?t.jsx(Ia,{windowSize:o,children:t.jsx(Qn,{})}):t.jsx(Ia,{windowSize:o,children:t.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:h,isDetectInsufficientFundsEnabled:u})})}const qi=Q((function(e,a){const{vendorId:l}=a,n=e.entityAutoCompleteState.autoCompleteText.common,c=ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:a.vendorViewDetails,screenType:r,filesEndPoint:`${Za.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,a){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=a,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,a.billId)),i!=null&&e(An(i))},saveVendorDetailLocalData:i=>{e(Ya({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Cn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(ra(u))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?qa(s,a.billId,u):ui(s,a.billId,u):p=di(s,a.billId,u);const m=T(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?kn(i,"vendor",u):wn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(vn({files:i}))},onEditFileName:(i,d)=>{e(In(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(ra(a.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(yn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=H(a.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ci(n.tenantEmailDomain,a.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(Sn(i,"BillPayVendor"))},onResendOtp:i=>{e(gn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(hn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(bn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Oa(i,!1))}}}))(ii),Be=()=>{const e=K(),a=le(),l=ai(),n=X(),{billId:c,vendorId:r}=ae(),u=k((b=>Z(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(g.isBillPayLocalCurrencyFeatureEnabled),[i,d]=S.useState(!1),p=k((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=k((b=>ye(b,r))),y=k((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?y:p;return S.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(a(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?t.jsx(ti,{}):h==="Error"?t.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):t.jsxs(t.Fragment,{children:[t.jsx(Ke,{vendorId:r,billId:c}),t.jsx(qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=Q((function(e,a){const{companyId:l}=a;return{billPaySetupView:En(e,l),analytics:j,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,a){const{companyId:l,navigate:n}=a;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(li),Ki=()=>{const e=oi(),a=K(),l=X(),{tenantEmailDomain:n}=ae(),[c,r]=S.useState(!1),u=ue(),o=k((h=>Z(h))),s=o.companyId??L.getSignedInUserTenant(n)?.companyId,i=L.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),y=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?t.jsx(ee,{to:"../../../bills"}):p===!0&&m===!0?t.jsx(ee,{to:"../../bills/setup"}):p===!1||d!=null&&Ye(o,d.loggedInUserRoleMap)?t.jsxs(t.Fragment,{children:[t.jsx(Ee,{analytics:j,onLoad:h=>(b=>b.trackPageLoaded(Wa.Event.billPayPromoPage))(h)}),t.jsx(Ka,{isAppContentDrawerOpen:c,handleDrawerToggle:y}),t.jsx(Ji,{companyId:s,navigate:a,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{y(!0)}})]}):t.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function Po(){const e=k(($=>Z($))),a=fe(),l=de(a?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(g.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Zi:Yi,{isFeatureEnabled:o}=c(g.isDebitCardFeatureEnabled),s=$a(o,e),i=La(e),d=X(),p=e?.userRole!=null&&ka(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(a?.loggedInUserRoleMap),y=Va(a?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Tn(a?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,I=b&&Ga(a?.loggedInUserRoleMap),{isFeatureEnabled:E}=c(g.isChargeCardFeatureEnabled),C=si(e,E,o)&&!p,x=C&&jn(a?.loggedInUserRoleMap),_=Pn(a?.loggedInUserRoleMap),D=Ua(a?.loggedInUserRoleMap),B=Fn(a?.loggedInUserRoleMap),N=b&&D,V=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&B,W=Rn(a?.loggedInUserRoleMap),O=Vn(a?.loggedInUserRoleMap),v=$n(a?.loggedInUserRoleMap),Y=C&&W,{tenantEmailDomain:M}=ae();return t.jsxs(ot,{children:[d.pathname.includes("/bills")?t.jsxs(t.Fragment,{children:[t.jsx(f,{path:"setup",element:t.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:y,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:_,productType:"bill_pay",type:"setup"})}),t.jsx(f,{path:"verification",element:t.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:y,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:_,productType:"bill_pay",type:"verification"})}),t.jsx(f,{path:"promo",element:t.jsx(Ki,{})}),t.jsx(f,{path:"approval-rules/*",element:m?t.jsx(bi,{}):t.jsx(hi,{showZeniAccountRoute:N,isUserHasBillPayAccess:O,isUserHasReimbursementAccess:v,showTreasuryRoute:V,isTenantBankingOnly:s,showChargeCardRoute:Y,tenantEmailDomain:M??""})}),t.jsx(f,{path:"international-wire",element:t.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:y,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:_,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&t.jsx(f,{path:"*",element:t.jsx(ji,{})}),(s===!0||i===!0)&&t.jsx(f,{path:"/*",element:t.jsx(Xa,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&t.jsx(f,{path:"*",element:t.jsx(ee,{to:"../setup"})}),a!=null&&Ye(e,a.loggedInUserRoleMap)&&t.jsx(f,{path:"*",element:t.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?t.jsxs(t.Fragment,{children:[t.jsx(f,{path:"new",element:t.jsx(w,{appContent:t.jsx(ga,{})})}),t.jsx(f,{path:":billId",element:t.jsx(w,{appContent:t.jsx(Si,{})})}),t.jsx(f,{path:":billId/edit",element:t.jsx(w,{appContent:t.jsx(ga,{})})}),t.jsx(f,{path:"new/review",element:t.jsx(w,{appContent:t.jsx(va,{})})}),t.jsx(f,{path:":billId/edit/review",element:t.jsx(w,{appContent:t.jsx(va,{})})}),t.jsx(f,{path:"/:billId/:addressType",element:t.jsx(w,{appContent:t.jsx(ua,{isSubPage:!0})})}),t.jsx(f,{path:"/new/:addressType",element:t.jsx(w,{appContent:t.jsx(ua,{isSubPage:!0})})}),t.jsx(f,{path:"new/vendor/create",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:"new/vendor/create/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:"new/vendor/create/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:"new/vendor/create/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:":billId/edit/vendor/create",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:"*",element:t.jsx(xe,{})})]}):t.jsx(f,{path:"*",element:t.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${n.colors.dropShadowNormal}`}})}),t.jsx(f,{path:"*",element:t.jsx(xe,{})})]})}export{Po as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-DR8KfETq.js";import{z as m}from"./index-CHaKE3QQ.js";import{g as n}from"./QBOConnectionScreen-CXR9MUeu.js";import"./sentry-FwaDhTzy.js";import{g as p,N as a}from"./core-Dh_SHcAD.js";import"./zeni-epic-state-DJh0-ZeR.js";import"./recharts-BTL88W4R.js";import"./mui-BYn_Ugho.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./empty-XI8MiQF0.js";import"./pdf-lib-DdZd3IiB.js";import"./index-B23hmQHl.js";import"./url-DHu7Ejzz.js";import"./index-D3h8toFn.js";import"./decodeURIComponentSafe-B9wRnGXi.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,20 +0,0 @@
1
- import{j as d}from"./liveblocks-DR8KfETq.js";import{i as q,j as _,g as H,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-Dh_SHcAD.js";import{fF as L,VP as He,bE as sa,br as Ee,Xa as vn,ka as An,Xb as Yt,Xc as In,kd as gt,Xd as Qe,Xe as En,ki as Tn,Xf as Gt,Xg as xn,km as bt,Xh as We,Xi as Dn,Xj as wn,W7 as Pn,lo as On,Xk as Fn,bn as Je,Xl as ra,WN as ue,bc as ia,lC as ca,ll as la,WP as me,WO as ae,fE as da,ga as jn,gq as Ct,Xm as Rn,Xn as Bn,Xo as ua,Xp as Oe,DV as Me,DW as Ue,Ei as Te,Ec as pe,D_ as Le,Xq as Mn,b$ as Ve,Xr as Un,Xs as Ln,Xt as ma,Xu as Fe,Xv as Vn,ei as et,A6 as pa,Xw as Yn,Xx as ha,Xy as Gn,Xz as Xn,XA as Nn,XB as St,UL as kt,u6 as xe,l$ as De,Es as yt,Ad as $n,Ak as zn,XC as Kn,XD as qn,DX as Xt,XE as Qn,A9 as Ae,A4 as fa,XF as be,XG as Nt,XH as Wn,XI as vt,UK as At,Ch as ga,XJ as Zn,XK as ba,XL as Hn,XM as Jn,XN as eo,XO as It,Cw as to,CD as ao,XP as no,XQ as oo,DZ as $t,XR as so,Cf as Ca,XS as Ce,XT as zt,XU as ro,bq as _a,Ex as Sa,XV as io,XW as ka,XX as co,XY as lo,XZ as uo,X_ as Et,Ep as mo,Er as po,X$ as ho,Y0 as fo,DY as Kt,Y1 as go,Ev as ya,Y2 as _e,Y3 as qt,Y4 as bo,Y5 as Co,Y6 as va,lQ as Aa,pX as Ia,lV as Ea,pV as Ta,pU as xa,pT as Da,BE as _o,dc as So,pQ as ko,U6 as yo,q5 as vo,Y7 as Ao,Y8 as Io,Y9 as Eo,b5 as Tt,p$ as To,ic as xo,gI as Do,p_ as wo,le as Po,pY as Oo,pW as Fo,d_ as jo,dZ as Ro}from"./zeni-epic-state-DJh0-ZeR.js";import{z as V,aw as oe,p as j,j as T,G as Q,bc as Bo,at as Ye,a9 as Ge,bd as wa,S as N,be as Mo,bf as Pa,E as Uo,bg as Lo,bh as Vo,a as Oa,a2 as Fa,e as ja,as as Yo,bi as Go,ap as Xo,c as we,bj as Ra,s as ce,bk as Ba,bl as Ma,av as Ua,bm as No,aj as Xe,Q as Ne,A as Y,bn as $o,o as zo,h as Ko,a5 as qo,ar as Qo,bo as Wo,bp as Zo,bq as Ho,br as Ie}from"./index-CHaKE3QQ.js";import{n as xt}from"./mui-BYn_Ugho.js";import{a as b}from"./sentry-FwaDhTzy.js";import{w as La}from"./withTransactionSidePanel-DLRTZIl6.js";import{c as Va,t as Pe,f as he,b as Dt,a as wt,v as Jo}from"./routePaths-DXpM4tZj.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-PLm72Ozi.js";import Be from"./NotFoundScreen-BG5HsGgf.js";import{u as Pt}from"./useInitialThreadRequest-DLA6PIFe.js";import{t as Ya}from"./analyticsHelper-Czpx502m.js";import{C as es}from"./CompanyPassportScreen-Cvbu6LUT.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-CJfIwtxx.js";import{F as as}from"./FeaturePreviewScreen-vWprV4-Z.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./TransactionDetailScreen-Dmc1SB66.js";import"./decodeURIComponentSafe-B9wRnGXi.js";import"./expenseAutomationHelper-jy143DnO.js";import"./stripSplatSuffix-CvpfThkG.js";import"./MobileAppDrawer-D3MVdjfj.js";import"./InboxNotificationsProvider-D6QvVVj8.js";import"./useTaskManagerAccess-D4PJ1zkK.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]="a531876c-acb5-49cf-8cfc-22510a28a99f",e._sentryDebugIdIdentifier="sentry-dbid-a531876c-acb5-49cf-8cfc-22510a28a99f")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=q(),p=H(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>vn(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(An(o,u))}),[u]),v=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Yt({sortKey:E,sortOrder:B}))}),[]),x=b.useCallback((E=>{C(Yt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),D=b.useCallback((()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",u.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&D()}),[D,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:T,onTransactionClick:P,onReload:I,onBackClick:v,onColumnSortConfigChanged:S,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ye({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),C=b.useCallback(((S,x)=>{e(Qe({sortKey:x,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),I=b.useCallback(((S,x)=>{}),[]),v=b.useCallback(((S,x)=>{e(Qe({selectedDate:S,agingDateSelectionType:x})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:T,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:T,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:v,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((D=>L(D))),{tenantEmailDomain:l}=q(),m=H(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((D=>En(D,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Tn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),v=b.useCallback(((D,E)=>{u(Gt({sortKey:D,sortOrder:E}))}),[]),S=b.useCallback((D=>{u(Gt({downloadState:D}))}),[]),x=b.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(l!=null){const E=Va({id:D.transactionId,type:D.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&T.trackArAgingDetail("AR Aging",c.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:T,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:v,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((v=>xn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ye({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((v=>L(v))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((v=>{e(We({searchString:v}))}),[]),u=b.useCallback(((v,S)=>{e(We({sortKey:S,sortOrder:v}))}),[]),C=b.useCallback((v=>{a(`./${v}/${p.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((v=>{e(We({downloadState:v}))}),[]),k=b.useCallback(((v,S)=>{e(We({selectedDate:v,agingDateSelectionType:S})),e(bt(v))}),[]),I=b.useCallback(((v,S)=>{e(Dn({nodeId:v,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:T,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Xa(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:Q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Xa)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:Q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Xa)(Pa);function ls(){const e=J(),a=H(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=H(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=xt.div`
2
- display: flex;
3
- flex: 1 1 auto;
4
- min-height: 100%;
5
- flex-direction: column;
6
- background-color: ${e=>e.theme.colors.grey4};
7
- `,ms=xt.div`
8
- display: flex;
9
- flex: 1 1 auto;
10
- flex-direction: column;
11
- align-items: center;
12
- background-color: ${e=>e.theme.colors.grey4};
13
- `;function ps({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=J(),i=z(),l=H(),{tenantEmailDomain:m}=q(),p=Uo();return d.jsxs(us,{children:[d.jsx(Lo,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:p.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:h=>{h.trim().length>=2?i(me({searchString:h,searchOrigin:"navbar"})):h.trim().length===0&&i(ae("navbar"))},onAutoCompleteEntity:h=>{n!=null&&T?.trackSearch(N.Event.search,hs(a),h.type,h.name,n);const f=he(h,m),c=j(l.state?.pathnameStackToGoBack,l.pathname);s(f,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:d.jsx(Vo,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(ms,{children:a==="cash_balance"?d.jsx(ls,{}):d.jsx(ds,{})})]})}function Qt(){const e=H(),a=z(),t=_((c=>c.cashBalanceState.fetchState)),n=_((c=>c.cardBalanceState.fetchState)),o=V.getSignedInUser();if(o==null)throw Error("Can't access dashboard detail without signing in...");const r=ra((c=>{const u=ia(c,"/").split("/");return u[u.length-1]})(e.pathname));let s="Not-Started",i="";const l=Q.getLocalizedStrings();switch(r){case"cash_balance":s=t,i=l.common.texts.cashBalance;break;case"card_balance":s=n,i=l.reportTitleById.card_balance;break;default:console.error(`${r} is not supported!`)}const{isAiCfoAccessEnabled:m,onAskAiCfoClick:p}=se({mobileExploreReferrer:r==="card_balance"?"Card Balance":"Cash Balance"});Ye({isDataReady:s==="Completed"});const h=_((c=>c.entityAutoCompleteState.autoCompleteText.navbar)),f=_((c=>ue(c,"navbar")));return b.useEffect((()=>{s==="Not-Started"&&(function(c,u){switch(u){case"card_balance":c(la());break;case"cash_balance":c(ca());break;default:throw new Error(`balance report type ${u} is not yet supported`)}})(a,r)}),[o,a,s]),d.jsxs(d.Fragment,{children:[s==="Completed"?d.jsx(Ge,{analytics:T,onLoad:c=>((u,C)=>{switch(C){case"card_balance":u.trackPageLoaded(N.Event.cardBalance);break;case"cash_balance":u.trackPageLoaded(N.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,r)}):null,d.jsx(ps,{title:i,reportId:r,autoCompleteText:h,entityAutoCompleteView:f,isAiCfoAccessEnabled:m,onAskAiCfoClick:p})]})}const hs=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},fs=[],Wt="insights_section";function $e(e){const{mobileExploreReferrer:a}=e,t=z(),n=J(),o=H(),{tenantEmailDomain:r}=q(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Oa(),l=Fa(),m=Ua(l),p=oa(),h=_((R=>R.tenantState.fetchState==="Completed"||R.tenantState.activeTenantFetchState.fetchState==="Completed"?L(R):void 0)),f=h?.masterTOSInfo?.isMasterTOSAccepted??!1,c=_((R=>da(R))),u=c.uiState?.currentChatSessionId,C=c.allSessionsWithOrderedQuestionAnswers??fs,g=V.getSignedInUser()?.userId,k=ja(),I=Yo()&&k&&r!=null,v=Go(),S=Xo(!0),x=_((R=>v!=null?jn(R,v):void 0)),{useDynamicConfig:P}=we(),{configValue:D}=P(Ra.aiCfoMessageDynamicConfig),E=b.useMemo((()=>Array.isArray(D.default_message_list)?D.default_message_list:[]),[D.default_message_list]),B=b.useMemo((()=>E.slice(0,2)),[E]),y=v!=null&&x!=null&&x.fetchState!=="Completed"&&x.fetchState!=="Error"&&(S||x.fetchState==="In-Progress"),w=b.useMemo((()=>{if(v==null||x?.fetchState==="Error")return B;if(y)return[];const R=(x?.suggestedQuestions??[]).map((ie=>ie.trim())).filter((ie=>ie.length>0)).slice(0,2);return R.length===0?B:R}),[B,y,v,x?.fetchState,x?.suggestedQuestions]),re=b.useCallback(((R,ie)=>{if(g==null||R.trim()==="")return;if(!f)return void ce({location:o,navigate:n,mergeState:{referrer:a,aiCfoInitialQuestion:R,aiCfoInitialSubmissionSource:Wt,aiCfoSuggestionIndex:ie}});const qe=Ba(p.getState());if(m){const at=j(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:at,referrer:a,aiCfoInitialQuestion:R,aiCfoShouldSubmit:!qe}})}else{if(qe)return t(Ct(R)),void s(!0);i(R),s(!0),Ma(t,R,Wt,u,C,g,ie,void 0)}}),[C,u,t,f,m,o,a,n,s,i,p,r,g]),Ke=b.useCallback((()=>{if(f)if(m){const R=j(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:R,referrer:a}})}else s(!0);else ce({location:o,navigate:n,mergeState:{referrer:a}})}),[f,m,o,a,n,s,r]);return b.useMemo((()=>{if(I)return{isSuggestedQuestionsLoading:y,onAskSomethingElseClick:Ke,onSuggestedQuestionClick:re,suggestedQuestions:w}}),[I,y,Ke,re,w])}const ze=No,gs=ne((function(e){const a=Rn(e),t=Bn(e),n=ua(e),{scrollPosition:o,...r}=n,s=Q.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=V.getSignedInUser(),l=e.tenantState.currentTenantId,m=L(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=ue(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:T,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Mn(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Le(t,n)),e(Oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(Te("month")),e(pe(a.firstMonthOfFY,t)),e(Oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ue(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onElementCollapseStateChanged:(t,n)=>{e(Oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(me({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=he(t,a.tenantEmailDomain),o=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(ze),bs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Xe(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashInCashOut"}),i=$e({mobileExploreReferrer:"DashboardCashInCashOut"}),l=_((m=>ua(m))).mode==="compare_mode";return d.jsx(gs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Ve(o("dashboard_report_filters"))})},Cs=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},_s=ne((function(e){const a=Un(e),t=Ln(e),n=ma(e),{scrollPosition:o,...r}=n,s=Q.getLocalizedStrings().reportTitleById.cash_position,i=V.getSignedInUser(),l=e.tenantState.currentTenantId,m=L(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=ue(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:T,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Vn(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Le(t,n)),e(Fe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(pe(a.firstMonthOfFY,t)),e(Fe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ue(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Cs(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(me({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=he(t,a.tenantEmailDomain),o=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Fe({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}}))(ze),Ss=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Xe(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashPosition"}),i=$e({mobileExploreReferrer:"DashboardCashPosition"}),l=_((m=>ma(m))).mode==="compare_mode";return d.jsx(_s,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Ve(o("dashboard_report_filters"))})},$=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!==t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))},ks=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},ys=ne((function(e){const a=pa(e),t=Yn(e),n=ha(e),o=Gn(e),r=Xn(e),s=Nn(e),i=St(e),{scrollPosition:l,...m}=i,p=t.reportTitle,h=V.getSignedInUser(),f=e.tenantState.currentTenantId,c=L(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=ue(e,"navbar"),I=kt(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:T,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:De(e),isAccountingProjectsEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Wn(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Le(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(pe(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ue(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=ks(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?wt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(Nt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(be({scrollPosition:t})):e(Nt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(me({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=he(t,a.tenantEmailDomain),o=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ae(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Xt({viewMode:"account_group"})),e(fa(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(be({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Burn Rate"),e(Xt({viewMode:t})),e(Qn({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(qn({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(Kn({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e($n()),a.isAccountingProjectsEnabled&&e(zn())},onResyncReports:()=>{e(yt(a.accountViewMode==="project"?"net_burn_or_income_by_projects":"net_burn_or_income_by_classes"))}}}))(ze),vs=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Xe(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=$e({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=_((y=>St(y))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=_((y=>vt(y.forecastState,c??""))),C=_((y=>pa(y))),g=_((y=>At(y))),k=_((y=>De(y))),I=_((y=>xe(y))),v=_((y=>ha(y).uiState.accountViewMode)),S=p.mode==="compare_mode",x=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const y=u?.forecastPeriod,w=x!=null&&y.endDate.isAfter(x?.endDate)===!0?x:y;a(pe(e.firstMonthOfFY,{startDate:w.endDate.startOf(f),endDate:w?.endDate}))}}),[c]);const P=Ne(),{useFeatureGate:D}=we(),{isFeatureEnabled:E}=D(Y.isReportsCommentingEnabled),B=Pt(E?P?.currentTenant?.companyId:void 0,{clearParams:C.fetchState==="Completed"});return d.jsx(ys,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:k,isAccountingProjectsEnabled:I,accountViewMode:v,isCompareModeOn:S,navigate:o,analytics:T,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:B,isReportsCommentingEnabled:E,meetingUrl:Ve(s("dashboard_report_filters"))})},As=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Is=ne((function(e){const a=ga(e),t=Zn(e),n=ba(e),o=Hn(e),r=Jn(e),s=eo(e),i=It(e),{scrollPosition:l,...m}=i,p=Q.getLocalizedStrings().common.texts.operatingExpenses,h=V.getSignedInUser(),f=e.tenantState.currentTenantId,c=L(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=ue(e,"navbar"),I=kt(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:T,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:De(e),isAccountingProjectsEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(ro(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Le(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(pe(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ue(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=As(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?wt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(Ce({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(zt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(Ce({scrollPosition:t})):e(zt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(me({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=he(t,a.tenantEmailDomain),o=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ae(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t=="forecast_mode"?(e($t({viewMode:"account_group"})),e(Ca(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(Ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Operating Expenses"),e($t({viewMode:t})),e(so({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(oo({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(no({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(to()),a.isAccountingProjectsEnabled&&e(ao())},onResyncReports:()=>{e(yt(a.accountViewMode==="project"?"operating_expenses_by_projects":"operating_expenses_by_classes"))}}}))(ze),Es=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Xe(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardOpEx"}),m=$e({mobileExploreReferrer:"DashboardOpEx"}),p=_((w=>It(w))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=_((w=>vt(w.forecastState,c??""))),C=_((w=>ga(w))),g=_((w=>At(w))),k=_((w=>De(w))),I=_((w=>xe(w))),v=_((w=>ba(w).uiState.accountViewMode)),S=p.mode==="compare_mode",x=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const w=u?.forecastPeriod,re=x!=null&&w.endDate.isAfter(x?.endDate)===!0?x:w;a(pe(e.firstMonthOfFY,{startDate:re.endDate.startOf(f),endDate:re?.endDate}))}}),[c]);const P=Ne(),D=P?.loggedInUserRole!=null&&_a(P?.loggedInUserRole)!==!0,{useFeatureGate:E}=we(),{isFeatureEnabled:B}=E(Y.isReportsCommentingEnabled),y=Pt(B?P?.currentTenant?.companyId:void 0,{clearParams:C.fetchState==="Completed"});return d.jsx(Is,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:k,isAccountingProjectsEnabled:I,accountViewMode:v,isCompareModeOn:S,navigate:o,forecastIdFromUrlPath:r,analytics:T,hasTransactionAccess:D,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:y,isReportsCommentingEnabled:B,meetingUrl:Ve(s("dashboard_report_filters"))})},Ts=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},xs=ne((function(e){const a=Sa(e),t=io(e),n=ka(e),o=co(e),r=lo(e),s=uo(e),i=Et(e),{scrollPosition:l,...m}=i,p=Q.getLocalizedStrings().common.texts.revenue,h=V.getSignedInUser(),f=e.tenantState.currentTenantId,c=L(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,k=ue(e,"navbar"),I=kt(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:T,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:k},isZeniCOAUsed:I,isAccountingClassesEnabled:De(e),isAccountingProjectsEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(bo(t))},onTimeframeSelectionChanged:t=>{e(Te(t)),setTimeout((()=>e(_e({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Le(t,n)),e(_e({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(pe(a.firstMonthOfFY,t)),e(_e({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Me(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ue(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(_e({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Ts(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?wt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(_e({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(qt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(_e({scrollPosition:t})):e(qt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(me({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=he(t,a.tenantEmailDomain),o=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ae(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Kt({viewMode:"account_group"})),e(ya(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(_e({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Revenues"),e(Kt({viewMode:t})),e(go({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(fo({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(ho({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(mo()),a.isAccountingProjectsEnabled&&e(po())},onResyncReports:()=>{e(yt(a.accountViewMode==="project"?"revenue_by_projects":"revenue_by_classes"))}}}))(ze),Ds=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Xe(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardRevenue"}),m=$e({mobileExploreReferrer:"DashboardRevenue"}),p=_((y=>Et(y))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=_((y=>vt(y.forecastState,c??""))),C=_((y=>Sa(y))),g=C.dataAvailable,k=p.mode==="compare_mode",I=_((y=>De(y))),v=_((y=>xe(y))),S=_((y=>ka(y).uiState.accountViewMode)),x=_((y=>At(y)));b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const y=u?.forecastPeriod,w=g!=null&&y.endDate.isAfter(g?.endDate)===!0?g:y;a(pe(e.firstMonthOfFY,{startDate:w.endDate.startOf(f),endDate:w?.endDate}))}}),[c]);const P=Ne(),{useFeatureGate:D}=we(),{isFeatureEnabled:E}=D(Y.isReportsCommentingEnabled),B=Pt(E?P?.currentTenant?.companyId:void 0,{clearParams:C.fetchState==="Completed"});return d.jsx(xs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:I,isAccountingProjectsEnabled:v,accountViewMode:S,isCompareModeOn:k,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:T,reportsResyncFetchState:x.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:B,isReportsCommentingEnabled:E,meetingUrl:Ve(s("dashboard_report_filters"))})},ws=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Ps=ne((function(e){const a=Co(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ue(e,"navbar");return{report:a,analytics:T,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}}),(function(e,a){return{onTimeframeSelectionChanged:t=>{T.trackTimeframeSwitch(Ya(t),"Top Expenses"),e(va(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=ws(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(me({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=he(t,a.tenantEmailDomain),o=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))($o),Os=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Ps,{tenantEmailDomain:a,location:t,navigate:n})},Fs=xt.div`
14
- display: flex;
15
- flex: 1 1 auto;
16
- min-height: 100%;
17
- flex-direction: column;
18
- background-color: ${e=>e.theme.colors.grey5};
19
- align-items: center;
20
- `;function js({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=J(),r=H(),{tenantEmailDomain:s}=q();let i;Ye({isDataReady:!0});const l={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(Es,{...l});break;case"revenue":i=d.jsx(Ds,{...l});break;case"net_burn_or_income":i=d.jsx(vs,{...l});break;case"cash_position":i=d.jsx(Ss,{...l});break;case"top_expenses":i=d.jsx(Os,{...l});break;case"cash_in_cash_out":i=d.jsx(bs,{...l});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(Fs,{children:i}):null}function le(){const e=H(),a=z(),{forecastId:t}=q();let n="Not-Started";const o=_((c=>It(c).fetchState)),r=_((c=>Et(c).fetchState)),s=_((c=>St(c).fetchState)),i=_((c=>c.cashPositionState.fetchState)),l=_((c=>c.topExState.fetchState)),m=_((c=>c.cashInCashOutState.fetchState));if(V.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const p=_((c=>L(c))),h=p?.company?.companyInfo?.firstMonthOfFY??1,f=ra((c=>{const u=ia(c,"/").split("/");return t!=null?u[u.length-3]:u[u.length-1]})(e.pathname));switch(f){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=l;break;case"cash_in_cash_out":n=m;break;default:console.error(`${f} is not supported!`)}return b.useEffect((()=>{n==="Not-Started"&&(function(c,u,C,g){switch(u){case"operating_expenses":c(Da(!0)),g!=null&&(c(Ae(C,!0,3,{id:g,index:0})),c(Ca(!1,g)));break;case"revenue":c(xa(!0)),g!=null&&(c(Ae(C,!0,3,{id:g,index:0})),c(ya(!1,g)));break;case"net_burn_or_income":c(Ta(!0)),g!=null&&(c(Ae(C,!0,3,{id:g,index:0})),c(fa(!1,g)));break;case"cash_position":c(Ea(!0));break;case"top_expenses":c(Ia());break;case"cash_in_cash_out":c(Aa());break;default:throw new Error(`report type ${u} is not yet supported`)}})(a,f,h,t)}),[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(Ge,{analytics:T,onLoad:c=>((u,C)=>{const g=e.state?.referrer;switch(C){case"operating_expenses":u.trackPageLoaded(N.Event.operatingExpenses,g);break;case"revenue":u.trackPageLoaded(N.Event.revenues,g);break;case"net_burn_or_income":u.trackPageLoaded(N.Event.burnRate,g);break;case"cash_position":u.trackPageLoaded(N.Event.cashPosition,g);break;case"top_expenses":u.trackPageLoaded(N.Event.topExpenses,g);break;case"cash_in_cash_out":u.trackPageLoaded(N.Event.cashInCashOut,g);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,f)}):null,d.jsx(js,{firstMonthOfFY:h,fetchState:n,reportId:f,forecastId:t})]})}var ct=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function lt(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),(function(){t(window.event)}))}function Na(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function $a(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Ot={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ct?173:189,"=":ct?61:187,";":ct?59:186,"'":222,"[":219,"]":221,"\\":220},de={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},_t={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},U={16:!1,18:!1,17:!1,91:!1},M={},Ze=1;Ze<20;Ze++)Ot["f".concat(Ze)]=111+Ze;var O=[],Zt=!1,za="all",Ht=[],tt=function(e){return Ot[e.toLowerCase()]||de[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Jt(e){za=e||"all"}function Re(){return za||"all"}var dt=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;$a(a).forEach((function(s){var i=s.split(r),l=i.length,m=i[l-1],p=m==="*"?"*":tt(m);if(M[p]){t||(t=Re());var h=l>1?Na(de,i):[];M[p]=M[p].filter((function(f){return!((!n||f.method===n)&&f.scope===t&&(function(c,u){for(var C=c.length>=u.length?c:u,g=c.length>=u.length?u:c,k=!0,I=0;I<C.length;I++)g.indexOf(C[I])===-1&&(k=!1);return k})(f.mods,h))}))}}))};function ea(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,U)Object.prototype.hasOwnProperty.call(U,r)&&(!U[r]&&a.mods.indexOf(+r)>-1||U[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||U[16]||U[18]||U[17]||U[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function ta(e,a){var t=M["*"],n=e.keyCode||e.which||e.charCode;if(X.filter.call(this,e)){if(n!==93&&n!==224||(n=91),O.indexOf(n)===-1&&n!==229&&O.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(u){var C=_t[u];e[u]&&O.indexOf(C)===-1?O.push(C):!e[u]&&O.indexOf(C)>-1?O.splice(O.indexOf(C),1):u==="metaKey"&&e[u]&&O.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(O=O.slice(O.indexOf(C))))})),n in U){for(var o in U[n]=!0,de)de[o]===n&&(X[o]=!0);if(!t)return}for(var r in U)Object.prototype.hasOwnProperty.call(U,r)&&(U[r]=e[_t[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(O.indexOf(17)===-1&&O.push(17),O.indexOf(18)===-1&&O.push(18),U[17]=!0,U[18]=!0);var s=Re();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&ea(e,t[i],s,a);if(n in M){for(var l=0;l<M[n].length;l++)if((e.type==="keydown"&&M[n][l].keydown||e.type==="keyup"&&M[n][l].keyup)&&M[n][l].key){for(var m=M[n][l],p=m.splitKey,h=m.key.split(p),f=[],c=0;c<h.length;c++)f.push(tt(h[c]));f.sort().join("")===O.sort().join("")&&ea(e,m,s,a)}}}}function X(e,a,t){O=[];var n=$a(e),o=[],r="all",s=document,i=0,l=!1,m=!0,p="+",h=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(l=a.keyup),a.keydown!==void 0&&(m=a.keydown),a.capture!==void 0&&(h=a.capture),typeof a.splitKey=="string"&&(p=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(p)).length>1&&(o=Na(de,e)),(e=(e=e[e.length-1])==="*"?"*":tt(e))in M||(M[e]=[]),M[e].push({keyup:l,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:p,element:s});s!==void 0&&!(function(f){return Ht.indexOf(f)>-1})(s)&&window&&(Ht.push(s),lt(s,"keydown",(function(f){ta(f,s)}),h),Zt||(Zt=!0,lt(window,"focus",(function(){O=[]}),h)),lt(s,"keyup",(function(f){ta(f,s),(function(c){var u=c.keyCode||c.which||c.charCode,C=O.indexOf(u);if(C>=0&&O.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&O.splice(0,O.length),u!==93&&u!==224||(u=91),u in U)for(var g in U[u]=!1,de)de[g]===u&&(X[g]=!1)})(f)}),h))}var ut={setScope:Jt,getScope:Re,deleteScope:function(e,a){var t,n;for(var o in e||(e=Re()),M)if(Object.prototype.hasOwnProperty.call(M,o))for(t=M[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Re()===e&&Jt(a||"all")},getPressedKeyCodes:function(){return O.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=tt(e)),O.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(M).forEach((function(t){var n=M[t].find((function(o){return o.scope===a&&o.shortcut===e}));n&&n.method&&n.method()}))},unbind:function(e){if(e===void 0)Object.keys(M).forEach((function(s){return delete M[s]}));else if(Array.isArray(e))e.forEach((function(s){s.key&&dt(s)}));else if(typeof e=="object")e.key&&dt(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),dt({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Ot,modifier:de,modifierMap:_t};for(var mt in ut)Object.prototype.hasOwnProperty.call(ut,mt)&&(X[mt]=ut[mt]);if(typeof window<"u"){var Rs=window.hotkeys;X.noConflict=function(e){return e&&window.hotkeys===X&&(window.hotkeys=Rs),X},window.hotkeys=X}X.filter=function(){return!0};var aa=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Bs(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,l=o.keydown,m=o.filterPreventDefault,p=m===void 0||m,h=o.enabled,f=h===void 0||h,c=o.enableOnContentEditable,u=c!==void 0&&c,C=b.useRef(null),g=b.useCallback((function(k,I){var v,S;return s&&!s(k)?!p:!!(aa(k,["INPUT","TEXTAREA","SELECT"])&&!aa(k,r)||(v=k.target)!=null&&v.isContentEditable&&!u)||!!(C.current===null||document.activeElement===C.current||(S=C.current)!=null&&S.contains(document.activeElement))&&(a(k,I),!0)}),n?[C,r,s].concat(n):[C,r,s]);return b.useEffect((function(){if(f)return i&&l!==!0&&(t.keydown=!1),X(e,t||{},g),function(){return X.unbind(e,g)};X.unbind(e,g)}),[g,e,f]),C}X.isPressed;const Ms=[],pt="dashboard_card",te="ai_cfo_dashboard_card";function na(e,a){return a?e.some((t=>String(t)===te))?e.slice():[te,...e]:e.filter((t=>String(t)!==te))}const Us=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","rewards_card"],Ls=(e,a,t,n,o)=>({card:{dimension:Tt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),je=(e,a,t,n,o)=>({card:{dimension:Tt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),Vs=(e,a,t,n)=>je(void 0,e,Ie,a,t),Ys=e=>{const a=Tt(Ie);return a.height=Ie.height+10,{card:{dimension:a,cardType:te,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},Gs=ne((function(e,a){const t=$s(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i}=a;let l=n.map(((m,p)=>{if(m==="reimbursement_promo_card"||m==="bill_pay_promo_card")return Vs(t,m,p);if(m==="zeni_promo_card")return je({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,Ie,m,p);if(m==="information_card")return je(void 0,"Completed",Ie,m,p);if(m===te)return Ys(p);{const h=o.find((f=>f?.reportId===m));return h?(function(f,c,u,C){const g=f.reportId;switch(g){case"card_balance":case"cash_balance":return[Ls(f,c,u,g,C)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"rewards_card":return[je(f,c,u,g,C)];case"net_burn_or_income_story_card":return[je(f,c,u,"net_burn_or_income_story_card",C)];default:return console.error(`card type ${g} not yet supported!`),[]}})(h,h.fetchState,Ie,p):[]}})).flat();return a.isSummaryCardsFiltered===!0&&(l=l.filter((m=>Us.includes(m.card.cardType)==0)).filter((m=>{const p=m.data?.availableNumberOfPeriods;return p!=null?p>0:m.card.cardType!="top_expenses"||m.data==null||(function(h){if(h==null||h.length===0)return!0;let f=!0;for(const c of h)if(c.balance.available.amount!==0){f=!1;break}return f})(m.data.topExpenses.accountsOrdered)===!1}))),{cardDataArray:l,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ue(e,"navbar")},analytics:T,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}}),(function(e,a){const t=a.tenantId,n=V.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)T.trackDashboardCardClicked("cards promo",2),T.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&T.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(T.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),(function(i,l,m,p){if(l!==te)switch(l){case"card_balance":i(la());break;case"cash_balance":i(ca());break;case"operating_expenses":i(Da(!0));break;case"revenue":i(xa(!0));break;case"net_burn_or_income":i(Ta(!0));break;case"net_burn_or_income_story_card":i(Fo(!0));break;case"cash_position":i(Ea(!0));break;case"top_expenses":i(Ia());break;case"cash_in_cash_out":i(Aa());break;case"insights_dashboard":i(Oo());break;case"bill_pay_card":i(Po());break;case"reimbursement_card":i(wo());break;case"company_details":i(Do(m));break;case"task_card":i(xo());break;case"accounts_payable_aging":p.includes("accounts_payable_aging")===!1&&i(gt(Ee()));break;case"accounts_receivable_aging":i(bt(Ee()));break;case"rewards_card":p.includes("rewards_card")===!1&&i(To(!0));break;default:throw new Error(`report type ${l} is not yet supported`)}})(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{T.trackTimeframeSwitch(Ya(r),Ns(o),"Dashboard"),(function(s,i,l){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(Te(l));break;case"top_expenses":s(va(l));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}})(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Eo(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:o=>{if(o==="bill_pay_promo_card"){const r="../bills",s=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}else if(o==="reimbursement_promo_card"){const r="../reimbursements",s=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(T.trackUpdateBurnRateCalculatorSettings(r,s,Ao(s)),e(Io(t,r,s)))}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(me({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(ae("navbar"))},onCancelAutoComplete:()=>{e(ae("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?he(o,a.tenantEmailDomain):Jo(o.zeniId,o.qboId,a.tenantEmailDomain);const s=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}}))(Ho);function Xs(){const e=oa(),a=Fa(),t=Ua(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=Oa(),s=J(),i=z(),l=H(),m=V.getSignedInUser(),{useFeatureGate:p,useDynamicConfig:h}=we(),[f,c]=b.useState(!1),[u,C]=b.useState(!1),g=ja(),{tenantEmailDomain:k}=q(),{isAiCfoAccessEnabled:I,onAskAiCfoClick:v}=se({mobileExploreReferrer:"Dashboard"}),S=_((A=>A.tenantState.fetchState==="Completed"||A.tenantState.activeTenantFetchState.fetchState==="Completed"?L(A):void 0)),x=S??V.getSignedInUserTenant(k),P=S?.masterTOSInfo?.isMasterTOSAccepted??!1,D=x.tenantId,E=x.companyId;b.useEffect((()=>{f===!1&&l.state?.message==="activation"&&(i(_o(E)),c(!0))}),[l.state,f,E,i]),b.useEffect((()=>{g&&!u&&l.state?.message==="open_ai_cfo_drawer"&&(C(!0),P?(o(!0),s({pathname:l.pathname,search:l.search,hash:l.hash},{replace:!0,state:{...l.state,message:void 0}})):ce({location:l,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))}),[l,u,g,P,o,s]);const{isFeatureEnabled:B}=p(Y.isApAgingFeatureEnabled),y=zo(),w=Ko(y),{isFeatureEnabled:re}=p(Y.isArAgingFeatureEnabled),{isFeatureEnabled:Ke}=p(Y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:R}=p(Y.isReferralFeatureEnabled),{isFeatureEnabled:ie}=p(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:qe}=p(Y.isAiCfoFileUploadEnabled),{isFeatureEnabled:at}=p(Y.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Ka}=p(Y.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:qa}=p(Y.aiAuditScorePercentage),{configValue:Ft}=h(Ra.zeniCardsConfig),Qa=Ft.charge_card_cashback_rate_per_transaction==null?.0175:Ft.charge_card_cashback_rate_per_transaction;if(l.state?.message==="activation"){const A=qo(l.state?.pathnameStackToGoBack);s(l.pathname,{state:{...l.state,message:void 0,pathnameStackToGoBack:A.newStack}})}const[jt,Wa]=b.useState(!1),[nt,Za]=b.useState(!1);Bs("command+p, Control+p",(A=>{Za(!nt),A.preventDefault()}),{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[nt]);const Rt=S?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const fe=_((A=>L(A)?.excludedResources)),Ha=_((A=>A.expenseAutomationViewState.selectedPeriodByTenantId)),Ja=!!S?.companyReimbursementInfo?.info?.isReimbursementEnabled,en=!!S?.companyBillPayInfo?.info?.isBillPayEnabled,tn=Ne(),K=[],Bt=fe?.resources?.find((A=>A.resource==="/reports/top_expenses"))==null,an=fe?.resources?.find((A=>A.resource==="/reports/task_card"))==null,Mt=S?.userRole!=null&&_a(S?.userRole),nn=fe?.resources?.find((A=>A.resource==="/bills"))==null&&!Mt,on=fe?.resources?.find((A=>A.resource==="/reimbursements"))==null,sn=So(tn?.loggedInUserRoleMap),rn=S?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,cn=S?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1;Bt===!1&&K.push("top_expenses"),an===!1&&K.push("task_card"),nn===!1&&K.push("bill_pay_card","bill_pay_promo_card"),B===!1&&K.push("accounts_payable_aging"),re===!1&&K.push("accounts_receivable_aging"),(y===!1||Mt)&&K.push("expense_automation_card"),on===!1&&K.push("reimbursement_card","reimbursement_promo_card"),K.push("zeni_accounts_promo_card","treasury_promo_card"),R===!1&&K.push("rewards_card");const{areTenantIdsInSync:Ut}=Qo();b.useLayoutEffect((()=>{jt&&w===y||Rt!==!0||!Ut||fe?.fetchState!=="Completed"&&fe?.fetchState!=="Error"||(Wa(!0),i(ko(m.userId,E,D,!0,!1,K)))}),[jt,m,D,i,Bt,Rt,fe?.fetchState,Ut]);const ln=_((A=>A.reportUIOptionsState.forecastOnDashboard.isForecastModeOn)),dn=_((A=>A.revenueState.uiState.selectedForecast?.id)),un=_((A=>A.cardBalanceState.fetchState)),ge=_((A=>yo(A,K))),mn=ge.fetchState,pn=b.useMemo((()=>na(ge.cardsOrdered,I)),[ge.cardsOrdered,I]),hn=b.useMemo((()=>na(ge.cardsForDashboardUI,I)),[ge.cardsForDashboardUI,I]);Ye({isDataReady:!0});const{isSuggestedQuestionsLoading:fn,suggestedPromptQuestions:gn}=ts(),Lt=_((A=>da(A))),Se=Lt.uiState?.currentChatSessionId,ot=Lt.allSessionsWithOrderedQuestionAnswers??Ms,{currentSessionQuestionAnswers:bn}=Wo(ot,Se),Vt=bn.length===0,Cn=b.useCallback(((A,W,ee)=>{const ke=m?.userId;if(ke==null)return;const G=A.trim();if(G.length===0&&W.length===0)return;if(!P)return void ce({location:l,navigate:s,mergeState:{referrer:"Dashboard",...G.length>0?{aiCfoInitialQuestion:G,aiCfoInitialSubmissionSource:pt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}:{}}});const Z=Ba(e.getState()),ye=()=>{const ve=j(l.state?.pathnameStackToGoBack,l.pathname);s(`/${k}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:ve,referrer:"Dashboard",aiCfoInitialQuestion:G,aiCfoShouldSubmit:!Z&&G.length>0,aiCfoInitialSubmissionSource:pt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}})};return t?W.length>0?void o(!0):void ye():W.length>0?Z?(i(Ct(G)),void o(!0)):(r(G.length>0?G:null),o(!0),void(G.length>0&&Ma(i,G,pt,Se,ot,ke,ee,W.length>0?W:void 0))):(Z&&i(Ct(G)),void ye())}),[ot,Se,i,P,t,l,s,r,o,m?.userId,e,k]),_n=b.useCallback((()=>{P?o(!0):ce({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[P,l,s,o]),Sn=b.useCallback((()=>{if(!P)return void ce({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});if(k==null)return;const A=j(l.state?.pathnameStackToGoBack,l.pathname);s(`/${k}/ai-cfo/explore`,{state:{pathnameStackToGoBack:A,referrer:"Dashboard"}})}),[P,l,s,k]),kn=b.useCallback((()=>{if(P)if(t){if(k==null||S==null)return;const A=Se==null||Vt?`/${k}/ai-cfo/explore`:`/${k}/ai-cfo/${Se}`,W=l.state?.pathnameStackToGoBack??[],ee=j(W,l.pathname);s(A,{state:{...l.state,pathnameStackToGoBack:ee,[Zo]:!0}})}else ce({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});else ce({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[P,t,l,s,k,S,Se,Vt]);return d.jsxs(d.Fragment,{children:[mn==="Completed"?d.jsx(Ge,{analytics:T,onLoad:A=>{A.trackPageLoaded(N.Event.dashboard)}}):null,d.jsx(Gs,{maxColumns:n?2:void 0,isAiCfoAccessEnabled:I,onAskAiCfoClick:v,onAiCfoDashboardOpenPanel:_n,onAiCfoDashboardOpenScopePage:kn,isAiCfoFileUploadEnabled:qe===!0&&t===!1,onAiCfoDashboardPromptSubmit:Cn,onAiCfoDashboardExpandToFullPage:Sn,aiCfoDashboardShouldClearPromptOnSubmit:P,aiCfoDashboardSuggestedPromptQuestions:gn,aiCfoDashboardSuggestedPromptQuestionsLoading:fn,onDragAndDropCard:(A,W)=>{if(A===te||W===te)return;const ee=(function(Z,ye,ve){const st=ve.indexOf(Z),rt=ve.indexOf(ye);if(st===-1||rt===-1||st===rt)return ve;const it=[...ve];return it.splice(st,1),it.splice(rt,0,Z),it})(A,W,pn),ke=ee.filter((Z=>Z!==te)),G=ge.cardsOrdered;(ke.length!==G.length||ke.some(((Z,ye)=>Z!==G[ye])))&&i(vo(ke))},dashboardReport:ge,passedCardsOrdered:hn,tenantId:D,companyId:E,tenantEmailDomain:k,location:l,navigate:s,isApAgingFeatureEnabled:B,isArAgingFeatureEnabled:re,isBillPayEnabled:en,isReimbursementEnabled:Ja,isSummaryCardsFiltered:nt,isForecastOn:ln,selectedForecastOnDashboard:dn,isVisitingFirstTime:f,isZeniAccountEnabled:Ke,isRewardsFeatureEnabled:R,selectedPeriod:Ha[D],isChargeCardFeatureEnabled:ie,isUserHasCardsAccess:sn,cardsCreditLimit:rn,cashbackRate:Qa,isInterestedInChargeCard:cn,cardBalanceFetchState:un,christmasAnimationEnabled:at,newYearAnimationEnabled:Ka,aiAuditScorePercentageEnabled:qa})]})}const Ns=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},$s=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map((a=>a.fetchState)).reduce(((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t));function ht(){return d.jsxs(ft,{children:[d.jsx(F,{path:"/",element:d.jsx(le,{})}),d.jsx(F,{path:"/:forecastId",element:d.jsx(le,{})}),d.jsx(F,{path:"/:forecastId/*",element:d.jsx(Be,{})})]})}function vr(){const e=Ne(),a=e?.excludedResources?.find((m=>m.resource==="/reports/top_expenses"))==null,{useFeatureGate:t}=we(),{isFeatureEnabled:n}=t(Y.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(Y.isArAgingFeatureEnabled),r=_((m=>L(m))),{isFeatureEnabled:s}=t(Y.isDebitCardFeatureEnabled),i=jo(s,r),l=Ro(r);return i===!0||l===!0?d.jsx(ft,{children:d.jsx(F,{path:"/*",element:d.jsx(as,{})})}):d.jsxs(ft,{children:[d.jsx(F,{path:"/",element:d.jsx(Xs,{})}),d.jsx(F,{path:"cash_balance/*",element:d.jsx(Qt,{})}),d.jsx(F,{path:"card_balance/*",element:d.jsx(Qt,{})}),d.jsx(F,{path:"operating_expenses/*",element:d.jsx(le,{})}),d.jsx(F,{path:"operating_expenses/forecast/*",element:d.jsx(ht,{})}),d.jsx(F,{path:"revenue/forecast/*",element:d.jsx(ht,{})}),d.jsx(F,{path:"revenue/*",element:d.jsx(le,{})}),d.jsx(F,{path:"net_burn_or_income/forecast/*",element:d.jsx(ht,{})}),d.jsx(F,{path:"net_burn_or_income/*",element:d.jsx(le,{})}),n===!0&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_payable_aging/*",element:d.jsx(os,{})}),d.jsx(F,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:d.jsx(ns,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(ss,{})}),d.jsx(F,{path:"accounts_receivable_aging/*",element:d.jsx(rs,{})})]}),d.jsx(F,{path:"cash_position/*",element:d.jsx(le,{})}),d.jsx(F,{path:"top_expenses/*",element:a===!0?d.jsx(le,{}):d.jsx(Be,{})}),d.jsx(F,{path:"cash_in_cash_out/*",element:d.jsx(le,{})}),d.jsx(F,{path:"company_details",element:d.jsx(es,{})}),d.jsx(F,{path:"referrals/*",element:d.jsx(yn,{to:"../../rewards/refer",replace:!0})}),d.jsx(F,{path:"*",element:d.jsx(Be,{})})]})}export{vr as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DR8KfETq.js";import{a as r}from"./sentry-FwaDhTzy.js";import{ax as d,ay as l,Y as p,a5 as m}from"./index-CHaKE3QQ.js";import"./mui-BYn_Ugho.js";import c from"./NotFoundScreen-BG5HsGgf.js";import{h as u,g as b}from"./core-Dh_SHcAD.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]="a5e9faae-533a-4537-9e13-bf2297ecdf01",e._sentryDebugIdIdentifier="sentry-dbid-a5e9faae-533a-4537-9e13-bf2297ecdf01")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),f=r.useCallback((()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=d(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:f}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1,12 +0,0 @@
1
- import{j as g}from"./liveblocks-DR8KfETq.js";import{a as u}from"./sentry-FwaDhTzy.js";import{u as O,g as _,h as w,t as M,j as l,N as L}from"./core-Dh_SHcAD.js";import{z as r,E as P,G as V,R as A,j as N,S as R,$,a0 as G,U as W}from"./index-CHaKE3QQ.js";import{fF as q,TT as B,Uk as H,Ub as J,gi as K,gk as Q,Ug as X,gU as Y,dj as Z,Ul as ee,Um as te}from"./zeni-epic-state-DJh0-ZeR.js";import{n as ne}from"./mui-BYn_Ugho.js";import{u as se}from"./useDeviceId-CUJxM_KE.js";import{f as ae}from"./analyticsHelper-Czpx502m.js";import{t as ie}from"./getLocaleForTenant-BTnTjmTv.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="d5b26c12-eb16-443b-90f5-4deb6af4a9e6",t._sentryDebugIdIdentifier="sentry-dbid-d5b26c12-eb16-443b-90f5-4deb6af4a9e6")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=O(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),b=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>q(e))),h=l((e=>B(e))),D=r.getSignedInUser(),v=P().mode;u.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),u.useEffect((()=>{b!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(h.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,h.tenantsInOrder),Y().then((()=>{const e=W();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[b,S,y,s,o,h,v,a.state,t]);const E=u.useCallback((()=>{m("/signin/auth")}),[m]),j=u.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),F=u.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return g.jsx($,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:E});if(b==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||D!=null){const e=a.state?.origin??"/";return g.jsx(L,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",U=n!=null&&r.getLastUsedMagicLinkToken()===n;return g.jsx(L,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:U,magicLinkExpired:!U&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return g.jsx(oe,{"data-testid":"smooth-loader",children:g.jsx(G,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- z-index: 9999;
11
- background-color: ${t=>t.theme.colors.background};
12
- `;export{Te as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-DR8KfETq.js";import{h as r,l as n}from"./core-Dh_SHcAD.js";import{an as i}from"./index-CHaKE3QQ.js";import"./mui-BYn_Ugho.js";import"./sentry-FwaDhTzy.js";import"./zeni-epic-state-DJh0-ZeR.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="3be885cb-07f5-4896-9ae7-ddcb5a1e09f4",o._sentryDebugIdIdentifier="sentry-dbid-3be885cb-07f5-4896-9ae7-ddcb5a1e09f4")}catch{}})();const a=n(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DR8KfETq.js";import E from"./NotFoundScreen-BG5HsGgf.js";import{a as r}from"./sentry-FwaDhTzy.js";import{h as _,g as v,j as p,i as M,u as O,N as U,l as P,n as z,o as h}from"./core-Dh_SHcAD.js";import{fF as F,a0Y as b,bo as B,bn as N,iL as V,gh as L}from"./zeni-epic-state-DJh0-ZeR.js";import{O as Y,z as I,at as $,dO as q}from"./index-CHaKE3QQ.js";import"./mui-BYn_Ugho.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-PLm72Ozi.js";import{M as H}from"./MobileAppDrawer-D3MVdjfj.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./InboxNotificationsProvider-D6QvVVj8.js";import"./useTaskManagerAccess-D4PJ1zkK.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]="9d163e5a-e3f6-4de1-98d3-35f313146693",e._sentryDebugIdIdentifier="sentry-dbid-9d163e5a-e3f6-4de1-98d3-35f313146693")}catch{}})();const J=P((function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(q),K=()=>{const e=_(),t=v(),d=Y(),o=p((a=>F(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=O(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,c=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(L({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||c(a,i,!0),m.current=!0}),[n?.fetchState,c]),j=r.useCallback(((a,i)=>{c(a,i,!1)}),[c]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:d,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-DR8KfETq.js";import{z as b,a9 as N,j as d,S as D,e3 as E,c as k,A as I}from"./index-CHaKE3QQ.js";import"./mui-BYn_Ugho.js";import g from"./NotFoundScreen-BG5HsGgf.js";import{a as c}from"./sentry-FwaDhTzy.js";import{u as C,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-Dh_SHcAD.js";import{fF as V,a1T as j,a1U as p,DM as _,p$ as P,a1V as z,DK as A}from"./zeni-epic-state-DJh0-ZeR.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.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]="1de644f6-b66f-4928-80c4-39b0e2aae6b8",e._sentryDebugIdIdentifier="sentry-dbid-1de644f6-b66f-4928-80c4-39b0e2aae6b8")}catch{}})();const G=T((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(A())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(E),K=()=>{const e=C(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>V(o))),l=F(),w=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:d,onLoad:o=>(v=>v.trackPageLoaded(D.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:w,currentTenant:r,companyName:S,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(K,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};