@zeniai/web-app-ui 5.1.26-prod → 5.1.27-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/assets/AddressRoutes-BEx7pIyJ.js +1 -0
  2. package/dist/assets/{AddressScreen-ByA9gOjk.js → AddressScreen-NX75uxLP.js} +2 -2
  3. package/dist/assets/AiCfoScreen-CZb65z7d.js +22 -0
  4. package/dist/assets/{BillPayApprovalRoutes-B41eOE3R.js → BillPayApprovalRoutes-DpviM7Hj.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D3yh_i_J.js → BillPayRoutes-CEExTPhN.js} +17 -17
  6. package/dist/assets/BusinessVerificationPageScreen-BrTGOncN.js +9 -0
  7. package/dist/assets/ChargeCardRoutes-B1YXL7MO.js +71 -0
  8. package/dist/assets/CompanyPassportScreen-i0UsKfLm.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-C5vKD3w5.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-CiW0f9pK.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-OE4wpozP.js +23 -0
  12. package/dist/assets/{DashboardRoutes-DAOiWLdf.js → DashboardRoutes-7xj8FEBo.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-C_LTDU9P.js → DefaultTenantHome-ChjGBZYC.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-D6V50bQg.js +18 -0
  15. package/dist/assets/DrawerScreen-DJHmM0O7.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-C4efmnJS.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-D9ixaUzm.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-BAyL66YE.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-BPiwWr2-.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-cUIc5JL6.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-C33e3haJ.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-Ccb0x0R8.js → MobileAppDrawer-CZdE1-bN.js} +1 -1
  23. package/dist/assets/NotFoundScreen-DX_llqMh.js +1 -0
  24. package/dist/assets/NotificationRoutes-DaXop-Kw.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-pOZW-eNU.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-Co54bj0J.js +1 -0
  27. package/dist/assets/{PeopleRoutes-CMgX7Mvp.js → PeopleRoutes-9vWHHz2M.js} +5 -5
  28. package/dist/assets/PerformanceRoutes-sQeICA2b.js +1 -0
  29. package/dist/assets/{Preview-ChZVJfSR.js → Preview-BcqiqhZQ.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-BmEp7chx.js → QBOConnectionScreen-CfgNXch3.js} +1 -1
  31. package/dist/assets/ReferralListScreen-fPRYSLID.js +5 -0
  32. package/dist/assets/{ReimbursementApprovalRoutes-CenrPQKa.js → ReimbursementApprovalRoutes---hNOkvq.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CZcshpr3.js → ReimbursementApprovalRuleDetailScreen-Dyn7RSI8.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DA_TGypu.js → ReimbursementRoutes-BYrKyLZ5.js} +9 -9
  35. package/dist/assets/{ReportsRoutes-CyCaZypl.js → ReportsRoutes-CUKyDjF3.js} +1 -1
  36. package/dist/assets/RewardsRoutes-CaV3J1uX.js +1 -0
  37. package/dist/assets/ScreenRoutes-BFQCZFGJ.js +2 -0
  38. package/dist/assets/{SettingsRoutes-CjiQpWge.js → SettingsRoutes-CkJ075Ax.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-Bdqzu7Hl.js → SetupPagesScreen-XTexjMJo.js} +5 -5
  40. package/dist/assets/SignInScreen-pvkgtVi3.js +1 -0
  41. package/dist/assets/SignOutScreen-Cbyp-03M.js +9 -0
  42. package/dist/assets/TaskListScreen-D710Rpak.js +9 -0
  43. package/dist/assets/TaskRoutes-COd2p3oz.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-Dkt-kNK_.js → TransactionDetailRoutes-WDvIYLwr.js} +1 -1
  45. package/dist/assets/TransactionDetailScreen-BGtmtzWU.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-DgwIs0Nz.js → TransactionListRoutes-CYIV6Wye.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-DGqpKuqj.js +37 -0
  48. package/dist/assets/{VendorsRoutes-D1VRVPSk.js → VendorsRoutes-MGXSfJTY.js} +27 -27
  49. package/dist/assets/WiseConfirmationScreen-CaHgXzgN.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-BIYk_P7c.js → ZeniAccountRoutes-Bk5y1BRP.js} +9 -9
  51. package/dist/assets/ZeniAccountStatementScreen-BWYeePA_.js +9 -0
  52. package/dist/assets/{accountMappingHelper-CYu6jU4s.js → accountMappingHelper-spXTehHl.js} +1 -1
  53. package/dist/assets/{analytics-CASgnR6n.js → analytics-D1kzjJGV.js} +1 -1
  54. package/dist/assets/{analyticsHelper-D1p4ejZm.js → analyticsHelper-MLU40ae_.js} +1 -1
  55. package/dist/assets/{core-N0s35_fE.js → core-Csep4njy.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-CXvy74j0.js → decodeURIComponentSafe-C5ifH7fM.js} +1 -1
  57. package/dist/assets/{dnd-BMJ08YBo.js → dnd-Cjdb2KWD.js} +1 -1
  58. package/dist/assets/{empty-CkWtTRNj.js → empty-DUEvEoMc.js} +1 -1
  59. package/dist/assets/{empty-DNacijM1.js → empty-D_3geiNL.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-R5jfD8zD.js → emptyVideoElement-Wm2X1tw3.js} +1 -1
  61. package/dist/assets/epic-DeTdbD7V.js +2 -0
  62. package/dist/assets/getLocaleForTenant-BVJn38ps.js +1 -0
  63. package/dist/assets/{index-BdFcpF-I.js → index--68azm8o.js} +2 -2
  64. package/dist/assets/{index-DHjDIdF6.js → index-BhYWNhjL.js} +1 -1
  65. package/dist/assets/{index-psXZdLE6.js → index-Bkr1b7Ol.js} +1 -1
  66. package/dist/assets/{index-WIce7Jzu.js → index-BmlRyOVO.js} +1 -1
  67. package/dist/assets/{index-DziAUx1C.js → index-Brq6QGrX.js} +1 -1
  68. package/dist/assets/{index-BWl9EkTP.js → index-CNDQ8F1I.js} +1 -1
  69. package/dist/assets/{index-BF-vIcKE.js → index-Cz7ZsetT.js} +1 -1
  70. package/dist/assets/{index-DbeH7KTi.js → index-Dccod20C.js} +13630 -13431
  71. package/dist/assets/{lexical-DzS0LUFS.js → lexical-wVYu_9-d.js} +1 -1
  72. package/dist/assets/{liveblocks-B46P4ZcR.js → liveblocks-DAjhbt80.js} +1 -1
  73. package/dist/assets/{lottie-DB3mu-01.js → lottie-DYZ-hqab.js} +1 -1
  74. package/dist/assets/{mui-DhWmpMK0.js → mui-BwrnAXoT.js} +1 -1
  75. package/dist/assets/{pathToGoBack-BhT8KU67.js → pathToGoBack-odCpMm49.js} +1 -1
  76. package/dist/assets/{pdf-BVvV9sq4.js → pdf-Cc8ZGklh.js} +4 -4
  77. package/dist/assets/{pdf-lib-B_CfhBsB.js → pdf-lib-jdfyLvIR.js} +1 -1
  78. package/dist/assets/{plaid-B2IiVtoq.js → plaid-BKdRBTqL.js} +1 -1
  79. package/dist/assets/{pusher-Dhv4OKiF.js → pusher-BUjJSsoy.js} +1 -1
  80. package/dist/assets/{react-B1ACk3Eb.js → react-BrtFI20B.js} +1 -1
  81. package/dist/assets/{react-CTzt8SGa.js → react-C4jn9LlB.js} +1 -1
  82. package/dist/assets/{react-B-hDF_6R.js → react-CZYvjgmH.js} +1 -1
  83. package/dist/assets/{react-BFXBvClo.js → react-DLx9jDCf.js} +1 -1
  84. package/dist/assets/{react-Y9LIewHr.js → react-DbE9JPRz.js} +1 -1
  85. package/dist/assets/{react-OSRGnqr_.js → react-Dn4PiCyS.js} +1 -1
  86. package/dist/assets/{recharts-DuXbfpiI.js → recharts-D7BeuhCa.js} +1 -1
  87. package/dist/assets/{routePaths--_KyRjDB.js → routePaths-DiDc2DBY.js} +1 -1
  88. package/dist/assets/{sentry-CXX07pCD.js → sentry-BchnSYMz.js} +1 -1
  89. package/dist/assets/{url-Cijgqz18.js → url-DFsuq-eL.js} +1 -1
  90. package/dist/assets/{url-6luVziaP.js → url-UFdKDvUl.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-PggIL0s_.js → useAiCfoDashboardSuggestedQuestionsChips-CFwAZJWa.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-CR3Kbk6n.js +1 -0
  93. package/dist/assets/{useDeviceId-DOxJoKW5.js → useDeviceId-C6SeJyTl.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-ptt6uc3o.js → useInitialThreadRequest-C5nc3ybP.js} +1 -1
  95. package/dist/assets/{utils-DX2xeBme.js → utils-aai5Jslk.js} +1 -1
  96. package/dist/assets/withTransactionSidePanel-B8L5PzVM.js +21 -0
  97. package/dist/assets/{zeni-epic-state-CAiwtZ5t.js → zeni-epic-state-B_XLk_Px.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +11 -6
  100. package/dist/assets/AddressRoutes-Nl0UWLfm.js +0 -1
  101. package/dist/assets/AiCfoScreen-BCzSteHh.js +0 -22
  102. package/dist/assets/BusinessVerificationPageScreen-I5C_Yywl.js +0 -9
  103. package/dist/assets/ChargeCardRoutes-B9VQhoM2.js +0 -71
  104. package/dist/assets/CompanyPassportScreen-CS8Nn4oM.js +0 -1
  105. package/dist/assets/ConnectionAuthScreen-HhZ28cQl.js +0 -11
  106. package/dist/assets/CustomerOnboardingAuthScreen-Ck16zEDM.js +0 -1
  107. package/dist/assets/CustomerOnboardingRoutes-BuEi7cb0.js +0 -23
  108. package/dist/assets/DomesticWireDetailScreen-Dv9e8QF-.js +0 -18
  109. package/dist/assets/DrawerScreen-7HPSzk3i.js +0 -1
  110. package/dist/assets/EntityDetailRoutes-D-YQd9uN.js +0 -1
  111. package/dist/assets/ExpenseAutomationRoutes-CfUSGVeo.js +0 -25
  112. package/dist/assets/FeaturePreviewScreen-D57zRMza.js +0 -1
  113. package/dist/assets/HubSpotOAuthCallbackScreen-BKBvfuXT.js +0 -1
  114. package/dist/assets/MagicLinkRoutes-26XF-749.js +0 -72
  115. package/dist/assets/MagicLinkSignInScreen-B1muzh6J.js +0 -12
  116. package/dist/assets/NotFoundScreen-fVlJBxuj.js +0 -1
  117. package/dist/assets/NotificationRoutes-Ct5sjwGb.js +0 -1
  118. package/dist/assets/OAuthConsentScreen-7r1ZFwWl.js +0 -1
  119. package/dist/assets/PandLWithForecastRoutes-H7K0cSeQ.js +0 -1
  120. package/dist/assets/PerformanceRoutes-BPwPlQnr.js +0 -1
  121. package/dist/assets/ReferralListScreen-CTYCNTCb.js +0 -5
  122. package/dist/assets/RewardsRoutes-DsYYQbp5.js +0 -1
  123. package/dist/assets/ScreenRoutes-CjWzmFZ3.js +0 -2
  124. package/dist/assets/SignInScreen-DZGYpMjI.js +0 -1
  125. package/dist/assets/SignOutScreen-CNaRM7tn.js +0 -9
  126. package/dist/assets/TaskListScreen-D88Vqo1-.js +0 -9
  127. package/dist/assets/TaskRoutes-CU3OFJWc.js +0 -9
  128. package/dist/assets/TransactionDetailScreen-gTxn6K9t.js +0 -5
  129. package/dist/assets/TreasuryRoutes-CbzTC5AZ.js +0 -37
  130. package/dist/assets/WiseConfirmationScreen-BWG8SpkJ.js +0 -12
  131. package/dist/assets/ZeniAccountStatementScreen-BLmTVktT.js +0 -9
  132. package/dist/assets/epic-D_Wf2mn6.js +0 -2
  133. package/dist/assets/getLocaleForTenant-BGfzfBRc.js +0 -1
  134. package/dist/assets/useAskAiCfoHostNavButtonProps-DFthlJGq.js +0 -1
  135. package/dist/assets/withTransactionSidePanel-CKBjU5WR.js +0 -21
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-DbeH7KTi.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-CXX07pCD.js"><link rel="modulepreload" crossorigin href="/assets/core-N0s35_fE.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-CAiwtZ5t.js"><link rel="modulepreload" crossorigin href="/assets/mui-DhWmpMK0.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CASgnR6n.js"><link rel="modulepreload" crossorigin href="/assets/utils-DX2xeBme.js"><link rel="stylesheet" crossorigin href="/assets/index-Bc34frN_.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-Dccod20C.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-BchnSYMz.js"><link rel="modulepreload" crossorigin href="/assets/core-Csep4njy.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-B_XLk_Px.js"><link rel="modulepreload" crossorigin href="/assets/mui-BwrnAXoT.js"><link rel="modulepreload" crossorigin href="/assets/analytics-D1kzjJGV.js"><link rel="modulepreload" crossorigin href="/assets/utils-aai5Jslk.js"><link rel="stylesheet" crossorigin href="/assets/index-Bc34frN_.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.1.26-prod",
3
+ "version": "5.1.27-dev",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],
@@ -27,9 +27,9 @@
27
27
  "@sentry/core": "^9.42.1",
28
28
  "@sentry/react": "^9.42.1",
29
29
  "@stripe/stripe-js": "^4.4.0",
30
- "@zeniai/client-analytics": "2.0.20",
31
- "@zeniai/client-epic-state": "5.0.76",
32
- "@zeniai/web-components": "4.1.37",
30
+ "@zeniai/client-analytics": "2.0.19",
31
+ "@zeniai/client-epic-state": "5.0.75",
32
+ "@zeniai/web-components": "4.1.39",
33
33
  "color": "3.1.3",
34
34
  "cross-fetch": "^4.0.0",
35
35
  "crypto-js": "4.2.0",
@@ -118,7 +118,7 @@
118
118
  "license": "UNLICENSED",
119
119
  "scripts": {
120
120
  "start": "vite --mode development",
121
- "build": "tsc && NODE_OPTIONS=--max-old-space-size=16384 vite build --mode development",
121
+ "build": "pnpm lint-modified-files && pnpm tsc-modified-files && NODE_OPTIONS=--max-old-space-size=16384 vite build --mode development",
122
122
  "preview": "vite preview --mode development --host",
123
123
  "start_dev": "vite --mode development",
124
124
  "build_dev": "tsc && NODE_OPTIONS=--max-old-space-size=16384 vite build --mode development",
@@ -148,6 +148,10 @@
148
148
  "format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx|js)$' | xargs prettier --write || true",
149
149
  "format-staged": "git diff --cached --name-only --diff-filter=ACM | grep -E '\\.(ts|tsx|js)$' | xargs prettier --write || true",
150
150
  "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
151
+ "lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
152
+ "lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
153
+ "tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
154
+ "typecheck": "tsc --noEmit",
151
155
  "build-scripts": "pnpm run check-version && tsc --outDir scripts --target ES6 --module commonjs --esModuleInterop --skipLibCheck",
152
156
  "check-version": "node ./scripts/check_version.js",
153
157
  "//": "When publishing to NPM, use the version suffix -dev for DEV, -qa for QA, -next for NEXT and -prod version suffix for PROD.",
@@ -159,7 +163,8 @@
159
163
  "publish_delhi": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm lint && pnpm build_delhi && pnpm publish --tag delhi",
160
164
  "publish_mohali": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm lint && pnpm build_mohali && pnpm publish --tag mohali",
161
165
  "publish_next": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm lint && pnpm build_next && pnpm publish --tag next",
162
- "test": "pnpm vitest run",
166
+ "test": "pnpm lint-modified-files && pnpm vitest run",
167
+ "test:pusher": "pnpm vitest run src/screens/pusher/tests src/screens/chargeCard/tests src/screens/chargeCard/constants/tests",
163
168
  "version": "pnpm format && git add -A src",
164
169
  "postversion": "git push && git push --tags",
165
170
  "check-dependencies": "node ./scripts/check_dependencies.js",
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-B46P4ZcR.js";import{A as d}from"./AddressScreen-ByA9gOjk.js";import i from"./NotFoundScreen-fVlJBxuj.js";import"./sentry-CXX07pCD.js";import{o as s,p as r}from"./core-N0s35_fE.js";import"./zeni-epic-state-CAiwtZ5t.js";import"./recharts-DuXbfpiI.js";import"./index-DbeH7KTi.js";import"./mui-DhWmpMK0.js";import"./analytics-CASgnR6n.js";import"./plaid-B2IiVtoq.js";import"./dnd-BMJ08YBo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DB3mu-01.js";import"./lexical-DzS0LUFS.js";import"./pdf-BVvV9sq4.js";import"./utils-DX2xeBme.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,22 +0,0 @@
1
- import{j as c}from"./liveblocks-B46P4ZcR.js";import{a as r}from"./sentry-CXX07pCD.js";import{u as ge,h as Ce,g as Ie,j as J,i as be,n as ke}from"./core-N0s35_fE.js";import{U as xe,z as we,J as Pe,cP as Ee,cQ as Qe,b4 as Y,cR as Te,b3 as Z,p as D,x as L,d as I,cS as F,cT as ve,cU as ye,a1 as _e,f as Oe,a7 as Ae,cV as Ue,a2 as je,r as Le,b0 as Fe,cW as Re}from"./index-DbeH7KTi.js";import{fI as De,eO as ee,eP as Be,hH as Me,QN as Ve,eS as Ge,hR as Ne,hN as $e,eQ as R,ft as qe,fm as We,fq as X,fu as ze,fv as He,fw as Je,fx as Ye,fy as Xe}from"./zeni-epic-state-CAiwtZ5t.js";import{D as Ke,n as b,S as Ze,P as et}from"./mui-DhWmpMK0.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-PggIL0s_.js";import{p as st}from"./pathToGoBack-BhT8KU67.js";import"./recharts-DuXbfpiI.js";import"./analytics-CASgnR6n.js";import"./plaid-B2IiVtoq.js";import"./dnd-BMJ08YBo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DB3mu-01.js";import"./lexical-DzS0LUFS.js";import"./pdf-BVvV9sq4.js";import"./utils-DX2xeBme.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="18c754e6-2fe8-47e5-bb3e-488b9f80594d",a._sentryDebugIdIdentifier="sentry-dbid-18c754e6-2fe8-47e5-bb3e-488b9f80594d")}catch{}})();const te="chat-response-generated",ot=ke(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:Q}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",o.text,t,Re(Q,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Je(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Ye({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Xe({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(X(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(We());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=xe(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=J(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=be(),p=Pe(),o=_e(p),u=J(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:Q}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),T=Qe({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),x=l.state,w=x?.aiCfoInitialQuestion,B=!!x?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[Y]!==!0)return;h(!0);const g={...n};delete g[Y],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,v]=r.useState(null),[ne,y]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&w!=null&&w!==""){const n=l.state;v(w),y(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[w,B,l.state]);const le=r.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??x?.aiCfoRef,A=V.get("emailRefId")??x?.aiCfoEmailRefId,N=r.useRef(!1);r.useEffect(()=>{N.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),N.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(v(P),y(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:$}=Te(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:$.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[$]);r.useEffect(()=>{U!=="In-Progress"&&j&&s(Ne())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s($e(t,f.userId))},[q,W,t,f,s]);const H=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:H}),T.drawerElement,c.jsx(it,{children:c.jsx(K,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:H}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&T.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?T.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:Q,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ke,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(K,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ve,{open:S,onClose:()=>h(!1),children:c.jsx(ye,{children:Se})}):null]})},K=b(Ze)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,at=b.div`
6
- height: 100vh;
7
- width: 100%;
8
- `,nt=b.div`
9
- height: 100vh;
10
- width: 100%;
11
- display: flex;
12
- flex-direction: column;
13
- min-height: 0;
14
- `,it=b.div`
15
- flex: 1;
16
- min-height: 0;
17
- display: flex;
18
- flex-direction: column;
19
- `,rt=b(et)`
20
- box-shadow: ${({theme:a})=>a.colors.elevation2};
21
- color: ${({theme:a})=>a.colors.grey4};
22
- `;export{Et as default};
@@ -1,9 +0,0 @@
1
- import{j as k}from"./liveblocks-B46P4ZcR.js";import{a as N}from"./sentry-CXX07pCD.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-N0s35_fE.js";import{k as ce,S as ue,aN as de,z,x as pe,d as B,af as x,f as E,bB as le,at as me,r as P,au as R}from"./index-DbeH7KTi.js";import{Ni as fe,eP as G,se as ye,HK as Se,xZ as ge,AG as Ie,Dd as he,DS as be,EL as De,NF as Oe,NG as Te,NH as ke,NI as Ce,NJ as Ne,Kc as Ve,MH as we,Ko as Ae,km as _e,fE as Fe,fD as ve,fC as xe,qf as Ee,q6 as ze,q3 as Be,ke as Pe,sn as Re,sl as L,bE as M,sz as U,cv as Le}from"./zeni-epic-state-CAiwtZ5t.js";import{n as Me}from"./mui-DhWmpMK0.js";import{d as j}from"./routePaths--_KyRjDB.js";import{M as Ue}from"./MobileAppDrawer-Ccb0x0R8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="f9332228-9ed3-41d1-a5a8-ac3558585ecf",e._sentryDebugIdIdentifier="sentry-dbid-f9332228-9ed3-41d1-a5a8-ac3558585ecf")}catch{}})();const je=Me.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=Ve(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=we(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:V,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:H,transactionVolume:K,transactionVolumeDescription:Z,purposeOfAccount:$,purposeOfAccountDescription:J,regulatedStatus:W,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Le(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?M(o?.toString()):o,typeOfIncorporation:V?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:Z,purposeOfAccount:$?.selectedOption??"",purposeOfAccountDescription:J,regulatedStatus:W??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?M(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(L(i,t,r))},onSendForVerificationClick:t=>{e(L(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(Ee(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=N.useState(!1),[l,b]=N.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(N.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),N.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ne(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(je,{children:[k.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(E.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(E.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(E.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
@@ -1,71 +0,0 @@
1
- import{j as s}from"./liveblocks-B46P4ZcR.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as qt,p as ne}from"./core-N0s35_fE.js";import{eP as ce,bs as Ue,Pc as ka,eY as be,eZ as ye,e_ as Se,fT as $e,cs as ze,Pd as Ze,Pe as Ma,tt as ba,jO as ya,Pf as Sa,gT as oa,zZ as Je,z$ as Ga,A0 as $a,jE as mt,Pg as Ye,zN as Ct,Ph as Qt,Pi as Xt,zQ as Da,Pj as Jt,NC as _a,rF as pt,zW as za,h2 as en,Pk as ht,Pl as Ke,bq as an,Pm as tn,fE as Pa,fD as wa,Au as nn,fC as Ta,Ni as rn,Pn as ft,cl as gt,cM as sn,NB as da,B4 as on,Po as tt,AG as Fa,Pp as bt,B5 as cn,O1 as dn,B6 as ln,C0 as un,sP as mn,BW as Cn,Af as yt,A8 as pn,Pq as hn,fV as fn,Ao as St,As as It,fU as gn,Pr as bn,AS as At,Ps as yn,Pt as Sn,Pu as In,Aq as Et,Ab as kt,zT as Dt,Ak as _t,Ai as Pt,Am as An,z_ as nt,Pv as wt,Pw as va,AD as Ia,Kh as Tt,cN as Za,Px as En,Py as kn,Pz as Dn,PA as _n,AA as Va,AZ as Pn,AV as wn,Aw as Tn,AX as Fn,AN as vn,AP as xn,PB as Ft,B3 as vt,HG as Bn,PC as Ln,PD as Rn,PE as Un,PF as xt,PG as On,Bq as jn,AF as Bt,Az as ia,AE as Vn,PH as Nn,PI as Hn,zK as Mn,PJ as Lt,PK as Rt,PL as Gn,zM as $n,zL as rt,PM as zn,PN as Zn,PO as Yn,Kd as Kn,PP as Ya,PQ as Wn,wl as Ut,km as qn,gU as Qn,Bv as Xn,PR as Ot,PS as Jn,Bw as er,PT as ar,de as tr,tn as nr,Bl as rr,Bf as Re,bt as sr,bF as or,cx as ir,bG as cr,Jq as dr}from"./zeni-epic-state-CAiwtZ5t.js";import{z as J,k as je,S as se,c as Z,B as la,c2 as xa,cd as lr,p as ve,ce as ur,cf as mr,J as ua,aN as Fe,r as fe,bm as Ka,cg as Cr,F as ma,i as Ba,h as Wa,d as Q,D as qa,ch as pr,_ as jt,aq as Qa,by as Qe,ci as Na,cj as hr,x as Xa,a7 as fr,ck as gr,at as Vt,a2 as Ha,W as Nt,f as Ht,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,cq as Er,o as Aa,cr as kr,cs as Dr,ct as Ua,v as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,cy as vr,a9 as xr}from"./index-DbeH7KTi.js";import{n as _e,D as Mt,S as Br}from"./mui-DhWmpMK0.js";import{a as c}from"./sentry-CXX07pCD.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ve,A as Lr,h as Ja,P as Rr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Zt,p as Or,S as st}from"./SetupPagesScreen-Bdqzu7Hl.js";import{u as Yt}from"./useInitialThreadRequest-ptt6uc3o.js";import La from"./NotFoundScreen-fVlJBxuj.js";import{M as Ge}from"./MobileAppDrawer-Ccb0x0R8.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-DFthlJGq.js";import{v as ot}from"./utils-DX2xeBme.js";import{t as jr}from"./AddressScreen-ByA9gOjk.js";import"./recharts-DuXbfpiI.js";import"./analytics-CASgnR6n.js";import"./plaid-B2IiVtoq.js";import"./dnd-BMJ08YBo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DB3mu-01.js";import"./lexical-DzS0LUFS.js";import"./pdf-BVvV9sq4.js";import"./analyticsHelper-D1p4ejZm.js";import"./routePaths--_KyRjDB.js";import"./BusinessVerificationPageScreen-I5C_Yywl.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]="cb327b17-fe60-4189-93b5-7af2f54d10e0",e._sentryDebugIdIdentifier="sentry-dbid-cb327b17-fe60-4189-93b5-7af2f54d10e0")}catch{}})();function Vr(){const e=le(),{cardId:t}=ca(),a=ue(),r=J.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Ue(C?.loggedInUserRoleMap),{useFeatureGate:g}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=g(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:O}=g(Z.isDebitCardFeatureEnabled),v=be(n),D=ye(n),p=Se(O,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,b=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),l=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:u}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y(X=>$e(X,n.companyId)),R=ze(F.controllers),{creditAccount:B,creditAccountRepayment:T}=y(X=>Ze(X)),N=y(X=>X.classListState.fetchState),d=!E&&l&&f,h=y(X=>Ma(X,t,d,l)),[P,w]=c.useState(!1),U=h.chargeCard,j=U?.cardCreatedByUser?.userId,$=y(X=>j!=null?ba(X.userRoleState,j):void 0),H=$?.accountingClassIDs[0],V=y(X=>H!=null?ya(X.classState,{classId:H,reportId:"class_list"}):void 0),A=U?.cardHolderUser?.userId,L=y(X=>A!=null?ba(X.userRoleState,A):void 0),W=L?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",q=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,Y,q]),c.useEffect(()=>{P||h.fetchState==="Completed"||h.fetchState==="In-Progress"||t==null||(w(!0),a(Je(t,d,!1)))},[P,h,t,a]),c.useEffect(()=>{if(h.fetchState==="Completed"&&(Y===!1||Y&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,U,i);e(X)}},[h.fetchState,i,Y]),c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a($a()),N!=="Completed"&&N!=="In-Progress"&&a(mt())},[B.fetchState,T.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",oe=Oe(l,b,_,f),ee=Ca(l,f,m,B,T),te=Gt(x,h);return h.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(lr,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:R,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:f,productInformation:oe,creditAccountInformation:ee,debitAccountInformation:te,chargeCardDetailView:h,creditAccount:B,classListFetchState:N,creditAccountRepayment:T,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:L?.userRoles,cardHolderDepartmentName:k?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(mr);function Hr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(Z.isCardsCommentingEnabled),[g,I]=c.useState(!1),o=y(S=>Ye(S)),i=Yt(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),f=S.poppedPathname??Mr(n.tenantEmailDomain);e(f,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{g||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(I(!0),t(Ct()))},[g,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(ur,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m}=se(),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),u=p.max_charge_card_activation_attempts_by_card_id,b=y(k=>Xt(k,n)),l=b.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:F}=se(),{isFeatureEnabled:R}=F(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=F(Z.isDebitCardFeatureEnabled),T=Se(B,D),N=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:T}),d=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,h=D.userRole.includes("charge_card_user"),P=be(D),w=ye(D),U=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),$=!h&&j&&d;c.useEffect(()=>{g===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),I(!0)),o===!1&&b.fetchState==="Not-Started"&&(i(!0),a(Je(n,$,j)))},[o,b.fetchState,g,_]);const H=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(E===!1&&(H===!1||H&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&b.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(Jt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[b.fetchState,l?.type.code,E,b.isRefreshingViewInBackground]);const V=J.getZeniOtpTokenForCardHolder(n),A=y(k=>pt(k.userState,v.userId)),L=()=>{l?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{b.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(L,3e3),S(!0))},[b.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const W=k=>{O(k)};if(_!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(A?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:A.phone,signedInUser:v,isSandboxEnv:Ka(),chargeCardDetailState:b,signedInUserToken:V,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:u[n]!=null?u[n]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Zr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=en(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),g=t.updateStatus,I=Ke(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(an())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:g,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(nn(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(tn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Cr),Zr=_e.div`
2
- display: flex;
3
- flex-direction: column;
4
- width: ${e=>`${Gr.containerWidth.value(e.windowSize)}%`};
5
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
6
- `,Yr=_e.div`
7
- display: flex;
8
- min-height: 100%;
9
- width: 100%;
10
- flex: 1 1 auto;
11
- flex-direction: column;
12
- align-items: center;
13
- background-color: ${e=>e.theme.colors.grey4};
14
- `,Ea=qa.getLocalizedStrings().dateFormat,Kr={overlayWidth:new ma(100,100,58)},Wr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:dn(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:ln(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:C,isCashbackInfoFetchStateCompleted:m,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:I,controllerEmails:o,paymentDetails:i,productInformation:E,cashbackInformation:S,paymentSourceInformation:f,creditAccountInformation:O,debitAccountInformation:v,paymentInitiatedDate:D,sourcePage:p}=t,{tenantEmailDomain:u}=r;return{onBackNavigation:()=>{if(m&&g&&I&&S!=null&&Q.trackCardsPayEarlyFormClick(o,E,S,"Back",i.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:i.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:i.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:i.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:i.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Ea.visual.MMMDCommaYYYYformat)},f,O,v),p==="cardPaymentHistory")t.closeDrawerHandler(!0),e(bt());else{const b=Ve(u);a(b)}},onUpdatePaymentAccountStatus:(b,l,_)=>{e(Cn(b,l,"bill_pay","bill_pay_detail",_))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:b=>{e(mn("external_account",b))},onEstablishConnectionClick:b=>{e(un(b,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${u}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{C?window.open(`/${u}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(pr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:C,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:I,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:i,isCashbackInfoFetchStateCompleted:E,paymentInitiatedDate:S,retryRepayment:f})=>{const O=le(),{useDynamicConfig:v}=se(),{configValue:D}=v(Fe.zeniAccountsConfig),p=rn(D),u=y(z=>ft(z)),{creditAccount:b}=y(z=>Ze(z)),l=y(z=>ce(z)),_=Wa(),F=ua(),R=ue(),B=J.getSignedInUser(),T=je(),[N,d]=c.useState(!1),[h,P]=c.useState(!1),{configValue:w}=v(Fe.zeniCardsConfig),U=w.credit_card_auto_pay_threshold_by_company_id?.[l.companyId]??w.default_credit_card_auto_pay_threshold??Lr,j=gt(T?.loggedInUserRoleMap),$=sn(T?.loggedInUserRoleMap),H=!!l.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=y(z=>da(z,l.companyId)),A=V.companyChargeCardInfo?.primaryFundingAccount,L=V.allFundingAccounts.find(z=>z.id===A?.accountId),W=y(z=>$e(z,l.companyId)),k=ze(W.controllers);c.useEffect(()=>{if(u.fetchState!=="Completed"&&u.fetchState!=="In-Progress"&&R(on()),u.fetchState==="Completed"&&!h){const z=l.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=u.transferFromAccounts.find(ee=>ee.id===z);let oe;if(C==="cardPaymentHistory"&&f){const ee=f.paymentAccountId!=null?u.transferFromAccounts.find(te=>te.id===f.paymentAccountId):void 0;oe={amount:f.amount,isAutoRepayment:l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ee??x}}else oe={amount:{amount:b.balance.amount+b.hold.amount,currencyCode:b.balance.currencyCode,currencySymbol:b.balance.currencySymbol},isAutoRepayment:l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};R(tt(oe)),P(!0)}},[u.fetchState,h,C,f,u.transferFromAccounts,l.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,l.companyChargeCardInfo?.info?.isAutoPayEnabled,b.balance.amount,b.balance.currencyCode,b.balance.currencySymbol,b.hold.amount,R]);const Y={isZeniCheckingEnabled:l.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:L?.accType==="depositAccount",creditCardPaymentSourceAccountName:L?.label,creditCardPaymentSourceAccountType:L?.accType,creditCardPaymentSourceLastFourDigits:L?.accountLast4,creditCardPaymentSourceBalance:L?.accountBalance?.available?.amount??0};if(c.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&R(Fa(l.companyId,!0))},[V.fetchState]),c.useEffect(()=>{u.updateStatus==="Completed"&&I!=null&&E&&i&&o&&Q.trackCardsPayEarlyPayNowClick(k,n,I,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:S?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:S?.format(Ea.visual.MMMDCommaYYYYformat)},Y,m,g)},[u.updateStatus,I,E,i,o,S]),c.useEffect(()=>{u.fetchState==="Completed"&&I!=null&&E&&i&&o&&!N&&e&&h&&I!=null&&(Q.trackCardsPayEarlyFormView(k,n,I,a,l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,b.balance.amount,Y,m,g),d(!0))},[u,E,i,o,N,e,h]),B==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),R(bt())};return s.jsx(s.Fragment,{children:s.jsx(Mt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Kr.overlayWidth.valuePercentage(F),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:_.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(qr,{onClick:z=>z.stopPropagation(),children:s.jsx(Wr,{closeDrawerHandler:t,navigate:O,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{E&&i&&o&&I!=null&&Q.trackCardsPayEarlyFormClick(k,n,I,"Pay Now",u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},Y,m,g),R(cn({companyId:l.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:z=>{R(tt(z))},currentTenant:l,hasZeniAccountsAdminAccess:j,isZeniAccountsUser:$,isZeniAccountSetupEnabled:H,productInformation:n,sourcePage:C,controllerEmails:k,autoPayThreshold:U,paymentSourceInformation:Y,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:I,isCashbackInfoFetchStateCompleted:E,isCreditCardInfoFetchStateCompleted:i,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:S,maxInsuredAmount:p.maxInsuredAmount})})})})},qr=_e(Br)`
15
- display: flex;
16
- min-height: 100%;
17
- flex-direction: column;
18
- `,Wt="charge-card-transaction-update",Oa=qa.getLocalizedStrings().dateFormat,Qr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:C}=t,m=J.getSignedInUser(),g=e.tenantState.currentTenantId,I={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},o=Ma(e,r,a,C),i=hn(e,r),E=fn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:i,vgsVaultId:Ba.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:I,isSnackbarOpen:E.isSnackbarOpen,cardsEndPoint:`${Vt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:C,cardProviderId:m,includeCreditAccountInfo:g,setIsPaymentOpen:I,controllerEmails:o,productInformation:i,cashbackInformation:E,primaryFundingAccountDetails:S,creditAccountInformation:f,debitAccountInformation:O,isChargeCardFeatureEnabled:v}=t,{tenantEmailDomain:D}=r;return{onEventReceived:p=>{p===Wt&&(e(za(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Je(a,g,v))},onFetchChargeCardTransactionList:(p,u)=>{e(nt(a,p,u))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{m!=null&&e(Ta(p,"ChargeCardHolder",a))},onResendOtp:p=>{m!=null&&e(wa(p,"ChargeCardHolder",a))},onVerifyOtp:(p,u)=>{m!=null&&e(Pa(p,u,"ChargeCardHolder",a))},onVerifyOtpSuccess:p=>{p!=null&&J.saveZeniOtpTokenForCardHolder(p,a)},onColorCodeChange:p=>{e(An(a,p))},onLockChargeCard:(p,u)=>{e(Pt(p,a,u))},onUnlockChargeCard:p=>{e(_t(p,a))},onCloseChargeCard:p=>{e(Dt(a,p))},onFetchChargeCardsRecurringExpenses:()=>{e(kt([a]))},updateChargeCardName:(p,u)=>{e(Et(p,a,u))},updateChargeCardTransactionAttachments:(p,u)=>{u!=null&&e(In({transactionId:p,data:u}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,u,b,l)=>{e(Sn({chargeCardId:u,transactionId:p,fetchState:b,error:l}))},updateChargeCardTransactionReceiptsShowTick:(p,u,b)=>{e(yn({chargeCardId:u,transactionId:p,shouldShowTick:b}))},onChargeCardRevokeInviteClick:()=>{e(At(a))},updateChargeCardTransactionIsViewReceiptClicked:(p,u,b)=>{e(bn({chargeCardId:u,transactionId:p,isViewReceiptClicked:b}))},onChargeCardTransactionRowClick:(p,u)=>{const b=fe(C.state?.pathnameStackToGoBack,C.pathname);n(`../../transaction/${p}/${u}`,{state:{pathnameStackToGoBack:b}})},onBackClick:()=>{const p=ve(C.state?.pathnameStackToGoBack),u=Ve(D);n(u,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(gn())},onUpdateDebitCardPinAttempt:p=>{e(It(a,p)),p==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,u)=>{p?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):u!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:u.message}]}))},updateSpendLimit(p,u,b,l){e(St(p,u,b.code,l))},shouldOpenCreditCardPaymentDrawer(p){p&&E!=null&&Q.trackCardsPayEarlyClick(o,i,E,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:S?.accType==="depositAccount",creditCardPaymentSourceAccountName:S?.label,creditCardPaymentSourceAccountType:S?.accType,creditCardPaymentSourceLastFourDigits:S?.accountLast4,creditCardPaymentSourceBalance:S?.accountBalance?.available?.amount??0},f,O),I(p)}}})(fr(gr));function Xr(){const e=le(),t=ue(),a=ge(),{cardId:r}=ca(),[n,C]=c.useState(!1),[m,g]=c.useState(!1),{useDynamicConfig:I}=se(),o=J.getSignedInUser(),i=y(M=>ce(M)),E=y(M=>ka(M).firstViewAfterActivation),S=y(M=>M.classListState.fetchState),{configValue:f}=I(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:O}=I(Fe.zeniCardsConfig),v=O.enable_card_controls_for_company_ids,D=O.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(v)&&v.includes(i.companyId),[p,u]=c.useState(!1),[b,l]=c.useState(!1),{useFeatureGate:_}=se(),{isFeatureEnabled:F}=_(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:R}=_(Z.isDebitCardFeatureEnabled),B=Se(R,i),T=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:B}),{isFeatureEnabled:N}=_(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=_(Z.isCardsCommentingEnabled),h=ye(i),P=be(i),w=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:F,isBookKeepingTenant:h,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:w}),j=!!i.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!i.companyChargeCardInfo?.info?.isChargeCardEnabled,H=!i.userRole.includes("charge_card_user")&&U&&$;if(r==null)throw Error("Empty card id is not valid...");const V=y(M=>da(M,i.companyId)),{creditAccount:A,creditAccountRepayment:L}=y(M=>Ze(M)),W=J.getZeniOtpTokenForCardHolder(r),k=y(M=>Ma(M,r,H,U)),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:q}=Kt({mobileExploreReferrer:"Card Detail"});jt({isDataReady:k.fetchState==="Completed"});const z=y(M=>Ye(M)),x=k.chargeCard,oe=je(),ee=Ue(oe?.loggedInUserRoleMap),te=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",X=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=Ca(U,$,ee,A,L),K=Gt(te,k),he=Ja(ee,z),ke=Oe(U,T,j,$),Be=k.depositAccountLimitFetchState.fetchState!=="Completed"&&k.depositAccountLimitFetchState.fetchState!=="In-Progress",Pe=y(M=>$e(M,i.companyId)),we=ze(Pe.controllers),ae=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ae?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ae?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>ie?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=i?.userRole,Le=y(M=>Ke(M,!1,T,F).revokeCardInvite),aa=Qa(Le.saveStatus.fetchState);if(c.useEffect(()=>{if(aa==="In-Progress"&&Le.saveStatus.fetchState==="Completed"){const M=Ve(i.tenantEmailDomain);e(M)}},[aa,Le.saveStatus.fetchState,e,i.tenantEmailDomain]),c.useEffect(()=>{E&&n===!1&&re&&(C(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[E,n,re,Ee]),c.useEffect(()=>{p||k.fetchState==="Completed"||k.fetchState==="In-Progress"||r==null||(u(!0),t(Je(r,H,U,!1)))},[p,k,r,t]),c.useEffect(()=>{!b&&k.fetchState==="Completed"&&k.chargeCard?.connectedAccountId!=null&&te&&Be&&ee&&(l(!0),t(yt({depositAccountId:k.chargeCard?.connectedAccountId})))},[b,k,t,Be,ee]),c.useEffect(()=>{z.fetchState!=="Completed"&&z.fetchState!=="In-Progress"&&ee&&t(Ct()),S!=="Completed"&&S!=="In-Progress"&&t(mt()),k.transactionStatistics.fetchState!=="Completed"&&k.transactionStatistics.fetchState!=="In-Progress"&&t(pn({chargeCardId:r})),V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&t(Fa(i.companyId,!0))},[z.fetchState,t,ee,S,k.transactionStatistics.fetchState,V.fetchState]),c.useEffect(()=>{if(!(k.fetchState!=="Completed"||U&&A.fetchState!=="Completed"||x==null||k.transactionStatistics.fetchState!=="Completed"||te&&ee&&k.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;Q.trackCardsCardDetailView(we,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Qe(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Qe(x.balance.amount),cardAvailableLimit:Qe(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Qe(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:k.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:k.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:k.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:k.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:k.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:k.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Na(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ae?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Na(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,K)}},[k.fetchState,k.depositAccountLimitFetchState.fetchState,k.transactionStatistics.fetchState,A.fetchState,ee]),o==null)throw Error("Can't access card detail page without signing in...");const We=i.companyId??J.getSignedInUserTenant(i.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-encrypted-${We}.${Wt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ne,frequency:qe,cardColor:G}=ja(x),De=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageViewed(r,M,me,Te,Ne,qe,G,De)}};c.useEffect(()=>{if(k.fetchState==="Completed"){const M=k.chargeCard;if(M?.status.code==="inactive"||te&&M?.isPinSet===!1||X&&E){const me=Ce(i.tenantEmailDomain,r,o,x,E);e(me)}}},[k.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ne,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageClicked(r,Te,Ne,qe,G,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ne,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsVerifyPopUpClick(r,Te,Ne,qe,G,De,M,He,me)}},Ra=A.balance.amount+A.hold.amount,ha=i.companyChargeCardInfo?.info?.primaryFundingAccount,fa=V.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||k.fetchState==="Error"?s.jsx(La,{}):k.fetchState==="In-Progress"||k.fetchState==="Not-Started"||Le.saveStatus.fetchState==="In-Progress"||te&&ee&&k.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(hr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:E}),k.fetchState==="Completed"?s.jsx(Xa,{analytics:Q,onLoad:na}):null,m===!0?s.jsx(at,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:m,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:K,cashbackInformation:he,creditAccountSpentAmount:Ra,isDebitCardInfoFetchStateCompleted:!te||!ee||k.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!U||A.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ee||z.fetchState==="Completed",paymentInitiatedDate:L.initiatedRepaymentDate}):null,s.jsx(Qr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ae?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:U,isDebitCardFeatureEnabled:T,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:$,isCardControlsEnabled:D,isEarlyPayEnabled:N,controllerEmails:we,chargeCardCashbackDetailState:z,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:K,cashbackInformation:he,classListFetchState:S,primaryFundingAccountDetails:fa,currentTenant:i,cardProviderId:k.chargeCard?.cardProviderID,cardId:r,creditAccount:A,creditAccountRepayment:L,includeCreditAccountInfo:H,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:f.documentAiReceiptMaxSizeLimitBytes!=null?f.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:Y,onAskAiCfoClick:q,isCardsCommentingEnabled:d})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,C=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:C,limit:n}},Jr=_e.div`
19
- display: flex;
20
- width: 100%;
21
- flex: 1 1 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,es=pe(function(e,t){const a=Ke(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:En(e),bulkActionView:kn(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:C,chargeCardListState:m,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:I,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:i,isDebitCardFeatureEnabled:E,isDebitCardSetupEnabled:S,isDebitCardTOSAccepted:f,isChargeCardTOSAccepted:O,controllerEmails:v,depositAccountListWithDebitCardIssued:D,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:u,productInformation:b,cashbackInformation:l,creditAccountInformation:_,debitAccountInformation:F,updatePayNowInfoTooltip:R,isUserHasCardsAdminLevelAccess:B}=t,{tenantEmailDomain:T}=r,{cards:N}=m;return{onChargeCardRowClick:(d,h)=>{const P=zt(N,d);let w;P!=null&&((j=>{const $=j.limit.amount-j.available.amount,H=`${j.cardHolderUser?.firstName.toLowerCase()} ${j.cardHolderUser?.lastName.toLowerCase()}`,V=j.cardName,A=j.department?.className??"",L=j.limit.amount,W=j.creditLimitFrequency.name;Q.trackCardsListRowClicked(H,V,A,$,L,W,C.userId===j.cardHolderUserId)})(P),Me(E,S,D)&&Q.trackCardsCardListRowClick(v,b,"Card Row Item","row_clicked",h+1,{cardOwner:Na(P.cardHolderUser,!1),cardName:P.cardName,cardType:P.type.code.includes("credit")?"credit":"debit",cardStatus:P.status.code,cardUtilizationAmount:Qe(P.limit.amount-P.available.amount),cardUtilizationPercent:P.limit.amount>0?Math.round((P.limit.amount-P.available.amount)/P.limit.amount*100):0,cardLimit:Qe(P.limit.amount)},l,_,F)),w=P?.status.code==="request_on_hold"&&C.userId===P.cardHolderUserId?Zt(T):Ce(T,d,C,P);const U=fe(n.state?.pathnameStackToGoBack,n.pathname);a(w,{state:{pathnameStackToGoBack:U}})},onFetchChargeCardsRecurringExpenses:d=>{e(kt(d))},onFetchDepositAccountLimit:d=>{e(yt({depositAccountId:d}))},onChargeCardResendInviteClick:d=>{e(xn(d))},onChargeCardRevokeInviteClick:d=>{e(At(d))},onLockChargeCardList:(d,h)=>{e(vn(d,h))},onUnlockChargeCardList:d=>{e(Fn(d))},onCloseChargeCardList:(d,h)=>{e(Tn(d,h))},onRevokeChargeCardList:d=>{e(wn(d))},updateChargeCardListSpendLimit(d,h,P){e(Pn(d,h,P.code))},onLockChargeCard:(d,h)=>{e(Pt(B,d,h))},onUnlockChargeCard:d=>{e(_t(B,d))},onCloseChargeCard:(d,h)=>{e(Dt(d,h))},onUpdateSpendLimit(d,h,P,w){e(St(d,h,P.code,w))},updateChargeCardName:(d,h)=>{e(Et(B,d,h))},onClickSetupIcon:()=>{Q.trackCardsListPageClicked("settings"),Me(E,S,D)&&l!=null&&Q.trackCardsSettingsClick(v,b,l,_,F);const d=Ur(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},onIssueCardClick:()=>{Q.trackCardsListPageClicked("new card"),Me(E,S,D)&&l!=null&&Q.trackCardsNewCardClick(v,b,l,"New Button","card_creation_initiated","Card List",_,F);const d=as(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},onColumnSortConfigChanged:(d,h)=>{Me(E,S,D)&&l!=null&&Q.trackCardsCardListSortClick(v,b,l,"Sort Icon","sort",d,h==="ascending"?"ASC":"DESC","Cards List",_,F),e(Va({uiState:{sortKey:d,sortOrder:h}}))},onSearchTextChanged:d=>{e(_n(d))},onReloadCards:()=>{e(Ia(g,E&&S,I&&i,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(E,S,D)&&l!=null&&Q.trackCardsCashbackOverviewClick(v,b,l,"Cashback Overview","cashback_details_viewed",_,F),a("./cashback")},onClickStatementsIcon:()=>{Me(E,S,D)&&l!=null&&Q.trackCardsStatementsClick(v,b,l,_,F),a("./statements")},onCreateNowClick:d=>{Me(E,S,D)&&l!=null&&Q.trackCardsNewCardClick(v,b,l,"Promo Banner","card_creation_initiated","Card List",_,F),a(`./new?cardType=${d}`)},onPromoCardClick:d=>{a(d==="debit"&&E&&!f||d==="credit"&&o&&!O?`../promo?cardPromoType=${d}`:"./setup")},navigateToCreditCardPaymentPage:(d,h)=>{u==="Completed"&&r.company!=null&&l!=null&&Q.trackCardsPayEarlyClick(v,b,l,"Card List",d,h,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},_,F);const P=ts(T);a(P)},navigateToCreditCardPaymentHistoryPage:()=>{const d=ns(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},shouldShowPayNowInfoTooltip:R,onSetRowActionCardId:d=>{e(Dn(d))},onSetBulkActionCardIds:d=>{e(wt(d))}}})(br);function it({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=ge(),n=c.useCallback((G,De)=>{a(wt([])),t(G,De)},[a,t]),[C,m]=c.useState(!1),[g,I]=c.useState(J.getPayNowInfoTooltip()??!1),o=G=>{J.savePayNowInfoTooltip(G),I(G)},[i,E]=c.useState(!1),S=J.getSignedInUser(),f=y(G=>ce(G)),[O,v]=c.useState(!1),[D,p]=c.useState(!1),{isAiCfoAccessEnabled:u,onAskAiCfoClick:b}=Kt({mobileExploreReferrer:"Cards"}),l=f.userRole.includes("charge_card_user"),_=!l,F=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:R,useDynamicConfig:B}=se(),{isFeatureEnabled:T}=R(Z.isCashbackFeatureEnabled),{isFeatureEnabled:N}=R(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:d}=R(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:h}=R(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:P}=R(Z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:w}=R(Z.isCardsCommentingEnabled),U=Se(d,f),j=Ie({isDebitCardFeatureEnabled:d,isBankingOnlyTenant:U}),$=be(f),H=ye(f),V=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=Ae({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:N,isBookKeepingTenant:H,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:V}),L=$t({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:N,isBookKeepingTenant:H}),{configValue:W}=B(Fe.zeniCardsConfig),k=je(),Y=Ue(k?.loggedInUserRoleMap),q=y(G=>$e(G,f.companyId)),z=ze(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,oe=W.credit_card_pay_now_threshold_by_company_id?.[f.companyId]??W.default_credit_card_pay_now_threshold??Rr,ee=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(f.companyId),te=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,X=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(G=>ft(G)),xe=Qa(Ee.updateStatus),K=y(G=>Ke(G,_,j&&F,A&&re)),he=K.cards.filter(G=>G.type.code.includes("debit")).map(G=>G.connectedAccountId),ke=[...new Set(he)],Be=y(G=>Ye(G)),Pe=y(G=>va(G,ke)),we=y(G=>da(G,f.companyId)),ae=we.companyChargeCardInfo?.primaryFundingAccount,pa=we.allFundingAccounts.find(G=>G.id===ae?.accountId),ie=K.fetchState,ea=K.creditAccount;jt({isDataReady:ie==="Completed"});const{creditAccountRepayment:de}=y(G=>Ze(G)),Le=y(G=>ka(G).firstViewAfterActivation),{areTenantIdsInSync:aa}=Nt(),We=Ja(Y,Be),ta=Ca(A,re,Y,ea,de),na=et(j,F,Y,Pe,K.debitCardSummary),ra=Oe(A,j,F,re),sa=K.creditAccount.balance.amount+K.creditAccount.hold.amount;if(c.useEffect(()=>{ie==="Completed"&&(J.getPayNowInfoTooltip()==null||sa<oe*K.creditAccount.limit.amount/100)&&o(!0)},[ie,oe,sa,K.creditAccount.limit.amount]),c.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),m(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){m(!1),document.body.style.overflow="auto";const G=Ve(f.tenantEmailDomain);n(G)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,f.tenantEmailDomain]),c.useEffect(()=>{!O&&(re||F)&&aa&&(v(!0),a(Ia(_,j&&F,A&&re,!1)))},[O,_,a,aa]),c.useEffect(()=>{Le&&i===!1&&(E(!0),setTimeout(()=>{a(Sa())},5e3))},[Le,i]),c.useEffect(()=>{ie==="Completed"&&l&&K.cards.length===1&&(K.cards[0].status.code==="inactive"&&K.cards[0].type.code==="business_physical_credit_card"?n(`./${K.cards[0].id}/activate`):K.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${K.cards[0].id}`)))},[ie,l,r.state,n,K.cards]),c.useEffect(()=>{if(ie==="Completed"&&l){const G=K.cards.length,De=K.cards.filter(He=>He.cardHolderUserId===S?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&G===De.length&&n("./onboard")}},[ie,K.cards,l,n,S?.userId]),c.useEffect(()=>{ie!=="Completed"||A&&de.fetchState!=="Completed"||j&&F&&Y&&Pe.fetchState!=="Completed"||Q.trackCardsCardListView(z,ra,We,ta,na)},[ie,ea,de.fetchState,Pe.fetchState,Y]),S==null)throw Error("Can't access charge card list page without signing in...");const Ra=y(G=>Tt(G.userState,G.userRoleState,G.userListViewState,"cardAdmin")),ha=Za(k?.loggedInUserRoleMap),fa=G=>{p(G)},M=K.creditAccount.limit,me=()=>{m(!1),n("..")},Te=f.companyChargeCardInfo?.info!=null&&Xe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:A,isTOSAccepted:te,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha}),Ne=f.companyDebitCardInfo?.info!=null&&Xe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:j,isTOSAccepted:X,isSetupEnabled:F,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha});return re||F?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{Q.trackPageLoaded(Ht.Event.cardsListPage),(A&&!re||j&&!F)&&Q.trackCardsPromoView(z,{isCreditCardOffered:A,isDebitCardOffered:j,isDebitCardEnabled:F,isCreditCardEnabled:re},"Banner",j&&!F?"Debit Card":A&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Le})]}):null,C===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:C,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(j&&F&&Y)||Pe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!A||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!Y||Be.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Jr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:fa}),s.jsx(es,{isCashbackFeatureEnabled:T,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:j,isCreditCardProductVisibleForExpressInterest:L,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:g,creditCardPayNowThreshold:oe,signedInUser:S,chargeCardListState:K,location:r,admins:Ra.users,navigateAndClearBulkSelection:n,currentTenant:f,isCardControlsEnabled:ee,companyChargeCardInfoCreditAccountLimit:f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:f.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:Y,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{fa(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:F,isEarlyPayEnabled:h,isChargeCardPaymentHistoryFeatureEnabled:P,cashbackRate:x,controllerEmails:z,chargeCardCashbackDetailState:Be,depositAccountListWithDebitCardIssued:Pe,isChargeCardTOSAccepted:te,isDebitCardTOSAccepted:X,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:we.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:u,onAskAiCfoClick:b,isCardsCommentingEnabled:w})]})]}):(te||X)&&Y===!0?s.jsx(ga,{to:"../setup"}):Te||Ne?s.jsx(ga,{to:"../promo"}):s.jsx(la,{fetchState:ie})}const as=e=>`/${e}/cards/new`,ts=e=>`/${e}/cards/payment`,ns=e=>`/${e}/cards/payment-history`,rs=pe(function(e){const t=J.getSignedInUser(),a=ce(e),r=e.tenantState.currentTenantId,n=Ft(e),C={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},m=a?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:Bn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:C,companyName:m,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),C=n.poppedPathname??"..";r(C,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,C)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:C}}})},onFiltersChange:n=>{e(Rn({filters:n}))},onReloadPayments:()=>{e(vt(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(Ln({uiState:{downloadState:n}}))}}})(yr);function ss(){const e=le(),t=ge(),a=ue(),{areTenantIdsInSync:r}=Nt(),{useFeatureGate:n}=se();if(J.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const C=y(q=>ce(q)),m=y(q=>Ft(q)),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(null),v=!C.userRole.includes("charge_card_user"),D=!!C.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=n(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Z.isDebitCardFeatureEnabled),b=Se(u,C),l=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:b}),_=be(C),F=ye(C),R=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:p,isBookKeepingTenant:F,isDebitCardProductVisible:l,chargeCardsCreditAccountLimit:R}),T=!!C.companyChargeCardInfo?.info?.isChargeCardEnabled,N=je(),d=Ue(N?.loggedInUserRoleMap),h=y(q=>Ke(q,v,l&&D,B&&T)),P=c.useMemo(()=>{const q=h.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(q.map(z=>z.connectedAccountId))]},[h.cards]),w=y(q=>Ye(q)),U=y(q=>va(q,P)),{creditAccountRepayment:j}=y(q=>Ze(q)),$=c.useMemo(()=>Ja(d,w),[d,w]),H=c.useMemo(()=>Ca(B,T,d,h.creditAccount,j),[B,T,d,h.creditAccount,j]),V=c.useMemo(()=>et(l,D,d,U,h.debitCardSummary),[l,D,d,U,h.debitCardSummary]),A=c.useMemo(()=>Oe(B,l,D,T),[B,l,D,T]),L=h.creditAccount.balance.amount+h.creditAccount.hold.amount,W=c.useMemo(()=>f!=null?m.repaymentHistory.find(q=>q.cardRepaymentId===f):void 0,[f,m.repaymentHistory]),k=c.useCallback(q=>{O(q),a(Ia(v,l&&D,B&&T,!1)),S(!0)},[a,v,l,D,B,T]),Y=c.useCallback(()=>{S(!1),O(null),document.body.style.overflow="auto"},[]);return c.useEffect(()=>{g||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(I(!0),a(vt()))},[g,a,m.fetchState]),c.useEffect(()=>{!o&&(T||D)&&r&&(i(!0),a(Ia(v,!1,B&&T,!1)))},[o,T,D,r,a,v,B]),s.jsxs(s.Fragment,{children:[E?s.jsx(at,{closeDrawerHandler:Y,isPaymentDrawerOpen:E,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:L,productInformation:A,creditAccountInformation:H,debitAccountInformation:V,cashbackInformation:$,isDebitCardInfoFetchStateCompleted:!(l&&D&&d)||U.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!B||j.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!d||w.fetchState==="Completed",paymentInitiatedDate:j.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(rs,{location:t,navigate:e,accountInfoByAccountId:m.accountInfoByAccountId,onRetryPaymentClick:k})]})}const ct=_e.div`
26
- display: flex;
27
- height: 100vh;
28
- width: 100%;
29
- flex: 1 1 auto;
30
- flex-direction: column;
31
- overflow: auto;
32
- align-items: center;
33
- background-color: ${e=>e.theme.colors.grey4};
34
- `,dt=qa.getLocalizedStrings().months;function os(){const e=le(),t=ue(),a=ge(),{creditAccount:r,creditAccountRepayment:n}=y(A=>Ze(A)),C=`${Vt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[m,g]=c.useState(!1),[I,o]=c.useState(!1),i=y(A=>Un(A)),{useFeatureGate:E}=se(),S=y(A=>ce(A)),{isFeatureEnabled:f}=E(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:O}=E(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:v}=E(Z.isCardsCommentingEnabled),D=Yt(v?S.companyId:void 0,{clearParams:v&&i.fetchState==="Completed"}),p=Se(O,S),u=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),b=be(S),l=ye(S),_=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,F=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:f,isBookKeepingTenant:l,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:_}),R=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,B=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,T=y(A=>$e(A,S.companyId)),N=ze(T.controllers),d=y(A=>xt(A)),h=d.cards.filter(A=>A.type.code.includes("debit")).map(A=>A.connectedAccountId),P=[...new Set(h)],w=y(A=>va(A,P)),U=y(A=>On(A));c.useEffect(()=>{I||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),t(Ga()))},[m,t,r.fetchState]),c.useEffect(()=>{I||r.fetchState!=="Completed"||r.id==null||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(o(!0),t(jn(r.id)))},[I,t,r.fetchState,r.id,i.fetchState]),c.useEffect(()=>{w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&u&&R&&t(Bt()),d.fetchState!=="Completed"&&d.fetchState!=="In-Progress"&&t(ia()),U.fetchState!=="Completed"&&U.fetchState!=="In-Progress"&&u&&R&&t(Vn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&F&&B&&t($a())},[w.fetchState,u,R,d.fetchState,U.fetchState,n.fetchState,F,B]),c.useEffect(()=>{if(i.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&d.fetchState==="Completed"&&(!u||!R||w.fetchState==="Completed"&&U.fetchState==="Completed")){let A="",L="";if(i.statements.length>0){const q=i.statements[i.statements.length-1].period,[z,x]=q.split("-"),oe=i.statements[0].period,[ee,te]=oe.split("-");A=`${dt[parseInt(x)-1]} ${z}`,L=`${dt[parseInt(te)-1]} ${ee}`}const W=Oe(F,u,R,B),k=Ca(F,B,!0,r,n),Y=et(u,R,!0,w,U);Q.trackCardsCreditCardStatementsView(N,W,{numberOfStatements:i.statements.length,oldestStatementMonthYear:A,latestStatementMonthYear:L},k,Y)}},[i.fetchState,r.fetchState,n.fetchState,w.fetchState,d.fetchState,U.fetchState]);const j=()=>{const A=ve(a.state?.pathnameStackToGoBack),L=A.poppedPathname??"..";e(L,{state:{pathnameStackToGoBack:A.newStack}})},$=y(A=>Ye(A)),H=J.getSignedInUser(),V={userId:H?.userId??"",sessionId:H?.zeniSessionId??"",tenantId:S.tenantId??""};if(H==null)throw Error("Can't access address page without signing in...");if(i.fetchState!=="Completed")return s.jsx(ct,{children:s.jsx(Sr,{onBackClick:j})});{const A=Oe(F,u,R,B);return s.jsx(ct,{children:s.jsx(Ir,{currentTenantCompanyName:S.companyName,statementListView:i,productInformation:A,onBackClick:j,authParams:V,controllerEmails:N,isChargeCardFeatureEnabled:F,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:R,isChargeCardSetupEnabled:B,isCardsCommentingEnabled:v,initialOpenThreadRequest:D,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:w,debitCardSummary:U,downloadEndPoint:C})})}}const is={containerWidth:new ma(100,58)},cs=({appContent:e})=>{const t=ua(),a=ue(),r=le(),n=ge(),{useDynamicConfig:C}=se(),[m,g]=c.useState(!1),[I,o]=c.useState(!1),[i,E]=c.useState(!1),[S,f]=c.useState(!1),[O,v]=c.useState(!1),[D,p]=c.useState(!1),u=J.getSignedInUser();if(u==null)throw Error("Can't access onboarding card page without signing in...");const b=y(L=>ce(L)),{configValue:l}=C(Fe.zeniCardsConfig),_=y(L=>Nn(L)),{tenantEmailDomain:F}=b,R=y(L=>L.settingsViewState.profile.fetchState),B=y(L=>L.chargeCardListState.fetchState),T=y(L=>L.settingsViewState.profile.userId),N=y(L=>L.chargeCardConfigState.fetchState);c.useEffect(()=>{m===!1&&R!=="In-Progress"&&R!=="Completed"&&(a(Hn()),g(!0)),I===!1&&N!=="In-Progress"&&N!=="Completed"&&(a(Da()),o(!0)),i===!1&&B==="Not-Started"&&(E(!0),a(ia()))},[m,i,B,I,N]),c.useEffect(()=>{R==="Completed"&&O===!1&&T!=null&&B==="Completed"&&_.cards.length>0&&(a(Mn({userId:T})),a(Lt({cardId:_.cards[_.cards.length-1].id})),v(!0))},[R,O,T,B]),c.useEffect(()=>{if(!S&&_.fetchState==="Completed"&&_.cards.length===0){const L=ve(n.state?.pathnameStackToGoBack),W=L.poppedPathname??Ve(F);r(W,{state:{pathnameStackToGoBack:L.newStack}})}},[_.fetchState,_.cards,S]);const d=y(L=>ka(L)),h=Qa(d.updateStatus.fetchState),P=d.currentDisplayedCardId,{useFeatureGate:w}=se(),{isFeatureEnabled:U}=w(Z.isChargeCardFeatureEnabled),j=!!b.companyChargeCardInfo?.info?.isChargeCardEnabled,$=!b.userRole.includes("charge_card_user")&&U&&j,H=y(L=>P!=null?Rt(L.chargeCardState,P):null),V=()=>{P!=null&&(a(Je(P,$,!0)),a(ia()),f(!0))};c.useEffect(()=>{if(S&&P!=null&&H!=null&&H.status.code!=="request_on_hold"){const L=Ce(b.tenantEmailDomain,P,u,H),W=fe(n.state?.pathnameStackToGoBack,n.pathname);a(Gn()),H?.type.code==="business_virtual_credit_card"&&a(_a()),r(L,{state:{pathnameStackToGoBack:W},replace:!0})}},[S,H?.status.code]),c.useEffect(()=>{h==="In-Progress"&&d.updateStatus.fetchState==="Completed"&&setTimeout(V,3e3)},[h,d.updateStatus.fetchState]);const A=L=>{p(L)};if(!S&&B!=="Completed"||R!=="Completed"||_.cards.length===0)return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:A}),s.jsx(Ar,{})]});if(T==null)throw Error("Can't access my userId.");return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:A}),s.jsx(ds,{chargeCardListView:_,cardUserOnboardingView:d,navigate:r,currentTenant:b,myUserId:T,location:n,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{A(!0)}}),e!=null?s.jsx(ls,{windowSize:t,children:e}):null]})},ds=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{cards:r.cards,showMenuIcon:m,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:C}=t,{tenantEmailDomain:m}=C;return{updateCardUserOnboardingLocalData:g=>{e(rt({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const I={...r.cardUserOnboardingLocalData,phone:g};e(rt({localData:I}))}e(Ta(g,"CardUserOnboarding"))},onResendOtp:g=>{e(wa(g,"CardUserOnboarding"))},onVerifyOtp:(g,I)=>{e(Pa(g,I,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e($n()),g!=null&&J.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(Lt({cardId:g}))},onBackClick:()=>{const g=ve(n.state?.pathnameStackToGoBack),I=g.poppedPathname??Ve(m);a(I,{state:{pathnameStackToGoBack:g.newStack}})}}})(Er),ls=_e.div`
35
- display: flex;
36
- flex-direction: column;
37
- width: ${e=>`${is.containerWidth.value(e.windowSize)}%`};
38
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
39
- `,lt=_e.div`
40
- display: flex;
41
- min-height: 100%;
42
- width: 100%;
43
- flex: 1 1 auto;
44
- flex-direction: column;
45
- align-items: center;
46
- background-color: ${e=>e.theme.colors.grey4};
47
- `,us={containerWidth:new ma(100,58)},ms=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m,useFeatureGate:g}=se(),[I,o]=c.useState(!1),[i,E]=c.useState(!1),[S,f]=c.useState(!1),[O,v]=c.useState(!1),D=J.getSignedInUser();if(D==null)throw Error("Can't access onboarding card page without signing in...");const p=y(V=>ce(V));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=m(Fe.zeniCardsConfig),b=y(V=>zn(V,n)),{isFeatureEnabled:l}=g(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=g(Z.isDebitCardFeatureEnabled),F=Se(_,p),R=Ie({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:F}),B=be(p),T=ye(p),N=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:l,isBookKeepingTenant:T,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:N}),h=b.chargeCard,P=y(V=>V.chargeCardConfigState.fetchState);c.useEffect(()=>{I===!1&&P!=="In-Progress"&&P!=="Completed"&&(a(Da()),o(!0)),i===!1&&b.fetchState==="Not-Started"&&(E(!0),a(Je(n,!1,d)))},[i,b.fetchState,I,P]);const w=h?.type.code==="business_physical_debit_card"||h?.type.code==="business_virtual_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(S===!1&&(w===!1||w&&h.status?.code!=="active"||w&&h.status.code==="active"&&h.isPinSet||h.cardHolderUserId!==D.userId)){const V=Ce(p.tenantEmailDomain,n,D,h,!0),A=fe(C.state?.pathnameStackToGoBack,C.pathname);r(V,{state:{pathnameStackToGoBack:A}})}else if(S&&b.isRefreshingViewInBackground===!1&&h?.isPinSet===!0){a(Zn({chargeCardId:n}));const V=Ce(p.tenantEmailDomain,n,D,h,!0),A=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(V,{state:{pathnameStackToGoBack:A}})}}},[b.fetchState,h?.type.code,S,b.isRefreshingViewInBackground]);const U=J.getZeniOtpTokenForCardHolder(n),j=y(V=>pt(V.userState,D.userId)),$=()=>{h?.isPinSet!==!0&&a(za(n,!0))};c.useEffect(()=>{b.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout($,3e3),f(!0))},[b.updateDebitCardPinAttemptFetchState.fetchState]);const H=V=>{v(V)};if(P!=="Completed"||h==null)return s.jsx(la,{fetchState:"In-Progress"});if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(hs,{children:[s.jsx(Ge,{isAppContentDrawerOpen:O,handleDrawerToggle:H}),s.jsx(Cs,{cardId:n,card:h,phone:j.phone,signedInUser:D,isSandboxEnv:Ka(),debitCardDetailState:b,signedInUserToken:U,navigate:r,currentTenant:p,location:C,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{H(!0)}}),e!=null?s.jsx(ps,{windowSize:t,children:e}):null]})},Cs=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=ht(e,a),n=t.updateStatus,C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{showMenuIcon:m,vgsVaultId:Ba.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,debitCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(It(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Yn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(kr),ps=_e.div`
48
- display: flex;
49
- flex-direction: column;
50
- width: ${e=>`${us.containerWidth.value(e.windowSize)}%`};
51
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
52
- box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
53
- `,hs=_e.div`
54
- display: flex;
55
- min-height: 100%;
56
- width: 100%;
57
- flex: 1 1 auto;
58
- flex-direction: column;
59
- align-items: center;
60
- background-color: ${e=>e.theme.colors.grey4};
61
- box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
62
- `,fs={overlayWidth:new ma(Ua[12],Ua[12],Ua[9])},gs=pe(function(e,t){const a=Ya(e,!1,!1),r=t.lineId,n=a.customAddress[r],C=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:C,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:C=>{a!=null&&e(Ut(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const m=jr(C);e(qn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:m})),e(Qn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Wn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(Dr),bs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=ua(),C=()=>{t()},m=y(g=>Kn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(Mt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:fs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,I)=>(I==="backdropClick"||I==="escapeKeyDown")&&C(),children:s.jsx(gs,{googleAPIKey:Ba.googleMapsAPIKey,onDismissClick:C,lineId:e,chargeCardTypeOption:a,newCustomAddressId:m})})},ys=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g}=t,I=Ya(e,a&&m,r&&g);return{issueChargeCards:I,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g,cardHolderCandidates:I.userList.map(o=>o.user).filter(Boolean),allRoles:I.userList.map(o=>o.userRole),allAccountingClasses:I.allAccountingClasses,userList:I.userList}},function(e,t){return{onIssueCardClick:()=>{e(er())},onSaveChangesToLocalStore:a=>{e(Jn(a))},onDismissClick:()=>{e(Ot()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Ut(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(wr);function Ss(){const e=J.getSignedInUser(),t=le(),a=ue(),r=_r(),[n]=ut(),C=n.get("cardType"),{useFeatureGate:m}=se(),{isFeatureEnabled:g}=m(Z.isIssuePhysicalCardEnabled),{isFeatureEnabled:I}=m(Z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=m(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(Z.isChargeCardFeatureEnabled),E=y($=>ce($)),S=Se(o,E),f=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:S}),O=be(E),v=ye(E),D=E.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=Ae({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:i,isBookKeepingTenant:v,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:D}),[u,b]=c.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");c.useEffect(()=>{u||(b(!0),a(Xn(f&&_,p&&l,!1)))},[u,b,a]);const l=!!E.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!E.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y($=>Ya($,p&&l,f&&_)),R=F.fetchState,B=F.issueCardStatus.fetchState,T=F.lastSelfIssuedDebitCardId,N=y($=>T!=null?Rt($.chargeCardState,T):void 0),[d,h]=c.useState(null),[P,w]=c.useState(null),U=()=>{h(null)},j=($,H)=>{h($),w(H)};return c.useEffect(()=>{if(B==="Completed"){if(T!=null&&N?.type.code==="business_virtual_debit_card"){let $;$=N?.status.code==="request_on_hold"&&e.userId===N.cardHolderUserId?Zt(E.tenantEmailDomain):Ce(E.tenantEmailDomain,T,e,N),t($)}else t("../");a(Ot())}},[B,T]),R==="Completed"?s.jsxs(s.Fragment,{children:[d!==null&&P!==null?s.jsx(bs,{closeDrawerHandler:U,lineId:d,chargeCardTypeOption:P}):null,s.jsx(ys,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:I,isDebitCardFeatureEnabled:f,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:l,isDebitCardSetupEnabled:_,navigate:t,fetchState:F.fetchState,openAddAddressDrawerHandler:j,defaultCardType:C==="creditCard"||C==="debitCard"?C:void 0})]}):R==="Error"?s.jsx(La,{}):s.jsx(Pr,{})}const Is=_e.div`
63
- display: flex;
64
- height: 100vh;
65
- width: 100%;
66
- flex: 1 1 auto;
67
- flex-direction: column;
68
- overflow: auto;
69
- align-items: center;
70
- background-color: ${e=>e.theme.colors.grey4};
71
- `,As=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:C,myPendingActivationChargeCardListState:m}=t,{tenantEmailDomain:g}=r,{cards:I}=m;return{onChargeCardRowClick:o=>{const i=zt(I,o),E=Ce(g,o,C,i),S=fe(n.state?.pathnameStackToGoBack,n.pathname);a(E,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(o,i)=>{e(Va({uiState:{sortKey:o,sortOrder:i}}))},onReloadCards:()=>{e(ia())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Va({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(Tr);function Es(){const e=le(),t=ue(),a=ge(),r=Wa(),[n,C]=c.useState(!1),m=y(w=>ar(w)),g=y(w=>ce(w)),I=y(w=>$e(w,g.companyId)),o=ze(I.controllers),{useFeatureGate:i}=se(),{isFeatureEnabled:E}=i(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=i(Z.isDebitCardFeatureEnabled),f=Se(S,g),O=Ie({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:f}),v=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,D=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,p=je(),u=be(g),b=ye(g),l=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Ae({isCardsOnlyTenant:u,isChargeCardFeatureEnabled:E,isBookKeepingTenant:b,isDebitCardProductVisible:O,chargeCardsCreditAccountLimit:l}),F=Ue(p?.loggedInUserRoleMap),R=y(w=>Ye(w)),{creditAccount:B,creditAccountRepayment:T}=y(w=>Ze(w)),N=y(w=>xt(w)).cards.filter(w=>w.type.code.includes("debit")).map(w=>w.connectedAccountId),d=[...new Set(N)],h=y(w=>va(w,d));c.useEffect(()=>{n||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(C(!0),t(ia()),t(Da()))},[n,t,m.fetchState]),c.useEffect(()=>{if(m.fetchState==="Completed"&&m.cards.length===1&&P!=null){const w=Ce(g.tenantEmailDomain,m.cards[0].id,P,m.cards[0]);e(w,{state:{message:a.state?.message}})}},[m.fetchState,m.cards]);const P=J.getSignedInUser();if(c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&_&&D&&F&&t(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&F&&t($a()),h.fetchState!=="Completed"&&h.fetchState!=="In-Progress"&&O&&v&&F&&t(Bt())},[B.fetchState,T.fetchState,t,h.fetchState,O,v,F,_,D]),P==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return s.jsx(la,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const w=Oe(_,O,v,D);return s.jsx(Is,{children:s.jsx(As,{navigate:e,currentTenant:g,signedInUser:P,productInformation:w,myPendingActivationChargeCardListState:m,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:O,isDebitCardSetupEnabled:v,isChargeCardSetupEnabled:D,chargeCardCashbackDetailState:R,creditAccount:B,creditAccountRepayment:T,depositAccountListWithDebitCardIssued:h,controllerEmails:o,location:a})})}}const ks=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:C,isChargeCardSetupEnabled:m,signedInUser:g,location:I,productInformation:o,isEarlyPayEnabled:i,controllerEmails:E,chargeCardsCreditAccountLimit:S}=t;return{onSetupButtonClick:f=>{if(g!=null&&Q.trackCardsPromoPageClicked("enable cards"),n)switch(Q.trackCardsEnableCardsClick(E,o,"Cards Promo"),f){case"credit":e(Re(r,!0,"charge_cards",i,!1));break;case"debit":e(Re(r,!0,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Re(r,!0,"debit_cards",i,!0):Re(r,!0,"charge_cards__debit_cards",i,!1))}else switch(Q.trackCardsSetupCardsClick(E,o,"Cards Promo"),f){case"credit":e(Re(r,!1,"charge_cards",i,!1));break;case"debit":e(Re(r,!1,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Re(r,!1,"debit_cards",i,!0):Re(r,!1,"charge_cards__debit_cards",i,!1))}},onBackClick:()=>{const f=ve(I.state?.pathnameStackToGoBack);let O=f.poppedPathname;O==null&&(O=C||m?"..":"../.."),a(O,{state:{pathnameStackToGoBack:f.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(rr(r))}}})(vr),Ds=()=>{const e=le(),{tenantEmailDomain:t}=ca(),[a]=ut(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:C,useFeatureGate:m}=se(),[g,I]=c.useState(!1),{isFeatureEnabled:o}=m(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:E}=m(Z.isChargeCardFeatureEnabled),{configValue:S}=C(Fe.zeniCardsConfig),f=y(ae=>ce(ae)),O=y(ae=>$e(ae,f.companyId)),v=ze(O.controllers),D=S.charge_card_cashback_rate_per_transaction!=null?S.charge_card_cashback_rate_per_transaction:.0175,p=ge(),u=J.getSignedInUserTenant(t)?.companyId??f.companyId,b=y(ae=>da(ae,u)),l=b.primaryFundingAccount,_=f.companyBillPayInfo?.info,F=be(f),R=ye(f),B=Se(o,f),T=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,N=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:B}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:E,isBookKeepingTenant:R,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:T}),h=$t({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:E,isBookKeepingTenant:R}),P=N&&d===!1,w=_?.businessVerificationStatus?.code==="verified"&&(P||l?.accType==="depositAccount"||tr(l?.providerVerificationStatus?.code??"")),U=J.getSignedInUser(),j=!!f.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,H=!!f.company?.companyChargeCardInfo.isChargeCardEnabled,V=!!f.company?.companyDebitCardInfo.isDebitCardEnabled,A=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,L=ae=>{I(ae)},W=y(ae=>ae.chargeCardSetupViewState.fetchState);if(U==null)throw Error("Can't access Charge Card promo page without signing in...");const k=je(),Y=Ue(k?.loggedInUserRoleMap),q=Za(k?.loggedInUserRoleMap),[z,x]=c.useState(!1),[oe,ee]=c.useState(!1),[te,X]=c.useState(!1);c.useEffect(()=>{z===!1&&p.state?.message==="activation"&&x(!0)},[p.state]),c.useEffect(()=>{oe||W!=="Not-Started"||u==null||(ee(!0),n(Fa(u,!0)))},[oe,W,u,n]);const re=f.companyChargeCardInfo?.info!=null&&Xe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:h,isTOSAccepted:$,isSetupEnabled:H,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),Ee=f.companyDebitCardInfo?.info!=null&&Xe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:N,isTOSAccepted:A,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),xe=N&&Ee&&h&&T>=0&&re?"debit_and_credit":N&&Ee?"debit":"credit",K=Or(r,xe),he=b?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=c.useRef(null);c.useEffect(()=>{he==="In-Progress"?ke.current=K:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,K]);const Be=he!=="In-Progress"&&he!=="Completed"||ke.current==null?K:ke.current;c.useEffect(()=>{K==="credit"&&(H||h===!1&&V)||K==="debit"&&V||K==="debit_and_credit"&&V&&H?e("../"):(K==="debit_and_credit"&&$===!0&&A===!0||K==="credit"&&($===!0||h===!1&&A===!0)||K==="debit"&&A===!0)&&Y===!0&&e("../setup")},[w,H,V,K,$,A]),c.useEffect(()=>{te||(n(nr("cardAdmin")),X(!0))},[te]);const Pe=y(ae=>Tt(ae.userState,ae.userRoleState,ae.userListViewState,"cardAdmin")),we=Oe(h,N,V,H);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{if(Q.trackPageLoaded(Ht.Event.cardsPromoPage),!!h&&!H||!!N&&!V||!!h&&!!N&&!V&&!H){const ae=_s({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:H,isCreditCardProductVisibleForExpressInterest:h,isDebitCardProductVisible:N});Q.trackCardsPromoView(v,we,"Page",ae,"Promo Page")}}}),s.jsx(xa,{showConfetti:z}),s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:L}),s.jsx(ks,{signedInUser:U,location:p,showEnableCardButton:w,isCompanyBusinessVerificationAndPaymentSetUpDone:w,isChargeCardSetupEnabled:H,isDebitCardSetupEnabled:V,companyLegalName:f.companyName,adminList:Pe.users,isCheckingEnabled:j,navigate:e,companyId:u,cardPromoType:Be,controllerEmails:v,productInformation:we,isCreditCardProductVisible:d,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:i,cashbackRate:D,chargeCardsCreditAccountLimit:T,onClickMenuIcon:()=>{L(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:L}),s.jsx(Fr,{})]})},_s=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Qs(){const e=ge(),t=y(W=>ce(W)),{useFeatureGate:a}=se(),{isFeatureEnabled:r}=a(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=a(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:m}=a(Z.isChargeCardPaymentHistoryFeatureEnabled),g=Se(n,t),I=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),o=xr(t,r,n),i=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,E=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,S=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,O=je(),v=Ue(O?.loggedInUserRoleMap),D=Za(O?.loggedInUserRoleMap),{isFeatureEnabled:p}=a(Z.isCashbackFeatureEnabled),u=t.userRole.includes("charge_card_user"),b=!u,l=!u&&S,_=t?.userRole!=null&&sr(t?.userRole),F=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!_)&&or(O?.loggedInUserRoleMap),R=ir(O?.loggedInUserRoleMap),B=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!_)&&cr(O?.loggedInUserRoleMap),{isFeatureEnabled:T}=a(Z.isDepositAccountsFeatureEnabled),N=T&&!_&&gt(O?.loggedInUserRoleMap),d=S&&!_,h=f&&!_,P=o&&!_&&Ue(O?.loggedInUserRoleMap),w=dr(O?.loggedInUserRoleMap),U=be(t),j=ye(t),$=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:r,isBookKeepingTenant:j,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:$}),V=t.companyChargeCardInfo?.info!=null&&Xe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:H,isTOSAccepted:i,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:v,isUserHasCardsAccess:D}),A=t.companyDebitCardInfo?.info!=null&&Xe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:I,isTOSAccepted:E,isSetupEnabled:f,isUserHasCardsAdminLevelAccess:v,isUserHasCardsAccess:D}),L=V||A;return s.jsxs(qt,{children:[v?s.jsx(ne,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:F,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:N,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:R,productType:"charge_cards",type:"setup"})}):null,v?s.jsx(ne,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:F,isUserHasOnlyBillPayAccess:R,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:N,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:w,productType:"charge_cards",type:"verification"})}):null,s.jsx(ne,{path:"promo",element:s.jsx(Ds,{})}),d||h?s.jsxs(s.Fragment,{children:[s.jsx(ne,{path:"/",element:s.jsx(it,{isPaymentDrawerOpen:!1})}),P&&C?s.jsx(ne,{path:"payment",element:s.jsx(it,{isPaymentDrawerOpen:!0})}):null,s.jsx(ne,{path:"activate",element:s.jsx(Es,{})}),s.jsx(ne,{path:"onboard",element:s.jsx(cs,{})}),v?s.jsx(ne,{path:"new",element:s.jsx(Ss,{})}):null,p&&b?s.jsx(ne,{path:"cashback",element:s.jsx(Hr,{})}):null,l?s.jsx(ne,{path:"statements",element:s.jsx(os,{})}):null,P&&m&&S?s.jsx(ne,{path:"payment-history",element:s.jsx(ss,{})}):null,s.jsx(ne,{path:":cardId/activate",element:s.jsx($r,{})}),s.jsx(ne,{path:":cardId/setPin",element:s.jsx(ms,{})}),s.jsx(ne,{path:":cardId/addToWallet",element:s.jsx(Vr,{})}),s.jsx(ne,{path:":cardId/*",element:s.jsx(Xr,{})}),s.jsx(ne,{path:"*",element:s.jsx(La,{})})]}):(i||E)&&v?s.jsx(ne,{path:"*",element:s.jsx(ga,{to:"../setup"})}):L?s.jsx(ne,{path:"*",element:s.jsx(ga,{to:"../promo",state:e.state})}):s.jsx(ne,{path:"*",element:null})]})}export{Qs as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-B46P4ZcR.js";import{a as g}from"./sentry-CXX07pCD.js";import{h as w,u as x,g as k,i as T,j as O,n as E}from"./core-N0s35_fE.js";import{z as N,b7 as P,x as F,d as V,f as j,af as C,b8 as A,at as L,au as M,r as U}from"./index-DbeH7KTi.js";import{eP as h,fG as B,se as _,fB as G,c2 as R,MH as z,bn as q,qf as H,q3 as Y,ke as K,lK as S,MI as Z,bE as $,cv as D,lS as J,lV as Q}from"./zeni-epic-state-CAiwtZ5t.js";import"./mui-DhWmpMK0.js";import{d as W}from"./routePaths--_KyRjDB.js";import{M as X}from"./MobileAppDrawer-Ccb0x0R8.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]="595a7e38-df11-44cf-95f5-2e5316855004",t._sentryDebugIdIdentifier="sentry-dbid-595a7e38-df11-44cf-95f5-2e5316855004")}catch{}})();const ee=E(function(t){const a=G(t),i=N.getSignedInUser(),l=h(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:b}=r,v={companyInfo:{...n,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:b.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(Z(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(K({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>h(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,11 +0,0 @@
1
- import{j as C}from"./liveblocks-B46P4ZcR.js";import{a}from"./sentry-CXX07pCD.js";import{u as D,g as v,j as u,N as w}from"./core-N0s35_fE.js";import{Jm as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jt as F}from"./zeni-epic-state-CAiwtZ5t.js";import{u as P,z as c,L as g,D as $,o as k}from"./index-DbeH7KTi.js";import{n as H}from"./mui-DhWmpMK0.js";import{t as z}from"./getLocaleForTenant-BGfzfBRc.js";import{g as R,Q as J}from"./QBOConnectionScreen-BmEp7chx.js";import"./recharts-DuXbfpiI.js";import"./analytics-CASgnR6n.js";import"./plaid-B2IiVtoq.js";import"./dnd-BMJ08YBo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DB3mu-01.js";import"./lexical-DzS0LUFS.js";import"./pdf-BVvV9sq4.js";import"./utils-DX2xeBme.js";import"./empty-CkWtTRNj.js";import"./pdf-lib-B_CfhBsB.js";import"./index-DziAUx1C.js";import"./url-6luVziaP.js";import"./index-BWl9EkTP.js";import"./decodeURIComponentSafe-CXvy74j0.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="d9735e6d-9385-4cb9-a9a7-880f042883c1",t._sentryDebugIdIdentifier="sentry-dbid-d9735e6d-9385-4cb9-a9a7-880f042883c1")}catch{}})();const W=H.div`
2
- display: flex;
3
- flex: 1 1 auto;
4
- flex-direction: row;
5
- justify-content: center;
6
- align-items: center;
7
- width: 100%;
8
- height: 100vh;
9
- background-color: ${t=>t.theme.colors.background};
10
- box-shadow: ${t=>`0px 2px ${k.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function pe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:x}=P(),p=a.useRef(!1),f=a.useRef(!1),{code:b,realmId:T,state:y}=R(i.search),N=b!==""&&T!==""&&y!=="",I=u(l=>A(l)),e=u(l=>O(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=c.getSignedInUser(),m=c.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{p.current||o==null||m==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(j(o.userId,m))))},[p,n,d]),a.useEffect(()=>{e.tenantId==null&&!f.current&&o!=null&&(f.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(U(o.userId)))},[f,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(_(e.tenantId)),c.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),$.updateAppLocaleID(z(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&c.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||x()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(W,{children:C.jsx(J,{})}):C.jsx(w,{to:"/",replace:!0})}export{pe as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-B46P4ZcR.js";import{z as n}from"./index-DbeH7KTi.js";import{g as d}from"./QBOConnectionScreen-BmEp7chx.js";import"./sentry-CXX07pCD.js";import{g as p,N as a}from"./core-N0s35_fE.js";import"./zeni-epic-state-CAiwtZ5t.js";import"./recharts-DuXbfpiI.js";import"./mui-DhWmpMK0.js";import"./analytics-CASgnR6n.js";import"./plaid-B2IiVtoq.js";import"./dnd-BMJ08YBo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DB3mu-01.js";import"./lexical-DzS0LUFS.js";import"./pdf-BVvV9sq4.js";import"./utils-DX2xeBme.js";import"./empty-CkWtTRNj.js";import"./pdf-lib-B_CfhBsB.js";import"./index-DziAUx1C.js";import"./url-6luVziaP.js";import"./index-BWl9EkTP.js";import"./decodeURIComponentSafe-CXvy74j0.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]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
@@ -1,23 +0,0 @@
1
- import{j as a}from"./liveblocks-B46P4ZcR.js";import{t as $e,A as Ce}from"./AddressScreen-ByA9gOjk.js";import Ke from"./NotFoundScreen-fVlJBxuj.js";import{a as g}from"./sentry-CXX07pCD.js";import{h as oe,g as se,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as Me,p as z}from"./core-N0s35_fE.js";import{v as de,k as le,z as B,S as ue,h as qe,c as _,r as V,x as H,d as N,B as we,f as Y,ap as Qe,J as Ze,aq as ke,i as te,ar as Je,as as Ie,o as He,at as We,au as Ee,av as Ye}from"./index-DbeH7KTi.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mU as at,fc as nt,bO as ot,ji as ae,jl as ve,JS as st,bT as it,c2 as ge,ss as he,sd as rt,Km as X,st as _e,HK as ct,km as Ue,Kn as Ve,Ko as dt,Kp as lt,Kq as ut,jg as pt,jj as mt,sf as Be,sr as gt,bE as Te,cv as ht,sF as xe,qf as ft,q3 as yt,ke as St,fE as bt,fD as Ct,fC as kt,Kr as It,s7 as Et,sG as Tt,sJ as xt,sM as Ot,sS as Pt,cT as Dt}from"./zeni-epic-state-CAiwtZ5t.js";import{n as fe}from"./mui-DhWmpMK0.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-BmEp7chx.js";import"./recharts-DuXbfpiI.js";import"./analytics-CASgnR6n.js";import"./plaid-B2IiVtoq.js";import"./dnd-BMJ08YBo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DB3mu-01.js";import"./lexical-DzS0LUFS.js";import"./pdf-BVvV9sq4.js";import"./utils-DX2xeBme.js";import"./empty-CkWtTRNj.js";import"./pdf-lib-B_CfhBsB.js";import"./index-DziAUx1C.js";import"./url-6luVziaP.js";import"./index-BWl9EkTP.js";import"./decodeURIComponentSafe-CXvy74j0.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]="9eb5ec7c-1a74-4e4b-a902-8040a99c92db",t._sentryDebugIdIdentifier="sentry-dbid-9eb5ec7c-1a74-4e4b-a902-8040a99c92db")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),D=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),q===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
2
- display: flex;
3
- height: 100vh;
4
- background-color: ${t=>t.theme.colors.grey4};
5
- `,Pe=fe.div`
6
- display: flex;
7
- flex-direction: column;
8
- align-items: center;
9
- min-width: calc(100% - ${Ie}px);
10
- padding-left: ${Ie}px;
11
- flex: 1;
12
-
13
- ${t=>t.theme.breakpoints.down("md")} {
14
- width: 100%;
15
- padding-left: ${He.sp0};
16
- }
17
-
18
- ${t=>t.windowSize!=="small"?"overflow: auto;":""}
19
- `,De=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:T,ssn:x,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:T,ssn:x,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:f!=null?Te(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:T,companyPhone:x,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:R,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:D,regulatedStatusDescription:Q,transactionVolume:K,transactionVolumeDescription:M,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:T!=""&&T!=null?ht(T):void 0,phone:x,syncToken:F,fileIds:$,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(J=>J.length===2?J:Ee(J))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:D??"",regulatedStatusDescription:Q,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:M,usNexus:v,usNexusTypes:q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=Ae(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=Ae(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(X({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Je),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),S=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=A(y=>y.onboardingCustomerViewState.fetchState),F=A(y=>y.onboardingCustomerViewState.currentStep),$=A(y=>y.onboardingCustomerViewState.uiState),c=A(y=>ee(y)),L=A(y=>y.userRoleConfigState.fetchState),j=A(y=>y.cardPaymentViewState),G=ke(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:b,realmId:R,state:w}=At(d.search),P=c.externalConnections?.accounting[0],D=P?.connectionType,Q=P?.connectionName,K=P?.connectionId??"",M=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(b,R,w,K,M)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:D??"accounting",connection_name:Q??"quickbooks_online",authorization_code:b,realm_id:R,connection_id:K,user_id:M},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,K),u(d.pathname))},[b,R,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=A(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const J=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(Y.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Re?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Ge?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return J===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>Se(y)}),a.jsx(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function Ae(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
20
- display: flex;
21
- height: 100vh;
22
- background-color: ${t=>t.theme.colors.grey4};
23
- `,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=A(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),T=me(i),x=A(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?x==="Completed"&&k===!0&&h&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Dt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&k===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:x}):I?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(Me,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx(Ke,{})})]})}export{oa as default};
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-B46P4ZcR.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-N0s35_fE.js";import{No as k,Nv as _,fE as q,fD as J,fC as K,iD as M,Kw as L,q6 as Q,eP as D,MW as V,iB as T,Np as v,Ny as F,iz as G,iW as N}from"./zeni-epic-state-CAiwtZ5t.js";import{bu as X,J as j,S as R,z as U,h as z,p,c as S,B as O,bv as Y,o as Z,bw as ee,r as te}from"./index-DbeH7KTi.js";import{n as H}from"./mui-DhWmpMK0.js";import"./sentry-CXX07pCD.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]="465d5b69-e662-4fd0-b925-29bd39b83ecb",e._sentryDebugIdIdentifier="sentry-dbid-465d5b69-e662-4fd0-b925-29bd39b83ecb")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(M(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function W({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.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
- `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??P();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??P(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:d}=B(),c=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>D(u)),g=z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(W,{vendorId:c,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
10
- display: flex;
11
- height: 100vh;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- box-shadow: ${e=>`0px 2px ${Z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,de=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:c}=d;return{onFetchBankName:r=>{e(N(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:d}=B(),c=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=z(),g=h(u=>D(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${Z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(W,{vendorId:c,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,W as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
@@ -1 +0,0 @@
1
- import{j as d}from"./liveblocks-B46P4ZcR.js";import{J as l,F as c,h as f}from"./index-DbeH7KTi.js";import{D as p}from"./mui-DhWmpMK0.js";import"./sentry-CXX07pCD.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="54186247-c913-4a96-a75f-fbb572e355c8",e._sentryDebugIdIdentifier="sentry-dbid-54186247-c913-4a96-a75f-fbb572e355c8")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),i=f();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-B46P4ZcR.js";import{a as d}from"./sentry-CXX07pCD.js";import{h as A,u as B,g as L,i as F,j as c,N as q,n as K,o as N,p as _}from"./core-N0s35_fE.js";import{LD as H,eP as O,L0 as R,kG as M,HC as I,LI as W,Kv as Y,jG as $,HD as S,L5 as z,L6 as V,Kx as J,Kw as Q}from"./zeni-epic-state-CAiwtZ5t.js";import{aR as U,d as X,p as Z,r as tt}from"./index-DbeH7KTi.js";import"./mui-DhWmpMK0.js";import{d as k}from"./decodeURIComponentSafe-CXvy74j0.js";import{w as et}from"./withTransactionSidePanel-CKBjU5WR.js";import{f as at,c as nt}from"./routePaths--_KyRjDB.js";import"./recharts-DuXbfpiI.js";import"./analytics-CASgnR6n.js";import"./plaid-B2IiVtoq.js";import"./dnd-BMJ08YBo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DB3mu-01.js";import"./lexical-DzS0LUFS.js";import"./pdf-BVvV9sq4.js";import"./utils-DX2xeBme.js";import"./useAskAiCfoHostNavButtonProps-DFthlJGq.js";import"./TransactionDetailScreen-gTxn6K9t.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="28e6060c-434c-40b4-9c4a-7d295e0b25f6",a._sentryDebugIdIdentifier="sentry-dbid-28e6060c-434c-40b4-9c4a-7d295e0b25f6")}catch{}})();const ot=K(function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(z()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=L(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=F(),r=k(x??""),p=k(j??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=c(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const P=c(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:b(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};