@zeniai/web-app-ui 5.3.25-qa → 5.3.26-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 (113) hide show
  1. package/dist/assets/{AccountMappingScreen-C0aQk3eU.js → AccountMappingScreen-Boic1d0a.js} +1 -1
  2. package/dist/assets/AddressRoutes-0fEsC1oH.js +1 -0
  3. package/dist/assets/{AddressScreen-BD6hfTYm.js → AddressScreen-Dp2DEY64.js} +1 -1
  4. package/dist/assets/{AiCfoScreen-BQBOwbGt.js → AiCfoScreen-CW4OlYtV.js} +1 -1
  5. package/dist/assets/{AppDrawer-DhN1iuHe.js → AppDrawer-iwPhifut.js} +1 -1
  6. package/dist/assets/{BillPayApprovalRoutes-D-5hMi6f.js → BillPayApprovalRoutes-pwHQS3o9.js} +1 -1
  7. package/dist/assets/{BillPayRoutes-Bl_cSE9O.js → BillPayRoutes-dMREYFET.js} +1 -1
  8. package/dist/assets/{BusinessVerificationPageScreen-C37udtB6.js → BusinessVerificationPageScreen-CIU6ITVX.js} +1 -1
  9. package/dist/assets/{CardsAiCfoScreen-DmUDeMY2.js → CardsAiCfoScreen-BRT-yq43.js} +1 -1
  10. package/dist/assets/{ChargeCardRoutes-BbRPoXSC.js → ChargeCardRoutes-CVOY1iE_.js} +1 -1
  11. package/dist/assets/{CompanyPassportScreen-C02FQ11m.js → CompanyPassportScreen-BCA1m9FT.js} +1 -1
  12. package/dist/assets/{ConnectionAuthScreen-MC_AsURR.js → ConnectionAuthScreen-Bsmh8PR1.js} +1 -1
  13. package/dist/assets/CustomerOnboardingAuthScreen-C6RjWCsB.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-C3c9eOtd.js → CustomerOnboardingRoutes-1wxFD7hL.js} +1 -1
  15. package/dist/assets/{DashboardRoutes-C_2UjNDc.js → DashboardRoutes-Cd1SkWkW.js} +1 -1
  16. package/dist/assets/{DefaultTenantHome-DhIA-Auv.js → DefaultTenantHome-BzGArQdn.js} +1 -1
  17. package/dist/assets/{DomesticWireDetailScreen-BQNmPyj8.js → DomesticWireDetailScreen-y67hSw0d.js} +1 -1
  18. package/dist/assets/{DrawerScreen-BRJIwisq.js → DrawerScreen-C1M2YhTn.js} +1 -1
  19. package/dist/assets/{EntityDetailRoutes-DbfX6l2s.js → EntityDetailRoutes-9DkSsNCu.js} +1 -1
  20. package/dist/assets/{ExpenseAutomationRoutes-BTeDD1VK.js → ExpenseAutomationRoutes--LfNg3pH.js} +1 -1
  21. package/dist/assets/{FeaturePreviewScreen-o3aGYwm3.js → FeaturePreviewScreen-By9QwwHb.js} +1 -1
  22. package/dist/assets/{HubSpotOAuthCallbackScreen-WSu5A4Ct.js → HubSpotOAuthCallbackScreen-BSSLi7ax.js} +1 -1
  23. package/dist/assets/{InboxNotificationsProvider-DDRknvRh.js → InboxNotificationsProvider-yp4VlF4V.js} +1 -1
  24. package/dist/assets/InvoicingRoutes-D0AtqhHk.js +2 -0
  25. package/dist/assets/{MagicLinkRoutes-BjW61OFo.js → MagicLinkRoutes-CX5BmZG-.js} +1 -1
  26. package/dist/assets/{MagicLinkSignInScreen-CuZ2N1Pw.js → MagicLinkSignInScreen-DoIxB0zL.js} +1 -1
  27. package/dist/assets/{MobileAppDrawer-Dt611RZ9.js → MobileAppDrawer-CLK0v4hO.js} +1 -1
  28. package/dist/assets/NotFoundScreen-D0cz8CS4.js +1 -0
  29. package/dist/assets/{NotificationRoutes-BrF6wQ3V.js → NotificationRoutes-Bnb2vos6.js} +1 -1
  30. package/dist/assets/{OAuthConsentScreen-BmxCN9Az.js → OAuthConsentScreen-tgDNnphJ.js} +1 -1
  31. package/dist/assets/{PandLWithForecastRoutes-CHdKE6AL.js → PandLWithForecastRoutes-Bf2BqvnJ.js} +1 -1
  32. package/dist/assets/{PaymentLinkScreen-DvX14mnT.js → PaymentLinkScreen-0MDQfoZq.js} +1 -1
  33. package/dist/assets/{PeopleRoutes-DdiAV2ss.js → PeopleRoutes-DOzmC_X8.js} +1 -1
  34. package/dist/assets/{PerformanceRoutes-DJdm2Hjh.js → PerformanceRoutes-BIixpS1v.js} +1 -1
  35. package/dist/assets/{Preview-CscVzNW8.js → Preview-BxM5wosg.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-Ck8uFfex.js → QBOConnectionScreen-BPvZ-19p.js} +1 -1
  37. package/dist/assets/{ReimbursementApprovalRoutes-5mZE12FG.js → ReimbursementApprovalRoutes-Bdy-6-Pg.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BFUt_Xh2.js → ReimbursementApprovalRuleDetailScreen--qsUWYUE.js} +1 -1
  39. package/dist/assets/{ReimbursementRoutes-CLw3cjMk.js → ReimbursementRoutes-BDX8OyTK.js} +1 -1
  40. package/dist/assets/{ReportsRoutes-CBUKpJzK.js → ReportsRoutes-RjH9WtMn.js} +1 -1
  41. package/dist/assets/{RewardsRoutes-BBrOnwnJ.js → RewardsRoutes-CPi4zMM5.js} +1 -1
  42. package/dist/assets/{ScreenRoutes-BUG6uyqt.js → ScreenRoutes-Cn2WAq7w.js} +2 -2
  43. package/dist/assets/{SettingsRoutes-D9auvf6o.js → SettingsRoutes-XkD8UAX3.js} +1 -1
  44. package/dist/assets/{SetupPagesScreen-C6kDqRGd.js → SetupPagesScreen-m2xCtrNq.js} +1 -1
  45. package/dist/assets/{SignInScreen-DRDEbF4D.js → SignInScreen-NwjSrcZC.js} +1 -1
  46. package/dist/assets/{SignOutScreen-uoV20vWX.js → SignOutScreen-BlQps5kZ.js} +1 -1
  47. package/dist/assets/{TaskListScreen-Cln-YyNE.js → TaskListScreen-BW-xU7Sa.js} +1 -1
  48. package/dist/assets/{TaskRoutes-CMDSqiu4.js → TaskRoutes-BsceFhBl.js} +1 -1
  49. package/dist/assets/TransactionDetailRoutes-Dn5BVJxH.js +1 -0
  50. package/dist/assets/{TransactionDetailScreen-B38w1Q4M.js → TransactionDetailScreen-D6CiVTKH.js} +1 -1
  51. package/dist/assets/{TransactionListRoutes-CtUzO7h7.js → TransactionListRoutes-BkZzcgx5.js} +1 -1
  52. package/dist/assets/{TreasuryRoutes-CaCxjqBo.js → TreasuryRoutes-DmVJVDE4.js} +1 -1
  53. package/dist/assets/{VendorsRoutes-P3oVwEbQ.js → VendorsRoutes-DgxrxHfH.js} +1 -1
  54. package/dist/assets/{WiseConfirmationScreen-BCBFNvno.js → WiseConfirmationScreen-ByccBu4X.js} +1 -1
  55. package/dist/assets/{ZeniAccountRoutes-BRGQxOqx.js → ZeniAccountRoutes-BujMAkE9.js} +1 -1
  56. package/dist/assets/{ZeniAccountStatementScreen-DQaLVOUo.js → ZeniAccountStatementScreen-DeWMnJNK.js} +1 -1
  57. package/dist/assets/{accountMappingHelper-L9SkIWKz.js → accountMappingHelper-C4yUO_tP.js} +1 -1
  58. package/dist/assets/{analytics-CsbG8awP.js → analytics-p9dV2gEo.js} +1 -1
  59. package/dist/assets/{analyticsHelper-DtAHYi5r.js → analyticsHelper-B9-PsR8g.js} +1 -1
  60. package/dist/assets/{core-CGqhbBHO.js → core-35eDsgGP.js} +1 -1
  61. package/dist/assets/{decodeURIComponentSafe-6FvQaIqS.js → decodeURIComponentSafe-DhnAz_92.js} +1 -1
  62. package/dist/assets/{dnd-CyZNzT3I.js → dnd-Dm1d6mZC.js} +1 -1
  63. package/dist/assets/{empty-CIUWZs8G.js → empty-BDPRkuRZ.js} +1 -1
  64. package/dist/assets/{empty-EE_1cMfQ.js → empty-DpY1OPz6.js} +1 -1
  65. package/dist/assets/{emptyVideoElement-CPGcaaig.js → emptyVideoElement-C6tD2_Is.js} +1 -1
  66. package/dist/assets/{epic-Cxd3kHt9.js → epic-BLC2ItWM.js} +1 -1
  67. package/dist/assets/{expenseAutomationHelper-wwug0Eyp.js → expenseAutomationHelper-XBf0IYWB.js} +1 -1
  68. package/dist/assets/{getLocaleForTenant-CSGkphtC.js → getLocaleForTenant-BBg2Cyvv.js} +1 -1
  69. package/dist/assets/{index-BcNWzeQF.js → index-B3U6gyEe.js} +1 -1
  70. package/dist/assets/{index-Dv01hTrY.js → index-CJI7GB_s.js} +1 -1
  71. package/dist/assets/{index-QncEC5ur.js → index-D-ldiYpS.js} +1 -1
  72. package/dist/assets/{index-BVFow4eV.js → index-D-oz9cOM.js} +1 -1
  73. package/dist/assets/{index-BswIxmLx.js → index-DHtuXNZa.js} +1 -1
  74. package/dist/assets/{index-CoKBrrSw.js → index-Dck-MxQS.js} +8 -8
  75. package/dist/assets/{index-CpkJ0bAk.js → index-DqXFykf0.js} +1 -1
  76. package/dist/assets/{index-tzevB3Ch.js → index-g5u7iWai.js} +2 -2
  77. package/dist/assets/{lexical-C5ZCOEAv.js → lexical-DQ4lSvQh.js} +1 -1
  78. package/dist/assets/{liveblocks-D83XGo_c.js → liveblocks-D0hIH2N0.js} +1 -1
  79. package/dist/assets/{lottie-DeqWxWVC.js → lottie-TJOzQ6Cz.js} +1 -1
  80. package/dist/assets/{mui-CD71lp6N.js → mui-CY_LMiAy.js} +1 -1
  81. package/dist/assets/{pathToGoBack-CoDJzfH-.js → pathToGoBack-n4Mx0taW.js} +1 -1
  82. package/dist/assets/{pdf-D4eEcTTi.js → pdf-DElOA9Iz.js} +3 -3
  83. package/dist/assets/{pdf-lib-Bd7L71QV.js → pdf-lib-D54M6RaZ.js} +1 -1
  84. package/dist/assets/{plaid-C8_LWTII.js → plaid-CoaHurGj.js} +1 -1
  85. package/dist/assets/{pusher-BsMqYR11.js → pusher-BBz5Zhu2.js} +1 -1
  86. package/dist/assets/{react-Dd8IfcKg.js → react-CFjwLJT9.js} +1 -1
  87. package/dist/assets/{react-1_9r2O7V.js → react-CcppuOI-.js} +1 -1
  88. package/dist/assets/{react-DvKEjk5s.js → react-Cn6RRlX0.js} +1 -1
  89. package/dist/assets/{react-CNf4SjYR.js → react-DRB89Tf-.js} +1 -1
  90. package/dist/assets/{react-l2dFGOnI.js → react-DlGIFhE7.js} +1 -1
  91. package/dist/assets/{react-BEE0PagD.js → react-psgyYffq.js} +1 -1
  92. package/dist/assets/{recharts-2kmMgB1t.js → recharts-B8j-bW95.js} +1 -1
  93. package/dist/assets/{routePaths-DU2fgaW2.js → routePaths-BDHLk4Ve.js} +1 -1
  94. package/dist/assets/{sentry-BPfEBx2C.js → sentry-DhqS_W-k.js} +1 -1
  95. package/dist/assets/{url-DSofFSVz.js → url-BlblTlRS.js} +1 -1
  96. package/dist/assets/{url-WFx5ES50.js → url-BniS_9P1.js} +1 -1
  97. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BBuMQpNs.js → useAiCfoDashboardSuggestedQuestionsChips-C3OYtJva.js} +1 -1
  98. package/dist/assets/{useAskAiCfoHostNavButtonProps-C4V1Wf7u.js → useAskAiCfoHostNavButtonProps-Cs4YJbah.js} +1 -1
  99. package/dist/assets/{useChargeCardPusherEvents-B1n0Fi92.js → useChargeCardPusherEvents-CgMKq4Ei.js} +1 -1
  100. package/dist/assets/{useDeviceId-D_DsCe-9.js → useDeviceId-Cd5EU_Dl.js} +1 -1
  101. package/dist/assets/{useEmailConnectResultRefresh-BxNSbaGA.js → useEmailConnectResultRefresh-D8GDRQig.js} +1 -1
  102. package/dist/assets/{useInitialThreadRequest-CP8MsLNf.js → useInitialThreadRequest-Bzg2iBlf.js} +1 -1
  103. package/dist/assets/{useTaskManagerAccess-Dl-8FUHJ.js → useTaskManagerAccess-C0Fwbmvt.js} +1 -1
  104. package/dist/assets/{utils-B6XFkcn3.js → utils-CgQOqOwX.js} +1 -1
  105. package/dist/assets/{withTransactionSidePanel-D0UiF_in.js → withTransactionSidePanel-CvrgoXlG.js} +1 -1
  106. package/dist/assets/{zeni-epic-state-DASyz1An.js → zeni-epic-state-BRRtwAQl.js} +3 -3
  107. package/dist/index.html +1 -1
  108. package/package.json +1 -1
  109. package/dist/assets/AddressRoutes-sfAfU_xp.js +0 -1
  110. package/dist/assets/CustomerOnboardingAuthScreen-96EM2Iem.js +0 -1
  111. package/dist/assets/InvoicingRoutes-BC26Hbp1.js +0 -2
  112. package/dist/assets/NotFoundScreen-RGfzDsux.js +0 -1
  113. package/dist/assets/TransactionDetailRoutes-DMotJtMw.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-CoKBrrSw.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-BPfEBx2C.js"><link rel="modulepreload" crossorigin href="/assets/core-CGqhbBHO.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-DASyz1An.js"><link rel="modulepreload" crossorigin href="/assets/mui-CD71lp6N.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CsbG8awP.js"><link rel="modulepreload" crossorigin href="/assets/utils-B6XFkcn3.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-Dck-MxQS.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-DhqS_W-k.js"><link rel="modulepreload" crossorigin href="/assets/core-35eDsgGP.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-BRRtwAQl.js"><link rel="modulepreload" crossorigin href="/assets/mui-CY_LMiAy.js"><link rel="modulepreload" crossorigin href="/assets/analytics-p9dV2gEo.js"><link rel="modulepreload" crossorigin href="/assets/utils-CgQOqOwX.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/web-app-ui",
3
- "version": "5.3.25-qa",
3
+ "version": "5.3.26-dev",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-D83XGo_c.js";import{A as o}from"./AddressScreen-BD6hfTYm.js";import i from"./NotFoundScreen-RGfzDsux.js";import"./sentry-BPfEBx2C.js";import{n as s,o as r}from"./core-CGqhbBHO.js";import"./zeni-epic-state-DASyz1An.js";import"./recharts-2kmMgB1t.js";import"./index-CoKBrrSw.js";import"./mui-CD71lp6N.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.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]="31d0e0e8-dcf1-419d-b2be-6dc359df28c9",t._sentryDebugIdIdentifier="sentry-dbid-31d0e0e8-dcf1-419d-b2be-6dc359df28c9")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(o,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(o,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-D83XGo_c.js";import{z as a}from"./index-CoKBrrSw.js";import{g as n}from"./QBOConnectionScreen-Ck8uFfex.js";import"./sentry-BPfEBx2C.js";import{g as p,N as s}from"./core-CGqhbBHO.js";import"./zeni-epic-state-DASyz1An.js";import"./recharts-2kmMgB1t.js";import"./mui-CD71lp6N.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.js";import"./empty-CIUWZs8G.js";import"./pdf-lib-Bd7L71QV.js";import"./index-QncEC5ur.js";import"./url-DSofFSVz.js";import"./index-BcNWzeQF.js";import"./decodeURIComponentSafe-6FvQaIqS.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]="c18cd95e-770d-4ff7-92bf-3374948ea538",t._sentryDebugIdIdentifier="sentry-dbid-c18cd95e-770d-4ff7-92bf-3374948ea538")}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,2 +0,0 @@
1
- import{j as s}from"./liveblocks-D83XGo_c.js";import{a as r}from"./sentry-BPfEBx2C.js";import{u as P,h as L,i as w,j as E,t as z,l as T,s as H,g as W,N as B,n as ie,o as y}from"./core-CGqhbBHO.js";import{a6 as ln,k as p,ao as F,S as m,c9 as dn,ca as un,cb as gn,cc as mn,cd as vn,ce as pn,cf as fn,cg as Sn,ch as hn,ci as Cn,cj as In,ck as En,cl as kn,cm as yn,p as J,cn as xn,co as bn,ac as se,cp as jn,cq as Dn,z as he,cr as Pn,cs as Ln,ct as An,cu as $n,cv as wn,cw as Fn,cx as Rn,cy as Tn,U as On,ag as ft,cz as _n,cA as Mn,cB as Nn,cC as Un,cD as Bn,cE as Vn,cF as Hn,cG as Zn,cH as qn,t as Ye,j as St,cI as Yn,cJ as Kn,cK as Qn,cL as Gn,cM as zn,cN as Wn,cO as Jn}from"./index-CoKBrrSw.js";import"./mui-CD71lp6N.js";import{A as Y}from"./AddressScreen-BD6hfTYm.js";import N from"./NotFoundScreen-RGfzDsux.js";import{YI as Xn,YJ as ei,uv as Ke,YK as De,YL as K,vz as Qe,vG as ti,vL as ht,YM as Pe,YN as Ct,vD as It,YO as Le,vB as Et,yg as ni,vC as ii,YP as Q,uY as ce,vv as oi,x7 as Ge,uX as Ce,YQ as ai,YR as kt,vS as si,YS as G,vZ as ci,YT as ri,YU as yt,YV as xt,y2 as li,YW as ue,YX as ze,YY as bt,uV as di,YZ as ui,uP as gi,Y_ as mi,xk as vi,Y$ as jt,xt as We,Z0 as pi,xq as fi,Z1 as Ae,gd as Si,Z2 as te,Z3 as ne,wc as hi,v1 as Je,Z4 as $e,v6 as Dt,v4 as Ci,u_ as Ii,w5 as Ei,v8 as ki,we as yi,Z5 as Ie,wm as Pt,wk as Ee,F6 as we,xz as Xe,Z6 as xi,uW as Fe,Z7 as Re,vh as ke,ve as ye,vr as Lt,vq as Te,vb as bi,vk as At,vt as oe,fB as Oe,Uv as $t,uZ as _e,vo as ji,vp as Di,vn as Pi,Z8 as Li,vV as et,v_ as Ai,vW as wt,Z9 as Ft,uJ as tt,Za as $i,uF as Rt,Zb as wi,xF as Fi,xJ as Z,xE as Ri,wN as Me,Zc as Ti,Zd as Tt,xS as nt,Ze as Oi,xP as _i,Zf as Ot,wQ as Mi,wR as V,wU as Ni,Zg as _t,x2 as ve,Zh as Ui,wd as Mt,T3 as Nt,Zi as Bi,xc as Vi,Zj as Ut,Zk as Hi,Zl as Zi,Zm as qi,yH as Yi,Zn as Ki,Zo as Bt,xZ as Vt,Zp as Ht,yF as pe,Zq as Qi,yC as Gi,Zr as zi,Zs as Wi,Zt as Ji,Zu as Xi,Zv as eo,Zw as it,Zx as to,yL as no,Zy as Ne,ww as ot,Zz as Ue,ZA as re,wG as Zt,wB as qt,wz as xe,ZB as io,wr as oo,y3 as Yt,yu as at,yp as ao,ZC as so,y4 as co,ZD as ro,yv as lo,yz as uo,ZE as go,ZF as Kt,c7 as mo,m6 as vo,m7 as po,ZG as st,vA as le,gh as fo,tX as So,md as ho,ym as Qt,yX as Co,yj as Gt,u1 as Io,yU as ct,tR as Eo,yR as rt,hP as ko,Tv as lt,Tw as yo,Fi as zt,hH as xo,ZH as bo,Uk as jo,ZI as Do,z1 as fe,z2 as Po,ZJ as Lo,ZK as Wt,y_ as Ao,ZL as $o,ZM as wo,xg as Fo,ZN as Ro}from"./zeni-epic-state-DASyz1An.js";import{M as To}from"./MobileAppDrawer-Dt611RZ9.js";import{q as de}from"./QBOConnectionScreen-Ck8uFfex.js";import"./recharts-2kmMgB1t.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.js";import"./InboxNotificationsProvider-DDRknvRh.js";import"./useTaskManagerAccess-Dl-8FUHJ.js";import"./empty-CIUWZs8G.js";import"./pdf-lib-Bd7L71QV.js";import"./index-QncEC5ur.js";import"./url-DSofFSVz.js";import"./index-BcNWzeQF.js";import"./decodeURIComponentSafe-6FvQaIqS.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="07c54213-dc12-4ee7-a3a6-443f2d2a41bb",n._sentryDebugIdIdentifier="sentry-dbid-07c54213-dc12-4ee7-a3a6-443f2d2a41bb")}catch{}})();const $=({event:n,isReady:e=!0})=>e?s.jsx(ln,{analytics:p,onLoad:t=>t.trackPageLoaded(n)}):null;function U(...n){return n.some((e=>e==="Error"))}function Oo(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:g,hasMore:f,items:S,nextCursor:I,auditLogEntityRouteOptions:j,auditLogListSortFieldOptions:k}=E(Xn),x=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),b=`/${t??""}/invoicing`,C=r.useCallback(((O,R)=>{const M=ei(b,O,R,j);M!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{entity:O,entityId:R,fromScreen:"audit_log"}),e(M))}),[j,e,b]);r.useEffect((()=>{const O=setTimeout((()=>d(o)),300);return()=>clearTimeout(O)}),[o]),r.useEffect((()=>{i&&n(Ke({filters:x,keepExistingListItems:!1,sort:u}))}),[i,x,u,n]);const D=g==="Not-Started"||g==="In-Progress"&&S.length===0,h=g==="In-Progress"&&S.length>0,_=g==="Completed";return U(g)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingAuditLogPage,isReady:_}),s.jsx(dn,{auditLogEntityRouteOptions:j,auditLogListSortFieldOptions:k,entries:S,hasMore:f,isLoading:D,isLoadingMore:h,searchValue:o,sortState:l,onEntityLinkClick:C,onLoadMore:()=>{f&&I!=null&&n(Ke({cursor:I,filters:x,keepExistingListItems:!0,sort:u}))},onSearchChange:a,onSortChange:v})]})}const _o=new Set(["plan"]),Jt=[],Mo=Ct((n=>n.length>0?n:Jt),mn),No=Ct((n=>n.length>0?n:Jt),gn),Uo=T((function(n,e){const{view:t}=e;return{groupedAccountOptions:Mo(t.qboAccountHierarchy),groupedClassOptions:No(t.qboClassHierarchy),catalogItemLifecycleActionOptions:t.catalogItemLifecycleActionOptions,catalogProductLifecycleActionOptions:t.catalogProductLifecycleActionOptions,tierTypeOptionsByPricingModel:t.catalogTierTypeOptionsByPricingModel,periodUnitOptions:t.periodUnitOptions,trialEndActionOptions:t.trialEndActionOptions,trialUnitOptions:t.trialUnitOptions,typeOptions:t.typeOptions,isLoading:e.isLoading,isRunningLifecycleAction:t.actionState.fetchState==="In-Progress",isSaving:t.fetchState==="In-Progress",itemId:e.itemId,localData:t.localData,plan:t.plan}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{itemId:i}=e;return{onBack:()=>e.navigate(`${t}/catalog`),onLifecycleAction:i!==""?o=>{i!==""&&n(It({action:o,id:i}))}:void 0,onEditChange:o=>{i!==""&&n(Pe({id:i,localData:o}))},onSaveEdit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemEdited,{itemId:i}),n(ht({id:i}))},onSubFamilyLifecycleAction:(o,a)=>{i!==""&&n(ti({action:a,id:o,parentItemId:i}))}}}))(un);function Bo(){const n=P(),e=L(),{item_id:t,tenantEmailDomain:i}=w(),[o]=z(),{areTenantIdsInSync:a}=F(),c=(d=o.get("kind"))!=null&&_o.has(d)?d:"plan";var d;const l=E((k=>De(k,t))),{pageFetchState:v,plan:u}=l,g=v.fetchState;r.useEffect((()=>(n(K()),()=>{n(K())})),[n]),r.useEffect((()=>{a&&n(Qe({id:t,kind:c}))}),[a,t,c,n]);const[f,S]=r.useState(0);r.useEffect((()=>{l.fetchState==="Completed"&&(n(K()),n(Qe({cacheOverride:!0,id:t,kind:c})),S((k=>k+1)))}),[l.fetchState,n,t,c]);const I=u==null&&(g==="Not-Started"||g==="In-Progress"),j=g==="Completed";return U(g)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogItemDetailPage,isReady:j}),s.jsx(Uo,{navigate:e,tenantEmailDomain:i,itemId:t??"",kind:c,isLoading:I,view:l},f)]})}function Be(n={}){const{enabled:e=!0,fetchSyncHealth:t=!1,loadAccountingPickers:i=!1,reuseCached:o=!1}=n,a=P(),{areTenantIdsInSync:c}=F(),d=E(Le),l=d.connection?.connected===!0,v=d.connectionFetchState.fetchState;return r.useEffect((()=>{e&&c&&(o&&v!=="Not-Started"||a(Et()),t&&a(ni()))}),[c,a,e,t,o]),r.useEffect((()=>{e&&c&&l&&i&&a(ii())}),[c,a,e,l,i]),{isQboConnected:l,qboView:d}}function Ve(n,e=!1){const t=P(),i=E((c=>Q(c).productNextCursor!=null)),o=E((c=>Q(c).productNextCursor)),a=E((c=>Q(c).productFetchState.fetchState));r.useEffect((()=>{n&&(e&&a!=="Not-Started"||t(ce({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[n,t,e]),r.useEffect((()=>{n&&a!=="In-Progress"&&i&&o!=null&&t(ce({cursor:o,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[n,t,a,i,o])}const Vo=new Set(["addon","charge","plan"]),Ho=new Set(["plan"]),Zo=T((function(n,e){const t=De(n,e.itemId);return{fieldHelp:t.fieldHelp,isQboPickerDataLoading:t.isQboPickerDataLoading,qboClassHierarchy:t.qboClassHierarchy,qboAccountHierarchy:t.qboAccountHierarchy,applicabilityValues:t.applicabilityValues,periodUnitOptions:t.periodUnitOptions,trialEndActionOptions:t.trialEndActionOptions,trialUnitOptions:t.trialUnitOptions,typeOptions:t.typeOptions,applicableItemOptions:t.applicableItemOptions,defaultType:e.isEdit?void 0:e.defaultType,errorMessage:t.fetchState==="Error"?t.error?.message??"Failed to save catalog item.":void 0,isSubmitting:t.fetchState==="In-Progress",localData:t.localData,mode:t.mode,pricingModelValues:t.pricingModelValues,prorationValues:t.prorationValues,tierTypeOptionsByPricingModel:t.catalogTierTypeOptionsByPricingModel,tierTypeValues:t.tierTypeValues}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:o}=e,a=o!=null?`${t}/catalog/${encodeURIComponent(o)}`:`${t}/catalog`;return{onBack:()=>e.navigate(a),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemFormCancelled),n(K()),e.navigate(`${t}/catalog`)},onChange:c=>{n(Pe({id:o,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemSaved,{mode:i}),n(ht({id:o}))}}}))(vn);function qo(){const n=P(),e=L(),{item_id:t,tenantEmailDomain:i}=w(),[o]=z(),{areTenantIdsInSync:a}=F(),c=t!=null,d=o.get("type"),l=d!=null&&Vo.has(d)?d:void 0,v=(u=o.get("kind"))!=null&&Ho.has(u)?u:"plan";var u;const g=E((f=>De(f,t)));return Ve(a,!0),Be({loadAccountingPickers:!0,reuseCached:!0}),r.useEffect((()=>{a&&t!=null&&n(oi({id:t,kind:v}))}),[a,t,v,n]),r.useEffect((()=>{c||l==null||g.localData.catalogType===l||n(Pe({localData:{...g.localData,catalogType:l}}))}),[c,l,g.localData?.catalogType,n]),r.useEffect((()=>{if(g.fetchState==="Completed"){const f=g.savedItemId??t,S=f!=null?`/${i}/invoicing/catalog/${encodeURIComponent(f)}`:`/${i}/invoicing/catalog`;e(S),n(K())}}),[g.fetchState,g.savedItemId,t,n,e,i]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogItemFormPage}),s.jsx(Zo,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:c,itemId:t})]})}const Yo={addons:"addon",all:"item",charges:"charge",plans:"plan"},Ko=T((function(n,e){const t=Q(n),i=e.activeTab==="plans",o=e.activeTab==="all",a=i?t.plans:o?[...t.plans,...t.products]:t.products,c=i||o&&t.fetchState==="In-Progress"?t.fetchState:t.productFetchState.fetchState;return{catalogItemLifecycleActionOptions:t.catalogItemLifecycleActionOptions,counts:t.count,countsLoading:t.countsFetchState.fetchState==="Not-Started"||t.countsFetchState.fetchState==="In-Progress",hasMore:i?t.planNextCursor!=null:o&&t.planNextCursor!=null||t.productNextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress"&&a.length===0,isLoadingMore:c==="In-Progress"&&a.length>0,plans:t.plans,productColumns:t.productColumns,products:t.products}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",o=e.activeTab==="all",a=i?e.planNextCursor:e.productNextCursor;return{activeTab:e.activeTab,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTabChange:e.onTabChange,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${t}/data_import`)},onAddItem:()=>{const c=Yo[e.activeTab];p.trackInvoicingActionClick(m.Event.invoicingAddCatalogItemClicked,{itemType:c}),e.navigate(`${t}/catalog/new?type=${c}`)},onItemClick:(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemRowClicked,{itemId:d}),e.navigate(`${t}/catalog/${encodeURIComponent(d)}`)},onCatalogItemLifecycleAction:(c,d)=>{n(It({action:ai(d),id:c}))},onLoadMore:()=>{if(o)return e.planNextCursor!=null&&n(Ce({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&n(ce({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));a!=null&&n(i?Ce({cursor:a,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):ce({cursor:a,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(pn);function Qo(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState("plans"),[l,v]=r.useState(""),[u,g]=r.useState(null),f=r.useMemo((()=>u!=null?{dir:u.direction,field:u.columnKey}:void 0),[u]),S=l.trim()!==""?l.trim():void 0,I=r.useMemo((()=>({search:S,type:"plan"})),[S]),j=r.useMemo((()=>({search:S,type:"addon|charge"})),[S]),k=E((O=>Q(O))),x=k.planFilters.search,b=k.planSort,C=k.planNextCursor,D=k.productNextCursor,h=k.fetchState==="Completed",_=k.runningActionId??null;return r.useEffect((()=>{const O=setTimeout((()=>v(o)),300);return()=>clearTimeout(O)}),[o]),r.useEffect((()=>{i&&n(Ge({cacheOverride:!1,planFilters:I,productFilters:j,planSort:f,productSort:f}))}),[i,n,I,j,f]),r.useEffect((()=>{i&&(S!==x||f?.field!==b?.field||f?.dir!==b?.dir)&&n(Ge({cacheOverride:!0,planFilters:I,productFilters:j,planSort:f,productSort:f}))}),[x,b,i,n,I,j,S,f]),U(k.fetchState)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogPage,isReady:h}),s.jsx(Ko,{navigate:e,tenantEmailDomain:t,activeTab:c,searchValue:o,sortState:u,planFilters:I,productFilters:j,sort:f,planNextCursor:C,productNextCursor:D,runningCatalogItemActionId:_,onSearchChange:a,onTabChange:d,onSortChange:g})]})}const Go=T((function(n,e){const t=kt(n,e.couponId);return{fieldHelp:t.fieldHelp,applyOnOptions:t.applyOnOptions,discountTypeOptions:t.discountTypeOptions,durationTypeOptions:t.durationTypeOptions,errorMessage:t.fetchState==="Error"?t.error?.message??"Failed to save coupon.":void 0,isSubmitting:t.fetchState==="In-Progress",localData:t.localData,mode:t.mode,periodUnitOptions:t.periodUnitOptions}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,o=i!=null?"edit":"create",a=i!=null?`${t}/discounts/${encodeURIComponent(i)}`:`${t}/discounts`;return{onBack:()=>e.navigate(a),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponFormCancelled),n(G()),e.navigate(`${t}/discounts`)},onChange:c=>{n(ri({id:i,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponSaved,{mode:o}),n(ci({id:i}))}}}))(fn);function zo(){const n=P(),e=L(),{coupon_id:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),{fetchState:a,savedCouponId:c}=E((d=>kt(d,t)));return r.useEffect((()=>{o&&t!=null&&n(si({id:t}))}),[o,t,n]),r.useEffect((()=>{if(a==="Completed"){const d=c??t,l=d!=null?`/${i}/invoicing/discounts/${encodeURIComponent(d)}`:`/${i}/invoicing/discounts`;e(l),n(G())}}),[a,c,t,n,e,i]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCouponFormPage}),s.jsx(Go,{couponId:t,navigate:e,tenantEmailDomain:i})]})}const Wo=T((function(n){const e=yt(n);return{fieldHelp:e.fieldHelp,customers:e.customers,planNames:e.planNames,errorMessage:e.fetchState==="Error"?e.error?.message??"Failed to create invoice. Please try again.":void 0,isSubmitting:e.fetchState==="In-Progress",localData:e.localData,settings:e.settings}}),(function(n){return{dispatch:n}}),(function(n,{dispatch:e},t){const i=`/${t.tenantEmailDomain}/invoicing`;return{...n,onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateInvoiceCancelled),t.navigate(`${i}/invoices`)},onChange:o=>{e(bt(o))},onSubmit:()=>{const o=ui(n.localData);p.trackInvoicingActionClick(m.Event.invoicingInvoiceCreated,{customerId:o.customer_id,lineItemCount:o.line_items?.length}),e(gi(o))}}}))(hn);function Jo(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),[i]=z(),{areTenantIdsInSync:o}=F(),a=i.get("customerId"),c=E((C=>yt(C))),d=c.fetchState,l=c.localData,v=c.savedInvoiceId,u=E(xt),g=E((C=>li(C))),f=E(ue),S=g.fetchState==="Not-Started"||g.fetchState==="In-Progress"&&u==null,I=f.fetchState==="Not-Started"||f.fetchState==="In-Progress"&&f.customers.length===0,j=S||I,k=g.fetchState==="Completed"&&f.fetchState==="Completed";r.useEffect((()=>(n(ze()),()=>{n(ze())})),[n]);const x=r.useRef(!1);r.useEffect((()=>{x.current||a==null||a===""||l.customerId!==""||(x.current=!0,n(bt({...l,customerId:a})))}),[a,l,n]),r.useEffect((()=>{o&&n(di({cacheOverride:!1}))}),[o,n]);const b=r.useRef(d);return r.useEffect((()=>{const C=b.current;if(b.current=d,C!=="Completed"&&d==="Completed"){const D=v!=null?`/${t}/invoicing/invoices/${encodeURIComponent(v)}`:`/${t}/invoicing/invoices`;e(D)}}),[d,v,e,t]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreateInvoicePage,isReady:k}),j?s.jsx(Sn,{}):s.jsx(Wo,{navigate:e,tenantEmailDomain:t})]})}const Xo=T((function(n,e){const{detailView:t}=e;return{fieldHelp:e.detailView.fieldHelp,creditNote:t.creditNote,creditNoteId:e.creditNoteId,isLoading:t.fetchState==="Not-Started"||t.fetchState==="In-Progress"}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{onBack:()=>e.navigate(`${t}/credits`),onCustomerClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${t}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${t}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${t}/subscriptions/${encodeURIComponent(i)}`)}}}))(Cn);function ea(){const n=P(),e=L(),{credit_note_id:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),a=E((d=>mi(d,t??""))),c=a.fetchState==="Completed";return r.useEffect((()=>{o&&t!=null&&n(vi({id:t}))}),[o,t,n]),U(a.fetchState)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreditDetailPage,isReady:c}),s.jsx(Xo,{navigate:e,tenantEmailDomain:i,creditNoteId:t??"",detailView:a})]})}const ta=T((function(n){const e=jt(n),{fetchState:t}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",creditNotes:e.creditNotes,hasMore:e.nextCursor!=null,isLoading:t==="Not-Started"||t==="In-Progress"&&e.creditNotes.length===0,isLoadingMore:t==="In-Progress"&&e.creditNotes.length>0,tabIds:e.tabIds}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${t}/data_import`)},onCreditNoteClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${t}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&n(fi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(In);function na(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:I,nextCursor:j,creditNoteListFetchState:k}=E((b=>{const C=jt(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,creditNoteListFetchState:C.fetchState}}),H),x=k==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&n(We({cacheOverride:!1}))}),[i,n]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==I?.field||u?.dir!==I?.dir)&&n(We({cacheOverride:!0,filters:g,sort:u}))}),[i,n,g,u,S,I]),U(k)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreditsListPage,isReady:x}),s.jsx(ta,{navigate:e,tenantEmailDomain:t,activeStatus:f,searchValue:o,sortState:l,filters:g,sort:u,nextCursor:j,onSearchChange:a,onStatusChange:b=>n(pi(b)),onSortChange:v})]})}const Xt=(n,e,t)=>{const i=`/${n}/invoicing/customers/`;return t!=null?`${i}${encodeURIComponent(t)}/${e}/`:`${i}new/${e}/`},ia=T((function(n,e){const{editView:t,hasLoadedRecord:i}=e;return{fieldHelp:t.fieldHelp,billingAddressLabel:t.billingAddressLabel,customerTypeOptions:t.customerTypeOptions,netTermDayOptions:t.netTermDayOptions,taxabilityOptions:t.taxabilityOptions,customer:t.record.invoicingCustomer,invoices:t.record.invoices.slice(0,5),isLoading:!i&&(t.pageFetchState.fetchState==="Not-Started"||t.pageFetchState.fetchState==="In-Progress"),hasPaymentLinkEmailPreviewFailed:t.emailPreviewFetchState.fetchState==="Error",isPaymentLinkEmailPreviewLoading:t.emailPreviewFetchState.fetchState==="In-Progress",isSaving:t.fetchState==="In-Progress",paymentLinkEmailPreview:t.emailPreview,isSendingPaymentLink:t.record.sendLinkState.fetchState==="In-Progress",localData:t.localData,paymentMethods:t.record.paymentMethods,sendPaymentLinkErrorMessage:t.record.sendLinkState.fetchState==="Error"?t.record.sendLinkState.error?.message??"Failed to send payment link.":void 0,sentPaymentLinkEmail:t.record.sendLinkState.fetchState==="Completed"?t.record.sentPaymentLinkEmail:void 0,sentPaymentLinkMagicUrl:t.record.sendLinkState.fetchState==="Completed"?t.record.sentPaymentLinkMagicUrl:void 0,stripeConnected:t.record.stripeConnected}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e;return{onBack:()=>e.navigate(`${t}/customers`),onChange:o=>{n(Ie({id:i,localData:o}))},onCreateInvoice:()=>e.navigate(`${t}/invoices/create`),onInvoiceClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${t}/invoices/${encodeURIComponent(o)}`)},onCreatePromotionalCredits:()=>e.onCreatePromotionalCredits(),onNewSubscription:()=>e.navigate(`${t}/subscriptions/new`),onOpenAddress:()=>{const o=Xt(e.tenantEmailDomain??"",Ee,i),a=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:a}})},onOpenPaymentSettings:()=>e.navigate(`${t}/settings/payment-destination`),onSaveEdit:o=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerEdited,{customerId:i}),n(Ie({id:i,localData:o})),n(Pt({id:i}))},onFetchPaymentLinkEmailPreview:o=>n(yi({cacheOverride:o,customerId:i})),onSendPaymentLink:(o,a,c)=>n(ki({body:c,customerId:i,email:o,subject:a})),onSubscriptionClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${t}/subscriptions/${encodeURIComponent(o)}`)}}}))(yn);function oa(){const n=P(),e=L(),t=W(),{customer_id:i,tenantEmailDomain:o}=w(),{areTenantIdsInSync:a}=F(),c=E((M=>Ae(M,i))),d=c.pageFetchState.fetchState,l=d==="Completed",[v,u]=r.useState(!1),[g,f]=r.useState(!1),[S,I]=r.useState(void 0);r.useEffect((()=>{i!=null&&c.record.fetchState==="Completed"&&I(i)}),[i,c.record.fetchState]);const j=S===i,{plaidTokenFetchState:k,promotionalCreditSubmitState:x}=c,{paymentMethodSaveState:b,setupIntentFetchState:C,stripeConnected:D}=c.record,h=r.useRef(c.record.sendLinkState.fetchState);r.useEffect((()=>{const M=c.record.sendLinkState.fetchState;h.current!=="Error"&&M==="Error"&&n(Si({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),h.current=M}),[n,c.record.sendLinkState.fetchState]);const _=C.fetchState==="Error"?C.error?.message??"Failed to start card setup.":b.fetchState==="Error"?b.error?.message??"Failed to save payment method.":k.fetchState==="Error"?k.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(n(te()),n(ne()),()=>{n(te()),n(ne())})),[n]),r.useEffect((()=>{t.state?.openPromotionalCreditsDialog===!0&&(f(!0),e(t.pathname,{replace:!0,state:null}))}),[t.pathname,t.state,e]),r.useEffect((()=>{a&&i!=null&&n(hi({id:i}))}),[a,i,n]),r.useEffect((()=>{a&&i!=null&&D&&n(Je({customerId:i}))}),[a,i,n,D]);const[O,R]=r.useState(0);return r.useEffect((()=>{c.fetchState==="Completed"&&(n($e()),i!=null&&n(Dt({id:i})),R((M=>M+1)))}),[c.fetchState,n,i]),U(d)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomerDetailPage,isReady:l}),s.jsx(ia,{customerId:i??"",editView:c,hasLoadedRecord:j,location:t,navigate:e,tenantEmailDomain:o,onAddPaymentMethod:()=>{n(te()),i!=null&&D&&n(Je({customerId:i})),u(!0)},onCreatePromotionalCredits:()=>{n(ne()),f(!0)}},O),s.jsx(En,{errorMessage:_,isCreatingSetupIntent:C.fetchState==="In-Progress",isSaving:b.fetchState==="In-Progress",open:v,plaidLinkToken:c.record.plaidLinkToken,saveSucceeded:b.fetchState==="Completed",setupIntent:c.record.setupIntent,stripeConnected:D,onChooseCard:()=>{i!=null&&n(Ii({customerId:i}))},onClose:()=>{u(!1),n(te())},onSavePaymentMethod:M=>{i!=null&&n(Ci({customerId:i,data:M}))}}),s.jsx(kn,{currentBalance:c.record.invoicingCustomer?.promotionalCredits,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:x.fetchState==="Error"?x.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:x.fetchState==="In-Progress",open:g,submitSucceeded:x.fetchState==="Completed",onClose:()=>{f(!1),n(ne())},onSubmit:({amount:M,description:ee})=>{i!=null&&n(Ei({amount:M,customerId:i,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,description:ee}))}})]})}const aa=T((function(n,e){const t=Ae(n,e.customerId);return{fieldHelp:t.fieldHelp,billingAddressLabel:t.billingAddressLabel,customerTypeOptions:t.customerTypeOptions,netTermDayOptions:t.netTermDayOptions,taxabilityOptions:t.taxabilityOptions,errorMessage:t.fetchState==="Error"?t.error?.message??"Failed to save customer.":void 0,isSubmitting:t.fetchState==="In-Progress",localData:t.localData,mode:t.mode}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,o=i!=null?"edit":"create",a=i!=null?`${t}/customers/${encodeURIComponent(i)}`:`${t}/customers`;return{onBack:()=>e.navigate(a),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerFormCancelled),n($e()),n(we(Ee)),e.navigate(`${t}/customers`)},onChange:c=>{n(Ie({id:i,localData:c}))},onOpenAddress:()=>{const c=Xt(e.tenantEmailDomain??"",Ee,i),d=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerSaved,{mode:o}),n(Pt({id:i}))}}}))(xn);function sa(){const n=P(),e=L(),t=W(),{customer_id:i,tenantEmailDomain:o}=w(),{areTenantIdsInSync:a}=F(),{fetchState:c,savedCustomerId:d}=E((l=>Ae(l,i)));return r.useEffect((()=>{a&&i!=null&&n(Dt({id:i}))}),[a,i,n]),r.useEffect((()=>{if(c==="Completed"){const l=d??i,v=l!=null?`/${o}/invoicing/customers/${encodeURIComponent(l)}`:`/${o}/invoicing/customers`;e(v),n($e())}}),[c,d,i,n,e,o]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomerFormPage}),s.jsx(aa,{customerId:i,location:t,navigate:e,tenantEmailDomain:o})]})}const ca=T((function(n){const e=ue(n),{fetchState:t}=e;return{addressesById:n.addressState.addressesById,columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",customers:e.customers,hasMore:e.nextCursor!=null,isLoading:t==="Not-Started"||t==="In-Progress"&&e.customers.length===0,isLoadingMore:t==="In-Progress"&&e.customers.length>0,tabIds:e.tabIds}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onAddCustomer:()=>{p.trackInvoicingActionClick(m.Event.invoicingAddCustomerClicked),e.navigate(`${t}/customers/new`)},onCustomerClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${t}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${t}/data_import`)},onRowAction:(i,o)=>{switch(o){case"createInvoice":e.navigate(`${t}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":e.navigate(`${t}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":e.navigate(`${t}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&n(Fe({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(bn);function ra(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:I,nextCursor:j,customerListFetchState:k}=E((b=>{const C=ue(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,customerListFetchState:C.fetchState}}),H),x=k==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&n(Xe({cacheOverride:!1}))}),[i,n]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==I?.field||u?.dir!==I?.dir)&&n(Xe({cacheOverride:!0,filters:g,sort:u}))}),[i,n,g,u,S,I]),U(k)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomersListPage,isReady:x}),s.jsx(ca,{navigate:e,tenantEmailDomain:t,activeStatus:f,searchValue:o,sortState:l,filters:g,sort:u,nextCursor:j,onSearchChange:a,onStatusChange:b=>n(xi(b)),onSortChange:v})]})}const be=(n,e)=>e==null?void 0:n.sessionDetail[e]??n.sessions.find((t=>t.id===e)),la=T((function(n,e){const{filters:t,sessionId:i,view:o}=e,a=i==null?void 0:o.diagnosticsBySession[i],c=a?.fetch.fetchState??"Not-Started";return{diagnostics:a?.items??[],errorMessage:c==="Error"?a?.fetch.error?.message:void 0,expired:a?.expired??!1,filters:t,hasMore:a?.nextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress",isLoadingMore:c==="In-Progress"&&(a?.items.length??0)>0,session:be(o,i)}}),(function(n,e){const{downloadUrl:t,filters:i,navigate:o,sessionId:a,tenantEmailDomain:c,view:d}=e,l=a==null?void 0:d.diagnosticsBySession[a],v=be(d,a),u=d.actionStateByKind.retry?.fetchState==="In-Progress",g=d.actionStateByKind.rollback?.fetchState==="In-Progress",f=v?.status==="done"&&v.rollback_available_until!=null&&new Date(v.rollback_available_until).getTime()>Date.now()&&!g;return{onBack:()=>o(`/${c}/invoicing/data_import`),onDownloadCsv:()=>{t!=null&&window.open(t,"_blank","noopener")},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{a!=null&&l?.nextCursor!=null&&n(ye({...i,cursor:l.nextCursor,sessionId:a}))},onRetry:v?.status!=="failed"||u?void 0:()=>{a!=null&&n(Te(a))},onRollback:f?()=>{a!=null&&n(Lt(a))}:void 0}}))(jn);function da(){const n=P(),e=L(),{sessionId:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),[a,c]=r.useState({}),d=E(Re),l=be(d,t),v=t==null?void 0:d.diagnosticsBySession[t];r.useEffect((()=>{o&&t!=null&&n(ke(t))}),[o,n,t]),r.useEffect((()=>{if(!o||t==null)return;const S=setTimeout((()=>{n(ye({...a,sessionId:t}))}),300);return()=>clearTimeout(S)}),[o,n,a,t]);const u=l?.status==="scanning"||l?.status==="importing";r.useEffect((()=>{if(!o||t==null||!u)return;const S=setInterval((()=>{n(ke(t)),n(ye({...a,sessionId:t}))}),3e3);return()=>clearInterval(S)}),[o,n,a,u,t]);const g=r.useMemo((()=>{if(t==null)return;const S=new URLSearchParams;a.moduleId!=null&&S.set("module_id",a.moduleId),a.level!=null&&S.set("level",a.level),a.outcome!=null&&S.set("outcome",a.outcome),a.search!=null&&a.search.trim()!==""&&S.set("search",a.search.trim());const I=S.toString();return`${se?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(t)}/issues.csv${I===""?"":`?${I}`}`}),[a,t]),f=v?.fetch.fetchState??"Not-Started";return U(f)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:l!=null&&f!=="Not-Started"}),s.jsx(la,{downloadUrl:g,filters:a,navigate:e,sessionId:t,tenantEmailDomain:i,view:d,onFiltersChange:c})]})}const en=n=>`invoicing_active_migration:${n}`,ae=(n,e)=>{if(n!=null&&n!=="")try{const t=en(n);e==null?sessionStorage.removeItem(t):sessionStorage.setItem(t,e)}catch{}},ua=T((function(n,e){const{sessions:t,sessionsFetch:i,statusFetch:o,statusRows:a}=e.view;return{isLoading:!(o.fetchState!=="Not-Started"&&o.fetchState!=="In-Progress"||a.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:t,statusRows:a}}),(function(n,e){const{navigate:t,tenantEmailDomain:i}=e,o=a=>{const c=a??null;n(oe(c)),ae(i,c),t(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:a=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"continue",sessionId:a}),o(a)},onNewImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingNewImportClicked),o()},onRetrySession:a=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"retry",sessionId:a}),n(Te(a)),o(a)},onRollbackSession:a=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"rollback",sessionId:a}),n(Lt(a))},onViewSession:a=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"view_details",sessionId:a}),t(`/${i}/invoicing/data_import/${encodeURIComponent(a)}`)}}}))(Dn);function ga(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),o=E(Re);r.useEffect((()=>{i&&(n(bi()),n(At()))}),[i,n]);const a=o.statusFetch.fetchState==="Completed"&&o.sessionsFetch.fetchState==="Completed";return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:a}),s.jsx(ua,{navigate:e,tenantEmailDomain:t,view:o})]})}const ma=T((function(n,e){const{activeId:t,integrationsView:i,settings:o,view:a}=e,{actionStateByKind:c,sessionDetail:d,sessions:l}=a,v=i.externalConnections?.revenue?.find((g=>g.connectionName==="chargebee")),u=t!=null?d[t]:void 0;return{chargebeeConnected:o?.chargebee_connected===!0||(v?.isValid??!1),chargebeeConnectorAvailable:v!=null,chargebeeSite:o?.chargebee_site,connectError:c.connect?.error?.message,connecting:c.connect?.fetchState==="In-Progress",retrying:c.retry?.fetchState==="In-Progress",session:u??l.find((g=>g.id===t)),starting:c.start?.fetchState==="In-Progress",uploading:c.upload?.fetchState==="In-Progress"}}),(function(n,e){const{activeId:t,navigate:i,tenantEmailDomain:o}=e;return{onBack:e.onBack,onDownloadTemplates:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportTemplatesDownloaded);const a=se?.invoicingMicroServiceBaseUrl,c=a!=null&&a.length>0?a:"";window.open(`${c}/1.0/data-import/templates`,"_blank","noopener")},onFetchFromChargebee:()=>{p.trackInvoicingActionClick(m.Event.invoicingChargebeeConnectClicked),n(Pi())},onGoToIntegrations:()=>{i(`/${o}/invoicing/settings`)},onGoToOverview:()=>i(`/${o}/invoicing/overview`),onRetry:()=>{t!=null&&n(Te(t))},onSaveLater:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportStarted),t!=null&&n(Di(t))},onUpload:a=>{p.trackInvoicingActionClick(m.Event.invoicingImportFileUploaded),n(ji({files:a}))},onViewDetails:t==null?void 0:()=>i(`/${o}/invoicing/data_import/${encodeURIComponent(t)}`)}}))(Pn);function va(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),o=E(xt),a=E(Oe).companyId??he.getSignedInUserTenant(t??"")?.companyId,c=E((S=>$t(S,a))),d=E(Re),{activeMigrationSessionId:l}=d,v=l??void 0,u=v!=null?d.sessionDetail[v]??d.sessions.find((S=>S.id===v)):void 0;r.useEffect((()=>{i&&(n(_e()),n(At()))}),[i,n]),r.useEffect((()=>{if(l!=null)return;const S=(I=>{if(I==null||I==="")return null;try{return sessionStorage.getItem(en(I))}catch{return null}})(t);S!=null&&n(oe(S))}),[l,n,t]),r.useEffect((()=>{ae(t,l)}),[l,t]);const g=u?.status,f=g==="scanning"||g==="importing";return r.useEffect((()=>{if(!i||v==null||!f)return;const S=setInterval((()=>{n(ke(v))}),3e3);return()=>clearInterval(S)}),[i,v,f,n]),r.useEffect((()=>{g==="done"&&(n(oe(null)),ae(t,null))}),[n,g,t]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportMigratePage}),s.jsx(ma,{activeId:v,integrationsView:c,navigate:e,settings:o,tenantEmailDomain:t,view:d,onBack:()=>{n(oe(null)),ae(t,null),e(`/${t}/invoicing/data_import`)}})]})}const pa=T((function(n,e){const{editView:t}=e;return{fieldHelp:t.fieldHelp,coupon:t.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,isLoading:!e.hasLoadedRecord&&(t.pageFetchState.fetchState==="Not-Started"||t.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:t.fetchState==="In-Progress"}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${t}/discounts`),onLifecycleAction:o=>{n(wt({action:o,id:i}))},onSaveEdit:o=>{p.trackInvoicingActionClick(m.Event.invoicingCouponEdited,{couponId:i}),n(Ai({data:o,id:i}))}}}))(Ln);function fa(){const n=P(),e=L(),{coupon_id:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),a=E((I=>Li(I,t))),c=a.actionState.fetchState==="In-Progress",d=a.pageFetchState.fetchState,l=d==="Completed",[v,u]=r.useState(void 0);r.useEffect((()=>{t!=null&&l&&u(t)}),[t,l]);const g=v===t;r.useEffect((()=>(n(G()),()=>{n(G())})),[n]),r.useEffect((()=>{o&&n(et({id:t}))}),[o,t,n]);const[f,S]=r.useState(0);return r.useEffect((()=>{a.fetchState==="Completed"&&(n(G()),n(et({cacheOverride:!0,id:t})),S((I=>I+1)))}),[a.fetchState,n,t]),U(d)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDiscountDetailPage,isReady:l}),s.jsx(pa,{hasLoadedRecord:g,couponId:t??"",discountLifecycleActionOptions:a.discountLifecycleActionOptions,editView:a,isRunningLifecycleAction:c,navigate:e,tenantEmailDomain:i},f)]})}const Sa=T((function(n){const e=Ft(n),{fetchState:t}=e;return{columns:e.columns,counts:e.count,discountLifecycleActionOptions:e.discountLifecycleActionOptions,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",coupons:e.coupons,hasMore:e.nextCursor!=null,isLoading:t==="Not-Started"||t==="In-Progress"&&e.coupons.length===0,isLoadingMore:t==="In-Progress"&&e.coupons.length>0,tabIds:e.tabIds}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onCouponClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${t}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateCouponClicked),e.navigate(`${t}/discounts/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${t}/data_import`)},onDiscountLifecycleAction:(i,o)=>{n(wt({action:o,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&n(Rt({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(An);function ha(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:I,nextCursor:j,couponListFetchState:k,runningDiscountActionId:x}=E((C=>{const D=Ft(C);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:D.sort,nextCursor:D.nextCursor,couponListFetchState:D.fetchState,runningDiscountActionId:D.runningActionId??null}}),H),b=k==="Completed";return r.useEffect((()=>{const C=setTimeout((()=>d(o)),300);return()=>clearTimeout(C)}),[o]),r.useEffect((()=>{i&&n(tt({cacheOverride:!1}))}),[i,n]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==I?.field||u?.dir!==I?.dir)&&n(tt({cacheOverride:!0,filters:g,sort:u}))}),[i,n,g,u,S,I]),U(k)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDiscountsListPage,isReady:b}),s.jsx(Sa,{navigate:e,tenantEmailDomain:t,activeStatus:f,searchValue:o,sortState:l,filters:g,sort:u,nextCursor:j,runningDiscountActionId:x,onSearchChange:a,onStatusChange:C=>n($i(C)),onSortChange:v})]})}const Ca=T((function(n,e){const{readView:t}=e;return{fieldHelp:e.readView.fieldHelp,caseId:e.caseId,dunningAttempts:e.dunningAttempts,dunningCase:t.dunningCase,isLoading:t.fetchState==="Not-Started"||t.fetchState==="In-Progress",isRunningAction:t.actionState.fetchState==="In-Progress"}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{caseId:i}=e,o=i!=="";return{onBack:()=>e.navigate(`${t}/dunning`),onInvoiceClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${t}/invoices/${encodeURIComponent(a)}`)},onCancel:o?()=>n(Z({action:"cancel",id:i})):void 0,onResolve:o?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resolve",caseId:i}),n(Z({action:"resolve",id:i}))}:void 0,onResume:o?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resume",caseId:i}),n(Z({action:"resume",id:i}))}:void 0,onRetry:o?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"retry",caseId:i}),n(Z({action:"retry",id:i}))}:void 0}}))(wn);function Ia(){const n=P(),e=L(),{case_id:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),a=E((h=>wi(h,t??""))),c=a.fetchState==="Completed",d=a.dunningCase?.invoiceID,[l,v]=r.useState("idle"),[u,g]=r.useState(!1),[f,S]=r.useState(),[I,j]=r.useState(!1),k=r.useCallback((()=>{v("idle"),g(!1),S(void 0),j(!1)}),[]),x=r.useCallback((()=>{if(t==null)return;n(Fi({id:t})),v("idle"),g(!1);const h=a.emailPreview.preview;S(h==null?void 0:{body:h.body,cc:h.cc,subject:h.subject,to:h.to}),j(!0)}),[t,n,a.emailPreview.preview]),b=r.useCallback((h=>{t!=null&&l!=="pending"&&(g(!1),v("pending"),p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"send-email",caseId:t}),n(Z({action:"send-email",body:h,id:t})))}),[t,n,l]),C=r.useMemo((()=>a.emailPreview.preview==null?void 0:{bodyToken:a.emailPreview.preview.bodyToken,renderedHtmlTemplate:a.emailPreview.preview.renderedHtmlTemplate,subjectToken:a.emailPreview.preview.subjectToken}),[a.emailPreview.preview]);r.useEffect((()=>{o&&t!=null&&n(Ri({id:t}))}),[o,t,n]),r.useEffect((()=>{o&&d!=null&&n(Me({invoiceId:d}))}),[o,d,n]),r.useEffect((()=>{v("idle"),g(!1),S(void 0),j(!1)}),[t]),r.useEffect((()=>{o||(v("idle"),g(!1),S(void 0),j(!1))}),[o]),r.useEffect((()=>{I&&f==null&&a.emailPreview.preview!=null&&S({body:a.emailPreview.preview.body,cc:a.emailPreview.preview.cc,subject:a.emailPreview.preview.subject,to:a.emailPreview.preview.to})}),[a.emailPreview.preview,f,I]),r.useEffect((()=>{l==="pending"&&(a.actionState.fetchState!=="In-Progress"?u&&a.actionState.fetchState==="Completed"?(t!=null&&n(Ti({id:t})),k()):u&&a.actionState.fetchState==="Error"&&v("failed"):g(!0))}),[t,k,n,l,u,a.actionState.fetchState]);const D=d!=null&&a.linkedInvoice?.id===d?a.linkedInvoice.dunningAttempts:void 0;return U(a.fetchState)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDunningDetailPage,isReady:c}),s.jsx(Ca,{navigate:e,tenantEmailDomain:i,caseId:t??"",readView:a,dunningAttempts:D,onSendEmail:x}),s.jsx($n,{initialDraft:f,isPreviewLoading:a.emailPreview.fetchState==="Not-Started"||a.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:k,onSend:b,open:I,preview:C,previewErrorMessage:a.emailPreview.fetchState==="Error"?a.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?a.actionState.error?.message:void 0})]})}const Ea=T((function(n){const e=Tt(n),{fetchState:t}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",dunningCases:e.dunningCases,hasMore:e.nextCursor!=null,isLoading:t==="Not-Started"||t==="In-Progress"&&e.dunningCases.length===0,isLoadingMore:t==="In-Progress"&&e.dunningCases.length>0,tabIds:e.tabIds}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>e.navigate(`${t}/data_import`),onDunningCaseClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingDunningCaseRowClicked,{caseId:i}),e.navigate(`${t}/dunning/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{o!=="retry"&&o!=="resume"&&o!=="resolve"&&o!=="cancel"||n(Z({action:o,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&n(_i({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Fn);function ka(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:I,nextCursor:j,dunningCaseListFetchState:k}=E((b=>{const C=Tt(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,dunningCaseListFetchState:C.fetchState}}),H),x=k==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&n(nt({cacheOverride:!1}))}),[i,n]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==I?.field||u?.dir!==I?.dir)&&n(nt({cacheOverride:!0,filters:g,sort:u}))}),[i,n,g,u,S,I]),U(k)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDunningListPage,isReady:x}),s.jsx(Ea,{navigate:e,tenantEmailDomain:t,activeStatus:f,searchValue:o,sortState:l,filters:g,sort:u,nextCursor:j,onSearchChange:a,onStatusChange:b=>n(Oi(b)),onSortChange:v})]})}const ya=T((function(n,e){const{view:t}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:t.billingAddress,invoice:t.invoice,invoiceId:e.invoiceId,shippingAddress:t.shippingAddress,isLoading:!e.hasLoadedRecord&&(t.pageFetchState.fetchState==="Not-Started"||t.pageFetchState.fetchState==="In-Progress"),isSaving:t.actionState.fetchState==="In-Progress",isVoiding:t.actionState.fetchState==="In-Progress"}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e;return{onBack:()=>e.navigate(`${t}/invoices`),onCustomerClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${t}/customers/${encodeURIComponent(o)}`)},onIssueCreditNote:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:i}),e.navigate(`${t}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentClicked,{fromScreen:"invoice_detail",invoiceId:i}),e.navigate(`${t}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRegenerated,{invoiceId:i}),n(V({action:"regenerate",invoiceId:i}))},onSaveEdit:o=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceEdited,{invoiceId:i}),n(Ni({data:{due_date:o.due_date!==""?o.due_date:void 0,notes:o.notes.trim()!==""?o.notes.split(`
2
- `).map((a=>a.trim())).filter((a=>a!=="")).map((a=>({note:a}))):void 0,po_number:o.po_number!==""?o.po_number:null},invoiceId:i}))},onSendReminder:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceReminderSent,{invoiceId:i}),n(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${t}/subscriptions/${encodeURIComponent(o)}`)},onVoid:o=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),n(V({action:"void",invoiceId:i,body:o}))}}}))(Rn);function xa(){const n=P(),e=L(),{invoice_id:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),a=E((g=>Ot(g,t??""))),c=a.pageFetchState.fetchState,d=c==="Completed",[l,v]=r.useState(void 0);r.useEffect((()=>{t!=null&&d&&v(t)}),[t,d]);const u=l===t;return r.useEffect((()=>{o&&t!=null&&n(Mi({invoiceId:t}))}),[o,t,n]),U(c)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(ya,{invoiceId:t??"",hasLoadedRecord:u,navigate:e,tenantEmailDomain:i,view:a})]})}const ba=T((function(n){const e=_t(n),{fetchState:t}=e;return{counts:e.counts,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,invoices:e.invoices,statusOptions:e.statusOptions,isLoading:t==="Not-Started"||t==="In-Progress"&&e.invoices.length===0,isLoadingMore:t==="In-Progress"&&e.invoices.length>0,kpis:e.kpis,kpisLoading:e.kpisFetchState.fetchState==="Not-Started"||e.kpisFetchState.fetchState==="In-Progress"&&e.kpis==null,tabIds:e.tabIds}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onCreateInvoice:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateInvoiceClicked),e.navigate(`${t}/invoices/create`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${t}/data_import`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRowClicked,{invoiceId:i}),e.navigate(`${t}/invoices/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{switch(o){case"recordPayment":e.navigate(`${t}/invoices/${encodeURIComponent(i)}/record-payment`);break;case"issueCreditNote":e.navigate(`${t}/invoices/${encodeURIComponent(i)}/issue-credit-note`);break;case"sendReminder":n(V({action:"send-reminder",invoiceId:i}));break;case"regenerate":n(V({action:"regenerate",invoiceId:i}));break;case"void":n(V({action:"void",invoiceId:i}))}},onVoidInvoice:(i,o)=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),n(V({action:"void",invoiceId:i,body:o}))},onLoadMore:()=>{e.nextCursor!=null&&n(Mt({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Tn);function ja(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:I,nextCursor:j,invoiceListFetchState:k,voidingInvoiceId:x}=E((C=>{const D=_t(C);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:C.invoicingInvoiceListState.sort,nextCursor:D.nextCursor,invoiceListFetchState:D.fetchState,voidingInvoiceId:D.runningActionId}}),H),b=k==="Completed";return r.useEffect((()=>{const C=setTimeout((()=>d(o)),300);return()=>clearTimeout(C)}),[o]),r.useEffect((()=>{i&&n(ve({cacheOverride:!1}))}),[i,n]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==I?.field||u?.dir!==I?.dir)&&n(ve({cacheOverride:!0,filters:g,sort:u}))}),[i,n,g,u,S,I]),U(k)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoicesListPage,isReady:b}),s.jsx(ba,{navigate:e,tenantEmailDomain:t,activeStatus:f,searchValue:o,sortState:l,filters:g,sort:u,nextCursor:j,voidingInvoiceId:x,onSearchChange:a,onStatusChange:C=>{n(Ui(C)),n(ve({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v})]})}function dt(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),i=On(),o=ft(),[a,c]=r.useState(!1),{acceptTermsState:d,status:l}=E(Nt),v=Bi(i?.loggedInUserRoleMap),u=`/${t}/invoicing`,g=f=>{c(f)};return l==="completed"?s.jsx(B,{to:`${u}/overview`,replace:!0}):l==="settings"&&v?s.jsx(B,{to:`${u}/settings`,replace:!0}):s.jsxs(s.Fragment,{children:[s.jsx(To,{isAppContentDrawerOpen:a,handleDrawerToggle:g}),s.jsx(_n,{analytics:p,isAccepting:d.fetchState==="In-Progress",isReadOnlyUser:!v,meetingUrl:o("invoicing_promo"),onAcceptClick:()=>{n(Vi())},onBackClick:()=>{e(`/${t}`)},onClickMenuIcon:()=>{g(!0)}})]})}const Da=T((function(n,e){const t=Ut(n,e.invoiceId),{invoice:i,localData:o,reasonCodeOptions:a,submitState:c,typeOptions:d}=t;return{fieldHelp:t.fieldHelp,amountDue:i?.amountDue,currencyCode:i?.currencyCode??"USD",customerName:i?.customerName??"",errorMessage:c.fetchState==="Error"?c.error?.message??"Failed to issue credit note. Please try again.":void 0,invoiceNumber:i?.invoiceNumber??e.invoiceId,isSubmitting:c.fetchState==="In-Progress",localData:o,reasonCodeOptions:a,typeOptions:d}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(t);return{onBack:i,onCancel:i,onChange:o=>{n(Ki({localData:o}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),n(Yi())}}}))(Mn);function Pa(){const n=P(),e=L(),{invoice_id:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),{fetchState:a,invoice:c,isPageReady:d,issuedCreditNoteId:l,submitState:v}=E((S=>Ut(S,t??""))),u=`/${i}/invoicing`,g=r.useRef(null);r.useEffect((()=>{n(Hi()),g.current=null}),[n,t]),r.useEffect((()=>{o&&t!=null&&n(Me({invoiceId:t}))}),[o,n,t]),r.useEffect((()=>{c!=null&&t!=null&&a==="Completed"&&g.current!==t&&(g.current=t,n(Zi({localData:qi(c)})))}),[n,a,c,t]);const f=r.useRef(v.fetchState);return r.useEffect((()=>{const S=f.current;f.current=v.fetchState,S!=="Completed"&&v.fetchState==="Completed"&&l!=null&&e(`${u}/credits/${encodeURIComponent(l)}`)}),[l,e,v.fetchState,u]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(Da,{invoiceId:t??"",navigate:e,tenantEmailDomain:i})]})}const La=T((function(n){return{invoicingOverview:Bt(n)}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{n(Vt(e.selectedPeriod,!0))},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${t}/subscriptions/${i}`)},onViewInvoices:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewInvoicesClicked),e.navigate(`${t}/invoices`)},onViewPayments:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewPaymentsClicked),e.navigate(`${t}/payments`)}}}))(Nn);function Aa(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o]=r.useState((()=>{const c=new Date;return{month:c.getMonth()+1,year:c.getFullYear()}})),a=E((c=>Bt(c).fetchState))==="Completed";return r.useEffect((()=>{i&&n(Vt(o))}),[i,n,o]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingOverviewPage,isReady:a}),s.jsx(La,{navigate:e,selectedPeriod:o,tenantEmailDomain:t})]})}const $a=T((function(n){const e=Ht(n),{fetchState:t}=e;return{columns:e.columns,hasMore:e.nextCursor!=null,isLoading:t==="Not-Started"||t==="In-Progress"&&e.transactions.length===0,isLoadingMore:t==="In-Progress"&&e.transactions.length>0,tabIds:e.tabIds,transactions:e.transactions}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`;return{activeType:e.activeType,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTypeChange:e.onTypeChange,onViewTransactionCustomer:e.onViewTransactionCustomer,onViewTransactionInvoice:e.onViewTransactionInvoice,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${t}/data_import`)},onTransactionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${t}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&n(Gi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Un);function wa(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeType:f,appliedSearch:S,appliedSort:I,nextCursor:j,transactionListFetchState:k,transactions:x}=E((_=>{const O=Ht(_);return{activeType:O.activeTab,appliedSearch:O.filters.search,appliedSort:O.sort,nextCursor:O.nextCursor,transactionListFetchState:O.fetchState,transactions:O.transactions}}),H),b=k==="Completed",C=`/${t}/invoicing`,D=r.useCallback((_=>{const O=x.find((M=>M.id===_)),R=O?.linkedInvoices?.[0]?.invoiceID??O?.invoiceID;R!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:R,toScreen:"invoice"}),e(`${C}/invoices/${encodeURIComponent(R)}`))}),[e,C,x]),h=r.useCallback((_=>{const O=x.find((R=>R.id===_))?.customerID;O!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:O,fromScreen:"payments_list",toScreen:"customer"}),e(`${C}/customers/${encodeURIComponent(O)}`))}),[e,C,x]);return r.useEffect((()=>{const _=setTimeout((()=>d(o)),300);return()=>clearTimeout(_)}),[o]),r.useEffect((()=>{i&&n(pe({cacheOverride:!1}))}),[i,n]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==I?.field||u?.dir!==I?.dir)&&n(pe({cacheOverride:!0,filters:g,sort:u}))}),[i,n,g,u,S,I]),U(k)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingPaymentsListPage,isReady:b}),s.jsx($a,{navigate:e,tenantEmailDomain:t,activeType:f,searchValue:o,sortState:l,filters:g,sort:u,nextCursor:j,onSearchChange:a,onTypeChange:_=>{n(Qi(_)),n(pe({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v,onViewTransactionCustomer:h,onViewTransactionInvoice:D})]})}const Fa=n=>{const e=[n.firstName,n.lastName].filter((t=>t!=null&&t.trim()!=="")).join(" ").trim();return(n.company!=null&&n.company.trim()!==""?n.company.trim():"")||e||(n.email!=null&&n.email.trim()!==""?n.email.trim():"")||n.id},ut=(n,e)=>new Intl.NumberFormat("en-US",{currency:e,style:"currency"}).format(n);function gt(){const n=P(),e=L(),{invoice_id:t,tenantEmailDomain:i}=w(),{areTenantIdsInSync:o}=F(),a=t!=null&&t!=="",c=E(ue),d=E((h=>zi(h))),l=E(Wi),v=E((h=>Ot(h,t??""))),u=v.invoice,g=`/${i}/invoicing`,f=r.useRef(null),S=r.useRef("");r.useEffect((()=>{n(Ji()),f.current=null,S.current=""}),[n,t]),r.useEffect((()=>{o&&n(a&&t!=null?Me({invoiceId:t}):Fe({filters:{},keepExistingListItems:!1}))}),[o,n,t,a]),r.useEffect((()=>{a&&u!=null&&t!=null&&v.fetchState==="Completed"&&f.current!==t&&(f.current=t,n(Xi({contextInvoiceId:t,localData:eo(u)})))}),[n,u,t,v.fetchState,a]),r.useEffect((()=>{if(a)return;const h=d.localData.customerId;h!==""&&h!==S.current&&(S.current=h,n(Mt({filters:{customerId:h},keepExistingListItems:!1})),d.localData.invoiceToLink!==""&&n(it({localData:{...d.localData,customerId:h,invoiceToLink:""}})))}),[n,d.localData,a]);const I=r.useRef(l.fetchState);r.useEffect((()=>{const h=I.current;if(I.current=l.fetchState,h!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${g}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${g}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,g]);const j=r.useMemo((()=>c.customers.map((h=>({id:h.id,name:Fa(h)})))),[c.customers]),k=E((h=>to(h,d.localData.customerId))),x=r.useMemo((()=>k.map((h=>({amountDue:ut(h.amountDue,"USD"),amountDueValue:h.amountDue,id:h.id,label:h.invoiceNumber})))),[k]),b=r.useMemo((()=>{if(!a||u==null)return;const h=u.currencyCode??"USD",_=u.amountDue?.amount??0;return{amountDue:ut(_,h),amountDueValue:_,currencyCode:h,customerName:u.customerName??u.customerID,invoiceId:u.id,invoiceNumber:u.invoiceNumber??u.id}}),[u,a]),C=a?`${g}/invoices/${encodeURIComponent(t??"")}`:`${g}/payments`,D=!a||v.fetchState==="Completed"&&d.localData.invoiceToLink!=="";return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingRecordPaymentPage,isReady:D}),s.jsx(Bn,{customers:j,fieldHelp:d.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:d.gatewayOptions,invoiceContext:b,invoiceOptions:x,isSubmitting:l.fetchState==="In-Progress",localData:d.localData,mode:a?"invoice":"customer",paymentMethodOptions:d.paymentMethodOptions,onBack:()=>{e(C)},onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentCancelled),e(C)},onChange:h=>{n(it({localData:h}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRecorded,{customerId:d.localData.customerId,invoiceId:a?t:d.localData.invoiceToLink,paymentMethod:d.localData.paymentMethod}),n(no(a?t??void 0:void 0))}})]})}const tn=(n,e,t)=>{const i=`/${n}/invoicing/subscriptions/`;return t!=null?`${i}${encodeURIComponent(t)}/${e}/`:`${i}new/${e}/`},Ra=(n,e)=>{if(n==null)return;const t=new Intl.NumberFormat("en-US",{currency:n.currencyCode??"USD",maximumFractionDigits:0,style:"currency"}).format(n.amount);return e!=null?`${t}/${e}`:t},nn=(n,e,t)=>{const i=[n,Ra(e,t)].filter((o=>o!=null&&o!=="")).join(" · ");return i!==""?i:void 0},mt=n=>n.priceCode!=null&&n.priceCode.trim()!=="",Ta=n=>({billingCycles:n.billingCycles,billingPeriod:n.period,billingPeriodUnit:n.periodUnit,label:n.name??n.id,subtitle:nn(n.productCode,n.price,n.periodUnit),value:n.priceCode}),Oa=n=>({label:n.name??n.couponCode??n.id,value:n.couponCode??n.id}),_a=T((function(n,e){const{editView:t}=e,i=t.subscription,o=i?.status,a=o!=null&&e.commercialEditAllowedFromStatuses.includes(o);return{cancelReasonCodeOptions:t.cancelReasonCodeOptions,fieldHelp:t.fieldHelp,addons:t.products.filter((c=>c.itemType==="addon")).filter(mt).map((c=>({label:c.name??c.id,subtitle:nn(c.productCode,c.price,c.periodUnit),value:c.priceCode}))),canEditCommercial:a,coupons:t.coupons.map(Oa),isLoading:!e.hasLoadedRecord&&(t.pageFetchState.fetchState==="Not-Started"||t.pageFetchState.fetchState==="In-Progress"),isRunningAction:t.actionState.fetchState==="In-Progress",isSaving:t.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:t.localData,plans:t.plans.filter(mt).map(Ta),shippingAddressLabel:t.shippingAddressLabel,subscription:i}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=="",a=(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:c,subscriptionId:i}),n(qt({action:c,id:i,body:d}))};return{onBack:()=>e.navigate(`${t}/subscriptions`),onChange:c=>{n(re({id:i,localData:c}))},onChangeTermEnd:o?c=>{const d=c?.trim()??"";d!==""&&a("change_term_end",{term_ends_at:d})}:void 0,onCustomerClick:c=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:c,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${t}/customers/${encodeURIComponent(c)}`,"_blank","noopener,noreferrer")},onOpenAddress:()=>{const c=tn(e.tenantEmailDomain??"",xe,i),d=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onViewInvoices:()=>e.navigate(`${t}/invoices`),onSaveEdit:c=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionEdited,{subscriptionId:i}),n(re({id:i,localData:c})),n(Zt({id:i}))},onCancelSubscription:o?c=>{a("cancel",{cancel_reason_code:c.cancelReasonCode,end_of_term:!1,...c.cancelReason!=null&&c.cancelReason.trim()!==""?{cancel_reason:c.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:o?(c,d)=>{c!=="pause"?a(c):a(c,d!=null&&d.trim()!==""?{resume_date:d.trim()}:void 0)}:void 0}}))(Vn);function Ma(){const n=P(),e=L(),t=W(),{subscription_id:i,tenantEmailDomain:o}=w(),{areTenantIdsInSync:a}=F(),c=E((x=>Ne(x,i))),{subscriptionCommercialEditAllowedFromStatuses:d,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:v}=c,u=c.pageFetchState.fetchState,g=u==="Completed",[f,S]=r.useState(void 0);r.useEffect((()=>{i!=null&&g&&S(i)}),[i,g]);const I=f===i;Ve(a),r.useEffect((()=>{a&&i!=null&&n(ot({id:i}))}),[a,i,n]);const[j,k]=r.useState(0);return r.useEffect((()=>{c.fetchState==="Completed"&&(n(Ue()),n(ot({cacheOverride:!0,id:i})),k((x=>x+1)))}),[c.fetchState,n,i]),U(u)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionDetailPage,isReady:g}),s.jsx(_a,{hasLoadedRecord:I,commercialEditAllowedFromStatuses:d,editView:c,lifecycleActionOptions:l,location:t,metadataEditAllowedFromStatuses:v,navigate:e,subscriptionId:i??"",tenantEmailDomain:o},j)]})}const Na=n=>{const e=[n.firstName,n.lastName].filter((t=>t!=null&&t.trim()!=="")).join(" ").trim();return(n.company!=null&&n.company.trim()!==""?n.company.trim():"")||e||(n.email!=null&&n.email.trim()!==""?n.email.trim():"")||n.id},Ua=(n,e)=>{if(n==null)return;const t=new Intl.NumberFormat("en-US",{currency:n.currencyCode??"USD",maximumFractionDigits:0,style:"currency"}).format(n.amount);return e!=null?`${t}/${e}`:t},je=(n,e,t)=>{const i=[n,Ua(e,t)].filter((o=>o!=null&&o!=="")).join(" · ");return i!==""?i:void 0},Ba=n=>({label:Na(n),value:n.id}),Se=n=>n.priceCode!=null&&n.priceCode.trim()!=="",Va=n=>({billingCycles:n.billingCycles,billingPeriod:n.period,billingPeriodUnit:n.periodUnit,label:n.name??n.id,subtitle:je(n.productCode,n.price,n.periodUnit),trialPeriod:n.trialPeriod,trialPeriodUnit:n.trialPeriodUnit,value:n.priceCode}),Ha=n=>({label:n.name??n.couponCode??n.id,value:n.couponCode??n.id}),Za=T((function(n,e){const t=Ne(n,e.subscriptionId);return{fieldHelp:t.fieldHelp,addons:t.products.filter((i=>i.itemType==="addon")).filter(Se).map((i=>({label:i.name??i.id,subtitle:je(i.productCode,i.price,i.periodUnit),value:i.priceCode}))),charges:t.products.filter((i=>i.itemType==="charge")).filter(Se).map((i=>({label:i.name??i.id,subtitle:je(i.productCode,i.price,void 0),value:i.priceCode}))),coupons:t.coupons.map(Ha),customers:t.customers.map(Ba),errorMessage:t.fetchState==="Error"?t.error?.message??"Failed to save subscription.":void 0,isSubmitting:t.fetchState==="In-Progress",localData:t.localData,mode:t.mode,plans:t.plans.filter(Se).map(Va),shippingAddressLabel:t.shippingAddressLabel}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=null?"edit":"create";return{onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionFormCancelled),n(Ue()),n(we(xe)),i==null?e.navigate(`${t}/subscriptions`):e.navigate(`${t}/subscriptions/${encodeURIComponent(i)}`)},onChange:a=>{n(re({id:i,localData:a}))},onOpenAddress:()=>{const a=tn(e.tenantEmailDomain??"",xe,i),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(a,{state:{pathnameStackToGoBack:c}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionSaved,{mode:o}),n(Zt({id:i}))}}}))(Hn);function qa(){const n=P(),e=L(),t=W(),{subscription_id:i,tenantEmailDomain:o}=w(),[a]=z(),{areTenantIdsInSync:c}=F(),d=a.get("customerId"),{fetchState:l,savedSubscriptionId:v}=E((f=>io(f,i))),u=E((f=>Ne(f,i).localData));Ve(c),r.useEffect((()=>{c&&(n(Fe({filters:{},keepExistingListItems:!1})),n(Ce({filters:{type:"plan"},keepExistingListItems:!1})),n(Rt({filters:{},keepExistingListItems:!1})),i!=null&&n(oo({id:i})))}),[c,i,n]);const g=r.useRef(!1);return r.useEffect((()=>{g.current||i!=null||d==null||d===""||u.customerId!==""||(g.current=!0,n(re({id:i,localData:{...u,customerId:d}})))}),[d,i,u,n]),r.useEffect((()=>{if(l==="Completed"){const f=v??i,S=f!=null?`/${o}/invoicing/subscriptions/${encodeURIComponent(f)}`:`/${o}/invoicing/subscriptions`;e(S),n(Ue())}}),[l,v,i,n,e,o]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionFormPage}),s.jsx(Za,{location:t,navigate:e,subscriptionId:i,tenantEmailDomain:o})]})}const Ya=T((function(n){const e=Yt(n),{fetchState:t}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,isLoading:t==="Not-Started"||t==="In-Progress"&&e.subscriptions.length===0,isLoadingMore:t==="In-Progress"&&e.subscriptions.length>0,cancelReasonCodeOptions:e.cancelReasonCodeOptions,lifecycleActionOptions:e.subscriptionLifecycleActionOptions,subscriptions:e.subscriptions,tabIds:e.tabIds}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,i=(o,a,c)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:a,subscriptionId:o}),n(qt({action:a,id:o,body:c}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{p.trackInvoicingActionClick(m.Event.invoicingAddSubscriptionClicked),e.navigate(`${t}/subscriptions/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${t}/data_import`)},onChangeTermEnd:(o,a)=>{const c=a?.trim()??"";c!==""&&i(o,"change_term_end",{term_ends_at:c})},onSubscriptionAction:(o,a,c)=>{a!=="pause"?i(o,a):i(o,a,c!=null&&c.trim()!==""?{resume_date:c.trim()}:void 0)},onCancelSubscription:(o,a)=>{i(o,"cancel",{cancel_reason_code:a.cancelReasonCode,end_of_term:!1,...a.cancelReason!=null&&a.cancelReason.trim()!==""?{cancel_reason:a.cancelReason.trim()}:{}})},onSubscriptionClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionRowClicked,{subscriptionId:o}),e.navigate(`${t}/subscriptions/${encodeURIComponent(o)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${t}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&n(co({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Zn);function Ka(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:I,nextCursor:j,subscriptionListFetchState:k,runningActionSubscriptionId:x}=E((D=>{const h=Yt(D);return{activeStatus:h.activeTab,appliedSearch:h.filters.search,appliedSort:h.sort,nextCursor:h.nextCursor,subscriptionListFetchState:h.fetchState,runningActionSubscriptionId:h.runningActionId??null}}),H),b=k==="Completed";r.useEffect((()=>{const D=setTimeout((()=>d(o)),300);return()=>clearTimeout(D)}),[o]),r.useEffect((()=>{i&&n(at({cacheOverride:!1}))}),[i,n]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==I?.field||u?.dir!==I?.dir)&&n(at({cacheOverride:!0,filters:g,sort:u}))}),[i,n,g,u,S,I]);const C=r.useRef(x);return r.useEffect((()=>{const D=C.current!=null&&x==null;C.current=x,D&&i&&n(ao())}),[x,i,n]),U(k)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionsListPage,isReady:b}),s.jsx(Ya,{navigate:e,tenantEmailDomain:t,activeStatus:f,searchValue:o,sortState:l,filters:g,sort:u,nextCursor:j,runningActionSubscriptionId:x,onSearchChange:a,onStatusChange:D=>n(so(D)),onSortChange:v})]})}const Qa=T((function(n,e){const{readView:t}=e;return{isLoading:t.fetchState==="Not-Started"||t.fetchState==="In-Progress",isRunningAction:t.actionState.fetchState==="In-Progress",transaction:t.transaction,transactionId:e.transactionId}}),(function(n,e){const t=`/${e.tenantEmailDomain}/invoicing`,{transactionId:i}=e;return{onBack:()=>e.navigate(`${t}/payments`),onCustomerClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${t}/customers/${encodeURIComponent(o)}`)},onInvoiceClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${t}/invoices/${encodeURIComponent(o)}`)},onSubscriptionClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${t}/subscriptions/${encodeURIComponent(o)}`)},onCapture:i!==""?()=>{p.trackInvoicingActionClick(m.Event.invoicingTransactionCaptured,{transactionId:i}),n(uo({action:"capture",id:i}))}:void 0}}))(qn);function Ga(){const n=P(),e=L(),{tenantEmailDomain:t,transaction_id:i}=w(),{areTenantIdsInSync:o}=F(),a=E((d=>ro(d,i??""))),c=a.fetchState==="Completed";return r.useEffect((()=>{o&&i!=null&&n(lo({id:i}))}),[o,i,n]),U(a.fetchState)?s.jsx(N,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingTransactionDetailPage,isReady:c}),s.jsx(Qa,{navigate:e,tenantEmailDomain:t,transactionId:i??"",readView:a})]})}const za={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function X(n){const e=P(),{areTenantIdsInSync:t}=F(),{tenantEmailDomain:i}=w(),{fetchState:o,fieldHelp:a,saveState:c,settings:d,stripeConnectState:l}=E(go),{configError:v,configFetchState:u,dunningScheduleActionOptions:g,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:S,qboSyncStatusOptions:I}=E(Kt),j=E(Le);Be({enabled:n==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const k=E(Oe),x=n==="dunning"||n==="quickbooks",b=k.companyId??he.getSignedInUserTenant(i??"")?.companyId,C=E((A=>$t(A,b))),D=mo(k.userRole??[]),h=k.tenantId??"",_=he.getSignedInUser(),O={userId:_?.userId??"",sessionId:_?.zeniSessionId??"",tenantId:h},R=d?.logo_file_id,M=E((A=>R!=null&&R!==""?A.fileState.fileByFileId[R]:void 0)),ee=E((A=>R!=null&&R!==""?vo(A,R):void 0)),He=E((A=>R!=null&&R!==""?po(A,R):void 0)),on=R!=null&&R!==""&&ee!=null?{[R]:ee}:{},an=R!=null&&R!==""&&He!=null?{[R]:He}:{};r.useEffect((()=>(e(st()),()=>{e(st())})),[e]),r.useEffect((()=>{t&&(o!=="Not-Started"&&o!=="Error"||e(_e()))}),[t,e,o]),r.useEffect((()=>{t&&x&&u==="Not-Started"&&e(le())}),[t,e,u,x]),r.useEffect((()=>{if(!t)return;const A=_?.userId;A!=null&&A!==""&&h!==""&&Ye.shouldFetchActiveTenant(h)&&(Ye.markActiveTenantFetchStarted(h),e(fo(A,h,_?.zeniSessionId)))}),[t,e,_?.userId,_?.zeniSessionId,h]),r.useEffect((()=>{t&&R!=null&&R!==""&&h!==""&&M==null&&e(So(R,h))}),[t,e,M,R,h]);const sn=g.length>0||f.length>0,cn=o==="Not-Started"||o==="In-Progress"&&d==null||x&&!sn&&(u==="Not-Started"||u==="In-Progress"),rn=o==="Completed"&&(!x||u==="Completed"),Ze=C.externalConnections?.revenue?.find((A=>A.connectionName==="chargebee"))?.connectionId,ge=se?.invoicingMicroServiceBaseUrl,qe=ge!=null&&ge.length>0?`${ge}/1.0/webhooks/stripe`:"",me={deleteConnectionError:C.externalConnections?.deleteConnectionError?.message,deleteConnectionState:C.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:C,isAdmin:D,isStripeBusy:l.fetchState==="In-Progress",onConnectStripe:A=>e(rt(A)),onDisconnect:(A,q)=>{h!==""&&e(xo(h,A,lt(q)))},onDisconnectStripe:()=>e(ct()),onReconnectQBO:()=>{const A=k.tenantEmailDomain??i??"";de.init("/connection/auth",A),de.handleClick()},onRefreshQBO:()=>{C.integrations.refreshQBO.fetchState!=="In-Progress"&&e(zt())},onSaveChargeBeeCredentials:(A,q)=>{Ze!=null&&h!==""&&e(ko(h,Ze,lt("revenue"),yo("chargebee"),{api_key:A,site:q}))},saveChargeBeeError:C.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:C.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:d,stripeError:l.fetchState==="Error"?l.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe};return{authParams:O,deleteFileStatusById:on,fieldHelp:a,dunningScheduleActionOptions:g,filesEndPoint:se?.fileMicroServiceBaseUrl??"",integrationsSectionProps:me,isInvoicingPageReady:rn,isLoading:cn,isSaving:c.fetchState==="In-Progress",isStripeBusy:l.fetchState==="In-Progress",logoFile:M,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:S,qboSyncStatusOptions:I,qboView:j,saveErrorMessage:c.fetchState==="Error"?c.error?.message??"Failed to save settings.":x&&u==="Error"?v?.message??"Failed to load invoicing configuration.":void 0,settings:d,stripeError:l.fetchState==="Error"?l.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe,updateFileStatusById:an,onConnectStripe:A=>e(rt(A)),onDeleteFile:A=>e(Eo(A)),onDisconnectStripe:()=>e(ct()),onEditFileName:(A,q)=>e(Io(A,q)),onReconnectQBO:me.onReconnectQBO,onRefreshQBO:me.onRefreshQBO,onRetryQboSyncTask:A=>e(Gt(A)),onSave:A=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:n??"hub"}),e(Co({settings:A,snackbarSection:za[n??""]}))},onStartQboBackfill:A=>e(Qt(A)),updateFilesEntity:A=>{p.trackInvoicingActionClick(m.Event.invoicingLogoUploaded),e(ho({files:A}))}}}function vt({appContent:n}){const e=L(),t=W(),i=P(),{tenantEmailDomain:o}=w(),a=X("branding"),c=E((v=>bo(v))),d=E((v=>jo(fe,v)?.addressToCreate));r.useEffect((()=>{c.saveState.fetchState==="Completed"&&(i(Do()),i(we(fe)))}),[c.saveState.fetchState,i]);const l=St(c.saveState.fetchState);return r.useEffect((()=>{l==="In-Progress"&&c.saveState.fetchState==="Completed"&&e("..")}),[l,c.saveState.fetchState,e]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:a.isInvoicingPageReady}),s.jsx(Yn,{address:d,fieldHelp:c.fieldHelp,addressLabel:c.addressLabel,appContent:n,authParams:a.authParams,dateFormatOptions:c.dateFormatOptions,deleteFileStatusById:a.deleteFileStatusById,filesEndPoint:a.filesEndPoint,isLoading:a.isLoading,isSaving:a.isSaving,localData:c.localData,saveErrorMessage:a.saveErrorMessage,settings:a.settings,updateFileStatusById:a.updateFileStatusById,onBackClick:()=>e(".."),onChange:v=>{i(Lo({localData:v}))},onDeleteFile:a.onDeleteFile,onEditFileName:a.onEditFileName,onOpenAddress:()=>{const v=`/${o}/invoicing/settings/branding/${fe}/`,u=J(t.state?.pathnameStackToGoBack,t.pathname);e(v,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>i(Po()),updateFilesEntity:a.updateFilesEntity})]})}function Wa(){const n=L(),e=X("dunning");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Kn,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>n(".."),onSave:e.onSave})]})}function Ja(){const n=L(),e=X("integrations");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Qn,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>n("../quickbooks"),onOpenPaymentDestination:()=>n("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>n("..")})]})}function Xa(){const n=L(),e=X("payment-destination");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Gn,{fieldHelp:e.fieldHelp,isLoading:e.isLoading,isStripeBusy:e.isStripeBusy,saveErrorMessage:e.saveErrorMessage,settings:e.settings,stripeError:e.stripeError,stripeWebhookUrl:e.stripeWebhookUrl,onBackClick:()=>n(".."),onConnectStripe:e.onConnectStripe})]})}const es=T((function(n){const e=Wt(n);return{accountMappingKindOptions:e.accountMappingKindOptions,fieldHelp:e.fieldHelp,accounts:e.accounts,connection:e.connection,customerMatchingOptions:e.customerMatchingOptions,isBackfilling:e.backfillState.fetchState==="In-Progress",isLoading:e.isLoading,isSaving:e.saveState.fetchState==="In-Progress",isSyncEnabledSaved:e.isSyncEnabledSaved,localData:e.localData,nestedAccountHierarchy:e.nestedAccountHierarchy,retryFetchStateByTaskId:e.retryFetchStateByTaskId,saveErrorMessage:e.saveState.fetchState==="Error"?e.saveState.error?.message:void 0,syncHealth:e.syncHealth,syncStatusOptions:e.syncStatusOptions}}),(function(n){return{onChange:e=>{n(wo({localData:e}))},onReset:()=>{n($o())},onRetryTask:e=>{n(Gt(e))},onSave:()=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:"quickbooks"}),n(Ao())},onStartBackfill:e=>{n(Qt(e))}}}))(zn);function ts(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),i=E(Oe),{configFetchState:o,settingsFetchState:a}=E(Wt);return r.useEffect((()=>{a!=="Not-Started"&&a!=="Error"||n(_e())}),[n,a]),r.useEffect((()=>{o==="Not-Started"&&n(le())}),[o,n]),Be({fetchSyncHealth:!0,loadAccountingPickers:!0}),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage}),s.jsx(es,{onBackClick:()=>e(".."),onReconnect:()=>{de.init("/connection/auth",i.tenantEmailDomain??t??""),de.handleClick()},onRefresh:()=>n(zt())})]})}const ns={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function is(){const n=ft(),e=P(),t=L(),[i,o]=z(),a=X(),{canEnableInvoicing:c,isEnablingInvoicing:d,isInvoicingEnabled:l,isQboConfigured:v,isStripeConnected:u}=E(Kt),g=i.get("tab");return r.useEffect((()=>{if(g==null)return;const f=ns[g];o({},{replace:!0}),f!=null&&t(f,{replace:!0})}),[g,t,o]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:a.isInvoicingPageReady}),s.jsx(Wn,{analytics:p,integrationsSectionProps:{...a.integrationsSectionProps,onConfigureQBO:()=>t("quickbooks"),onOpenPaymentDestination:()=>t("payment-destination")},isEnablingInvoicing:d,isLoading:a.isLoading,meetingUrl:n("invoicing_settings"),settings:a.settings,onBrandingClick:()=>t("branding"),onDunningClick:()=>t("dunning"),canEnableInvoicing:c,isQboConfigured:v,isStripePaymentsReady:u,onEnableInvoicingClick:l?void 0:()=>{e(Fo())}})]})}function pt(){return s.jsxs(ie,{children:[s.jsx(y,{index:!0,element:s.jsx(is,{})}),s.jsx(y,{path:"payment-destination",element:s.jsx(Xa,{})}),s.jsx(y,{path:"branding",element:s.jsx(vt,{})}),s.jsx(y,{path:"branding/:addressType",element:s.jsx(vt,{appContent:s.jsx(Y,{isSubPage:!0,hideAddressBackButton:!0})})}),s.jsx(y,{path:"integrations",element:s.jsx(Ja,{})}),s.jsx(y,{path:"dunning",element:s.jsx(Wa,{})}),s.jsx(y,{path:"quickbooks",element:s.jsx(ts,{})}),s.jsx(y,{path:"*",element:s.jsx(B,{to:"..",replace:!0})})]})}function $s(){const n=P(),e=L(),{tenantEmailDomain:t}=w(),{areTenantIdsInSync:i}=F(),{enableState:o,fetchState:a,status:c}=E(Nt),d=St(o.fetchState),l=`/${t}/invoicing`,v=r.useRef(!1),u=E((g=>Le(g).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(a!=="Not-Started"?a!=="Error"||v.current||(v.current=!0,n(le({cacheOverride:!1}))):n(le({cacheOverride:!1})))}),[i,n,a]),r.useEffect((()=>{i&&u==="Not-Started"&&n(Et())}),[i,n,u]),r.useEffect((()=>{d==="In-Progress"&&o.fetchState==="Completed"&&(e(`${l}/catalog`),n(Ro()))}),[d,o.fetchState,l,n,e]),c==null&&a!=="Error"?s.jsx(Jn,{}):c==="not_started"?s.jsxs(ie,{children:[s.jsx(y,{path:"promo",element:s.jsx(dt,{})}),s.jsx(y,{path:"*",element:s.jsx(B,{to:`${l}/promo`,replace:!0})})]}):c==="settings"?s.jsxs(ie,{children:[s.jsx(y,{path:"promo",element:s.jsx(dt,{})}),s.jsx(y,{path:"settings/*",element:s.jsx(pt,{})}),s.jsx(y,{path:"*",element:s.jsx(B,{to:`${l}/settings`,replace:!0})})]}):s.jsxs(ie,{children:[s.jsx(y,{path:"/",element:s.jsx(B,{to:"overview",replace:!0})}),s.jsx(y,{path:"overview",element:s.jsx(Aa,{})}),s.jsx(y,{path:"promo",element:s.jsx(B,{to:`${l}/overview`,replace:!0})}),s.jsx(y,{path:"customers",element:s.jsx(ra,{})}),s.jsx(y,{path:"customers/new",element:s.jsx(sa,{})}),s.jsx(y,{path:"customers/new/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"customers/:customer_id",element:s.jsx(oa,{})}),s.jsx(y,{path:"customers/:customer_id/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"subscriptions",element:s.jsx(Ka,{})}),s.jsx(y,{path:"subscriptions/new",element:s.jsx(qa,{})}),s.jsx(y,{path:"subscriptions/new/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"subscriptions/:subscription_id",element:s.jsx(Ma,{})}),s.jsx(y,{path:"subscriptions/:subscription_id/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"invoices",element:s.jsx(ja,{})}),s.jsx(y,{path:"invoices/create",element:s.jsx(Jo,{})}),s.jsx(y,{path:"invoices/:invoice_id",element:s.jsx(xa,{})}),s.jsx(y,{path:"invoices/:invoice_id/record-payment",element:s.jsx(gt,{})}),s.jsx(y,{path:"invoices/:invoice_id/issue-credit-note",element:s.jsx(Pa,{})}),s.jsx(y,{path:"payments",element:s.jsx(wa,{})}),s.jsx(y,{path:"payments/record",element:s.jsx(gt,{})}),s.jsx(y,{path:"payments/:transaction_id",element:s.jsx(Ga,{})}),s.jsx(y,{path:"credits",element:s.jsx(na,{})}),s.jsx(y,{path:"credits/:credit_note_id",element:s.jsx(ea,{})}),s.jsx(y,{path:"discounts",element:s.jsx(ha,{})}),s.jsx(y,{path:"discounts/new",element:s.jsx(zo,{})}),s.jsx(y,{path:"discounts/:coupon_id",element:s.jsx(fa,{})}),s.jsx(y,{path:"dunning",element:s.jsx(ka,{})}),s.jsx(y,{path:"dunning/:case_id",element:s.jsx(Ia,{})}),s.jsx(y,{path:"catalog",element:s.jsx(Qo,{})}),s.jsx(y,{path:"catalog/new",element:s.jsx(qo,{})}),s.jsx(y,{path:"catalog/:item_id",element:s.jsx(Bo,{})}),s.jsx(y,{path:"settings/*",element:s.jsx(pt,{})}),s.jsx(y,{path:"audit_log",element:s.jsx(Oo,{})}),s.jsx(y,{path:"data_import",element:s.jsx(ga,{})}),s.jsx(y,{path:"data_import/migrate",element:s.jsx(va,{})}),s.jsx(y,{path:"data_import/:sessionId",element:s.jsx(da,{})}),s.jsx(y,{path:"*",element:s.jsx(N,{})})]})}export{$s as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-D83XGo_c.js";import{h as r,l as i}from"./core-CGqhbBHO.js";import{ak as n}from"./index-CoKBrrSw.js";import"./mui-CD71lp6N.js";import"./sentry-BPfEBx2C.js";import"./zeni-epic-state-DASyz1An.js";import"./recharts-2kmMgB1t.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.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]="e1fe4b0b-a509-4443-892f-577d1dfd5036",o._sentryDebugIdIdentifier="sentry-dbid-e1fe4b0b-a509-4443-892f-577d1dfd5036")}catch{}})();const a=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-D83XGo_c.js";import i from"./NotFoundScreen-RGfzDsux.js";import{T as r}from"./TransactionDetailScreen-B38w1Q4M.js";import"./sentry-BPfEBx2C.js";import{n as a,o}from"./core-CGqhbBHO.js";import"./zeni-epic-state-DASyz1An.js";import"./recharts-2kmMgB1t.js";import"./index-CoKBrrSw.js";import"./mui-CD71lp6N.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.js";import"./useAskAiCfoHostNavButtonProps-C4V1Wf7u.js";import"./decodeURIComponentSafe-6FvQaIqS.js";import"./useInitialThreadRequest-CP8MsLNf.js";import"./routePaths-DU2fgaW2.js";import"./expenseAutomationHelper-wwug0Eyp.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]="9520d72a-46e5-44e2-9697-a97671635162",e._sentryDebugIdIdentifier="sentry-dbid-9520d72a-46e5-44e2-9697-a97671635162")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};