@zeniai/web-app-ui 5.4.18-dev → 5.4.19-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 (167) hide show
  1. package/dist/assets/{AccountMappingScreen-4Zeu95kU.js → AccountMappingScreen-BpJDQCQx.js} +2 -2
  2. package/dist/assets/ActualMatchingMatchDetailScreen-fK8c-oot.js +1 -0
  3. package/dist/assets/AddressRoutes-_bCuEkwx.js +1 -0
  4. package/dist/assets/AddressScreen-Dh4KOVQ1.js +9 -0
  5. package/dist/assets/AiCfoScreen-03lSUwaj.js +22 -0
  6. package/dist/assets/AppDrawer-DtBNEFvY.js +10 -0
  7. package/dist/assets/{BillPayApprovalRoutes-B4dh4WxY.js → BillPayApprovalRoutes-D1JvUYMQ.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-DZx-x_-P.js → BillPayRoutes-DosvZj42.js} +18 -18
  9. package/dist/assets/BusinessVerificationPageScreen-CeIfGxLQ.js +9 -0
  10. package/dist/assets/CardsAiCfoScreen-C8_v-BYR.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-Db9V9An_.js → ChargeCardRoutes-BZz4pRiz.js} +10 -10
  12. package/dist/assets/{CompanyPassportScreen-Db20J8Yl.js → CompanyPassportScreen-BieP2EZa.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-C1MNasE2.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-DYKZjGKN.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-De4sHn4O.js → CustomerOnboardingRoutes-DyVqaxvR.js} +3 -3
  16. package/dist/assets/CustomersRoutes-CtL2o5-n.js +8 -0
  17. package/dist/assets/DashboardRoutes-7yhAEy7g.js +20 -0
  18. package/dist/assets/{DefaultTenantHome-BN__AQ5l.js → DefaultTenantHome-DHs0Czed.js} +1 -1
  19. package/dist/assets/DomesticWireDetailScreen-BIF8BW0a.js +18 -0
  20. package/dist/assets/{DrawerScreen-DUhkZI2Z.js → DrawerScreen-XY9r5sqx.js} +1 -1
  21. package/dist/assets/EntityDetailRoutes-CLCMxp18.js +1 -0
  22. package/dist/assets/{ExpenseAutomationRoutes-DcjeaHHd.js → ExpenseAutomationRoutes-CA-VSGA_.js} +6 -6
  23. package/dist/assets/{FallBackRoute-orqRsHMl.js → FallBackRoute-BmlOw1z3.js} +2 -2
  24. package/dist/assets/FeaturePreviewScreen-C2u4cMYG.js +1 -0
  25. package/dist/assets/HubSpotOAuthCallbackScreen-CdL4B6fj.js +1 -0
  26. package/dist/assets/InboxNotificationsProvider-DvvXiK-n.js +1 -0
  27. package/dist/assets/InvoicingRoutes-Ds8bd8V8.js +3 -0
  28. package/dist/assets/MagicLinkRoutes-BCx3YLpp.js +72 -0
  29. package/dist/assets/MagicLinkSignInScreen-BJFFKbta.js +12 -0
  30. package/dist/assets/MobileAppDrawer-BLYS912H.js +1 -0
  31. package/dist/assets/NotFoundScreen-BDU6ccX1.js +1 -0
  32. package/dist/assets/NotificationRoutes-B3DfKahf.js +1 -0
  33. package/dist/assets/OAuthConsentScreen-DMS9CTOV.js +1 -0
  34. package/dist/assets/PandLWithForecastRoutes-D4c4br1B.js +1 -0
  35. package/dist/assets/PaymentLinkScreen-BEA834bi.js +21 -0
  36. package/dist/assets/PeopleRoutes-By8BlbIz.js +22 -0
  37. package/dist/assets/PerformanceRoutes-CQ6Hxkqk.js +1 -0
  38. package/dist/assets/{Preview-Db0nRlxD.js → Preview-lAFQaJcB.js} +1 -1
  39. package/dist/assets/{QBOConnectionScreen-BEn_CddB.js → QBOConnectionScreen-DyZaNX6V.js} +1 -1
  40. package/dist/assets/ReimbursementApprovalRoutes-CPfPh7_I.js +1 -0
  41. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DrgxKZH7.js +1 -0
  42. package/dist/assets/ReimbursementRoutes-Bq5czlC0.js +68 -0
  43. package/dist/assets/ReportsRoutes-DxNr6i5Y.js +1 -0
  44. package/dist/assets/RewardsRoutes-CO6TuNiV.js +1 -0
  45. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-BxMaq7Gq.js +33 -0
  46. package/dist/assets/ScreenRoutes-LEc4L-Ek.js +2 -0
  47. package/dist/assets/{SettingsRoutes-CCWla9X1.js → SettingsRoutes-Cc8RIjZt.js} +6 -6
  48. package/dist/assets/{SetupPagesScreen-C5PRNruc.js → SetupPagesScreen-BgAn4bD3.js} +5 -5
  49. package/dist/assets/SignInScreen-Di05f1i8.js +1 -0
  50. package/dist/assets/SignOutScreen-CiQsSj2I.js +9 -0
  51. package/dist/assets/{TaskListScreen-C7smUYFP.js → TaskListScreen-CBFYc4EW.js} +2 -2
  52. package/dist/assets/TaskRoutes-w6Z4j7Vq.js +9 -0
  53. package/dist/assets/TransactionDetailRoutes-ggKexh3-.js +1 -0
  54. package/dist/assets/{TransactionDetailScreen-CHzsnTr9.js → TransactionDetailScreen-BBWVy8TW.js} +2 -2
  55. package/dist/assets/{TransactionListRoutes-ChJOrV96.js → TransactionListRoutes-B7kikvJW.js} +1 -1
  56. package/dist/assets/TreasuryRoutes-DnYXMIpO.js +37 -0
  57. package/dist/assets/{VendorsRoutes-CVu8jS5h.js → VendorsRoutes-BtVR0Vii.js} +18 -18
  58. package/dist/assets/WiseConfirmationScreen-8Hcaa3Fc.js +12 -0
  59. package/dist/assets/{ZeniAccountRoutes-D3ONSR9y.js → ZeniAccountRoutes-VM-T0h6_.js} +10 -10
  60. package/dist/assets/ZeniAccountStatementScreen-CM9U5Zls.js +9 -0
  61. package/dist/assets/{accountMappingHelper-CHQgwqfy.js → accountMappingHelper-8C9JQylV.js} +1 -1
  62. package/dist/assets/{analytics-D051O7ML.js → analytics-u8j262Ga.js} +1 -1
  63. package/dist/assets/{analyticsHelper-DkNc3mKz.js → analyticsHelper-CKG9W7dC.js} +1 -1
  64. package/dist/assets/{core-BBlQ3ArL.js → core-BVdj_noT.js} +1 -1
  65. package/dist/assets/{decodeURIComponentSafe-YbpxzvKa.js → decodeURIComponentSafe-JMSvQveN.js} +1 -1
  66. package/dist/assets/{dnd-CU3yeazS.js → dnd-Ex3ltzzE.js} +1 -1
  67. package/dist/assets/{empty-BiAWzWBi.js → empty-C5tm1JkN.js} +1 -1
  68. package/dist/assets/{index-fVadamkP.js → empty-C97tUCQZ.js} +1 -1
  69. package/dist/assets/{emptyVideoElement-CRPwTqUS.js → emptyVideoElement-Hn3yI6W2.js} +1 -1
  70. package/dist/assets/epic-BPbLNJeP.js +2 -0
  71. package/dist/assets/expenseAutomationHelper-BtpowfoM.js +1 -0
  72. package/dist/assets/{getLocaleForTenant-DTPcYF0O.js → getLocaleForTenant-CI9ZVduS.js} +1 -1
  73. package/dist/assets/{index-MRZKoeCT.js → index-B1EE-QC-.js} +2 -2
  74. package/dist/assets/index-BtE2ozWs.js +1 -0
  75. package/dist/assets/{index-s4pcd-16.js → index-CCd99LPb.js} +1 -1
  76. package/dist/assets/{index--CQENyaz.js → index-Ch4hjMoy.js} +1 -1
  77. package/dist/assets/{index-ClwW47Zs.js → index-Dme9CBSK.js} +15750 -15711
  78. package/dist/assets/{empty-B3C-udVF.js → index-OsAw6lBi.js} +1 -1
  79. package/dist/assets/{index-jomr_c-N.js → index-TJhTBaFX.js} +1 -1
  80. package/dist/assets/{index-CaztP9tz.js → index-UCW7ypYi.js} +1 -1
  81. package/dist/assets/{lexical-DVH-xgq1.js → lexical-CVwGZsIc.js} +1 -1
  82. package/dist/assets/{liveblocks-CuUK5O_2.js → liveblocks-XOqCw7q2.js} +1 -1
  83. package/dist/assets/{lottie-Du4lbH8J.js → lottie-C5YZIzuj.js} +1 -1
  84. package/dist/assets/{mui--aGBnNu2.js → mui-BZ0jnpww.js} +1 -1
  85. package/dist/assets/{pathToGoBack-DOePc_e5.js → pathToGoBack-BYz7DD9r.js} +1 -1
  86. package/dist/assets/{pdf-lib-Cvsvldn7.js → pdf-lib-BIDHf6ZS.js} +1 -1
  87. package/dist/assets/{pdf-CrvsvvW3.js → pdf-q1-3GLH6.js} +3 -3
  88. package/dist/assets/{plaid-7P9b69CP.js → plaid-CCMRXiQR.js} +1 -1
  89. package/dist/assets/{pusher-DdvpIMG0.js → pusher-DF-wuBh7.js} +1 -1
  90. package/dist/assets/{react-CjVSd3S9.js → react-BzblgiCG.js} +1 -1
  91. package/dist/assets/{react-B8GJK4jq.js → react-CGkIeSIu.js} +1 -1
  92. package/dist/assets/{react-D-JjM7p6.js → react-Cjn3drUx.js} +1 -1
  93. package/dist/assets/{react-CUlf2ISA.js → react-Czniha8W.js} +1 -1
  94. package/dist/assets/{react-Bz6aBujY.js → react-D35bcyMl.js} +1 -1
  95. package/dist/assets/{react-DoYRVAKa.js → react-znTjPsiU.js} +1 -1
  96. package/dist/assets/{recharts-CkREU3LH.js → recharts-VHHravhf.js} +1 -1
  97. package/dist/assets/{reportTimeframe-ChAOzqo_.js → reportTimeframe-BTqRG1HM.js} +1 -1
  98. package/dist/assets/routePaths-TIOEKAr9.js +1 -0
  99. package/dist/assets/{sentry-D0lP5-8e.js → sentry-CNIAdl-1.js} +1 -1
  100. package/dist/assets/stripSplatSuffix-CLHAbjpi.js +1 -0
  101. package/dist/assets/{url-GwD82u5j.js → url-CyyPACTT.js} +1 -1
  102. package/dist/assets/{url-nN4BnP9N.js → url-uObfQ0XR.js} +1 -1
  103. package/dist/assets/useActualMatchingMatchDetail-ClGwke9Y.js +1 -0
  104. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-usJW6KKQ.js → useAiCfoDashboardSuggestedQuestionsChips-CF91keX4.js} +1 -1
  105. package/dist/assets/useAskAiCfoHostNavButtonProps-DO-bnRp-.js +1 -0
  106. package/dist/assets/{useChargeCardPusherEvents-DPfHk-vM.js → useChargeCardPusherEvents-DTd9bnXH.js} +1 -1
  107. package/dist/assets/{useDeviceId-pp3Grc-z.js → useDeviceId-CF-WgrL6.js} +1 -1
  108. package/dist/assets/useEmailConnectResultRefresh-BJWnx3gQ.js +1 -0
  109. package/dist/assets/useEnsureVendorListLoaded-U686iOkV.js +1 -0
  110. package/dist/assets/{useInitialThreadRequest-DmfmyzKI.js → useInitialThreadRequest-DCdvOJx6.js} +1 -1
  111. package/dist/assets/useIsCustomersTabEnabled-DZ7jecHx.js +1 -0
  112. package/dist/assets/{useTaskManagerAccess-DrmpkeUw.js → useTaskManagerAccess-Z6bIfXqO.js} +1 -1
  113. package/dist/assets/{useTaskManagerPusherEvents-CHhZ2DRZ.js → useTaskManagerPusherEvents-Doj7t2BI.js} +1 -1
  114. package/dist/assets/{utils-Ctp9Zfhk.js → utils-BtSqr9lx.js} +1 -1
  115. package/dist/assets/{withTransactionSidePanel-CKC1_4cy.js → withTransactionSidePanel-DybBA6JZ.js} +2 -2
  116. package/dist/assets/{zeni-epic-state-aUBx6G2Q.js → zeni-epic-state-BSu6fdxh.js} +7 -7
  117. package/dist/index.html +1 -1
  118. package/package.json +3 -3
  119. package/dist/assets/ActualMatchingMatchDetailScreen-B6pl-MVl.js +0 -1
  120. package/dist/assets/AddressRoutes-zjWkB0xf.js +0 -1
  121. package/dist/assets/AddressScreen-Czlolp2X.js +0 -9
  122. package/dist/assets/AiCfoScreen-BhfmD__h.js +0 -22
  123. package/dist/assets/AppDrawer-B7GEeTxi.js +0 -10
  124. package/dist/assets/BusinessVerificationPageScreen-je1np7-9.js +0 -9
  125. package/dist/assets/CardsAiCfoScreen-abedaxWu.js +0 -14
  126. package/dist/assets/ConnectionAuthScreen-BmJpUHtJ.js +0 -11
  127. package/dist/assets/CustomerOnboardingAuthScreen-Deo-LVYJ.js +0 -1
  128. package/dist/assets/DashboardRoutes-CCGs4e1_.js +0 -20
  129. package/dist/assets/DomesticWireDetailScreen-6W-Er5_q.js +0 -18
  130. package/dist/assets/EntityDetailRoutes-BrJAd36h.js +0 -1
  131. package/dist/assets/FeaturePreviewScreen-Dcu53_tf.js +0 -1
  132. package/dist/assets/HubSpotOAuthCallbackScreen-ClZsPGpZ.js +0 -1
  133. package/dist/assets/InboxNotificationsProvider-DiTDJFwP.js +0 -1
  134. package/dist/assets/InvoicingRoutes-BTvzZ8JV.js +0 -3
  135. package/dist/assets/MagicLinkRoutes-V1DxaNiW.js +0 -72
  136. package/dist/assets/MagicLinkSignInScreen-DnCx8Y6G.js +0 -12
  137. package/dist/assets/MobileAppDrawer-Bql3K6nh.js +0 -1
  138. package/dist/assets/NotFoundScreen-CTik05r2.js +0 -1
  139. package/dist/assets/NotificationRoutes-wSm6mA8N.js +0 -1
  140. package/dist/assets/OAuthConsentScreen-BELrcqAy.js +0 -1
  141. package/dist/assets/PandLWithForecastRoutes-Dpao8SIb.js +0 -1
  142. package/dist/assets/PaymentLinkScreen-vbM_NtP3.js +0 -21
  143. package/dist/assets/PeopleRoutes-CJeBX2Ca.js +0 -22
  144. package/dist/assets/PerformanceRoutes-W4NxEUmH.js +0 -1
  145. package/dist/assets/ReimbursementApprovalRoutes-CSZJghRB.js +0 -1
  146. package/dist/assets/ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js +0 -1
  147. package/dist/assets/ReimbursementRoutes-BUZKWvJ7.js +0 -68
  148. package/dist/assets/ReportsRoutes-BUZ4r7hx.js +0 -1
  149. package/dist/assets/RewardsRoutes-DuYZ4TXP.js +0 -1
  150. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DN2DZsFw.js +0 -33
  151. package/dist/assets/ScreenRoutes-CxP9HSCe.js +0 -2
  152. package/dist/assets/SignInScreen-BScZ138a.js +0 -1
  153. package/dist/assets/SignOutScreen-Bk-Y8Sbv.js +0 -9
  154. package/dist/assets/TaskRoutes-DPcu4NRR.js +0 -9
  155. package/dist/assets/TransactionDetailRoutes-yEwix446.js +0 -1
  156. package/dist/assets/TreasuryRoutes-C24SAGLB.js +0 -37
  157. package/dist/assets/WiseConfirmationScreen-Dt6hB5m-.js +0 -12
  158. package/dist/assets/ZeniAccountStatementScreen-CmfHt6Wr.js +0 -9
  159. package/dist/assets/epic-DwBfFPJQ.js +0 -2
  160. package/dist/assets/expenseAutomationHelper-SA0jUIyg.js +0 -1
  161. package/dist/assets/index-ae04Qn4V.js +0 -1
  162. package/dist/assets/routePaths-D0jOibXk.js +0 -1
  163. package/dist/assets/stripSplatSuffix-CFosfir7.js +0 -1
  164. package/dist/assets/useActualMatchingMatchDetail-nJ3hpXEY.js +0 -1
  165. package/dist/assets/useAskAiCfoHostNavButtonProps-CWWQxV2L.js +0 -1
  166. package/dist/assets/useEmailConnectResultRefresh-B6j7j1rG.js +0 -1
  167. package/dist/assets/useEnsureVendorListLoaded-COBYTL2U.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-CuUK5O_2.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-D0lP5-8e.js";import{L as ge,d$ as xc,fI as kc,UP as Tc,a1h as jl,c7 as xl}from"./zeni-epic-state-aUBx6G2Q.js";import{a as pe,b as kl,d as Tl,e as Al,f as un,g as Rl,h as Pl,i as Il,j as Ve,k as Ac,l as ot,m as xt,o as Ll,p as ct,q as Nl}from"./utils-Ctp9Zfhk.js";import{r as cn}from"./empty-BiAWzWBi.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-Cvsvldn7.js";import{r as Ye,a as Fl}from"./index--CQENyaz.js";import{r as Ul}from"./index-ae04Qn4V.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-BBlQ3ArL.js";import{d4 as Zl,_ as Hl,u as Vl,z as Rc,b as Yl,d5 as Wl,O as Kl}from"./index-ClwW47Zs.js";import"./mui--aGBnNu2.js";import{d as It}from"./decodeURIComponentSafe-YbpxzvKa.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="702b8bc2-8e60-4ecd-9146-c2a2cec2dea0",e._sentryDebugIdIdentifier="sentry-dbid-702b8bc2-8e60-4ecd-9146-c2a2cec2dea0")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
1
+ import{j as _l}from"./liveblocks-XOqCw7q2.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-CNIAdl-1.js";import{L as ge,e0 as xc,fJ as kc,U_ as Tc,a1t as jl,c8 as xl}from"./zeni-epic-state-BSu6fdxh.js";import{a as pe,b as kl,d as Tl,e as Al,f as un,g as Rl,h as Pl,i as Il,j as Ve,k as Ac,l as ot,m as xt,o as Ll,p as ct,q as Nl}from"./utils-BtSqr9lx.js";import{r as cn}from"./empty-C5tm1JkN.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-BIDHf6ZS.js";import{r as Ye,a as Fl}from"./index-Ch4hjMoy.js";import{r as Ul}from"./index-BtE2ozWs.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-BVdj_noT.js";import{d4 as Zl,W as Hl,u as Vl,z as Rc,L as Yl,d5 as Wl,J as Kl}from"./index-Dme9CBSK.js";import"./mui-BZ0jnpww.js";import{d as It}from"./decodeURIComponentSafe-JMSvQveN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c7fcf9fc-a0ae-4a7b-9e73-105a4fc68ab4",e._sentryDebugIdIdentifier="sentry-dbid-c7fcf9fc-a0ae-4a7b-9e73-105a4fc68ab4")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
2
2
  `),I=S(E).split(`
3
3
  `),k=0,C="";if(O==="strictEqual"&&l(j)==="object"&&l(E)==="object"&&j!==null&&E!==null&&(O="strictEqualObject"),R.length===1&&I.length===1&&R[0]!==I[0]){var H=R[0].length+I[0].length;if(H<=10){if(!(l(j)==="object"&&j!==null||l(E)==="object"&&E!==null||j===0&&E===0))return"".concat(_[O],`
4
4
 
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-XOqCw7q2.js";import z from"./NotFoundScreen-BDU6ccX1.js";import{a as p}from"./sentry-CNIAdl-1.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as X,o as g}from"./core-BVdj_noT.js";import{fJ as x,Yi as w,XW as h,Ox as U,Ot as B,Ow as f,Om as L,XY as N,Oq as Y,Oz as q}from"./zeni-epic-state-BSu6fdxh.js";import{z as T,w as $,bl as J,B as W,b0 as K,bm as F}from"./index-Dme9CBSK.js";import"./mui-BZ0jnpww.js";import{u as G}from"./useEnsureVendorListLoaded-U686iOkV.js";import{R as E}from"./ReimbursementApprovalRuleDetailScreen-DrgxKZH7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b889dbd4-154c-46fe-932a-900bbd4bad34",e._sentryDebugIdIdentifier="sentry-dbid-b889dbd4-154c-46fe-932a-900bbd4bad34")}catch{}})();const j="reimbursement-approval-rule-update",H=O((function(e){return{approvalView:w(e),remiSetupApproverViewUpdateData:h(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(N(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))($(J)),M=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),b=u((o=>o.remiSetupApproverViewState.fetchState)),d=u((o=>x(o))),c=u((o=>w(o))),S=u((o=>h(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&a(U())}),[S]),p.useEffect((()=>{t||b!=="Not-Started"||e||(l(!0),a(B(!0,!1,!1,!1)))}),[t,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,c,a]);const m={events:d.companyId!=null?[`private-encrypted-${d.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return d?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(H,{currentTenant:d,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=O((function(e){const s=w(e),n=h(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(N(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(q(t,!0))}}}))($(F)),Q=()=>{const e=u((a=>x(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=K(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(M,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[b,d]=p.useState(!1),c=u((i=>i.remiSetupApproverViewState.fetchState)),S=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>x(i))),o=u((i=>w(i)));G();const y=u((i=>h(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||c!=="Not-Started"||e||(l(!0),a(B(!0,!1,!1,!0)))}),[t,c,e,a]),p.useEffect((()=>{v||S!=="Not-Started"||e||(R(!0),a(Y(!1,!0)))}),[v,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(b||(d(!0),a(f())),s("./new"))}),[b,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(A)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return r.jsxs(X,{children:[r.jsx(g,{path:"/",element:r.jsx(Q,{})}),r.jsx(g,{path:"/new",element:r.jsx(E,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(E,{})}),r.jsx(g,{path:"*",element:r.jsx(z,{})})]})}export{ue as R};
@@ -0,0 +1 @@
1
+ import{j as g}from"./liveblocks-XOqCw7q2.js";import{a as y}from"./sentry-CNIAdl-1.js";import{h as T,u as C,g as _,i as V,j as S,l as k}from"./core-BVdj_noT.js";import{XW as E,Yi as U,Op as j,OC as B,Ox as A,Oy as w,YR as F,fJ as Y,Ow as z}from"./zeni-epic-state-BSu6fdxh.js";import{z as N,a8 as P,bn as J,B as $,b0 as K,bo as L}from"./index-Dme9CBSK.js";import{u as q}from"./mui-BZ0jnpww.js";import{u as X}from"./useEnsureVendorListLoaded-U686iOkV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="fd37a3ec-62c8-46cb-bf85-234566b12c5d",e._sentryDebugIdIdentifier="sentry-dbid-fd37a3ec-62c8-46cb-bf85-234566b12c5d")}catch{}})();const G=k((function(e,p){const t=E(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=$(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const b=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const f=(R=m.value,F(R)==null);var R;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=b.concat(I);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(J);function H(){const e=T(),p=C(),t=_(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=q(),r=S((n=>E(n))),l=S((n=>U(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(G,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const M=k((function(e,p){const t=E(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=$(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const R=f.actorKind?.selectedOption,W=f.selectedRole?.selectedNonUsers??[];let D=[];R==="role"?D=W.map((O=>({type:"attribute",subType:O.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):R==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((O=>({type:"user",subType:void 0,userId:O.userId,idType:"user",isImplicitActor:!1}))));const x=f.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const b=v?.selection.selectedOptions??[];b.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:b});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(L);function ne(){const e=S((t=>Y(t))),{isApprovalRulesV3Enabled:p}=K(e?.tenantId);return p?g.jsx(Q,{}):g.jsx(H,{})}function Q(){const e=T(),p=C(),t=_(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=q(),r=S((n=>E(n))),l=S((n=>U(n))),[a,d]=y.useState(!1);if(X(),y.useEffect((()=>{a||(d(!0),p(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-XOqCw7q2.js";import{u as ae,j as v,h as Q,g as J,i as ie,N,l as ee,q as lt,n as mt,o as E}from"./core-BVdj_noT.js";import{fJ as Z,Ot as ct,Xx as ge,c8 as he,Nz as Fe,mm as dt,NO as ce,NN as de,Xy as ut,bm as fe,g_ as Le,Xz as pt,VS as bt,mb as $e,VU as ke,VT as gt,kZ as ht,Xo as ft,lc as St,Nn as It,CT as yt,l4 as Rt,O8 as Ne,XA as Pe,XB as Ce,XC as At,XD as vt,XE as kt,NU as we,li as Ct,XF as wt,NM as xt,Nx as Et,XG as Bt,Nw as Tt,XH as Dt,NE as xe,NY as jt,NX as Ut,NT as Ft,XI as Me,Tj as Lt,bn as $t,NH as Nt,Oq as Pt,XJ as Mt,XK as Ot,O4 as _t,O1 as Ee,WU as Xt,Nu as zt,XL as Oe,OT as Be,O$ as Gt,XM as Vt,XN as Y,XO as Zt,XP as _e,XQ as Ht,XR as Xe,XS as ze,Og as ue,d1 as Wt,bL as Se,cF as Ie,er as Ge,eq as Ve,XT as Yt,gl as qt,X5 as Jt,XU as Kt,XV as Ze,X9 as Qt,XW as en,XX as tn,XY as nn,OY as Te,OX as an,XZ as sn,X_ as on,X$ as rn,Y0 as ln,Y1 as mn,Y2 as cn,OO as dn,OS as un,bp as pn,bK as bn,cz as gn,cm as hn,bs as fn,hb as Sn,ec as In,ef as yn,ee as Rn,cy as An}from"./zeni-epic-state-BSu6fdxh.js";import{b0 as vn,j as He,a2 as We,p as oe,_ as F,z as L,b1 as Ye,a9 as re,c as x,aM as De,N as j,af as se,ag as kn,G as qe,b2 as Cn,s as q,al as Je,b3 as wn,V as le,b4 as xn,aC as En,ac as Bn,a8 as ye,R as Ke,w as Tn,aP as Dn,aj as jn,az as Un,b5 as Fn,i as Ln}from"./index-Dme9CBSK.js";import{n as P,S as $n,u as Qe}from"./mui-BZ0jnpww.js";import pe from"./NotFoundScreen-BDU6ccX1.js";import{S as je}from"./SetupPagesScreen-BgAn4bD3.js";import{F as et}from"./FeaturePreviewScreen-C2u4cMYG.js";import{a as g}from"./sentry-CNIAdl-1.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-DO-bnRp-.js";import{u as tt}from"./useInitialThreadRequest-DCdvOJx6.js";import{D as Nn}from"./DrawerScreen-XY9r5sqx.js";import{M as nt}from"./MobileAppDrawer-BLYS912H.js";import{F as Pn}from"./FallBackRoute-BmlOw1z3.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CPfPh7_I.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.js";import"./BusinessVerificationPageScreen-CeIfGxLQ.js";import"./routePaths-TIOEKAr9.js";import"./analyticsHelper-CKG9W7dC.js";import"./InboxNotificationsProvider-DvvXiK-n.js";import"./useTaskManagerAccess-Z6bIfXqO.js";import"./useIsCustomersTabEnabled-DZ7jecHx.js";import"./useEnsureVendorListLoaded-U686iOkV.js";import"./ReimbursementApprovalRuleDetailScreen-DrgxKZH7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="70dc3856-5846-41a2-943f-6dcf8d0ef44c",e._sentryDebugIdIdentifier="sentry-dbid-70dc3856-5846-41a2-943f-6dcf8d0ef44c")}catch{}})();const at=e=>`/${e}/reimbursements`,On=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:W,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=qe.getLocalizedStrings(),_n=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),m=L.getSignedInUser(),c=fe(m),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,m?.userId??"");let I=`${m?.firstName} ${m?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=m?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:x,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(xe(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(xe(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(Et({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(xt({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(vt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(At({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=q(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(x.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),m=He(),c=We(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(F.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(F.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"}),B=J().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,R]=g.useState(!1),S=L.getSignedInUser(),w=v((b=>Z(b))),h=v((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),U=he(w?.userRole??[]);(function(){const b=ae(),O=v((K=>Z(K))),_=O?.tenantId,{isApprovalRulesV3Enabled:X,isLoading:H}=vn(_),z=v((K=>K.remiSetupApproverViewState.fetchState));g.useEffect((()=>{_==null||H||z==="Not-Started"&&b(ct(!0,!1,!1,X))}),[_,H,X,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(R(!0),t(Fe(!1,I,u,r)))}));const A=v((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const M={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||U&&h.billStatus==="rejected"||U===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:M}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Xn,{windowSize:c,children:[s.jsx(re,{analytics:x,onLoad:b=>(O=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&O.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:W.upload,single:ne.dropReceipt.single,or:W.texts.or,multiple:ne.dropReceipt.multiple,receipts:W.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Zn,{onClick:()=>a(!1),children:s.jsx(On,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:W.upload,single:ne.dropReceipt.single,or:W.texts.or,multiple:ne.dropReceipt.multiple,receipts:W.texts.receipts2}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(_n,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Ye,{isNewReimbursement:r==null})}const Xn=P.div`
2
+ display: flex;
3
+ position: relative;
4
+ height: 100vh;
5
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,zn=P.div`
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ background-color: ${kn.overlayBackgroundBlack};
14
+ z-index: 5;
15
+ `,Gn=P.div`
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 42%;
20
+ height: 100%;
21
+ z-index: 6;
22
+ display: flex;
23
+ background-color: transparent;
24
+ overflow: hidden;
25
+ `,Vn=P.div`
26
+ position: fixed;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ z-index: 11;
32
+ display: flex;
33
+ flex-direction: column;
34
+ overflow-y: auto;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ `,Zn=P.button`
37
+ align-self: flex-end;
38
+ background: none;
39
+ border: none;
40
+ cursor: pointer;
41
+ padding: ${j.sp2} ${j.sp3};
42
+ line-height: 1;
43
+ color: ${e=>e.theme.colors.hero};
44
+ &:hover {
45
+ color: ${e=>e.theme.colors.primary};
46
+ }
47
+ svg {
48
+ width: ${j.sp4};
49
+ height: ${j.sp4};
50
+ }
51
+ `,Hn=P.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,Wn=ee((function(e,t){const n=Me(e,t.reimbursementId),r=L.getSignedInUser(),m=fe(r),c=e.tenantState.currentTenantId,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},i=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Mt(n.remiActivities,Ot(t.currentTenant),r));const o=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:d,signedInUser:r,createdBy:i,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:o,showApproveRejectBtns:a,isZeniUser:m,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r;return{onDuplicateLineClick:(a,o)=>window.open(`/${i}/reimbursement/${a}#L${o}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=at(i),o=q(m.state?.pathnameStackToGoBack,m.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onSaveRealTimeApprovals:a=>{e(zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Xt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ee(n,a.type,"")):e(Ee(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=q(m.state?.pathnameStackToGoBack,m.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{x.trackReimbursementDeleteReimbursement(n),e(Ne(n))},cancelAndDeleteReport:a=>{a===!0?x.trackReimbursementCancelAndDeleteReimbursement(n):x.trackReimbursementCancelReimbursement(n),e(_t(n,a))},handleZeniLogoClick:()=>{d.toggle()}}}))(wn);function Yn(){const e=Q(),t=ae(),n=J(),r=n.hash.substring(1),m=He(),{reimbursementId:c}=ie(),d=L.getSignedInUser(),i=v((A=>Z(A))),a=v((A=>Me(A,c??""))),o=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(i?.companyId,{clearParams:a.fetchState==="Completed"&&!o}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:I}=Re({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=oe(),{isFeatureEnabled:T}=u(F.isLimitedCategoryForReimbursement),[y,B]=g.useState(!1),[D,k]=g.useState(!1),[C,R]=g.useState(!1),{isFeatureEnabled:S}=u(F.isShowDeletedReimbursementsFeatureEnabled),w=v((A=>ge(A,c??""))),h=Lt(i),$=$t(i.userRole),U=a.fetchState;if(g.useEffect((()=>{y||c==null?y==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(c,!1,S)))}),[y,c,t,U]),g.useEffect((()=>{S&&a.remiDetails?.isDeleted===!0||i.isZeni===!0&&d?.userEmailDomain==="zeni.ai"&&h===!1?R(!1):R(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((A=>A.user.userId===d?.userId))!=null||a.remiDetails?.lastUpdatedBy===d?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,i.isZeni,h,d]),g.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||w.fetchState=="Completed"||w.fetchState=="In-Progress"||(k(!0),t(Fe(!1,T,S,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,c,t]),d==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Ye,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:x,onLoad:A=>(M=>{c!=null&&M.trackReimbursementReimbursementDetails(c)})(A)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:S,location:n,navigate:e,isRealTimeApprovalEnabled:C,currentTenant:i,reimbursementId:c??"",themeState:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:I})]})}const qn=ee((function(e,t){return{remisReviewView:Oe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(Y())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Be("approved",r??""));break;case"reject":e(Be("rejected",r??""))}}}}))(xn);function Jn({tenantEmailDomain:e}){const t=Q(),n=v((d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((d=>Oe(d))),m=le(),c=m?.loggedInUserRole?.includes("admin")===!0;return g.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(qn,{navigate:t,analytics:x,isAdmin:c,tenantEmailDomain:e})}const V=Qt(),st="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:Kn,common:me}=qe.getLocalizedStrings(),Qn=Kn.reimbursement.bulkActions,ea=P.div`
57
+ display: flex;
58
+ min-height: 100%;
59
+ width: 100%;
60
+ flex: 1 1 auto;
61
+ flex-direction: column;
62
+ align-items: center;
63
+ background-color: ${e=>e.theme.colors.grey4};
64
+ `,ta=ee((function(e,t){const n=ze(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const m=L.getSignedInUser(),c=fe(m),d=e.tenantState.currentTenantId,i=Z(e),a=i?.companyName??"",o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:d??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const p=n.fetchState,I=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:x,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:o,companyName:a,timePeriod:V,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:m,period:c}=t,{tenantEmailDomain:d}=r;return{updateTabToState:i=>{e(Y()),e(_e(i))},onSubtabChange:i=>{e(Y()),e(Xe(i))},onTransactionClick:(i,a)=>{const o=sa(d,i,a),l=q(m.state?.pathnameStackToGoBack,m.pathname);n(o,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const i=aa(d),a=q(m.state?.pathnameStackToGoBack,m.pathname);n(i,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:i}=t.currentTenant;x?.trackReimbursementNewReimbursement();const a=`/${i}/reimbursement/new`,o=q(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:o}})},onColumnSortConfigChanged:(i,a)=>{e(mn({uiState:{sortKey:i,sortOrder:a},period:t.period}))},onSearchTextChanged:i=>{e(ln(i))},onFiltersChange:i=>{e(rn({filters:i})),i.categories.every((a=>a.field!=null&&a.values?.length!==0))&&x.trackSpendManagmentFilterChange("reimbursement",i.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:i=>{i==="In-Progress"&&x.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:i}}))},onReloadTransactions:()=>{e(ue(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:i=>{e(sn(i))},removeAllTransactionsFromBulkActionList:()=>{e(Y())},onProceedForBulkActionClick:(i,a)=>{switch(i){case"delete":case"cancel":e(an(i,a??""));break;case"send_for_approval":e(Te("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Te("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:i=>{i.endsWith(be)&&e(nn(!1))},onEventReceived:i=>{i===st&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ae(),n=J(),r=n.state,m=We(),[c,d]=g.useState(null),i=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Zt(r.tab.toString());f!=null?t(_e(f)):console.log("Warning:Not a valid remiListTab");const G=Ht(r.subTab.toString());G!=null?t(Xe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(Y())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:o}=a(F.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(F.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:p}=a(F.isReimbursementBulkActionEnabled),I=L.getSignedInUser(),u=v((f=>Z(f))),[T,y]=g.useState(!1),[B,D]=g.useState(!1),k=le(),C=k?.loggedInUserRole?.includes("admin")===!0,R=v((f=>ze(f,V,p))),{areTenantIdsInSync:S}=En(),w=R.fetchState,{isAiCfoAccessEnabled:h,onAskAiCfoClick:$}=Re({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:w==="Completed"}),g.useEffect((()=>{!B&&S&&(D(!0),t(ue(V,!0,l,!1,!0)))}),[B,V,t,S]),I==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&Wt(u),A=Se(k?.loggedInUserRoleMap),M=Ie(k?.loggedInUserRoleMap),b=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,_=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,X=v((f=>Le(f.companyState,u.companyId))),H=X?.company.featuresActivationInfo.connectedAccountProvider,z=f=>{y(f)},{isFeatureEnabled:K}=a(F.isDebitCardFeatureEnabled),it=Ge(K,u),ot=Ve(u),{remisProcessed:te,remisProcessing:Ae}=v((f=>Yt(f)));g.useEffect((()=>{te===Ae&&c!=null&&(t(qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:Qn.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Jt(c)}]})),t(Kt()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),d(null))}),[te,Ae]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(f,G,ve)=>{f.endsWith(be)?ve.onReimbursementApprovalRulesEventReceived?.(f):G.entity_type==="reimbursement"&&(d(G.operation_type),ve.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(et,{}):O&&(!U||A)||M&&b?s.jsxs(s.Fragment,{children:[w==="Completed"?s.jsx(re,{analytics:x,onLoad:f=>(G=>G.trackPageLoaded(Ke.Event.reimbursementHome))(f)}):null,s.jsx(nt,{isAppContentDrawerOpen:T,handleDrawerToggle:z}),s.jsxs(ea,{windowSize:m,children:[s.jsx(Nn,{isOpen:i,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(Y())},children:s.jsx(ia,{onClick:f=>f.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:o,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:V,isAdmin:C,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{z(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:H,isBulkActionEnabled:p,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:h,onAskAiCfoClick:$,...rt})]})]}):_&&A?s.jsx(N,{to:"../setup"}):k!=null&&Ze(u,k.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=P($n)`
65
+ display: flex;
66
+ min-height: 100%;
67
+ flex-direction: column;
68
+ `,oa=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:x,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Fn),ra=()=>{const e=Un(),t=Q(),n=J(),{tenantEmailDomain:r}=ie(),m=Qe(),[c,d]=g.useState(!1),i=v((C=>Z(C))),a=L.getSignedInUserTenant(r)?.companyId??i.companyId,o=L.getSignedInUser(),l=i.userRoleId,p=!!i.userRole?.includes("reimbursements_user"),I=le(),u=Se(I?.loggedInUserRoleMap),T=Ie(I?.loggedInUserRoleMap),y=!!i.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!i.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!i.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,k=C=>{d(C)};if(o==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&T&&y?s.jsx(N,{to:"../../../reimbursements"}):D&&u?s.jsx(N,{to:"../../reimbursements/setup"}):i.companyReimbursementInfo&&!D||i.userReimbursementInfo&&T&&y===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:x,onLoad:C=>(R=>R.trackPageLoaded(Ke.Event.reimbursementPromoPage))(C)}),s.jsx(nt,{isAppContentDrawerOpen:c,handleDrawerToggle:k}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:i.userReimbursementInfo,userRoleId:l,isEmployee:p,onClickMenuIcon:()=>{k(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})};function Oa(){const e=v((z=>Z(z))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),m=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:d}=oe(),{isFeatureEnabled:i}=d(F.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=d(F.isDebitCardFeatureEnabled),o=Ge(a,e),l=Ve(e),p=e?.userRole!=null&&pn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,y=Se(t?.loggedInUserRoleMap),B=T&&y,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,k=D&&hn(t?.loggedInUserRoleMap),C=Ln(e,i,a)&&!p,R=C&&fn(t?.loggedInUserRoleMap),S=Sn(t?.loggedInUserRoleMap),w=In(t?.loggedInUserRoleMap),h=yn(t?.loggedInUserRoleMap),$=D&&w,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&h,A=Rn(t?.loggedInUserRoleMap),M=An(t?.loggedInUserRoleMap),b=Ie(t?.loggedInUserRoleMap),O=C&&A,{tenantEmailDomain:_}=ie(),X=J(),H=n===!0&&(y||b&&c);return s.jsxs(mt,{children:[X.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"verification",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"verification"})}),s.jsx(E,{path:"setup",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"setup"})}),s.jsx(E,{path:"promo",element:s.jsx(ra,{})}),s.jsx(E,{path:"approval-rules/*",element:B?s.jsx(Mn,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:M,isUserHasReimbursementAccess:b,showTreasuryRoute:U,isTenantBankingOnly:o,showChargeCardRoute:O,tenantEmailDomain:_??""})}),H&&s.jsx(E,{path:"*",element:s.jsx(na,{})}),(o===!0||l===!0)&&s.jsx(E,{path:"/*",element:s.jsx(et,{})}),t!=null&&Ze(e,t?.loggedInUserRoleMap)&&s.jsx(E,{path:"*",element:s.jsx(N,{to:"../promo"})}),m&&y&&s.jsx(E,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):X.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"new",element:s.jsx(Ue,{})}),s.jsx(E,{path:":reimbursementId",element:s.jsx(Yn,{})}),s.jsx(E,{path:":reimbursementId/edit",element:s.jsx(Ue,{})}),s.jsx(E,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(E,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(E,{path:"*",element:s.jsx(pe,{})})]})}export{Oa as default};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-XOqCw7q2.js";import{g as te,h as Ze,u as ve,i as Ve,j as _,l as Ue,n as xe,o as oe}from"./core-BVdj_noT.js";import{fJ as K,EW as I,Wi as ze,mb as ue,uB as he,vq as v,lS as O,l$ as D,lT as P,kW as A,kN as E,kM as M,DZ as V,vv as ye,bp as Ge,Wa as He,bm as Ne,Fi as qe,YS as $e,YT as We,ca as R,DS as ne,YU as re,YV as Qe,YW as Je,YX as Ke,YY as Xe,YZ as ea,Y_ as aa,Y$ as sa,Z0 as ta,Z1 as oa,Z2 as na,Z3 as ra,Z4 as la,Z5 as j,Z6 as U,Z7 as x,Z8 as z,Z9 as G,Za as H,Zb as N,Zc as q,Zd as $,Ze as W,ej as ca,EY as ia,EK as le,EL as ce,F2 as da,EP as ie,bF as k,VY as de,d2 as pe,EQ as _e,F8 as pa,Zf as _a,Zg as fa,Zh as ba,Zi as ma,Zj as ua,Zk as ha,Zl as ya,Zm as Ca,Zn as ga,Zo as wa,er as Ra,eq as Sa}from"./zeni-epic-state-BSu6fdxh.js";import{bp as Ia,at as Ta,bq as ja,g as ka,a2 as Fa,p as Ce,_ as Q,z as ge,aC as Oa,V as Da,a as Pa,ar as Aa,al as Ea,a9 as Ma,c as J,R as Ba,E as La,s as we,br as Ya,ax as Za,aj as va}from"./index-Dme9CBSK.js";import"./mui-BZ0jnpww.js";import Va from"./NotFoundScreen-BDU6ccX1.js";import{F as Ua}from"./FeaturePreviewScreen-C2u4cMYG.js";import{a as u}from"./sentry-CNIAdl-1.js";import{u as xa}from"./useInitialThreadRequest-DCdvOJx6.js";import{a as fe,c as be,b as za}from"./routePaths-TIOEKAr9.js";import{t as me}from"./reportTimeframe-BTqRG1HM.js";import{M as Ga}from"./MobileAppDrawer-BLYS912H.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.js";import"./InboxNotificationsProvider-DvvXiK-n.js";import"./useTaskManagerAccess-Z6bIfXqO.js";import"./useIsCustomersTabEnabled-DZ7jecHx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="fb770e76-cfcb-4cc5-8298-f3e60f781d2d",e._sentryDebugIdIdentifier="sentry-dbid-fb770e76-cfcb-4cc5-8298-f3e60f781d2d")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],S=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(W({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(ga()),e(wa())},qa=Ue((function(e){const o=ge.getSignedInUser(),b=e.tenantState.currentTenantId,m=K(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=I(e),n=He(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:J,isZeniUser:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${va}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(v(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=k(a),i=k(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(V());break;case"balance_sheet":e(M(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(M(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(E());break;case"balance_sheet_by_projects":e(M(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(A());break;case"cash_flow":e(O(r,!0,a,s));break;case"cash_flow_by_classes":e(O(r,!0,a,s)),o.isAccountingClassesEnabled&&e(P());break;case"cash_flow_by_projects":e(O(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(D())}const i=k(a),d=k(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:B}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:B}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(S(a)||R(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?za(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=we(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:F(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(W({scrollPosition:s}));break;case"profit_and_loss_by_classes":e($({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(G({scrollPosition:s}));break;case"cash_flow_by_classes":e(z({scrollPosition:s}));break;case"cash_flow_by_projects":e(x({scrollPosition:s}));break;case"cash_flow":e(U({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=S(t),r=R(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",F(t)),e(j(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",F(t)),e(j(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",F(t)),e(j(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{R(o.selectedReportID)?e(Xe({classesToFilterOut:a})):S(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{R(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):S(o.selectedReportID)?e(Je({projectsToFilterOut:a})):e(Ke({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=S(o.selectedReportID),s=R(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?E():ne()),o.isAccountingProjectsEnabled&&e(s?D():a?A():V())},onUpdateDisplayOrder:a=>{e(We(a))},onUpdateReportFormat:a=>{Na(e),e($e(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?qe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):D(!0):P(!0):A(!0):E(!0))}}}))(Ya);function $a(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ka(),b=Fa(),m=Za(b),a=Ze(),s=ve(),t=te(),{tenantEmailDomain:n}=Ve(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(Q.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(Q.isReportsCustomDateRangeEnabled),c=ge.getSignedInUser(),[p,B]=u.useState(!1),[X,Re]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>K(l))),Se=L.masterTOSInfo?.isMasterTOSAccepted??!1,Ie=L.company?.companyInfo.firstMonthOfFY??1,Te=xa(L?.companyId),g=_((l=>I(l).fetchState)),je=_((l=>ze(l))),{areTenantIdsInSync:y}=Oa(),Y=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),w=_((l=>he(l))),ke=_((l=>I(l).isCompareModeOn)),C=_((l=>I(l).filter)),Z=_((l=>I(l).selectedReportAndTimeframeFetchState)),Fe=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(B(!0),s(v(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&g==="Completed"&&y&&(s(v(c.userId,!1,!0,!1)),Re(!0))}),[p,X,g,y]),u.useEffect((()=>{if(p&&Z.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(Y){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":w&&s(V());break;case"balance_sheet":s(M(C.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":w&&s(A());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":w&&s(D());break;case"cash_flow":s(O(C.timeframe))}}),[p,Y,Z,y,T,w]);const ee=Da(),Oe=ee?.loggedInUserRole!=null&&Ge(ee?.loggedInUserRole)!==!0,[De,Pe]=u.useState(!1),ae=l=>{Pe(l)},Ae=Pa(),Ee=Aa();return(function(l){const{isDataReady:Me}=l,{pathname:Be}=te(),se=Ia(Be??"")==="reports",Le=Ta(Me),Ye=u.useMemo((()=>se?Ha:void 0),[se]);ja({canFetchSuggestedQuestions:Le,pageContexts:Ye})})({isDataReady:g==="Completed"}),Ea({isDataReady:g==="Completed"}),f.jsxs(f.Fragment,{children:[g==="Completed"?f.jsx(Ma,{analytics:J,onLoad:l=>l.trackPageLoaded(Ba.Event.reports)}):null,f.jsx(Ga,{isAppContentDrawerOpen:De,handleDrawerToggle:ae}),f.jsx(qa,{firstMonthOfFY:Ie,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:Fe,selectedReportID:Y,analytics:J,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:w,isCompareModeOn:ke,hasTransactionAccess:Oe,signedInUser:c,selectedReportAndTimeframeFetchState:Z,handleDrawerToggle:ae,reportsResyncFetchState:je.reportsResyncFetchState,isAiCfoAccessEnabled:Ee&&Ae&&!e,onAskAiCfoClick:()=>{if(Se)if(m){const l=we(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const F=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function Cs(){const e=_((s=>K(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(Q.isDebitCardFeatureEnabled),m=Ra(b,e),a=Sa(e);return m===!0||a===!0?f.jsx(Ua,{}):f.jsxs(xe,{children:[f.jsx(oe,{path:"/",element:f.jsx($a,{})}),f.jsx(oe,{path:"*",element:f.jsx(Va,{})})]})}export{Cs as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-XOqCw7q2.js";import{z as b,a9 as N,c as u,R as S,ed as I,p as k,_ as C}from"./index-Dme9CBSK.js";import"./mui-BZ0jnpww.js";import g from"./NotFoundScreen-BDU6ccX1.js";import{a as c}from"./sentry-CNIAdl-1.js";import{u as D,j as h,h as F,g as L,l as _,n as T,o as d,N as y}from"./core-BVdj_noT.js";import{fJ as U,a3H as j,a3I as p,EB as P,qo as V,a3J as z,Ez as J}from"./zeni-epic-state-BSu6fdxh.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="36ef668d-b769-4d89-be5b-2d3c12465df8",e._sentryDebugIdIdentifier="sentry-dbid-36ef668d-b769-4d89-be5b-2d3c12465df8")}catch{}})();const R=_((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(J())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),q=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),w=L(),f=b.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(R,{navigate:l,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -0,0 +1,33 @@
1
+ import{j as k}from"./liveblocks-XOqCw7q2.js";import{a as v}from"./sentry-CNIAdl-1.js";import{i as R,u as W,h as X,g as ee,j as r,l as te}from"./core-BVdj_noT.js";import{_N as Ge,$1 as Ve,mb as ae,sW as Me,t6 as Re,tm as $e,tk as Fe,tn as Ke,tp as Ue,a0N as Ye,fJ as K,$R as pe,a0O as Se,h3 as ne,ct as le,cu as se,G0 as ve,a0P as Ce,G4 as ze,gT as ce,sZ as qe,ty as Ze,dq as He,dp as Qe,Ua as fe,F_ as We,FU as Xe,VS as De,FM as et,FL as tt,FG as at,FR as nt,G5 as lt,VU as Y,VT as ge,FN as st,$S as oe,Gl as Ae,Ge as Ie,a0Q as xe,t0 as Te,G8 as Be,G6 as Le,a0R as Je,Gs as be,Gp as we,G9 as je,Gr as Ne}from"./zeni-epic-state-BSu6fdxh.js";import{a5 as de,cG as ie,cH as ct,z as ot,o as dt,a8 as it,a9 as ue,c as _,aj as ut,cI as rt,s as V,G as ye,j as ke,cJ as ht,cK as mt,cL as pt}from"./index-Dme9CBSK.js";import{n as re}from"./mui-BZ0jnpww.js";import{p as St}from"./pathToGoBack-BYz7DD9r.js";import{a as ft}from"./useActualMatchingMatchDetail-ClGwke9Y.js";import Q from"./NotFoundScreen-BDU6ccX1.js";import{t as M}from"./routePaths-TIOEKAr9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aaa29c04-3b0c-4c80-94b8-4227deb19a67",e._sentryDebugIdIdentifier="sentry-dbid-aaa29c04-3b0c-4c80-94b8-4227deb19a67")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=R(),s=t??l,n=W(),i=X(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Ge(u,s??""))),m=r((u=>Ve(u))),C=r((u=>ae(u))),y=ft(),S=v.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),I=v.useRef(!1);return v.useEffect((()=>{o.fetchState!=="In-Progress"&&I.current&&o.fetchState==="Completed"&&(I.current=!1,S())}),[o.fetchState,S]),v.useEffect((()=>{s!=null&&d==null&&h.fetchState==="Not-Started"&&n(Me(s))}),[s,d,h.fetchState]),v.useEffect((()=>{n(Re({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?k.jsx(Q,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(Q,{}):k.jsx(Dt,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n(Fe(s,u,f))},onSkip:(u,f)=>{n($e(s,u,f))}})})}const Dt=re.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 0 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,gt=ye.getLocalizedStrings(),yt=te((function(e,t){const c=Se(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:l}=t;return{onTransactionSelect(s){e(Ce({selectedTransaction:s}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(ze()),c("..",{relative:"path"})},onTransactionClick:s=>{const n=`${M(s,t.tenantEmailDomain)}`,i=V(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Yt=({setShouldNavigateBack:e})=>{const t=X(),c=ee(),{scheduleDetailId:l,tenantEmailDomain:s}=R(),{scheduleType:n}=R();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=r((y=>K(y))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=r((y=>Se(y,a))),h=o.selectedJELinkRowIndex,A=r((y=>ne(y,i.companyId))),m=dt(o.updateStatus.fetchState);v.useEffect((()=>{m==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[m,o.updateStatus.fetchState]),v.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),v.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return k.jsx(k.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?k.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&h!=null?k.jsxs(k.Fragment,{children:[C===!0?k.jsx(ue,{analytics:_,onLoad:()=>{kt(o,a,A)}}):null,k.jsx(yt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:_,controllerUserDetails:A,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[h]})]}):null})},_e=e=>{const t=gt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},kt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:i}=e.linkBillExpenseView,a=i.some((h=>h.isRecommendedTransaction===!0)),d=le(c.controllers),o=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{..._e(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function Ee({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:l}){const s=W(),{ignoreStatusById:n,revertStatusById:i}=r((A=>ce(A).jeSchedules)),a=v.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=v.useRef(!1),h=v.useRef(l);return h.current=l,v.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,h.current())}),[d]),{onScheduleDecision:v.useCallback(((A,m,C)=>{if(t!=null){if(A==="ignore")return(function(y){return He.includes(y)})(m)?(o.current=!0,a.current="ignore",void s(qe(t,c,m,C))):void 0;e!=null&&(function(y){return Qe.includes(y)})(m)&&(o.current=!0,a.current="revert",s(Ze(e,t,c,m,C)))}}),[s,e,t,c]),scheduleDecisionStatus:d}}const Et=re.div`
10
+ display: flex;
11
+ min-height: 100%;
12
+ width: 100%;
13
+ flex: 1 0 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,Ct=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,l=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:c,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(l.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(s,n))},onDelete:n=>{e(st(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(lt(s,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:h,months:A,scheduleAccruedExpenseCategory:m,scheduleClass:C,scheduleExpenseCategory:y,startDate:S,vendor:I}=d,u=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,f=y.selectedOption!=null?t.accountList.find((B=>B.qboId===y.selectedOption)):void 0,D=m.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===m.selectedOption)):void 0,J=A?.selectedOption;e(et({scheduleType:s,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||f?.accountId==null||t.isAccountingClassesEnabled!==!1&&u?.classId==null||D==null||I.selectedOption==null||h==null||o==null&&o==0||S==null||J==null||e(tt({scheduleType:s}))}}}))(ht),zt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:l,onPanelCloseAfterDecision:s,onPanelNavigateBack:n}={})=>{const[i,a]=v.useState(!1),d=e??i,o=t??a,h=X(),A=ee(),m=W(),C=ke(),{tenantEmailDomain:y}=R(),[S,I]=v.useState(!1);if(y==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:u}=R(),f=l??u;let D;f!=="new"&&(D=f);const J=vt(f),B=r((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),b="accrued_expenses",E=r((L=>Se(L,"accrued_expenses"))),w=r((L=>fe(L))),j=r((L=>L.classListState.fetchState)),x=r((L=>ae(L))),N=w!=="Completed"||j!=="Completed";v.useEffect((()=>{S===!1&&N?(m(We(b,D)),I(!0)):N===!1&&S===!1&&f!=="new"&&(m(Xe(b,f)),I(!0))}),[S]);const P=r((L=>K(L))),T=r((L=>ne(L,P.companyId))),O=A.state?.message==="expenseAutomation",z=r((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:q,scheduleDecisionStatus:Z}=Ee({jeScheduleId:E.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:E.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:b,onDecided:()=>{if(s==null)if(O!==!0)h("../schedules/accrued_expenses");else{const{month:L,year:Pe}=z;h(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else s()}}),G=E.fetchState,$=E.allAccountList,H=E.allClassList,g=E.allAccruedAccountList,p=E.scheduleAccruedDetailsLocalData;if(J!==!0||E.fetchState==="Error")return k.jsx(Q,{});const F=G==="Completed"&&S===!0,Oe=E.selectedJEAccruedSchedule!=null;return G==="Completed"||G==="Not-Started"||c===!0&&Oe?k.jsxs(Et,{children:[F===!0?k.jsx(ue,{analytics:_,onLoad:()=>{At(E,b,T)}}):null,k.jsx(Ct,{onScheduleDecision:U?q:void 0,scheduleDecisionStatus:Z,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:E,location:A,navigate:h,classList:H,accountList:$,shouldNavigateBack:d,accruedAccountList:g,scheduleLocalData:p,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:E.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:y,analytics:_,controllerUserDetails:T,isAccountingClassesEnabled:x,status:E.selectedJEAccruedSchedule?.status.code})]}):k.jsx(ie,{})},vt=e=>e!=null,At=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=le(c.controllers),n=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{..._e(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},It=re.div`
18
+ display: flex;
19
+ min-height: 100%;
20
+ width: 100%;
21
+ flex: 1 0 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,xt=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(be(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,h=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:h,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,h=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:h}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:h,scheduleDetailsListSection:A}=d,{scheduleClass:m,scheduleExpenseCategory:C,accumulatedDepreciationCategory:y,assetId:S,months:I,startDate:u,postingDate:f,vendor:D}=h,J=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},b=m.selectedOption!=null?t.classList.find((T=>T.classId===m.selectedOption)):void 0,E=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=y.selectedOption!=null?t.depAccountList.find((T=>T.qboId===y.selectedOption)):void 0,j=I?.selectedOption,x=A.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),N=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,P=f.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:E?.accountId,selectedClass:b?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:u,selectedMonths:j,assetId:S,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:N,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||E?.accountId==null||t.isAccountingClassesEnabled!==!1&&b?.classId==null||u==null||j==null||P!==!0&&N==null||e(Le({scheduleType:i}))}}}))(mt),qt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:l}={})=>{const s=X(),n=ee(),i=W(),a=ke(),{tenantEmailDomain:d}=R(),[o,h]=v.useState(!1),{scheduleDetailId:A}=R(),m=t??A,C=n.state?.message==="expenseAutomation",y=Tt(m),S=r((g=>g.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{S!=null&&S.length!==0||m!=="new"||s("../schedules/fixed_assets")}),[S,m]);const I="fixed_assets",u=r((g=>oe(g,I))),f=r((g=>g.entityAutoCompleteState.autoCompleteText.common)),D=r((g=>De(g,"common"))),J=r((g=>fe(g))),B=r((g=>g.classListState.fetchState)),b=r((g=>ae(g))),E=r((g=>ce(g).selectedPeriod)),w=J!=="Completed"||B!=="Completed";v.useEffect((()=>{o===!1&&w?(i(Ae(I,G,!0)),h(!0)):w===!1&&o===!1&&(i(Ie(I,m==="new"?void 0:m,!0)),h(!0))}),[o]),v.useEffect((()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:g,year:p}=E;s(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else s("../schedules/fixed_assets")}),[u.markAsCompleteStatus.fetchState]);const j=r((g=>K(g))),x=r((g=>ne(g,j.companyId))),N=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=Ee({jeScheduleId:u.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:u.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:I,onDecided:()=>{if(c==null)if(C!==!0)s("../schedules/fixed_assets");else{const{month:g,year:p}=E;s(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else c()}}),O=u.fetchState,z=u.allAccountList,U=u.allClassList,q=u.allDepreciationAccountList,Z=u.scheduleDetailsLocalData.fixed_assets;let G;if(m!=="new"&&(G=m),y!==!0||u.fetchState==="Error")return k.jsx(Q,{});const $=O==="Completed"&&o===!0,H=u.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&H?k.jsxs(It,{children:[$===!0?k.jsx(ue,{analytics:_,onLoad:()=>{Lt(u,I,x)}}):null,k.jsx(xt,{onScheduleDecision:N?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:l,location:n,navigate:s,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:E,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{i(Te(g,p))},accountList:z,depAccountList:q,scheduleLocalData:Z,selectedJEScheduleKey:S,scheduleDetailId:G,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:_,controllerUserDetails:x,isAccountingClassesEnabled:b,status:u.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},Tt=e=>e!=null,Bt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Lt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Bt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Jt=re.div`
26
+ display: flex;
27
+ min-height: 100%;
28
+ width: 100%;
29
+ flex: 1 0 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,bt=te((function(e,t){const c=K(e),l=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Ne(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(be(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:h}=a,{scheduleClass:A,scheduleExpenseCategory:m,months:C,startDate:y,postingDate:S,vendor:I}=o,u=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((x=>x.id===I?.selectedOption)):void 0,f={id:u?.zeniId??I?.selectedOption??"",name:u?.name??I?.defaultOptions.find((x=>x.value===I?.selectedOption))?.label??"",logo:u?.logo},D=A.selectedOption!=null?t.classList.find((x=>x.classId===A.selectedOption)):void 0,J=m.selectedOption!=null?t.accountList.find((x=>x.qboId===m.selectedOption)):void 0,B=C?.selectedOption,b=h.map(((x,N)=>({...t.scheduleLocalData.jeScheduleDetails[N],amount:{...t.scheduleLocalData.jeScheduleDetails[N].amount,amount:x.amount}}))),E=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,w=S.type==="lastDayOfMonth"||void 0,j={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:y,selectedMonths:B,jeScheduleDetails:b,lastDayOfMonth:w,selectedVendor:f,selectedDayOfMonth:E};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||y==null||B==null||w!==!0&&E==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Zt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:l,onPanelNavigateBack:s}={})=>{const n=X(),i=ee(),a=W(),d=ke(),{tenantEmailDomain:o}=R(),[h,A]=v.useState(!1),m=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:y}=R(),S=t??y,I=wt(c??C,S),u=r((p=>p.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{u!=null&&u.length!==0||S!=="new"||n("../schedules/prepaid_expenses")}),[u,S]);const f=c??pe(C)??"prepaid_expenses",D=r((p=>oe(p,f))),J=r((p=>p.entityAutoCompleteState.autoCompleteText.common)),B=r((p=>De(p,"common"))),b=r((p=>fe(p))),E=r((p=>p.classListState.fetchState)),w=r((p=>ae(p))),j=r((p=>ce(p).selectedPeriod)),x=b!=="Completed"||E!=="Completed";v.useEffect((()=>{h===!1&&x?(a(Ae(f,$,!0)),A(!0)):x===!1&&h===!1&&(a(Ie(f,S==="new"?void 0:S,!0)),A(!0))}),[h]),v.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),m===!0){const{month:p,year:F}=j;n(`../../month_end_close_checks/review/je_schedules/${p}-${F}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const N=r((p=>K(p))),P=r((p=>ne(p,N.companyId))),T=e||m,{onScheduleDecision:O,scheduleDecisionStatus:z}=Ee({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:f,onDecided:()=>{if(l==null)if(m!==!0)n("../schedules/prepaid_expenses");else{const{month:p,year:F}=j;n(`../../month_end_close_checks/review/je_schedules/${p}-${F}`)}else l()}}),U=D.fetchState,q=D.allAccountList,Z=D.allClassList,G=D.scheduleDetailsLocalData;let $;if(S!=="new"&&($=S),I!==!0||D.fetchState==="Error")return k.jsx(Q,{});const H=U==="Completed"&&h===!0,g=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&g?k.jsxs(Jt,{children:[H===!0?k.jsx(ue,{analytics:_,onLoad:()=>{Nt(D,f,P)}}):null,k.jsx(bt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:z,isRenderedInPanel:e,onPanelNavigateBack:s,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:m,removeJeScheduleTransactionKey:(p,F)=>{a(Te(p,F))},expenseAutomationSelectedPeriod:j,navigate:n,classList:Z,accountList:q,scheduleLocalData:G[f],selectedJEScheduleKey:u,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:f,analytics:_,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},wt=(e,t)=>pe(e)!=null&&t!=null,jt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Nt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...jt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Ut as J,Zt as S,qt as a,zt as b,Yt as c};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReportsRoutes-DxNr6i5Y.js","assets/sentry-CNIAdl-1.js","assets/core-BVdj_noT.js","assets/zeni-epic-state-BSu6fdxh.js","assets/index-Dme9CBSK.js","assets/mui-BZ0jnpww.js","assets/analytics-u8j262Ga.js","assets/utils-BtSqr9lx.js","assets/NotFoundScreen-BDU6ccX1.js","assets/FeaturePreviewScreen-C2u4cMYG.js","assets/useInitialThreadRequest-DCdvOJx6.js","assets/routePaths-TIOEKAr9.js","assets/reportTimeframe-BTqRG1HM.js","assets/MobileAppDrawer-BLYS912H.js","assets/InboxNotificationsProvider-DvvXiK-n.js","assets/useTaskManagerAccess-Z6bIfXqO.js","assets/useIsCustomersTabEnabled-DZ7jecHx.js","assets/index-BQ3cXEYt.css","assets/AddressRoutes-_bCuEkwx.js","assets/AddressScreen-Dh4KOVQ1.js","assets/PeopleRoutes-By8BlbIz.js","assets/useAskAiCfoHostNavButtonProps-DO-bnRp-.js","assets/PandLWithForecastRoutes-D4c4br1B.js","assets/CustomerOnboardingRoutes-DyVqaxvR.js","assets/QBOConnectionScreen-DyZaNX6V.js","assets/empty-C5tm1JkN.js","assets/index-Ch4hjMoy.js","assets/url-uObfQ0XR.js","assets/index-BtE2ozWs.js","assets/decodeURIComponentSafe-JMSvQveN.js","assets/useEmailConnectResultRefresh-BJWnx3gQ.js","assets/useChargeCardPusherEvents-DTd9bnXH.js","assets/VendorsRoutes-BtVR0Vii.js","assets/ScheduleDetailsPrepaidExpensesScreen-BxMaq7Gq.js","assets/pathToGoBack-BYz7DD9r.js","assets/useActualMatchingMatchDetail-ClGwke9Y.js","assets/stripSplatSuffix-CLHAbjpi.js","assets/DrawerScreen-XY9r5sqx.js","assets/accountMappingHelper-8C9JQylV.js","assets/CustomersRoutes-CtL2o5-n.js","assets/TransactionDetailRoutes-ggKexh3-.js","assets/useEnsureVendorListLoaded-U686iOkV.js","assets/TransactionDetailScreen-BBWVy8TW.js","assets/expenseAutomationHelper-BtpowfoM.js","assets/EntityDetailRoutes-CLCMxp18.js","assets/withTransactionSidePanel-DybBA6JZ.js","assets/DashboardRoutes-7yhAEy7g.js","assets/analyticsHelper-CKG9W7dC.js","assets/CompanyPassportScreen-BieP2EZa.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CF91keX4.js","assets/BillPayRoutes-DosvZj42.js","assets/DomesticWireDetailScreen-BIF8BW0a.js","assets/BusinessVerificationPageScreen-CeIfGxLQ.js","assets/SetupPagesScreen-BgAn4bD3.js","assets/BillPayApprovalRoutes-D1JvUYMQ.js","assets/ReimbursementApprovalRuleDetailScreen-DrgxKZH7.js","assets/FallBackRoute-BmlOw1z3.js","assets/SettingsRoutes-Cc8RIjZt.js","assets/AccountMappingScreen-BpJDQCQx.js","assets/ReimbursementApprovalRoutes-CPfPh7_I.js","assets/InvoicingRoutes-Ds8bd8V8.js","assets/ReimbursementRoutes-Bq5czlC0.js","assets/ZeniAccountRoutes-VM-T0h6_.js","assets/ZeniAccountStatementScreen-CM9U5Zls.js","assets/TreasuryRoutes-DnYXMIpO.js","assets/TransactionListRoutes-B7kikvJW.js","assets/ChargeCardRoutes-BZz4pRiz.js","assets/NotificationRoutes-B3DfKahf.js","assets/PerformanceRoutes-CQ6Hxkqk.js","assets/ExpenseAutomationRoutes-CA-VSGA_.js","assets/ActualMatchingMatchDetailScreen-fK8c-oot.js","assets/RewardsRoutes-CO6TuNiV.js","assets/TaskRoutes-w6Z4j7Vq.js","assets/TaskListScreen-CBFYc4EW.js","assets/useTaskManagerPusherEvents-Doj7t2BI.js","assets/AiCfoScreen-03lSUwaj.js","assets/CardsAiCfoScreen-C8_v-BYR.js"])))=>i.map(i=>d[i]);
2
+ import{bm as hs,fJ as _s,er as ps,eq as xs,h8 as js,d4 as Es,c8 as gs,gN as Is,gd as Rs,eh as xe,cz as As,gr as Ts,cq as fs,bF as bs,bw as ys,h9 as ws,v as Cs,ha as Ds,bp as vs,hb as Us,bL as ks,bK as Fs,bs as Os,cm as Ps,hc as Hs,hd as Ss,ec as Bs,ef as Ls,ee as Ns,cy as Vs,cF as Zs,he as je,gm as Ee,h1 as Ms,go as ge,gP as Ie,gQ as Re,gp as zs,_ as r}from"./zeni-epic-state-BSu6fdxh.js";import{j as e}from"./liveblocks-XOqCw7q2.js";import{a as U}from"./sentry-CNIAdl-1.js";import{u as Gs,h as $s,i as Ys,g as qs,j as z,q as Ae,N as d,n as Ws,o as s}from"./core-BVdj_noT.js";import{u as Ks,z as f,p as Js,a as Qs,h as Xs,_ as L,i as en,K as sn,V as nn,L as F,G as Te,t as c,b as an,P as tn,c as ae,r as on,l as i,d as rn,Z as ln}from"./index-Dme9CBSK.js";import{u as dn}from"./mui-BZ0jnpww.js";import{f as fe}from"./analyticsHelper-CKG9W7dC.js";import{t as cn}from"./getLocaleForTenant-CI9ZVduS.js";import{u as un}from"./useIsCustomersTabEnabled-DZ7jecHx.js";import{F as C}from"./FallBackRoute-BmlOw1z3.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new l.Error().stack;b&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[b]="1c231a9c-a720-4a84-9133-c2aa76ffe40d",l._sentryDebugIdIdentifier="sentry-dbid-1c231a9c-a720-4a84-9133-c2aa76ffe40d")}catch{}})();const mn=i((()=>r((()=>import("./ReportsRoutes-DxNr6i5Y.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])))),hn=i((()=>r((()=>import("./AddressRoutes-_bCuEkwx.js")),__vite__mapDeps([18,1,2,3,19,4,5,6,7,8,17])))),_n=i((()=>r((()=>import("./PeopleRoutes-By8BlbIz.js")),__vite__mapDeps([20,1,2,3,4,5,6,7,8,21,13,14,15,16,17])))),pn=i((()=>r((()=>import("./PandLWithForecastRoutes-D4c4br1B.js")),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,21,10,11,13,14,15,16,17])))),xn=i((()=>r((()=>import("./CustomerOnboardingRoutes-DyVqaxvR.js")),__vite__mapDeps([23,1,2,3,19,4,5,6,7,8,24,25,26,27,28,29,30,31,17])))),jn=i((()=>r((()=>import("./VendorsRoutes-BtVR0Vii.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,19,8,9,33,34,35,36,29,11,21,13,14,15,16,37,38,17])))),En=i((()=>r((()=>import("./CustomersRoutes-CtL2o5-n.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,11,8,21,13,14,15,16,17])))),gn=i((()=>r((()=>import("./TransactionDetailRoutes-ggKexh3-.js")),__vite__mapDeps([40,1,2,3,8,4,5,6,7,29,41,42,21,10,11,43,17])))),be=i((()=>r((()=>import("./EntityDetailRoutes-CLCMxp18.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,29,45,21,42,10,11,43,36,16,17])))),In=i((()=>r((()=>import("./DashboardRoutes-7yhAEy7g.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,45,21,42,29,10,11,43,36,16,8,12,47,48,13,14,15,49,9,17])))),ye=i((()=>r((()=>import("./BillPayRoutes-DosvZj42.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,19,8,51,21,10,52,11,13,14,15,16,37,9,53,47,54,41,55,56,17])))),Rn=i((()=>r((()=>import("./SettingsRoutes-Cc8RIjZt.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,15,58,13,14,16,24,25,26,27,28,29,38,19,8,47,52,11,48,30,54,41,55,59,17])))),An=i((()=>r((()=>import("./InvoicingRoutes-Ds8bd8V8.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,19,8,13,14,15,16,24,25,26,27,28,29,17])))),we=i((()=>r((()=>import("./ReimbursementRoutes-Bq5czlC0.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,8,53,52,11,13,14,15,16,47,9,21,10,37,56,59,41,55,17])))),Tn=i((()=>r((()=>import("./ZeniAccountRoutes-VM-T0h6_.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,8,53,52,11,13,14,15,16,47,9,51,19,21,63,17])))),fn=i((()=>r((()=>import("./TreasuryRoutes-DnYXMIpO.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,8,53,52,11,13,14,15,16,47,21,10,9,17])))),bn=i((()=>r((()=>import("./TransactionListRoutes-B7kikvJW.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,45,21,42,29,10,11,43,36,63,17])))),yn=i((()=>r((()=>import("./ChargeCardRoutes-BZz4pRiz.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,21,13,14,15,16,53,52,11,8,47,10,31,19,17])))),wn=i((()=>r((()=>import("./NotificationRoutes-B3DfKahf.js")),__vite__mapDeps([67,1,2,3,8,4,5,6,7,21,15,17])))),Cn=i((()=>r((()=>import("./PerformanceRoutes-CQ6Hxkqk.js")),__vite__mapDeps([68,1,2,3,8,4,5,6,7,21,13,14,15,16,17])))),Dn=i((()=>r((()=>import("./ExpenseAutomationRoutes-CA-VSGA_.js")),__vite__mapDeps([69,1,2,3,8,4,5,6,7,21,42,29,10,11,43,35,36,45,33,34,38,37,17])))),vn=i((()=>r((()=>import("./ActualMatchingMatchDetailScreen-fK8c-oot.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,35,36,29,11,8,17])))),Un=i((()=>r((()=>import("./RewardsRoutes-CO6TuNiV.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8,17])))),kn=i((()=>r((()=>import("./TaskRoutes-w6Z4j7Vq.js")),__vite__mapDeps([72,1,2,3,8,4,5,6,7,10,13,14,15,16,73,21,74,17])))),Fn=i((()=>r((()=>import("./AiCfoScreen-03lSUwaj.js")),__vite__mapDeps([75,1,2,3,4,5,6,7,49,34,11,74,17])))),Ce=i((()=>r((()=>import("./CardsAiCfoScreen-C8_v-BYR.js")),__vite__mapDeps([76,1,2,3,4,5,6,7,17])))),R=i((()=>r((()=>import("./NotFoundScreen-BDU6ccX1.js")),__vite__mapDeps([8,1,2,3,4,5,6,7,17])))),On=i((()=>r((()=>import("./TaskListScreen-CBFYc4EW.js").then((l=>l.f))),__vite__mapDeps([73,1,2,3,4,5,6,7,21,13,14,15,16,74,17]))));function na({setTenantEmailDomain:l}){const b=Gs(),N=$s(),{tenantEmailDomain:o}=Ys(),V=dn().mode,{setLoading:O,clearAllLoading:W,clearLoading:H}=Ks(),y=f.getSignedInUserTenant(o)?.tenantId,A=f.getSignedInUser(),K=hs(A),G=qs(),[P,ve]=U.useState(!1),n=z((a=>_s(a))),{useFeatureGate:S}=Js(),Z=Qs(),J=Xs(),Ue=!!n.company?.companyZeniAccountInfo?.isZeniAccountEnabled,ke=n.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Fe}=S(L.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=S(L.isDebitCardFeatureEnabled),T=z((a=>a.tenantState.fetchState)),x=z((a=>a.tenantState.activeTenantFetchState.fetchState)),m=x==="Completed"||T==="Completed"?ps(te,n):void 0,Q=x==="Completed"||T==="Completed"?xs(n):void 0,oe=x==="Completed"||T==="Completed"?js(n)&&!Es(n):void 0,Oe=en(n,Fe,te),{isCardsHidden:Pe}=sn(n?.tenantId),He=!Oe||!!Pe,{isFeatureEnabled:Se}=S(L.isSettingsFeatureEnabled),{isFeatureEnabled:X}=S(L.isAiCfoFileUploadEnabled),{isFeatureEnabled:Be}=S(L.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Le=n?.userRole!=null&&gs(n.userRole),$=z((a=>Is(a)));if(o!=null){const a=f.getSignedInUserTenant(o);A!=null&&a!=null&&fe(A,n,V)}const M={tenantId:y,userId:A?.userId,sessionId:A?.zeniSessionId},re=Rs(),h=nn(),Ne=un(n.company==null),Ve=n.company==null||h?.loggedInUserRoleMap!=null&&xe(h.loggedInUserRole),Ze=As(h?.loggedInUserRoleMap),ee=Ae("/:tenantEmailDomain/onboarding/*")!==null,Me=Ae("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Me?.params.selectedPeriod,ze=z((a=>M.tenantId!=null?Ts(a,M.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),l(o)}),[o]),U.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const D=fs(Number(a[0])),w=Number(a[1]),t=bs(`01-${D<10?`0${D}`:D}-${w}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),_=ys();t.isAfter(_,"month")===!1?b(ws(y,{month:D,year:w})):N(`/${o}/month_end_close_checks/review`)}}}),[se,o,y]),U.useEffect((()=>{P||(ve(!0),O(F.TENANT_FETCHING))}),[P,M,re,A,b,f]),U.useLayoutEffect((()=>{!Cs(re,M)&&f.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t){if(Ee(D?.userId,D?.zeniSessionId,a.tenantId),w(Ms(!0)),w(ge(a.tenantId)),a.tenantId!=null&&c.clearTenant(a.tenantId),a.tenantId!=null){const _=f.getSignedInUserTenantWithId(a.tenantId);t&&Te.updateAppLocaleID(cn(t)),_?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(_?.tenantEmailDomain)}a.userId!=null?ae.identify(a.userId,{tenant_id:a.tenantId}):ae.resetUserIdentity()})(M,A,b,ze))}),[y]),U.useEffect((()=>{f.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t,_,ls,B){if(w==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&_?.zeniSessionId!=null,ds=w==null||w.tenantId!==t,cs=w!=null&&w.excludedResources==null,us=w!=null&&w.externalConnections==null;if(Y&&ds){B(ge(t));const q=f.getSignedInUserTenantWithId(t);q?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(q?.tenantEmailDomain),Ee(_?.userId,_?.zeniSessionId,t),c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)))}else Y&&cs&&c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),Y&&us&&c.shouldFetchConnections(t)&&(c.markConnectionsFetchStarted(t),B(Re(_.userId,t)));if(Y){ae.identify(_.userId,{tenant_id:t});const q=t==null||t!=null&&(D==="Completed"||D==="Error");if(a==="Completed"||D!=="Not-Started"&&D!=="Error"||t==null||!c.shouldFetchActiveTenant(t)||(c.markActiveTenantFetchStarted(t),ls(F.TENANT_FETCHING),B(zs(_.userId,t,_.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&c.shouldFetchAllTenants()){c.markAllTenantsFetchStarted();const{userId:ms,zeniSessionId:pe}=_;on((()=>{f.getSignedInUser()?.zeniSessionId===pe?B(je(ms,pe)):c.markAllTenantsFetchFailed()}),Pn)}}})(T,x,n,y,A,O,b))}),[y,x]),U.useEffect((()=>{f.isSignedIn()&&T==="Completed"&&$.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),f.saveSignedInUserTenants(Ds($.tenantsBaseInOrder)),A!=null&&fe(A,n,V,void 0,$.tenantsBaseInOrder))}),[$,T,n,A]),U.useEffect((()=>{x==="In-Progress"&&O(F.TENANT_FETCHING),x!=="Completed"&&x!=="Error"||(x==="Completed"&&y!=null?(performance.mark("zeni:boot_tenant_data"),W(),c.markActiveTenantFetchCompleted(y)):x==="Error"&&y!=null&&(c.markActiveTenantFetchFailed(y),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?c.markAllTenantsFetchCompleted():T==="Error"&&c.markAllTenantsFetchFailed())}),[x,T,y,P]);const ie=U.useRef(!1);U.useEffect((()=>{!ie.current&&x==="Completed"&&P&&(ie.current=!0,an())}),[x,P]);const v=n?.userRole!=null&&vs(n?.userRole),{isFeatureEnabled:Ge}=S(L.isReferralFeatureEnabled),{isFeatureEnabled:$e}=S(L.isAccrualEnabled),Ye=n?.userRole!=null&&n.userRole.includes("charge_card_user"),qe=n?.userRole!=null&&n.userRole.includes("charge_card_admin"),k=n?.userRole!=null&&xe(n.userRole),le=n?.company==null||n.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!v,de=!He&&!v,We=Us(h?.loggedInUserRoleMap),Ke=n.externalConnections?.accounting[0]?.isValid,Je=n.externalConnections?.fetchState==="Completed",ne=n.company?.companyOnboardingInfo.isOnboardingCompleted,ce=n?.company==null||n.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!v,ue=ce&&ks(h?.loggedInUserRoleMap),me=Ue&&!v,Qe=ke&&!v,Xe=le&&Fs(h?.loggedInUserRoleMap),es=de&&Os(h?.loggedInUserRoleMap),ss=me&&Ps(h?.loggedInUserRoleMap),ns=Hs(h?.loggedInUserRoleMap),as=Ss(h?.loggedInUserRoleMap),ts=Bs(h?.loggedInUserRoleMap),os=Ls(h?.loggedInUserRoleMap),rs=Ns(h?.loggedInUserRoleMap),j=Vs(h?.loggedInUserRoleMap),E=Zs(h?.loggedInUserRoleMap),he=le&&j,_e=ce&&E,g=me&&ts,I=Qe&&os,u=de&&rs,is=n.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ze===!0||We===!0||ns===!0||as===!0;return f.isSignedIn()?y==null?T==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(A!=null&&T!=="In-Progress"&&b(je(A.userId,A.zeniSessionId)),null):x!=="In-Progress"&&x!=="Not-Started"||T==="Completed"?(ne===!0||K&&!ee)&&Je&&Ke!==!0&&m===!1&&Q===!1&&oe===!1?(l(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!P||oe!==!0||ne!==!0||ee||K?!P||ne!==!1||ee||K?P&&n?.userRole&&m!=null&&Q!=null&&o!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ws,{children:e.jsxs(s,{element:e.jsx(tn,{}),children:[e.jsx(s,{path:"/",element:e.jsx(Hn,{isDashboardAccess:k,showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,isTenantCardsOnly:Q,showChargeCardRoute:u})}),e.jsx(s,{path:"dashboard/*",element:k?e.jsx(In,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reports/*",element:k?e.jsx(mn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"people/*",element:is||k?e.jsx(_n,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"forecast/*",element:k?e.jsx(pn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"onboarding/*",element:e.jsx(xn,{})}),e.jsx(s,{path:"transaction/*",element:k&&v===!1||Ye||qe?e.jsx(gn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"transactions/*",element:k&&v===!1?e.jsx(bn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"customer/*",element:k&&v===!1?e.jsx(be,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,isTenantBankingOnly:m,showTreasuryRoute:I,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"vendor/*",element:k&&v===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"tasks",element:e.jsx(On,{})}),e.jsx(s,{path:"tasks/*",element:e.jsx(kn,{})}),e.jsx(s,{path:"address/*",element:Xe||ue||ss||es?e.jsx(hn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"checking/*",element:e.jsx(p,{isAllowed:g,fallback:e.jsx(R,{}),children:e.jsx(Tn,{})})}),e.jsx(s,{path:"treasury/*",element:e.jsx(p,{isAllowed:I,fallback:e.jsx(R,{}),children:e.jsx(fn,{})})}),e.jsx(s,{path:"performance",element:e.jsx(p,{isAllowed:J,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(Cn,{})})}),e.jsx(s,{path:"month_end_close_checks/review/*",element:e.jsx(p,{isAllowed:J&&!v,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(Dn,{})})}),e.jsx(s,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(p,{isAllowed:J&&!v&&$e,fallback:e.jsx(R,{}),children:e.jsx(vn,{})})}),e.jsx(s,{path:"notifications/*",element:e.jsx(wn,{})}),e.jsx(s,{path:"vendors/*",element:e.jsx(p,{isAllowed:Ve,fallback:e.jsx(R,{}),children:e.jsx(jn,{})})}),e.jsx(s,{path:"customers/*",element:e.jsx(p,{isAllowed:Ne,fallback:e.jsx(R,{}),children:e.jsx(En,{})})}),e.jsx(s,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursement/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursements/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:E,showTreasuryRoute:I,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"settings/*",element:e.jsx(p,{isAllowed:Se,fallback:e.jsx(R,{}),children:e.jsx(Rn,{hasAdminLevelAccess:ue})})}),e.jsx(s,{path:"invoicing/*",element:e.jsx(p,{isAllowed:Be&&Le,fallback:e.jsx(R,{}),children:e.jsx(An,{})})}),e.jsx(s,{path:"cards/ask",element:e.jsx(p,{isAllowed:u&&Z,fallback:e.jsx(R,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/ask/:session_id",element:e.jsx(p,{isAllowed:u&&Z,fallback:e.jsx(R,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/*",element:e.jsx(p,{isAllowed:u,fallback:e.jsx(R,{}),children:e.jsx(yn,{})})}),e.jsx(s,{path:"rewards/*",element:e.jsx(p,{isAllowed:Ge,fallback:e.jsx(R,{}),children:e.jsx(Un,{})})}),e.jsx(s,{path:"/ai-cfo",element:e.jsx(p,{isAllowed:Z,fallback:e.jsx(R,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/",element:e.jsx(p,{isAllowed:Z,fallback:e.jsx(R,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/:session_id",element:e.jsx(p,{isAllowed:Z,fallback:e.jsx(R,{}),children:e.jsx(Fn,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"*",element:e.jsx(R,{})})]})}):null:(l(void 0),e.jsx(d,{to:`/${o}/onboarding`,replace:!0})):(l(void 0),e.jsx(d,{to:`/${o}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),l(void 0),e.jsx(d,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const Pn=5e3,Hn=({isDashboardAccess:l,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:o,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:W,showChargeCardRoute:H})=>{if(O===!0){if(b)return e.jsx(d,{to:"checking"});if(V)return e.jsx(d,{to:"treasury"});if(H)return e.jsx(d,{to:"cards"})}return W===!0&&H?e.jsx(d,{to:"cards"}):l?e.jsx(d,{to:"dashboard"}):b?e.jsx(d,{to:"checking"}):V?e.jsx(d,{to:"treasury"}):H?e.jsx(d,{to:"cards"}):N?e.jsx(d,{to:"bills"}):o?e.jsx(d,{to:"reimbursements"}):e.jsx(d,{to:"dashboard"})},p=({children:l,fallback:b,isAllowed:N})=>{const o=rn();return N?l:o?e.jsx(ln,{fetchState:"In-Progress"}):b},De=({tenantEmailDomain:l})=>e.jsx(d,{to:`/${l}/dashboard`});export{na as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8e.js";import{h as Y,g as Z,u as _,i as O,j as C,l as K,n as Q,o as k}from"./core-BBlQ3ArL.js";import{fI as w,Y6 as Pe,Oj as ve,Xi as we,Y7 as Ae,c7 as W,cK as De,cL as Ue,bp as _e,ef as Re,GB as Te,Y8 as Me,PM as Be,Na as Ne,N1 as de,M_ as Ve,GF as ue,N4 as pe,N7 as ge,Nd as X,CJ as ee,GE as Fe,lF as $,lI as me,Y9 as Ye,mS as Oe,GW as Le,Ya as Ge,Yb as $e,lD as Ze,Yc as Ke,lG as He,uV as qe,Yd as ze,Ye as Qe,uZ as Je,i4 as We,Vl as z,hY as ae,hV as Xe,i1 as en,Vm as nn,GT as tn,Yf as an,Yg as on,Nr as sn,ma as rn,ep as fe,eq as he,Yh as ln,gF as cn,V$ as dn,GS as oe,gK as se,gJ as un,GR as pn,gI as gn,gH as mn,Yi as fn,UT as Ce,Yj as hn,Yk as Cn,Yl as bn,Ym as Sn,Yn as yn,Yo as In,GZ as xn,Yp as En,GQ as ie,GK as G,Yq as kn,Yr as jn,Ys as re,Yt as Pn,dF as vn,Yu as wn,Yv as An,Yw as Dn,V3 as Un,dN as _n,dU as Rn,dT as Tn,dO as Mn,Yx as Bn,dR as Nn,dQ as Vn,dS as Fn,dP as Yn}from"./zeni-epic-state-aUBx6G2Q.js";import{b0 as On,z as v,V as L,a8 as ne,b7 as Ln,d as H,p as te,N as V,i as be,L as Se,b8 as Gn,m as $n,_ as ye,b9 as Zn,az as Kn,ba as Hn,bb as qn,aC as zn,bc as Qn,q as Jn,j as Ie,bd as Wn}from"./index-ClwW47Zs.js";import{n as B}from"./mui--aGBnNu2.js";import{u as xe}from"./useTaskManagerAccess-DrmpkeUw.js";import{U as Xn}from"./AccountMappingScreen-4Zeu95kU.js";import{t as et,A as nt}from"./AddressScreen-Czlolp2X.js";import F from"./NotFoundScreen-CTik05r2.js";import{g as tt}from"./analyticsHelper-DkNc3mKz.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-je1np7-9.js";import{C as st}from"./CompanyPassportScreen-Db20J8Yl.js";import{M as T}from"./MobileAppDrawer-Bql3K6nh.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-B6j7j1rG.js";import{q as le}from"./QBOConnectionScreen-BEn_CddB.js";import{B as lt}from"./BillPayApprovalRoutes-B4dh4WxY.js";import{R as ct}from"./ReimbursementApprovalRoutes-CSZJghRB.js";import"./recharts-CkREU3LH.js";import"./analytics-D051O7ML.js";import"./plaid-7P9b69CP.js";import"./dnd-CU3yeazS.js";import"./stripe-cKAAJElX.js";import"./lottie-Du4lbH8J.js";import"./lexical-DVH-xgq1.js";import"./pdf-CrvsvvW3.js";import"./utils-Ctp9Zfhk.js";import"./accountMappingHelper-CHQgwqfy.js";import"./routePaths-D0jOibXk.js";import"./InboxNotificationsProvider-DiTDJFwP.js";import"./empty-BiAWzWBi.js";import"./pdf-lib-Cvsvldn7.js";import"./index--CQENyaz.js";import"./url-nN4BnP9N.js";import"./index-ae04Qn4V.js";import"./decodeURIComponentSafe-YbpxzvKa.js";import"./useEnsureVendorListLoaded-COBYTL2U.js";import"./ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="1bddfe8d-0f71-48e6-9f64-d6854e667199",e._sentryDebugIdIdentifier="sentry-dbid-1bddfe8d-0f71-48e6-9f64-d6854e667199")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-XOqCw7q2.js";import{a as d}from"./sentry-CNIAdl-1.js";import{h as Y,g as $,u as _,i as F,j as C,l as Z,n as J,o as k}from"./core-BVdj_noT.js";import{fJ as w,Yh as je,Ot as ve,Xt as we,Yi as Ae,c8 as Q,cM as De,cN as Ue,bp as _e,eg as Te,GL as Re,Yj as Me,PW as Be,Nk as Ne,Nb as de,N8 as Ve,GP as ue,Ne as pe,Nh as ge,Nn as X,CT as ee,GO as Oe,lG as H,lJ as me,Yk as Ye,mT as Fe,H4 as Le,Yl as Ge,Ym as He,lE as $e,Yn as Ze,lH as Ke,v3 as qe,Yo as ze,Yp as Je,v7 as We,i5 as Qe,Vw as z,hZ as ae,hW as Xe,i2 as en,Vx as nn,H1 as tn,Yq as an,Yr as on,NB as sn,mb as rn,eq as fe,er as he,Ys as ln,gG as cn,Wa as dn,H0 as oe,gL as se,gK as un,G$ as pn,gJ as gn,gI as mn,Yt as fn,V2 as Ce,Yu as hn,Yv as Cn,Yw as bn,Yx as yn,Yy as Sn,Yz as In,H7 as xn,YA as En,G_ as ie,GU as G,YB as kn,YC as Pn,YD as re,YE as jn,dG as vn,YF as wn,YG as An,YH as Dn,Ve as Un,dO as _n,dV as Tn,dU as Rn,dP as Mn,YI as Bn,dS as Nn,dR as Vn,dT as On,dQ as Yn}from"./zeni-epic-state-BSu6fdxh.js";import{b0 as Fn,z as v,V as L,a8 as ne,b7 as Ln,c as K,p as te,_ as V,i as be,K as ye,b8 as Gn,o as Hn,W as Se,b9 as $n,az as Zn,ba as Kn,bb as qn,aC as zn,bc as Jn,s as Wn,k as Ie,bd as Qn}from"./index-Dme9CBSK.js";import{n as B}from"./mui-BZ0jnpww.js";import{u as xe}from"./useTaskManagerAccess-Z6bIfXqO.js";import{U as Xn}from"./AccountMappingScreen-BpJDQCQx.js";import{t as et,A as nt}from"./AddressScreen-Dh4KOVQ1.js";import O from"./NotFoundScreen-BDU6ccX1.js";import{g as tt}from"./analyticsHelper-CKG9W7dC.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-CeIfGxLQ.js";import{C as st}from"./CompanyPassportScreen-BieP2EZa.js";import{M as R}from"./MobileAppDrawer-BLYS912H.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-BJWnx3gQ.js";import{q as le}from"./QBOConnectionScreen-DyZaNX6V.js";import{B as lt}from"./BillPayApprovalRoutes-D1JvUYMQ.js";import{R as ct}from"./ReimbursementApprovalRoutes-CPfPh7_I.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.js";import"./accountMappingHelper-8C9JQylV.js";import"./routePaths-TIOEKAr9.js";import"./InboxNotificationsProvider-DvvXiK-n.js";import"./useIsCustomersTabEnabled-DZ7jecHx.js";import"./empty-C5tm1JkN.js";import"./pdf-lib-BIDHf6ZS.js";import"./index-Ch4hjMoy.js";import"./url-uObfQ0XR.js";import"./index-BtE2ozWs.js";import"./decodeURIComponentSafe-JMSvQveN.js";import"./useEnsureVendorListLoaded-U686iOkV.js";import"./ReimbursementApprovalRuleDetailScreen-DrgxKZH7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="1197c102-8227-46d8-ae1a-a942649ce08d",e._sentryDebugIdIdentifier="sentry-dbid-1197c102-8227-46d8-ae1a-a942649ce08d")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=On(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return y?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=Z((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(Q(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=Y(),l=$(),o=_(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:y,isLoading:m}=Fn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const S=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,y)))}),[t,u,m,y,c?.tenantId,o]);const E=g=>{n(g)};return S?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:S.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),y=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&_e(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=be(m,t,s),D=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=A=>{u(A)};return y||P||E||D?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:y,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(F,{})},ht=B.div`
17
+ `,mt=Z((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=Y(),l=$(),o=_(),{tenantEmailDomain:i}=F(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,y]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),S=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&_e(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,T=be(m,t,s),D=Te(m,r?.loggedInUserRoleMap)&&T,{isCardsHidden:I}=ye(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(y(!0),o(Re(!1)))}),[h,o,p]);const M=A=>{u(A)};return S||j||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:S,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(O,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ye(e,o),{uiState:t}=n,s=(W(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(He(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(Ze(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Oe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Zn),bt=()=>{const e=Y(),l=Z(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),y=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&y==="Completed"&&o($())}),[p,y]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=K((function(e){const l=Qe(e,J);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,z("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,z(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(We(t,z("payments"),s))},onNotifyMe:s=>{H.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(Hn),yt=()=>{const e=Kn(),l=Y(),o=_(),{tenantEmailDomain:i}=O(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=L(),m=W(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(qe(J))}),[o]);const[p,y]=d.useState(!1);d.useEffect((()=>{p||(y(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>ze(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:D,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=Z((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ye(e,o),{uiState:t}=n,s=(Q(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Se.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Ke(n))},updateCardPaymentModalState:n=>{e(Ze({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e($e(n,t,s))},handleFetchPaymentSources:()=>{e(H())},resetCardPaymentViewState:()=>{e(He())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Fe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))($n),bt=()=>{const e=Y(),l=$(),o=_(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>w(P))),y=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Hn(y.addCardPaymentSourceStatus.fetchState),S=y.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Oe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o(H()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&S==="Completed"&&o(H())}),[p,S]);const j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},W="external_integrations",yt=Z((function(e){const l=Je(e,W);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,z("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,z(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Qe(t,z("payments"),s))},onNotifyMe:s=>{K.trackIntegrationsNotifyMeClicked("Settings",s),e(We(W,s,r))}}}))(Kn),St=()=>{const e=Zn(),l=Y(),o=_(),{tenantEmailDomain:i}=F(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),y=L(),m=Q(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(qe(W))}),[o]);const[p,S]=d.useState(!1);d.useEffect((()=>{p||(S(!0),o(H()))}),[p,o]);const E=I=>{t(I)},g=C((I=>ze(I,u))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:T,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return y?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(yt,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:P,onAddPlaidAccount:T,onReLoginPlaidAccount:D,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=_(),{tenantEmailDomain:l}=O(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(qn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=_(),{tenantEmailDomain:l}=F(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),y=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(qn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:y,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=_(),o=Y(),i=Z(),[r,n]=d.useState(!1),t=C((b=>w(b))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",y=C((b=>rn(b))),E=fe(t),g=he(m,t),P=!g&&y,j=be(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),D=!j||R,{areTenantIdsInSync:I}=zn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((b=>cn(b,P))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=b=>{n(b)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:y,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:b=>{const N=(function(ke,je){let q=`/${ke}/settings/my_profile`;return q=q.concat(`/new/${je}`),q})(s,b),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:b=>{const N={...x.myProfileLocalData,phone:b};l(oe({localData:N})),l(mn(b,"MyProfile"))},onResendOtp:b=>{l(gn(b,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(b,N)=>{l(un(b,N,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&v.saveZeniOtpToken(b),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{l(oe({localData:b}))}})]})};function jt(){const e=_(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>bn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),y=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(yn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,b)=>{e(jn({eventId:f,channel:re(U),enabled:b}))}),[e]),I=d.useCallback(((f,U)=>{e(Pn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,b)=>{e(wn({groupId:f,channel:re(U),enabled:b}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:y}),a.jsx(Wn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{y(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function ua(e){const[l,o]=d.useState(!1),i=C((y=>Ce(y))),r=C((y=>w(y))),n=L(),t=Ie(),s=_(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?_n(r)?a.jsxs(Q,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(bt,{})}),Yn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(yt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function Pt(e){return a.jsxs(Q,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{ua as default};
49
+ `,ce=({appContent:e})=>{const l=_(),o=Y(),i=$(),[r,n]=d.useState(!1),t=C((b=>w(b))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=C((b=>rn(b))),E=fe(t),g=he(m,t),j=!g&&S,P=be(t,y,m),{isCardsHidden:T}=ye(t?.tenantId),D=!P||T,{areTenantIdsInSync:I}=zn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((b=>cn(b,j))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=b=>{n(b)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:S,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:b=>{const N=(function(ke,Pe){let q=`/${ke}/settings/my_profile`;return q=q.concat(`/new/${Pe}`),q})(s,b),Ee=Wn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:b=>{const N={...x.myProfileLocalData,phone:b};l(oe({localData:N})),l(mn(b,"MyProfile"))},onResendOtp:b=>{l(gn(b,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(b,N)=>{l(un(b,N,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&v.saveZeniOtpToken(b),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{l(oe({localData:b}))}})]})};function Pt(){const e=_(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>bn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:y}=xe(u),[m,p]=d.useState(!1),S=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(yn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(Sn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),T=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,b)=>{e(Pn({eventId:f,channel:re(U),enabled:b}))}),[e]),I=d.useCallback(((f,U)=>{e(jn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,b)=>{e(wn({groupId:f,channel:re(U),enabled:b}))}),[e]),M=d.useMemo((()=>{if(y&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[y,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:S}),a.jsx(Qn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{S(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:T,taskNotifications:M,isTaskNotificationsDirty:c})]})}function pa(e){const[l,o]=d.useState(!1),i=C((S=>Ce(S))),r=C((S=>w(S))),n=L(),t=Ie(),s=_(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),y=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||y!==!0?_n(r)?a.jsxs(J,{children:[Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(bt,{})}),Yn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(St,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),y&&a.jsx(k,{path:"notifications",element:a.jsx(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function jt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{pa as default};