@zeniai/web-app-ui 5.0.83-qa → 5.0.84-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 (134) hide show
  1. package/dist/assets/AddressRoutes-CxSksp5X.js +1 -0
  2. package/dist/assets/AddressScreen-BsDFx8f9.js +9 -0
  3. package/dist/assets/{AiCfoScreen-DEUFQGrJ.js → AiCfoScreen-BdUmXEVc.js} +1 -1
  4. package/dist/assets/BillPayApprovalRoutes-CPj12fD4.js +1 -0
  5. package/dist/assets/{BillPayRoutes-CM8hJk1L.js → BillPayRoutes-UokUnIth.js} +9 -9
  6. package/dist/assets/BusinessVerificationPageScreen-Cu1EqrOf.js +9 -0
  7. package/dist/assets/{ChargeCardRoutes-bFbVJcJ3.js → ChargeCardRoutes-CE4ZeDWt.js} +9 -9
  8. package/dist/assets/{CompanyPassportScreen-2BatYHL7.js → CompanyPassportScreen-BV4MyG7l.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-D6zD7C1V.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-5zFaGEyC.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-Qc9BWmGL.js → CustomerOnboardingRoutes-Dfz2-llu.js} +3 -3
  12. package/dist/assets/DashboardRoutes-DBbyVSZr.js +20 -0
  13. package/dist/assets/{DefaultTenantHome-Z9AqTWY6.js → DefaultTenantHome-DiDfypo1.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-xVrYNbII.js +18 -0
  15. package/dist/assets/DrawerScreen-CfGPVQAS.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-D0FZ4okq.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-CSoEa0_v.js → ExpenseAutomationRoutes-S1bDDjBF.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-BYl4gC2d.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-B0ptLePN.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-Iy5unnpW.js → MagicLinkRoutes-Ugw3OIOt.js} +6 -6
  21. package/dist/assets/MagicLinkSignInScreen-BmdcomX5.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-e8XeuLFm.js → MobileAppDrawer-DzR1e2uV.js} +1 -1
  23. package/dist/assets/NotFoundScreen-D7jhyBo6.js +1 -0
  24. package/dist/assets/NotificationRoutes-BikmJeNE.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-CFFXqy5F.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-C_UyuQ8R.js +1 -0
  27. package/dist/assets/PeopleRoutes-BD51rx7L.js +22 -0
  28. package/dist/assets/PerformanceRoutes-EuINTPbb.js +1 -0
  29. package/dist/assets/{Preview-Dk35mkO2.js → Preview-CBdON77x.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-CZ1MGgEp.js → QBOConnectionScreen-Ber2Vu7P.js} +1 -1
  31. package/dist/assets/ReferralListScreen-DFe3F7FC.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-C8yCelDJ.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Dd8W-jsp.js → ReimbursementApprovalRuleDetailScreen-Bb0yhRm2.js} +1 -1
  34. package/dist/assets/ReimbursementRoutes-BlSI1eiT.js +68 -0
  35. package/dist/assets/{ReportsRoutes-C8V-XsK0.js → ReportsRoutes-C00QeT_D.js} +1 -1
  36. package/dist/assets/RewardsRoutes-xj_hxIfA.js +1 -0
  37. package/dist/assets/ScreenRoutes-B0sYFsPR.js +2 -0
  38. package/dist/assets/{SettingsRoutes-e_2YajK9.js → SettingsRoutes-uFQNDOCC.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-DqRLJPMB.js → SetupPagesScreen-NG-BX2Cs.js} +5 -5
  40. package/dist/assets/SignInScreen-CDOuiR5t.js +1 -0
  41. package/dist/assets/SignOutScreen-CS7iDZe7.js +9 -0
  42. package/dist/assets/{TaskListScreen-A3idk1NZ.js → TaskListScreen-NdCfUdJV.js} +2 -2
  43. package/dist/assets/TaskRoutes-ixLMdnQk.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-D6GBGhEO.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-DIB74eML.js → TransactionDetailScreen-BRjuwlbo.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-FL8BD3WO.js → TransactionListRoutes-7pDKaOvg.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-DsmWumi7.js +37 -0
  48. package/dist/assets/{VendorsRoutes-BpeSS5jb.js → VendorsRoutes-D_LeCbvb.js} +21 -21
  49. package/dist/assets/WiseConfirmationScreen-BUHV4iEA.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-D5ItrMUC.js → ZeniAccountRoutes-Dt-bE3mA.js} +12 -12
  51. package/dist/assets/ZeniAccountStatementScreen-CzgqPJRt.js +9 -0
  52. package/dist/assets/{accountMappingHelper-DN2NK9FA.js → accountMappingHelper-DZfGqaZH.js} +1 -1
  53. package/dist/assets/{analytics-B134UjSL.js → analytics-B2BEDPCs.js} +1 -1
  54. package/dist/assets/{analyticsHelper-lTEhuqth.js → analyticsHelper-DtNneJAN.js} +1 -1
  55. package/dist/assets/{core-B1Jz41nC.js → core-DoFWsAh3.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-HQbzOYEL.js → decodeURIComponentSafe-DeajK0Ay.js} +1 -1
  57. package/dist/assets/{dnd-DumzdahX.js → dnd-BcveyY8t.js} +1 -1
  58. package/dist/assets/{empty-ByyVwI2e.js → empty-CTDyybn0.js} +1 -1
  59. package/dist/assets/{empty-oTLwTSll.js → empty-QfTzS1iQ.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-C6Cu7fXI.js → emptyVideoElement-QuH_897V.js} +1 -1
  61. package/dist/assets/epic-B7M-yw7I.js +2 -0
  62. package/dist/assets/getLocaleForTenant-B77lQ07b.js +1 -0
  63. package/dist/assets/{index-DegTeG1R.js → index-4Xo98QFU.js} +1 -1
  64. package/dist/assets/{index-C8wkuIN5.js → index-BMRrhTMt.js} +1 -1
  65. package/dist/assets/{index-B90Cr8bv.js → index-BPKEmbll.js} +1 -1
  66. package/dist/assets/{index-BA1kjk_c.js → index-B_zQQVmD.js} +14091 -14116
  67. package/dist/assets/{index-jkshGKhR.js → index-CGS6EY1J.js} +2 -2
  68. package/dist/assets/{index-Ve4RRM-O.js → index-CSPFKsWD.js} +1 -1
  69. package/dist/assets/{index-C6t5Pm8y.js → index-CyF1r7km.js} +1 -1
  70. package/dist/assets/{index-DbMluP3a.js → index-D4aHobjN.js} +1 -1
  71. package/dist/assets/{lexical-DsIUchFW.js → lexical-Bn41B4hZ.js} +1 -1
  72. package/dist/assets/{liveblocks-Cjqg1XsV.js → liveblocks-C0YDUK6I.js} +1 -1
  73. package/dist/assets/{lottie-B-v1nIzb.js → lottie-GT0I8BXz.js} +1 -1
  74. package/dist/assets/{mui-DSSmRxLI.js → mui-D7NGykaU.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DUiwH7Zn.js → pathToGoBack-BDnP7cAC.js} +1 -1
  76. package/dist/assets/{pdf-SAu_SEbF.js → pdf-BkkC7i8o.js} +4 -4
  77. package/dist/assets/{pdf-lib-DFDlNXnV.js → pdf-lib-zi68Ap-S.js} +1 -1
  78. package/dist/assets/{plaid-H6p_O3yl.js → plaid-BJpo1TK4.js} +1 -1
  79. package/dist/assets/{pusher-fPmkj0tk.js → pusher-ChH_QGyh.js} +1 -1
  80. package/dist/assets/{react-OAg8acZB.js → react-CVXPHUlL.js} +1 -1
  81. package/dist/assets/{react-Db4JNA42.js → react-CYcHY21q.js} +1 -1
  82. package/dist/assets/{react-CykgLUvo.js → react-DC9LUNFA.js} +1 -1
  83. package/dist/assets/{react-BNA9zwlm.js → react-DYNQ_QYS.js} +1 -1
  84. package/dist/assets/{react-CmgKrC8_.js → react-DbIi67kQ.js} +1 -1
  85. package/dist/assets/{react-B5_vH0ZV.js → react-hkCEeb4O.js} +1 -1
  86. package/dist/assets/{recharts-DW5j2-RD.js → recharts-Cuk30a9F.js} +1 -1
  87. package/dist/assets/{routePaths-CRbFlZJW.js → routePaths-jEiEovGM.js} +1 -1
  88. package/dist/assets/{sentry-DTwqiEdO.js → sentry-D_iKj4jN.js} +1 -1
  89. package/dist/assets/{url-CFX7crLz.js → url-CCqaghyE.js} +1 -1
  90. package/dist/assets/{url-CQOi-x1h.js → url-CmxamPcT.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-CrrCW8TF.js +1 -0
  92. package/dist/assets/{useDeviceId-DOSS9iCb.js → useDeviceId-lfYb9gi-.js} +1 -1
  93. package/dist/assets/useFetchSuggestedQuestionsWhenReady-RpPSJmI8.js +1 -0
  94. package/dist/assets/{useInitialThreadRequest-D05iPKhd.js → useInitialThreadRequest-B2YcCNaV.js} +1 -1
  95. package/dist/assets/{utils-CCEyXo02.js → utils-C2wS7D4E.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-C4l2rQhD.js → withTransactionSidePanel-D2Y7jJCS.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-CFJ-5drS.js → zeni-epic-state-DxMSPxpM.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -4
  100. package/dist/assets/AddressRoutes-CWhsyRK1.js +0 -1
  101. package/dist/assets/AddressScreen-VrcMQjiD.js +0 -9
  102. package/dist/assets/BillPayApprovalRoutes-Bto_8DlZ.js +0 -1
  103. package/dist/assets/BusinessVerificationPageScreen-aX8WAJEu.js +0 -9
  104. package/dist/assets/ConnectionAuthScreen-B2ntqz66.js +0 -11
  105. package/dist/assets/CustomerOnboardingAuthScreen-AYY31Mbm.js +0 -1
  106. package/dist/assets/DashboardRoutes-B2MHI9aq.js +0 -20
  107. package/dist/assets/DomesticWireDetailScreen-wgKBNuTX.js +0 -18
  108. package/dist/assets/DrawerScreen-CD89PYIf.js +0 -1
  109. package/dist/assets/EntityDetailRoutes-DY6s5vdx.js +0 -1
  110. package/dist/assets/FeaturePreviewScreen-ClFmJj0F.js +0 -1
  111. package/dist/assets/HubSpotOAuthCallbackScreen-Bv0Dplnr.js +0 -1
  112. package/dist/assets/MagicLinkSignInScreen-BT8J4zZB.js +0 -12
  113. package/dist/assets/NotFoundScreen-Bky0x63m.js +0 -1
  114. package/dist/assets/NotificationRoutes-BebVEMiU.js +0 -1
  115. package/dist/assets/OAuthConsentScreen-D5F3V9z0.js +0 -1
  116. package/dist/assets/PandLWithForecastRoutes-B8DWi2uL.js +0 -1
  117. package/dist/assets/PeopleRoutes-C_Z9cC8z.js +0 -22
  118. package/dist/assets/PerformanceRoutes-loPr71_u.js +0 -1
  119. package/dist/assets/ReferralListScreen-CT69aUhD.js +0 -5
  120. package/dist/assets/ReimbursementApprovalRoutes-cun-DBmT.js +0 -1
  121. package/dist/assets/ReimbursementRoutes-BlJI16jt.js +0 -68
  122. package/dist/assets/RewardsRoutes-BHmDW7as.js +0 -1
  123. package/dist/assets/ScreenRoutes-zKgwm72u.js +0 -2
  124. package/dist/assets/SignInScreen-Cog1Vtto.js +0 -1
  125. package/dist/assets/SignOutScreen-ZO39xI3M.js +0 -9
  126. package/dist/assets/TaskRoutes-NoT_X70G.js +0 -9
  127. package/dist/assets/TransactionDetailRoutes-CVrjMcax.js +0 -1
  128. package/dist/assets/TreasuryRoutes-CTNKrHTc.js +0 -37
  129. package/dist/assets/WiseConfirmationScreen-CXqsKsLQ.js +0 -12
  130. package/dist/assets/ZeniAccountStatementScreen-CFbM7j61.js +0 -9
  131. package/dist/assets/epic-BnAvJDb_.js +0 -2
  132. package/dist/assets/getLocaleForTenant-BgJ-_j4h.js +0 -1
  133. package/dist/assets/useAskAiCfoHostNavButtonProps-BtmGLJlN.js +0 -1
  134. package/dist/assets/useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js +0 -1
package/dist/index.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-BA1kjk_c.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-DTwqiEdO.js"><link rel="modulepreload" crossorigin href="/assets/core-B1Jz41nC.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-CFJ-5drS.js"><link rel="modulepreload" crossorigin href="/assets/mui-DSSmRxLI.js"><link rel="modulepreload" crossorigin href="/assets/analytics-B134UjSL.js"><link rel="modulepreload" crossorigin href="/assets/utils-CCEyXo02.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-B_zQQVmD.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-D_iKj4jN.js"><link rel="modulepreload" crossorigin href="/assets/core-DoFWsAh3.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-DxMSPxpM.js"><link rel="modulepreload" crossorigin href="/assets/mui-D7NGykaU.js"><link rel="modulepreload" crossorigin href="/assets/analytics-B2BEDPCs.js"><link rel="modulepreload" crossorigin href="/assets/utils-C2wS7D4E.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.0.83-qa",
3
+ "version": "5.0.84-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.11",
31
- "@zeniai/client-epic-state": "5.0.44",
32
- "@zeniai/web-components": "4.0.88",
30
+ "@zeniai/client-analytics": "2.0.13",
31
+ "@zeniai/client-epic-state": "5.0.46",
32
+ "@zeniai/web-components": "4.0.89",
33
33
  "color": "3.1.3",
34
34
  "cross-fetch": "^4.0.0",
35
35
  "crypto-js": "4.2.0",
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-Cjqg1XsV.js";import{A as i}from"./AddressScreen-VrcMQjiD.js";import s from"./NotFoundScreen-Bky0x63m.js";import"./sentry-DTwqiEdO.js";import{n as d,o as r}from"./core-B1Jz41nC.js";import"./zeni-epic-state-CFJ-5drS.js";import"./recharts-DW5j2-RD.js";import"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.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]="624154e3-3694-4a3c-b645-a66b8e12404c",t._sentryDebugIdIdentifier="sentry-dbid-624154e3-3694-4a3c-b645-a66b8e12404c")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,9 +0,0 @@
1
- import{j as r}from"./liveblocks-Cjqg1XsV.js";import{a as h}from"./sentry-DTwqiEdO.js";import{j as T,h as _,u as j,l as E,g as $,k as B}from"./core-B1Jz41nC.js";import{Z as K,m as M,z as D,c as L,v as R,x as z,d as C,f as S,j as F,h as b,p as N}from"./index-BA1kjk_c.js";import{J$ as k,gY as U,eQ as G,K0 as O,c2 as V,K1 as q,ki as H}from"./zeni-epic-state-CFJ-5drS.js";import{n as J}from"./mui-DSSmRxLI.js";import Q from"./NotFoundScreen-Bky0x63m.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]="ee6d5e0a-8fe8-4b7a-9851-63a0ad277e87",e._sentryDebugIdIdentifier="sentry-dbid-ee6d5e0a-8fe8-4b7a-9851-63a0ad277e87")}catch{}})();const Y=J.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
- `,Z=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=N(d?.pathnameStackToGoBack);let s=n.poppedPathname??v();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=W(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(F);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=j(),{addressId:s,addressType:u}=E(),g=K(),w=M(),x=D.getSignedInUser(),[f,I]=h.useState(s==null),p=$(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=L();if(x==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(I(!0),d(U(s,!1)))},[f,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(R,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(z,{analytics:C,onLoad:P}),r.jsx(Y,{windowSize:g,children:r.jsx(Z,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(Q,{})}const v=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},W=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{re as A,W as t};
@@ -1 +0,0 @@
1
- import{j as l}from"./liveblocks-Cjqg1XsV.js";import{a as y}from"./sentry-DTwqiEdO.js";import{j as U,u as B,h as j,g as v,N,k as T,l as O,n as $,o as S}from"./core-B1Jz41nC.js";import{eQ as F,Ni as R,M_ as h,xM as x,xG as L,xK as I,xz as z,N0 as M,xC as W,xO as q,xN as E}from"./zeni-epic-state-CFJ-5drS.js";import{m as P,z as k,v as V,a3 as G,by as K,ac as _,bz as Q}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-Dd8W-jsp.js";import J from"./NotFoundScreen-Bky0x63m.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="bc5482af-bb8b-488a-8fa2-2ba976526bb1",e._sentryDebugIdIdentifier="sentry-dbid-bc5482af-bb8b-488a-8fa2-2ba976526bb1")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(w)&&e(M(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(z(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(G(K)),Y=()=>{const e=U(),o=B(),a=j(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(L(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const a=h(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(b=>{const C=!!H(b.value);return{type:C?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{a("../")}}})(Q);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=O(),t=k.getSignedInUser(),u=P(),s=v(r=>h(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs($,{children:[l.jsx(S,{path:"/",element:l.jsx(Y,{})}),l.jsx(S,{path:"/new",element:l.jsx(D,{})}),l.jsx(S,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(S,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
@@ -1,9 +0,0 @@
1
- import{j as k}from"./liveblocks-Cjqg1XsV.js";import{a as V}from"./sentry-DTwqiEdO.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-B1Jz41nC.js";import{c as ce,y as ue,aK as de,z,x as pe,d as B,ac as F,f as E,bu as le,aq as me,q as R,ar as P}from"./index-BA1kjk_c.js";import{N6 as fe,eQ as q,s8 as ye,Hx as Se,xR as ge,Ay as Ie,D5 as he,DK as be,ED as De,Nt as Oe,Nu as Te,Nv as ke,Nw as Ce,Nx as Ve,K0 as Ne,Mv as we,Kc as Ae,ki as ve,fC as _e,fB as xe,fA as Fe,q9 as Ee,q0 as ze,pZ as Be,ka as Re,sh as Pe,sf as M,bE as L,st as U,cv as Me}from"./zeni-epic-state-CFJ-5drS.js";import{n as Le}from"./mui-DSSmRxLI.js";import{c as j}from"./routePaths-CRbFlZJW.js";import{M as Ue}from"./MobileAppDrawer-e8XeuLFm.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]="4ca37fa6-e467-4ae2-8b74-798e5f5777f8",e._sentryDebugIdIdentifier="sentry-dbid-4ca37fa6-e467-4ae2-8b74-798e5f5777f8")}catch{}})();const je=Le.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
- `,qe=re(function(e,d){const{businessVerificationDetails:i}=d,r=q(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=Ne(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:N,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:v,countriesOfOperations:h,companySourceOfFunds:G,companySourceOfFundsDescription:K,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:H,purposeOfAccountDescription:Q,regulatedStatus:W,regulatedStatusDescription:J,usNexus:X,usNexusTypes:Y}=t,_=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:N?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:v?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(x=>x.length===2?x:P(x))??[],companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:H?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:W??"",regulatedStatusDescription:J,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:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:v}=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?P(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:v,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(M(i,t,r))},onSendForVerificationClick:t=>{e(M(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Pe({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Re({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(Ee(t,s.split(".")[0]))},onGetOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(xe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(_e(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(ve({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.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=>q(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.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=Ve(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,F(i)?"Settings":void 0)}})(a)}),F(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(qe,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:F(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
@@ -1,11 +0,0 @@
1
- import{j as C}from"./liveblocks-Cjqg1XsV.js";import{a}from"./sentry-DTwqiEdO.js";import{h as D,u as v,g as u,N as w}from"./core-B1Jz41nC.js";import{J9 as A,eQ as O,fl as U,mS as _,fN as E,fk as j,eR as L,Jg as k}from"./zeni-epic-state-CFJ-5drS.js";import{u as F,z as p,L as g,D as $,o as H}from"./index-BA1kjk_c.js";import{n as R}from"./mui-DSSmRxLI.js";import{t as z}from"./getLocaleForTenant-BgJ-_j4h.js";import{g as Q,Q as J}from"./QBOConnectionScreen-CZ1MGgEp.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./empty-oTLwTSll.js";import"./pdf-lib-DFDlNXnV.js";import"./index-C6t5Pm8y.js";import"./url-CFX7crLz.js";import"./index-B90Cr8bv.js";import"./decodeURIComponentSafe-HQbzOYEL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="0a98b192-a0c4-4670-822f-b14995350685",t._sentryDebugIdIdentifier="sentry-dbid-0a98b192-a0c4-4670-822f-b14995350685")}catch{}})();const P=R.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 ${H.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function fe(){const t=D(),d=v(),{setLoading:i,clearAllLoading:b}=F(),f=a.useRef(!1),c=a.useRef(!1),{code:x,realmId:N,state:S}=Q(d.search),T=x!==""&&N!==""&&S!=="",I=u(l=>A(l)),e=u(l=>O(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=p.getSignedInUser(),m=p.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,h=e?.externalConnections?.saveConnectionState,y=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{i(g.CONNECTION_AUTH)},[i]),a.useEffect(()=>{f.current||o==null||m==null||(f.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(i(g.TENANT_FETCHING),t(U(o.userId,m))))},[f,n,i]),a.useEffect(()=>{e.tenantId==null&&!c.current&&o!=null&&(c.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(_(o.userId)))},[c,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||h!=="Error"||(i(g.CONNECTION_AUTH),t(E(o.userId,e.tenantId)))},[h]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(j(e.tenantId)),p.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),$.updateAppLocaleID(z(k(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(E(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&p.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:T||y===!1?C.jsx(P,{children:C.jsx(J,{})}):C.jsx(w,{to:"/",replace:!0})}export{fe as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-Cjqg1XsV.js";import{z as a}from"./index-BA1kjk_c.js";import{g as n}from"./QBOConnectionScreen-CZ1MGgEp.js";import"./sentry-DTwqiEdO.js";import{u as p,N as s}from"./core-B1Jz41nC.js";import"./zeni-epic-state-CFJ-5drS.js";import"./recharts-DW5j2-RD.js";import"./mui-DSSmRxLI.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./empty-oTLwTSll.js";import"./pdf-lib-DFDlNXnV.js";import"./index-C6t5Pm8y.js";import"./url-CFX7crLz.js";import"./index-B90Cr8bv.js";import"./decodeURIComponentSafe-HQbzOYEL.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]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,20 +0,0 @@
1
- import{j as l}from"./liveblocks-Cjqg1XsV.js";import{l as z,g as S,u as q,h as $,j as Z,k as H,s as Ka,n as st,o as w}from"./core-B1Jz41nC.js";import{eQ as j,Kv as Ge,bE as Vt,bq as he,LI as qa,i2 as Za,LJ as wt,LK as Qa,i5 as rt,LL as Le,LM as Ha,ia as Wa,LN as Dt,LO as Xa,ie as it,LP as Ue,LQ as Ja,cl as lt,LR as en,LS as tn,KP as an,j8 as nn,LT as on,bn as Ee,LU as Nt,Kj as ae,bc as $t,jm as zt,m_ as Kt,j5 as qt,Kl as ne,Kk as Q,f5 as sn,eN as rn,fn as cn,LV as ln,LW as dn,LX as Zt,LY as _e,uc as Ie,ud as Te,uA as fe,uu as oe,uh as xe,LZ as un,L_ as mn,L$ as pn,M0 as Qt,M1 as ke,M2 as hn,dE as Ve,qJ as Ht,M3 as fn,M4 as gn,M5 as bn,M6 as dt,JI as ut,jC as ge,uI as mt,qR as Cn,M7 as _n,ue as Ft,qM as me,qI as Wt,M8 as ie,M9 as kn,Ma as pt,JG as ht,sQ as Xt,Mb as Sn,Mc as yn,Md as An,Me as ft,t1 as vn,Mf as En,ug as Pt,sP as Jt,Mg as ce,Mh as In,bv as ea,uM as ta,Mi as Tn,Mj as xn,Mk as wn,Ml as gt,uH as Dn,Mm as Fn,uf as Ot,uL as aa,Mn as le,Mo as Pn,Mp as On,Mq as na,jr as oa,mX as sa,jw as ra,mV as ia,mU as ca,mT as la,sc as Mn,fd as Rn,cO as Bn,cP as jn,mQ as Ln,f9 as Un,n5 as Yn,DQ as Mt,Mr as Gn,Ms as Vn,Mt as Nn,Mu as $n,b5 as bt,f0 as zn,gM as Kn,fE as qn,m$ as Zn,i_ as Qn,mY as Hn,mW as Wn,eW as Xn,eU as Jn}from"./zeni-epic-state-CFJ-5drS.js";import{z as R,X as W,q as D,d as I,D as K,aR as eo,x as we,aS as da,f as V,aT as to,c as De,aU as ua,y as Fe,S as B,m as ao,aV as no,aW as oo,Q as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,W as lo,aZ as uo,a_ as mo,an as po,p as ho,T as fo,a$ as go,b0 as ye}from"./index-BA1kjk_c.js";import{n as Ct}from"./mui-DSSmRxLI.js";import{a as C}from"./sentry-DTwqiEdO.js";import{w as fa}from"./withTransactionSidePanel-C4l2rQhD.js";import{b as ga,t as be,e as se,a as _t,v as bo}from"./routePaths-CRbFlZJW.js";import{u as X}from"./useAskAiCfoHostNavButtonProps-BtmGLJlN.js";import{c as Pe,b as Co,u as _o}from"./useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js";import ve from"./NotFoundScreen-Bky0x63m.js";import{u as ko}from"./useInitialThreadRequest-D05iPKhd.js";import{t as ba}from"./analyticsHelper-lTEhuqth.js";import{C as So}from"./CompanyPassportScreen-2BatYHL7.js";import{F as yo}from"./FeaturePreviewScreen-ClFmJj0F.js";import{R as Ao}from"./ReferralListScreen-CT69aUhD.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./TransactionDetailScreen-DIB74eML.js";import"./decodeURIComponentSafe-HQbzOYEL.js";import"./MobileAppDrawer-e8XeuLFm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="e06e160a-64f2-4a6e-9881-7dc4b7167c5c",e._sentryDebugIdIdentifier="sentry-dbid-e06e160a-64f2-4a6e-9881-7dc4b7167c5c")}catch{}})();const vo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(v=>v.tenantState.currentTenantId),d=S(v=>j(v)),{tenantEmailDomain:p}=z(),_=q(),b=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:b,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ge()}),[]),m=C.useMemo(()=>r!=null?Vt(r):he(),[r]),h=$(),f=Z(),k=S(v=>qa(v,m,o)),y=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),g=C.useCallback(()=>{f("../../",{relative:"path"})},[]),A=C.useCallback((v,L)=>{h(wt({sortKey:v,sortOrder:L}))},[]),P=C.useCallback(v=>{h(wt({downloadState:v}))},[]),U=C.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(p!=null){const L=ga({id:v.transactionId,type:v.transactionType},p);f(L);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(L,{state:{pathnameStackToGoBack:de}})}},[p,e]),T=C.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{y()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&T()},[T,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:U,onReload:y,onBackClick:g,onColumnSortConfigChanged:A,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Eo=()=>{const e=$(),a=Z(),t=S(A=>Qa(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AP Aging"});Pe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>j(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${W}/agingReport`,timezone:Ge()}),[]),b=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(b))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(A=>{e(Le({searchString:A}))},[]),h=C.useCallback((A,P)=>{e(Le({sortKey:P,sortOrder:A}))},[]),f=C.useCallback(A=>{a(`./${A}/${b.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[b]),k=C.useCallback(A=>{e(Le({downloadState:A}))},[]),y=C.useCallback((A,P)=>{},[]),g=C.useCallback((A,P)=>{e(Le({selectedDate:A,agingDateSelectionType:P})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:g,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Io=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(T=>j(T)),{tenantEmailDomain:d}=z(),p=q(),_=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:b,companyName:_,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ge()}),[]),c=C.useMemo(()=>r!=null?Vt(r):he(),[r]),m=$(),h=Z(),f=S(T=>Ha(T,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Wa(o,c))},[c]),y=C.useCallback(()=>{h("../../",{relative:"path"})},[]),g=C.useCallback((T,v)=>{m(Dt({sortKey:T,sortOrder:v}))},[]),A=C.useCallback(T=>{m(Dt({downloadState:T}))},[]),P=C.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(d!=null){const v=ga({id:T.transactionId,type:T.transactionType},d);h(v);const L=D(p.state?.pathnameStackToGoBack,p.pathname);h(v,{state:{pathnameStackToGoBack:L}})}},[d,e]),U=C.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&U()},[f.fetchState,U]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:P,onReload:k,onBackClick:y,onColumnSortConfigChanged:g,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),To=()=>{const e=$(),a=Z(),t=S(g=>Xa(g)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AR Aging"});Pe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(g=>j(g)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${W}/agingReport`,timezone:Ge()}),[]),_=t.arAgingUIState.selectedDate??he(),b=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{b()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(g=>{e(Ue({searchString:g}))},[]),m=C.useCallback((g,A)=>{e(Ue({sortKey:A,sortOrder:g}))},[]),h=C.useCallback(g=>{a(`./${g}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(g=>{e(Ue({downloadState:g}))},[]),k=C.useCallback((g,A)=>{e(Ue({selectedDate:g,agingDateSelectionType:A})),e(it(g))},[]),y=C.useCallback((g,A)=>{e(Ja({nodeId:g,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:g=>g.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:b,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ca=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const xo=H(function(e){const a=en(e).accountsInOrder.map((n,o)=>Ca(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},_a)(ua),wo=H(function(e){const a=on(e).accountsInOrder.map((o,r)=>Ca(o,r)),t=R.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},_a)(ua);function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Fo(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(wo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Po=Ct.div`
2
- display: flex;
3
- flex: 1 1 auto;
4
- min-height: 100%;
5
- flex-direction: column;
6
- background-color: ${e=>e.theme.colors.grey4};
7
- `,Oo=Ct.div`
8
- display: flex;
9
- flex: 1 1 auto;
10
- flex-direction: column;
11
- align-items: center;
12
- background-color: ${e=>e.theme.colors.grey4};
13
- `;function Mo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=Z(),i=$(),d=q(),{tenantEmailDomain:p}=z(),_=ao();return l.jsxs(Po,{children:[l.jsx(no,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:_.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:b=>{b.trim().length>=2?i(ne({searchString:b,searchOrigin:"navbar"})):b.trim().length===0&&i(Q("navbar"))},onAutoCompleteEntity:b=>{n!=null&&I?.trackSearch(V.Event.search,Ro(a),b.type,b.name,n);const u=se(b,p),c=D(d.state?.pathnameStackToGoBack,d.pathname);s(u,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:l.jsx(oo,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),l.jsx(Oo,{children:a==="cash_balance"?l.jsx(Do,{}):l.jsx(Fo,{})})]})}function Rt(){const e=q(),a=$(),{useFeatureGate:t}=Fe(),{isFeatureEnabled:n}=t(B.isDepositAccountsFeatureEnabled),o=S(h=>h.cashBalanceState.fetchState),r=S(h=>h.cardBalanceState.fetchState),s=R.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=Nt((h=>{const f=$t(h,"/").split("/");return f[f.length-1]})(e.pathname));let d="Not-Started",p="";const _=K.getLocalizedStrings();switch(i){case"cash_balance":d=o,p=_.reportTitleById.cash_balance;break;case"card_balance":d=r,p=_.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:b,onAskAiCfoClick:u}=X({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});Pe({isDataReady:d==="Completed"});const c=S(h=>h.entityAutoCompleteState.autoCompleteText.navbar),m=S(h=>ae(h,"navbar"));return C.useEffect(()=>{d==="Not-Started"&&function(h,f,k){switch(f){case"card_balance":h(qt());break;case"cash_balance":h(zt()),k===!0&&h(Kt());break;default:throw new Error(`balance report type ${f} is not yet supported`)}}(a,i,n)},[s,a,d]),l.jsxs(l.Fragment,{children:[d==="Completed"?l.jsx(we,{analytics:I,onLoad:h=>((f,k)=>{switch(k){case"card_balance":f.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${k}!`)}})(h,i)}):null,l.jsx(Mo,{title:p,reportId:i,autoCompleteText:c,entityAutoCompleteView:m,isAiCfoAccessEnabled:b,onAskAiCfoClick:u})]})}const Ro=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Bo=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=$(),n=Z(),o=q(),{tenantEmailDomain:r}=z(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=ma(),d=so(),p=lo(d),_=Ka(),b=S(O=>sn(O)),u=b.uiState?.currentChatSessionId,c=b.allSessionsWithOrderedQuestionAnswers??Bo,m=R.getSignedInUser()?.userId,h=pa(),f=Co()&&h&&r!=null,k=ro(),y=_o(!0),g=S(O=>k!=null?rn(O,k):void 0),{useDynamicConfig:A}=Fe(),{configValue:P}=A(ha.aiCfoMessageDynamicConfig),U=C.useMemo(()=>Array.isArray(P.default_message_list)?P.default_message_list:[],[P.default_message_list]),T=C.useMemo(()=>U.slice(0,2),[U]),v=k!=null&&g!=null&&g.fetchState!=="Completed"&&g.fetchState!=="Error"&&(y||g.fetchState==="In-Progress"),L=C.useMemo(()=>{if(k==null||g?.fetchState==="Error")return T;if(v)return[];const O=(g?.suggestedQuestions??[]).map(J=>J.trim()).filter(J=>J.length>0).slice(0,2);return O.length===0?T:O},[T,v,k,g?.fetchState,g?.suggestedQuestions]),de=C.useCallback((O,J)=>{if(m==null||O.trim()==="")return;const Re=io(_.getState());if(p){const $e=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:$e,referrer:a,aiCfoInitialQuestion:O,aiCfoShouldSubmit:!Re}})}else{if(Re)return t(cn(O)),void s(!0);i(O),s(!0),co(t,O,"insights_section",u,c,m,J,void 0)}},[c,u,t,p,o.pathname,o.state,a,n,s,i,_,r,m]),Ce=C.useCallback(()=>{if(p){const O=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:O,referrer:a}})}else s(!0)},[p,o.pathname,o.state,a,n,s,r]);return C.useMemo(()=>{if(f)return{isSuggestedQuestionsLoading:v,onAskSomethingElseClick:Ce,onSuggestedQuestionClick:de,suggestedQuestions:L}},[f,v,Ce,de,L])}const Me=uo,jo=H(function(e){const a=ln(e),t=dn(e),n=Zt(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=R.getSignedInUser(),d=e.tenantState.currentTenantId,p=j(e),_=p?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${W}/statement`,authParams:b},analytics:I,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(un(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(_e({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(fe("month")),e(oe(a.firstMonthOfFY,t)),e(_e({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(_e({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(_e({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(_e({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Q("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(Me),Lo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=X({mobileExploreReferrer:"DashboardCashInCashOut"}),s=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),i=S(d=>Zt(d)).mode==="compare_mode";return l.jsx(jo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Yo=H(function(e){const a=mn(e),t=pn(e),n=Qt(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_position,i=R.getSignedInUser(),d=e.tenantState.currentTenantId,p=j(e),_=p?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${W}/statement`,authParams:b},analytics:I,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(hn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ke({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ke({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Q("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(ke({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(Me),Go=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=X({mobileExploreReferrer:"DashboardCashPosition"}),s=Oe({mobileExploreReferrer:"DashboardCashPosition"}),i=S(d=>Qt(d)).mode==="compare_mode";return l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},N=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Je(){return l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId/*",element:l.jsx(ve,{})})]})}const Vo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},No=H(function(e){const a=Ht(e),t=fn(e),n=gn(e),o=bn(e),r=dt(e),{scrollPosition:s,...i}=r,d=t.reportTitle,p=R.getSignedInUser(),_=e.tenantState.currentTenantId,b=j(e),u=b?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${W}/statement`,authParams:c},analytics:I,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(kn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ie({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ie({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Vo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(ie({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ie({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Q("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(Wt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ie({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(_n({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Cn())},onResyncReports:()=>{e(mt("net_burn_or_income_by_classes"))}}})(Me),$o=e=>{const a=$(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=X({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),d=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S(g=>dt(g)),_=p.isForecastModeOn,b=p.timeframe,u=p.selectedForecast?.id,c=S(g=>pt(g.forecastState,u??"")),m=S(g=>Ht(g)),h=S(g=>ht(g)),f=S(g=>ge(g)),k=p.mode==="compare_mode",y=m.dataAvailable;return C.useEffect(()=>{if(u!=null&&_===!0&&(N(_,r,u,o),c!=null)){const g=c?.forecastPeriod,A=y!=null&&g.endDate.isAfter(y?.endDate)===!0?y:g;a(oe(e.firstMonthOfFY,{startDate:A.endDate.startOf(b),endDate:A?.endDate}))}},[u]),l.jsx(No,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,analytics:I,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},zo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Ko=H(function(e){const a=Xt(e),t=Sn(e),n=yn(e),o=An(e),r=ft(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.operating_expenses,p=R.getSignedInUser(),_=e.tenantState.currentTenantId,b=j(e),u=b?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${W}/statement`,authParams:c},analytics:I,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ce({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(ce({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=zo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(ce({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ce({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Q("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t=="forecast_mode"?(e(Pt({viewMode:"account_group"})),e(Jt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Pt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(En({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(vn())},onResyncReports:()=>{e(mt("operating_expenses_by_classes"))}}})(Me),qo=e=>{const a=$(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=X({mobileExploreReferrer:"DashboardOpEx"}),d=Oe({mobileExploreReferrer:"DashboardOpEx"}),p=S(v=>ft(v)),_=p.isForecastModeOn,b=p.timeframe,u=p.selectedForecast?.id,c=S(v=>pt(v.forecastState,u??"")),m=S(v=>Xt(v)),h=S(v=>ht(v)),f=S(v=>ge(v)),k=p.mode==="compare_mode",y=m.dataAvailable;C.useEffect(()=>{if(u!=null&&_===!0&&(N(_,r,u,o),c!=null)){const v=c?.forecastPeriod,L=y!=null&&v.endDate.isAfter(y?.endDate)===!0?y:v;a(oe(e.firstMonthOfFY,{startDate:L.endDate.startOf(b),endDate:L?.endDate}))}},[u]);const g=De(),A=g?.loggedInUserRole!=null&&ea(g?.loggedInUserRole)!==!0,{useFeatureGate:P}=Fe(),{isFeatureEnabled:U}=P(B.isReportsCommentingEnabled),T=ko(U?g?.currentTenant?.companyId:void 0,{clearParams:m.fetchState==="Completed"});return l.jsx(Ko,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:I,hasTransactionAccess:A,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i,initialOpenThreadRequest:T,isReportsCommentingEnabled:U})},Zo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Qo=H(function(e){const a=ta(e),t=Tn(e),n=xn(e),o=wn(e),r=gt(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.revenue,p=R.getSignedInUser(),_=e.tenantState.currentTenantId,b=j(e),u=b?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${W}/statement`,authParams:c},analytics:I,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Pn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(le({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(le({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(le({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(le({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(le({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(le({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Q("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(aa(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(le({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Fn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Dn())},onResyncReports:()=>{e(mt("revenue_by_classes"))}}})(Me),Ho=e=>{const a=$(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=X({mobileExploreReferrer:"DashboardRevenue"}),d=Oe({mobileExploreReferrer:"DashboardRevenue"}),p=S(y=>gt(y)),_=p.isForecastModeOn,b=p.timeframe,u=p.selectedForecast?.id,c=S(y=>pt(y.forecastState,u??"")),m=S(y=>ta(y)).dataAvailable,h=p.mode==="compare_mode",f=S(y=>ge(y)),k=S(y=>ht(y));return C.useEffect(()=>{if(u!=null&&_===!0&&(N(_,r,u,o),c!=null)){const y=c?.forecastPeriod,g=m!=null&&y.endDate.isAfter(m?.endDate)===!0?m:y;a(oe(e.firstMonthOfFY,{startDate:g.endDate.startOf(b),endDate:g?.endDate}))}},[u]),l.jsx(Qo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:f,isCompareModeOn:h,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:I,reportsResyncFetchState:k.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Wo=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Xo=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ae(e,"navbar");return{report:a,analytics:I,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{I.trackTimeframeSwitch(ba(t),"Top Expenses"),e(na(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Wo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Q("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(mo),Jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Xo,{tenantEmailDomain:a,location:t,navigate:n})},es=Ct.div`
14
- display: flex;
15
- flex: 1 1 auto;
16
- min-height: 100%;
17
- flex-direction: column;
18
- background-color: ${e=>e.theme.colors.grey5};
19
- align-items: center;
20
- `,pe=3,kt=1;function ts({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=Z(),r=q(),{tenantEmailDomain:s}=z();let i;Pe({isDataReady:!0});const d={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(qo,{...d});break;case"revenue":i=l.jsx(Ho,{...d});break;case"net_burn_or_income":i=l.jsx($o,{...d});break;case"cash_position":i=l.jsx(Go,{...d});break;case"top_expenses":i=l.jsx(Jo,{...d});break;case"cash_in_cash_out":i=l.jsx(Lo,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(es,{children:i}):null}function ee(){const e=q(),a=$(),{forecastId:t}=z();let n="Not-Started";const o=S(c=>ft(c).fetchState),r=S(c=>gt(c).fetchState),s=S(c=>dt(c).fetchState),i=S(c=>c.cashPositionState.fetchState),d=S(c=>c.topExState.fetchState),p=S(c=>c.cashInCashOutState.fetchState);if(R.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const _=S(c=>j(c)),b=_?.company?.companyInfo?.firstMonthOfFY??1,u=Nt((c=>{const m=$t(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(u){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=d;break;case"cash_in_cash_out":n=p;break;default:console.error(`${u} is not supported!`)}return C.useEffect(()=>{n==="Not-Started"&&function(c,m,h,f){switch(m){case"operating_expenses":c(la(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Jt(!1,f)));break;case"revenue":c(ca(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(aa(!1,f)));break;case"net_burn_or_income":c(ia(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Wt(!1,f)));break;case"cash_position":c(ra(!0));break;case"top_expenses":c(sa());break;case"cash_in_cash_out":c(oa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,u,b,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(we,{analytics:I,onLoad:c=>((m,h)=>{const f=e.state?.referrer;switch(h){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,f);break;case"revenue":m.trackPageLoaded(V.Event.revenues,f);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,f);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,f);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,f);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,u)}):null,l.jsx(ts,{firstMonthOfFY:b,fetchState:n,reportId:u,forecastId:t})]})}var et=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function tt(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ka(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Sa(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var St={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":et?173:189,"=":et?61:187,";":et?59:186,"'":222,"[":219,"]":221,"\\":220},te={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ct={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},M={16:!1,18:!1,17:!1,91:!1},F={},Ye=1;Ye<20;Ye++)St["f".concat(Ye)]=111+Ye;var x=[],Bt=!1,ya="all",jt=[],Ne=function(e){return St[e.toLowerCase()]||te[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Lt(e){ya=e||"all"}function Ae(){return ya||"all"}var at=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Sa(a).forEach(function(s){var i=s.split(r),d=i.length,p=i[d-1],_=p==="*"?"*":Ne(p);if(F[_]){t||(t=Ae());var b=d>1?ka(te,i):[];F[_]=F[_].filter(function(u){return!((!n||u.method===n)&&u.scope===t&&function(c,m){for(var h=c.length>=m.length?c:m,f=c.length>=m.length?m:c,k=!0,y=0;y<h.length;y++)f.indexOf(h[y])===-1&&(k=!1);return k}(u.mods,b))})}})};function Ut(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,M)Object.prototype.hasOwnProperty.call(M,r)&&(!M[r]&&a.mods.indexOf(+r)>-1||M[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||M[16]||M[18]||M[17]||M[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Yt(e,a){var t=F["*"],n=e.keyCode||e.which||e.charCode;if(Y.filter.call(this,e)){if(n!==93&&n!==224||(n=91),x.indexOf(n)===-1&&n!==229&&x.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var h=ct[m];e[m]&&x.indexOf(h)===-1?x.push(h):!e[m]&&x.indexOf(h)>-1?x.splice(x.indexOf(h),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(h))))}),n in M){for(var o in M[n]=!0,te)te[o]===n&&(Y[o]=!0);if(!t)return}for(var r in M)Object.prototype.hasOwnProperty.call(M,r)&&(M[r]=e[ct[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(x.indexOf(17)===-1&&x.push(17),x.indexOf(18)===-1&&x.push(18),M[17]=!0,M[18]=!0);var s=Ae();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&Ut(e,t[i],s,a);if(n in F){for(var d=0;d<F[n].length;d++)if((e.type==="keydown"&&F[n][d].keydown||e.type==="keyup"&&F[n][d].keyup)&&F[n][d].key){for(var p=F[n][d],_=p.splitKey,b=p.key.split(_),u=[],c=0;c<b.length;c++)u.push(Ne(b[c]));u.sort().join("")===x.sort().join("")&&Ut(e,p,s,a)}}}}function Y(e,a,t){x=[];var n=Sa(e),o=[],r="all",s=document,i=0,d=!1,p=!0,_="+",b=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(d=a.keyup),a.keydown!==void 0&&(p=a.keydown),a.capture!==void 0&&(b=a.capture),typeof a.splitKey=="string"&&(_=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(_)).length>1&&(o=ka(te,e)),(e=(e=e[e.length-1])==="*"?"*":Ne(e))in F||(F[e]=[]),F[e].push({keyup:d,keydown:p,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:_,element:s});s!==void 0&&!function(u){return jt.indexOf(u)>-1}(s)&&window&&(jt.push(s),tt(s,"keydown",function(u){Yt(u,s)},b),Bt||(Bt=!0,tt(window,"focus",function(){x=[]},b)),tt(s,"keyup",function(u){Yt(u,s),function(c){var m=c.keyCode||c.which||c.charCode,h=x.indexOf(m);if(h>=0&&x.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in M)for(var f in M[m]=!1,te)te[f]===m&&(Y[f]=!1)}(u)},b))}var nt={setScope:Lt,getScope:Ae,deleteScope:function(e,a){var t,n;for(var o in e||(e=Ae()),F)if(Object.prototype.hasOwnProperty.call(F,o))for(t=F[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Ae()===e&&Lt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ne(e)),x.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(F).forEach(function(t){var n=F[t].find(function(o){return o.scope===a&&o.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(e===void 0)Object.keys(F).forEach(function(s){return delete F[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&at(s)});else if(typeof e=="object")e.key&&at(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),at({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:St,modifier:te,modifierMap:ct};for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(Y[ot]=nt[ot]);if(typeof window<"u"){var as=window.hotkeys;Y.noConflict=function(e){return e&&window.hotkeys===Y&&(window.hotkeys=as),Y},window.hotkeys=Y}Y.filter=function(){return!0};var Gt=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function ns(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,d=o.keydown,p=o.filterPreventDefault,_=p===void 0||p,b=o.enabled,u=b===void 0||b,c=o.enableOnContentEditable,m=c!==void 0&&c,h=C.useRef(null),f=C.useCallback(function(k,y){var g,A;return s&&!s(k)?!_:!!(Gt(k,["INPUT","TEXTAREA","SELECT"])&&!Gt(k,r)||(g=k.target)!=null&&g.isContentEditable&&!m)||!!(h.current===null||document.activeElement===h.current||(A=h.current)!=null&&A.contains(document.activeElement))&&(a(k,y),!0)},n?[h,r,s].concat(n):[h,r,s]);return C.useEffect(function(){if(u)return i&&d!==!0&&(t.keydown=!1),Y(e,t||{},f),function(){return Y.unbind(e,f)};Y.unbind(e,f)},[f,e,u]),h}Y.isPressed;const os=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],ss=(e,a,t,n,o)=>({card:{dimension:bt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),Se=(e,a,t,n,o)=>({card:{dimension:bt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),rs=(e,a,t,n)=>Se(void 0,e,ye,a,t),is=(e,a,t,n,o)=>({card:{dimension:bt(ye),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),cs=H(function(e,a){const t=us(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:p,treasuryFetchState:_}=a;let b=n.map((u,c)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return rs(t,u,c);if(u==="zeni_promo_card")return Se({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ye,u,c);if(u==="treasury_promo_card")return is(_,u,c,d,p);if(u==="information_card")return Se(void 0,"Completed",ye,u,c);{const m=o.find(h=>h?.reportId===u);return m?function(h,f,k,y){const g=h.reportId;switch(g){case"card_balance":case"cash_balance":return[ss(h,f,k,g,y)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[Se(h,f,k,g,y)];case"net_burn_or_income_story_card":return[Se(h,f,k,"net_burn_or_income_story_card",y)];default:return console.error(`card type ${g} not yet supported!`),[]}}(m,m.fetchState,ye,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(b=b.filter(u=>os.includes(u.card.cardType)==0).filter(u=>{const c=u.data?.availableNumberOfPeriods;return c!=null?c>0:u.card.cardType!="top_expenses"||u.data==null||function(m){if(m==null||m.length===0)return!0;let h=!0;for(const f of m)if(f.balance.available.amount!==0){h=!1;break}return h}(u.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:b,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ae(e,"navbar")},analytics:I,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=R.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)I.trackDashboardCardClicked("cards promo",2),I.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&I.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(I.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,d,p,_){switch(d){case"card_balance":i(qt());break;case"cash_balance":i(zt());break;case"operating_expenses":i(la(!0));break;case"revenue":i(ca(!0));break;case"net_burn_or_income":i(ia(!0));break;case"net_burn_or_income_story_card":i(Wn(!0));break;case"cash_position":i(ra(!0));break;case"top_expenses":i(sa());break;case"cash_in_cash_out":i(oa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Qn());break;case"reimbursement_card":i(Zn());break;case"company_details":i(qn(p));break;case"task_card":i(Kn());break;case"accounts_payable_aging":_.includes("accounts_payable_aging")===!1&&i(rt(he()));break;case"accounts_receivable_aging":i(it(he()));break;case"zeni_accounts_promo_card":_.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":_.includes("rewards_card")===!1&&i(zn(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{I.trackTimeframeSwitch(ba(r),ds(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(fe(d));break;case"top_expenses":s(na(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e($n(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){R.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(I.trackUpdateBurnRateCalculatorSettings(r,s,Vn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Mt())},onVideoClose:()=>{e(Mt()),e(Gn())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ne({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Q("navbar"))},onCancelAutoComplete:()=>{e(Q("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?se(o,a.tenantEmailDomain):bo(o.zeniId,o.qboId,a.tenantEmailDomain);const s=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(go);function ls(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=ma(),t=Z(),n=$(),o=q(),r=R.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Fe(),d=Ee(r),[p,_]=C.useState(!1),[b,u]=C.useState(!1),c=pa(),{tenantEmailDomain:m}=z(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:f}=X({mobileExploreReferrer:"Dashboard"}),k=S(E=>E.tenantState.fetchState==="Completed"||E.tenantState.activeTenantFetchState.fetchState==="Completed"?j(E):void 0),y=k??R.getSignedInUserTenant(m),g=y.tenantId,A=y.companyId;C.useEffect(()=>{p===!1&&o.state?.message==="activation"&&(n(Mn(A)),_(!0))},[o.state,p,A,n]),C.useEffect(()=>{c&&!b&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),u(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,b,c,a,t,o.pathname]);const{isFeatureEnabled:P}=s(B.isApAgingFeatureEnabled),{isFeatureEnabled:U}=s(B.isExpenseAutomationEnabled),{isFeatureEnabled:T}=s(B.isExpenseAutomationEnabledV2),v=T||U&&d,{isFeatureEnabled:L}=s(B.isTreasuryEnabled),de=po(v),{isFeatureEnabled:Ce}=s(B.isArAgingFeatureEnabled),{isFeatureEnabled:O}=s(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:J}=s(B.isReferralFeatureEnabled),{isFeatureEnabled:Re}=s(B.isChargeCardFeatureEnabled),{isFeatureEnabled:$e}=s(B.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Aa}=s(B.isDashboardSidebarNewYearAnimationEnabled),{configValue:yt}=i(ha.zeniCardsConfig),va=yt.charge_card_cashback_rate_per_transaction==null?.0175:yt.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const E=ho(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:E.newStack}})}const[At,Ea]=C.useState(!1),[ze,Ia]=C.useState(!1);ns("command+p, Control+p",E=>{Ia(!ze),E.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[ze]);const vt=k?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const re=S(E=>j(E)?.excludedResources),Ta=S(E=>E.expenseAutomationViewState.selectedPeriodByTenantId),xa=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,Da=S(E=>E.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Fa=k?.company!=null&&Rn(k.company),Ke=L&&Fa,qe=De(),Pa=lt(qe?.loggedInUserRoleMap),G=[],Et=re?.resources?.find(E=>E.resource==="/reports/top_expenses")==null,Oa=re?.resources?.find(E=>E.resource==="/reports/task_card")==null,Ze=k?.userRole!=null&&ea(k?.userRole),Ma=re?.resources?.find(E=>E.resource==="/bills")==null&&!Ze,Ra=re?.resources?.find(E=>E.resource==="/reimbursements")==null,Ba=Bn(qe?.loggedInUserRoleMap),ja=jn(qe?.loggedInUserRoleMap),La=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ua=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ya=S(E=>E.treasurySetupViewState.treasuryFundsDetails).fundsDetails;Et===!1&&G.push("top_expenses"),Oa===!1&&G.push("task_card"),Ma===!1&&G.push("bill_pay_card","bill_pay_promo_card"),P===!1&&G.push("accounts_payable_aging"),Ce===!1&&G.push("accounts_receivable_aging"),(v===!1||Ze)&&G.push("expense_automation_card"),Ra===!1&&G.push("reimbursement_card","reimbursement_promo_card"),O===!1&&G.push("zeni_accounts_promo_card"),J===!1&&G.push("rewards_card"),Ke===!1&&G.push("treasury_promo_card");const{areTenantIdsInSync:It}=fo();C.useLayoutEffect(()=>{At&&de===v||vt!==!0||!It||re?.fetchState!=="Completed"&&re?.fetchState!=="Error"||(Ea(!0),n(Ln(r.userId,A,g,!0,!1,G)))},[At,r,g,n,Et,vt,re?.fetchState,It]);const Ga=S(E=>E.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Va=S(E=>E.revenueState.uiState.selectedForecast?.id),Na=S(E=>E.cardBalanceState.fetchState),ue=S(E=>Un(E,G,r,T,U,Ke)),$a=ue.fetchState;Pe({isDataReady:!0});const Tt=k?.isTreasuryVideoViewed===!0||ue.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[$a==="Completed"?l.jsx(we,{analytics:I,onLoad:E=>{E.trackPageLoaded(V.Event.dashboard),Ke&&!Tt&&E.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(cs,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:f,onDragAndDropCard:(E,za)=>{const xt=function(Be,Qe,je){const He=je.indexOf(Be),We=je.indexOf(Qe);if(He===-1||We===-1||He===We)return je;const Xe=[...je];return Xe.splice(He,1),Xe.splice(We,0,Be),Xe}(E,za,ue.cardsOrdered);xt.some((Be,Qe)=>Be!==ue.cardsOrdered[Qe])&&n(Yn(xt))},dashboardReport:ue,passedCardsOrdered:ue.cardsForDashboardUI,tenantId:g,companyId:A,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:P,isArAgingFeatureEnabled:Ce,isBillPayEnabled:wa,isReimbursementEnabled:xa,isSummaryCardsFiltered:ze,isForecastOn:Ga,selectedForecastOnDashboard:Va,isVisitingFirstTime:p,isZeniAccountEnabled:O,isRewardsFeatureEnabled:J,hasZeniAccountsAdminAccess:Pa,isExpenseAutomationEnabledForUser:v&&Ze===!1,selectedPeriod:Ta[g],isChargeCardFeatureEnabled:Re,isUserHasCardsAccess:Ba,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ua,cardBalanceFetchState:Na,christmasAnimationEnabled:$e,newYearAnimationEnabled:Aa,treasuryFundDetails:Ya,hasUserSeenTreasuryVideo:Tt,treasuryFetchState:Da})]})}const ds=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},us=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function Ys(){const e=De(),a=e?.excludedResources?.find(p=>p.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Fe(),{isFeatureEnabled:n}=t(B.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(B.isArAgingFeatureEnabled),r=S(p=>j(p)),{isFeatureEnabled:s}=t(B.isDebitCardFeatureEnabled),i=Xn(s,r),d=Jn(r);return i===!0||d===!0?l.jsx(st,{children:l.jsx(w,{path:"/*",element:l.jsx(yo,{})})}):l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(ls,{})}),l.jsx(w,{path:"cash_balance/*",element:l.jsx(Rt,{})}),l.jsx(w,{path:"card_balance/*",element:l.jsx(Rt,{})}),l.jsx(w,{path:"operating_expenses/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"operating_expenses/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"revenue/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"revenue/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"net_burn_or_income/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"net_burn_or_income/*",element:l.jsx(ee,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_payable_aging/*",element:l.jsx(Eo,{})}),l.jsx(w,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(vo,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(Io,{})}),l.jsx(w,{path:"accounts_receivable_aging/*",element:l.jsx(To,{})})]}),l.jsx(w,{path:"cash_position/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"top_expenses/*",element:a===!0?l.jsx(ee,{}):l.jsx(ve,{})}),l.jsx(w,{path:"cash_in_cash_out/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"company_details",element:l.jsx(So,{})}),l.jsx(w,{path:"referrals/*",element:l.jsx(Ao,{})}),l.jsx(w,{path:"*",element:l.jsx(ve,{})})]})}export{Ys as default};
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-Cjqg1XsV.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-B1Jz41nC.js";import{Nc as k,Nj as q,fC as K,fB as M,fA as Q,iz as W,Kk as J,q0 as L,eQ as V,MK as D,ix as T,Nd as S,Nm as F,iv as G,iS as j}from"./zeni-epic-state-CFJ-5drS.js";import{bn as X,Z as N,y as R,z as U,m as Z,p,S as v,v as z,bo as Y,o as O,bp as ee,q as te}from"./index-BA1kjk_c.js";import{n as H}from"./mui-DSSmRxLI.js";import"./sentry-DTwqiEdO.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]="2ca4bf58-31bb-4991-9036-2964a563801c",e._sentryDebugIdIdentifier="sentry-dbid-2ca4bf58-31bb-4991-9036-2964a563801c")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,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=D(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(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),c=s.poppedPathname??P();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(F({data:c}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??P(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),d=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>V(u)),g=Z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.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(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,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 Se(e,t,n){return E(e,"ach",t,n)}function ve(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 ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,ce=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(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:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(j(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(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,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(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=Z(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=i(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(v.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(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,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,_ as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-Cjqg1XsV.js";import{Z as c,G as l,m as f}from"./index-BA1kjk_c.js";import{D as b}from"./mui-DSSmRxLI.js";import"./sentry-DTwqiEdO.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]="b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7",e._sentryDebugIdIdentifier="sentry-dbid-b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=c(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{m as D};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-Cjqg1XsV.js";import{a as d}from"./sentry-DTwqiEdO.js";import{j as A,h as B,u as K,l as G,g as l,N as F,k as O,n as N,o as W}from"./core-B1Jz41nC.js";import{Lr as _,eQ as H,KQ as L,kC as M,Hp as k,Lw as Q,Kj as R,jC as V,Hq as S,KV as Y,KW as $,Kl as z,Kk as J}from"./zeni-epic-state-CFJ-5drS.js";import{aO as U,d as X,p as Z,q as tt}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import{d as b}from"./decodeURIComponentSafe-HQbzOYEL.js";import{w as et}from"./withTransactionSidePanel-C4l2rQhD.js";import{e as at,b as nt}from"./routePaths-CRbFlZJW.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./useAskAiCfoHostNavButtonProps-BtmGLJlN.js";import"./useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js";import"./TransactionDetailScreen-DIB74eML.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]="44e034a2-e3b7-466a-8b38-2784ed16bdab",a._sentryDebugIdIdentifier="sentry-dbid-44e034a2-e3b7-466a-8b38-2784ed16bdab")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=Q(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:R(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Y()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();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(k(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(),c=K(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:I,entityIdEncoded:j,entityNameEncoded:w}=G(),r=b(j??""),p=b(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),q=l(n=>H(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>L(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=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&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:q,tenantEmailDomain:I,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(N,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-Cjqg1XsV.js";import{a as r}from"./sentry-DTwqiEdO.js";import{Y as i,_ as l,a0 as p,p as d}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import m from"./NotFoundScreen-Bky0x63m.js";import{j as u,u as b}from"./core-B1Jz41nC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="6cc6e893-8e4c-439b-a6ff-557044a4a5fa",e._sentryDebugIdIdentifier="sentry-dbid-6cc6e893-8e4c-439b-a6ff-557044a4a5fa")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-DTwqiEdO.js";import{h as l,j as f,u as m}from"./core-B1Jz41nC.js";import{gv as p,Jx as g,Jy as _}from"./zeni-epic-state-CFJ-5drS.js";import{u as b,L as h,z as y}from"./index-BA1kjk_c.js";import"./liveblocks-Cjqg1XsV.js";import"./recharts-DW5j2-RD.js";import"./mui-DSSmRxLI.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="38346526-e167-43b6-a777-34fdf3173551",e._sentryDebugIdIdentifier="sentry-dbid-38346526-e167-43b6-a777-34fdf3173551")}catch{}})();function z(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:c}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{z as default};
@@ -1,12 +0,0 @@
1
- import{j as u}from"./liveblocks-Cjqg1XsV.js";import{a as g}from"./sentry-DTwqiEdO.js";import{h as J,u as O,j as _,q as w,g as l,N as T}from"./core-B1Jz41nC.js";import{z as r,m as M,D as P,e as V,d as A,f as N,i as R,B as q,g as B}from"./index-BA1kjk_c.js";import{eQ as Q,Jb as W,Jl as $,Jc as G,eR as H,fk as K,Jh as X,fJ as Y,cU as Z,Jm as ee,Jn as te}from"./zeni-epic-state-CFJ-5drS.js";import{n as ne}from"./mui-DSSmRxLI.js";import{u as se}from"./useDeviceId-DOSS9iCb.js";import{f as ae}from"./analyticsHelper-lTEhuqth.js";import{t as ie}from"./getLocaleForTenant-BgJ-_j4h.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.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]="6b47ac97-2899-4405-980c-774a8d5663ad",t._sentryDebugIdIdentifier="sentry-dbid-6b47ac97-2899-4405-980c-774a8d5663ad")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=J(),a=O(),f=_(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>Q(e)),k=l(e=>W(e)),E=r.getSignedInUser(),v=M().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t($(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(G(k.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=B();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,b,s,o,k,v,a.state,t]);const U=g.useCallback(()=>{f("/signin/auth")},[f]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||m==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- z-index: 9999;
11
- background-color: ${t=>t.theme.colors.background};
12
- `;export{De as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-Cjqg1XsV.js";import{j as i,k as n}from"./core-B1Jz41nC.js";import{N as e}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import"./sentry-DTwqiEdO.js";import"./zeni-epic-state-CFJ-5drS.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="0c8dcb74-2c7d-426d-b2f0-d04ad191873a",o._sentryDebugIdIdentifier="sentry-dbid-0c8dcb74-2c7d-426d-b2f0-d04ad191873a")}catch{}})();const d=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(e);function h(){const o=i();return r.jsx(d,{navigate:o})}export{h as default};
@@ -1 +0,0 @@
1
- import{l as ct,a as mt,m as lt,j as A}from"./liveblocks-Cjqg1XsV.js";import dt from"./NotFoundScreen-Bky0x63m.js";import{a as k}from"./sentry-DTwqiEdO.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as Q}from"./core-B1Jz41nC.js";import{cr as St,eZ as X,eQ as H,fc as bt,f4 as b,PG as Y,f8 as l,eY as y,qX as M,wg as It,PH as Ct,eX as Tt,ff as yt,r0 as Et,PI as $,bq as F,gO as x,r4 as W,PJ as _t,cC as At,cw as Nt}from"./zeni-epic-state-CFJ-5drS.js";import{T as wt,z as Bt,y as xt,S as Pt,ct as Rt,q as N,a3 as Dt,cu as vt,a4 as Gt,p as Ut}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-BtmGLJlN.js";import{c as Ft}from"./useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="6f001a73-402b-499a-8018-be913f04fcfe",t._sentryDebugIdIdentifier="sentry-dbid-6f001a73-402b-499a-8018-be913f04fcfe")}catch{}})();const Mt=(t,d)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{d(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,d){const n=X(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=d,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,d){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:w,fetchMoreCommentsNotifications:P}=d;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(W("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(l(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Y(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(W("task_manager",m,c)):(t(l({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(w(r),t($([r],F())))})).then(()=>{t(l({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(l({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(l({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(l({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,w).then(()=>{t($(s,F())),t(l({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(l({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ut(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(vt)),Vt=()=>{const t=ft(),d=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[w,P]=k.useState(!1),a=S(e=>X(e)),o=S(e=>H(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Ft({isDataReady:!0});const Z=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),K=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:B,isLoading:E,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:q,isLoading:z,fetchMore:J,isFetchingMore:L,hasFetchedAll:O}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Y(i)),i==null){const e=`../${V}`,p=N(d.state?.pathnameStackToGoBack,d.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{K.fetchState==="Not-Started"&&s(l({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(E===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(l({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[E,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=E||v===!0||C!==!0||E||v===!0||C!==!0;k.useEffect(()=>{G&&D!=="In-Progress"?s(l({fetchState:"In-Progress",error:void 0},"comments")):G||D!=="In-Progress"||s(l({fetchState:"Completed",error:void 0},"comments"))},[G,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&z===!1&&B!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),_=p.map(f=>f.id),it=p.map(f=>{const U=q.find(rt=>rt.id===f.threadId);return U!=null?{inboxNotification:{...f,threadId:U.id},thread:U}:(L||O===!0||J==null||J(),null)}).filter(f=>f!=null);s(l({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,v,L,C,O,z,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];R==="all"?_.push("read","unread"):R!=="mentions"&&_.push(R),s(M("task_manager",T,_,!0))}}}},nt=lt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:h,externalNotificationsUnreadCount:tt,location:d,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return A.jsxs(gt,{children:[A.jsx(Q,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(Q,{path:"*",element:A.jsx(dt,{})})]})}export{ie as default};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-Cjqg1XsV.js";import{a as r}from"./sentry-DTwqiEdO.js";import{h as T,u as C,g as o,N as D}from"./core-B1Jz41nC.js";import{JA as J,eQ as P,f3 as j,JB as x,JC as z,JD as M,JE as R,mS as k,Iw as L}from"./zeni-epic-state-CFJ-5drS.js";import{z as h,K as I}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="4008888b-bb46-4859-abce-911369b21d97",n._sentryDebugIdIdentifier="sentry-dbid-4008888b-bb46-4859-abce-911369b21d97")}catch{}})();function ee(){const n=T(),s=C(),{params:t,error:i}=r.useMemo(()=>J(s.search),[s.search]),b=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>P(e)),l=o(e=>j(e)),d=o(e=>e.tenantState.fetchState),w=o(x),y=o(z),u=o(M),[S,v]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(A=>A.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),c=S??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:b,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:v,approveError:E??y,isApproving:w==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&a!=null&&c!=null&&n(L(a.userId,a.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(D,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-Cjqg1XsV.js";import{j as Y,h as z,u as J,l as Q,g as d,k as Z,n as H,o as I}from"./core-B1Jz41nC.js";import{eQ as v,qL as R,qj as X,K7 as O,qe as T,bv as ee,bn as ae,bT as te,qf as se,K8 as oe,JV as C,dE as re,ud as ne,K9 as ie,uA as ce,eW as le,eU as de}from"./zeni-epic-state-CFJ-5drS.js";import{z as me,T as fe,c as pe,y as q,S as M,x as ue,d as $,al as he,q as ge}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import Fe from"./NotFoundScreen-Bky0x63m.js";import{F as be}from"./FeaturePreviewScreen-ClFmJj0F.js";import{a as g}from"./sentry-DTwqiEdO.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-BtmGLJlN.js";import{c as Ce}from"./useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js";import{u as Te}from"./useInitialThreadRequest-D05iPKhd.js";import{t as Se}from"./routePaths-CRbFlZJW.js";import{M as ye}from"./MobileAppDrawer-e8XeuLFm.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="7d283999-7f91-4bc1-a7a8-b98eea7d497f",s._sentryDebugIdIdentifier="sentry-dbid-7d283999-7f91-4bc1-a7a8-b98eea7d497f")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=Z(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function U(){const s=Y(),e=z(),a=J(),{forecastId:o,tenantEmailDomain:r}=Q(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>v(t)),w=y.company?.companyInfo.firstMonthOfFY??1,c=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Ce({isDataReady:l});const{isAiCfoAccessEnabled:W,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(b=>b.id===L):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(O(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&F&&e(T(c.forecasts[t].id))}},[i,p,e,l,c,m,u,R,T,F]);const D=pe(),N=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:_}=q(),{isFeatureEnabled:j}=_(M.isReportsCommentingEnabled),G=Te(j?y?.companyId:void 0,{clearParams:l&&m}),[K,V]=g.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:K,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:w,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:N,isAiCfoAccessEnabled:W,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d(i=>v(i)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(H,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -1,22 +0,0 @@
1
- import{j as s}from"./liveblocks-Cjqg1XsV.js";import{K2 as te,eQ as N,jC as G,eW as Y,eU as ne,Ht as q,JI as oe,tl as Ee,K3 as J,t9 as ke,tu as Ie,to as ie,td as re,ts as Pe,tp as je,K4 as le,u$ as Te,K5 as Le,fz as ve,K6 as K,ti as de,tg as ce,tx as Fe,c2 as Ae}from"./zeni-epic-state-CFJ-5drS.js";import{Z as pe,y as X,S as E,z as M,a6 as ue,H as me,ah as ge,ai as Re,G as he,o as R,I as fe,D as Ce,aj as Oe,T as Ve,x as Ue,d as be,f as Ze,q as Be,ak as $e,c as Ke}from"./index-BA1kjk_c.js";import{D as ye,n as W,S as we}from"./mui-DSSmRxLI.js";import ae from"./NotFoundScreen-Bky0x63m.js";import{a as r}from"./sentry-DTwqiEdO.js";import{h as ee,l as He,g as m,j as ze,u as Ge,k as Me,n as se,o as $}from"./core-B1Jz41nC.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-BtmGLJlN.js";import{c as _e}from"./useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js";import{M as Qe}from"./MobileAppDrawer-e8XeuLFm.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.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]="3f87c74c-817c-4eab-be32-c35ed4c7ea48",a._sentryDebugIdIdentifier="sentry-dbid-3f87c74c-817c-4eab-be32-c35ed4c7ea48")}catch{}})();const Je={overlayWidth:new he(100,100,48)},H=Ce.getLocalizedStrings().peoplePage.invitePage,Ne=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=He(),d=m(e=>te(e)),u=m(e=>N(e)),D=m(e=>G(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Y(k,u),L=ne(u),v=q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(M.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(J()),y()},F=()=>{O===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Ye,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:H.discardTitle}),descriptionComponent:s.jsx(De,{children:H.discardDescription}),primaryButtonText:H.discard,secondaryButtonText:H.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Ye=W(we)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,Se=W(fe.H6Regular)`
6
- margin-top: ${R.sp7};
7
- padding-left: ${R.sp8};
8
- padding-right: ${R.sp8};
9
- color: ${a=>a.theme.colors.primary};
10
- word-break: break-word;
11
- `,De=W(fe.LargeRegularSp)`
12
- color: ${a=>a.theme.colors.hero};
13
- padding-left: ${R.sp8};
14
- padding-right: ${R.sp8};
15
- margin-bottom: 30px;
16
- margin-top: ${R.sp4};
17
- white-space: pre-line;
18
- `,qe={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>N(i)),u=m(i=>G(i)),{useFeatureGate:D}=X(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=Y(f,d),P=ne(d),L=q(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,Z=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(M.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(J())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},B=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:Z};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(J()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:z.discardTitle}),descriptionComponent:s.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=W(we)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,aa=Me(function(a,t){const l=le(a),n=M.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(K({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(K({searchText:o}))}}}})($e);function Q({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=Ge(),{areTenantIdsInSync:o}=Ve(),y=M.getSignedInUser(),h=m(e=>N(e)),{useFeatureGate:p}=X(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>G(e)),I=!Y(O,h)&&V,w=q(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[Z,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:B}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));_e({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(K({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),L(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(K({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Ue,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Xe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Ne,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Qe,{isAppContentDrawerOpen:Z,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,_)=>{n(K({sortKey:e,sortOrder:_}))},onRowClick:e=>{const _=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=Be(g.state?.pathnameStackToGoBack,g.pathname);l(_,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:B})]})}function Sa(){const a=Ke();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(Q,{})}),s.jsx($,{path:"new",element:s.jsx(Q,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(Q,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{Sa as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-Cjqg1XsV.js";import E from"./NotFoundScreen-Bky0x63m.js";import{a as r}from"./sentry-DTwqiEdO.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-B1Jz41nC.js";import{eQ as B,PK as b,bo as F,bn as N,hi as V,gO as K}from"./zeni-epic-state-CFJ-5drS.js";import{r as Q,z as I,cv as $}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import{u as q}from"./useAskAiCfoHostNavButtonProps-BtmGLJlN.js";import{c as G}from"./useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js";import{M as H}from"./MobileAppDrawer-e8XeuLFm.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.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]="e815959e-6ef1-4e2b-963c-494684e6135b",e._sentryDebugIdIdentifier="sentry-dbid-e815959e-6ef1-4e2b-963c-494684e6135b")}catch{}})();const J=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})($),L=()=>{const e=_(),t=v(),c=Q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:u}=M(),f=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{f(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f(K({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=q({mobileExploreReferrer:"Performance"});return G({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:u,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${u}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
@@ -1,5 +0,0 @@
1
- import{j as s}from"./liveblocks-Cjqg1XsV.js";import{a as o}from"./sentry-DTwqiEdO.js";import{g as f,j as H,h as L,u as M,k as V}from"./core-B1Jz41nC.js";import{m as W,Z as F,z as R,b3 as z,G as N,T as U,x as $,d as l,f as G,a3 as Q,b4 as Z}from"./index-BA1kjk_c.js";import{e_ as q,eQ as J,Mx as P,My as K,u3 as X,tV as g,f0 as Y,bO as ee,t_ as ae,Mz as re}from"./zeni-epic-state-CFJ-5drS.js";import{D as ne,e as te,n as se,S as oe}from"./mui-DSSmRxLI.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-BtmGLJlN.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-B8aqOZNy.js";import{M as de}from"./MobileAppDrawer-e8XeuLFm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="28893e3e-60c1-476e-9a9a-b6828316ba89",e._sentryDebugIdIdentifier="sentry-dbid-28893e3e-60c1-476e-9a9a-b6828316ba89")}catch{}})();const ce={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=W(),n=F();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>q(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(z,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,x="refer-and-earn-status-update",pe=V(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ee([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(re({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(ae(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===x&&e(g(!0,!0))}}})(Q(Z));function Se({isReferralDrawerOpen:e}){const a=H(),r=L(),n=M(),[i,u]=o.useState(!1),[d,I]=o.useState(!1),[D,E]=o.useState(!1),[k,m]=o.useState(!1),p=R.getSignedInUser(),C=f(t=>J(t)),h=f(t=>P(t)),b=h.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=K([h,w]),{areTenantIdsInSync:c}=U();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(X()),E(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&c&&(u(!0),r(g(!0)))},[b,r,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(I(!0),r(Y(!0)))},[w,r,c]),o.useEffect(()=>{m(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),v=t=>{A(t)},{isAiCfoAccessEnabled:T,onAskAiCfoClick:O}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const _={events:p?.userId!=null?[`private-encrypted-${p.userId}.${x}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx($,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(G.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{m(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:O,..._})]})}export{Se as R};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-Cjqg1XsV.js";import x from"./NotFoundScreen-Bky0x63m.js";import{a as p}from"./sentry-DTwqiEdO.js";import{j as C,u as I,h as A,g as l,N as E,k as D,n as k,o as u}from"./core-B1Jz41nC.js";import{eQ as N,Nr as g,NH as S,D0 as T,C9 as V,C$ as m,CS as U,NX as _}from"./zeni-epic-state-CFJ-5drS.js";import{m as $,z as O,v as W,a3 as z,bJ as B,ac as H}from"./index-BA1kjk_c.js";import"./mui-DSSmRxLI.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-Dd8W-jsp.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]="16c99b4c-4ce2-4b66-af53-19cdc2803875",e._sentryDebugIdIdentifier="sentry-dbid-16c99b4c-4ce2-4b66-af53-19cdc2803875")}catch{}})();const d="reimbursement-approval-rule-update",J=D(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:c}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(d)&&e(_(!1))},onBackClick:()=>{H(c)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})(z(B)),P=()=>{const e=C(),r=I(),a=A(),[c,s]=p.useState(!1),[f,y]=p.useState(!1),b=l(n=>n.remiSetupApproverViewState.fetchState),o=l(n=>N(n)),w=$(),i=l(n=>g(n)),v=l(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&a(T())},[v]),p.useEffect(()=>{c||b!=="Not-Started"||(s(!0),a(V(!0)))},[c,b,a]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${d}`]:[],eventCallback:(n,Q,R)=>{n.endsWith(d)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(u,{path:"/",element:t.jsx(P,{})}),t.jsx(u,{path:"/new",element:t.jsx(h,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};