@zeniai/web-app-ui 5.4.13-qa → 5.4.14-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 (178) hide show
  1. package/dist/assets/{AccountMappingScreen-CkSG8Ep-.js → AccountMappingScreen-BZk8jrAP.js} +2 -2
  2. package/dist/assets/ActualMatchingMatchDetailScreen-DdqC6TYo.js +1 -0
  3. package/dist/assets/AddressRoutes-DZnn8xs0.js +1 -0
  4. package/dist/assets/AddressScreen-DpzckL13.js +9 -0
  5. package/dist/assets/AiCfoScreen-BuC0DF7-.js +22 -0
  6. package/dist/assets/{AppDrawer-CyEwqluX.js → AppDrawer-BnkAekbe.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-BANLfai6.js → BillPayApprovalRoutes-2Q-AgKCr.js} +1 -1
  8. package/dist/assets/BillPayRoutes-CV19o_tt.js +119 -0
  9. package/dist/assets/BusinessVerificationPageScreen-NPjj2cPM.js +9 -0
  10. package/dist/assets/CardsAiCfoScreen-CadRu1yE.js +14 -0
  11. package/dist/assets/ChargeCardRoutes-BRNnHx29.js +71 -0
  12. package/dist/assets/CompanyPassportScreen-d_xThxF-.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-B-GQ_uXR.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-Dv-djr6z.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-KQwdDIjg.js +30 -0
  16. package/dist/assets/{DashboardRoutes-BVcbPKcq.js → DashboardRoutes-VCRBM_Lo.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-BPVy5EXN.js → DefaultTenantHome-Bnjp4uin.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-FhF-Oy51.js +18 -0
  19. package/dist/assets/DrawerScreen-DOVfIfbY.js +1 -0
  20. package/dist/assets/EntityDetailRoutes-BKu8bIme.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-D4ZdAmsG.js → ExpenseAutomationRoutes-C-dPVJak.js} +6 -6
  22. package/dist/assets/FallBackRoute-BsefzYi4.js +2 -0
  23. package/dist/assets/FeaturePreviewScreen-CEvvSUOY.js +1 -0
  24. package/dist/assets/HubSpotOAuthCallbackScreen-BRLjqcM8.js +1 -0
  25. package/dist/assets/{InboxNotificationsProvider-CN_Nayn3.js → InboxNotificationsProvider-CPjcPE2w.js} +1 -1
  26. package/dist/assets/InvoicingRoutes-Cn0ho2Ac.js +3 -0
  27. package/dist/assets/MagicLinkRoutes-DETheAv8.js +72 -0
  28. package/dist/assets/MagicLinkSignInScreen-hwNEJu9D.js +12 -0
  29. package/dist/assets/MobileAppDrawer-YElMwyTk.js +1 -0
  30. package/dist/assets/NotFoundScreen-DD1ftXbM.js +1 -0
  31. package/dist/assets/NotificationRoutes-j31qfFA3.js +1 -0
  32. package/dist/assets/OAuthConsentScreen-CQV1J_Nj.js +1 -0
  33. package/dist/assets/PandLWithForecastRoutes-CUitXoy8.js +1 -0
  34. package/dist/assets/{PaymentLinkScreen-Dy4CaKOq.js → PaymentLinkScreen-B77tcNGP.js} +5 -5
  35. package/dist/assets/PeopleRoutes-BbZuMgKW.js +22 -0
  36. package/dist/assets/PerformanceRoutes-D6iGCdx1.js +1 -0
  37. package/dist/assets/{Preview-Dct-47t1.js → Preview-DyDyLMFa.js} +1 -1
  38. package/dist/assets/{QBOConnectionScreen-BSELy8om.js → QBOConnectionScreen-DdhMvyre.js} +2 -2
  39. package/dist/assets/ReimbursementApprovalRoutes-lGHZV1sd.js +1 -0
  40. package/dist/assets/ReimbursementApprovalRuleDetailScreen-CtdOG2XT.js +1 -0
  41. package/dist/assets/ReimbursementRoutes-DjGiFO3h.js +68 -0
  42. package/dist/assets/ReportsRoutes-DNhWXb3T.js +1 -0
  43. package/dist/assets/RewardsRoutes-C0czxWPN.js +1 -0
  44. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-CkM33AZC.js +33 -0
  45. package/dist/assets/ScreenRoutes-DYGYxgwA.js +2 -0
  46. package/dist/assets/SettingsRoutes-DRSU5I7g.js +49 -0
  47. package/dist/assets/{SetupPagesScreen-C8-cu-gz.js → SetupPagesScreen-CfUfKDWM.js} +5 -5
  48. package/dist/assets/SignInScreen-DDQ1e38Q.js +1 -0
  49. package/dist/assets/SignOutScreen-CmYRhks4.js +9 -0
  50. package/dist/assets/TaskListScreen-D8jqZbNF.js +9 -0
  51. package/dist/assets/TaskRoutes-Cu7kReic.js +9 -0
  52. package/dist/assets/TransactionDetailRoutes-B7AzD4hg.js +1 -0
  53. package/dist/assets/TransactionDetailScreen-CpvJY1a3.js +5 -0
  54. package/dist/assets/TransactionListRoutes-BejbKDzL.js +1 -0
  55. package/dist/assets/TreasuryRoutes-DTax48Tc.js +37 -0
  56. package/dist/assets/{VendorsRoutes-BGLmnXCm.js → VendorsRoutes-DWNg-EPe.js} +20 -20
  57. package/dist/assets/WiseConfirmationScreen-C4KbEpAc.js +12 -0
  58. package/dist/assets/{ZeniAccountRoutes-Jpu6XeAb.js → ZeniAccountRoutes-BI00gqox.js} +11 -11
  59. package/dist/assets/ZeniAccountStatementScreen-BUg2sDXI.js +9 -0
  60. package/dist/assets/{accountMappingHelper-B5UoHtgR.js → accountMappingHelper-DPBaxZAX.js} +1 -1
  61. package/dist/assets/{analytics-Z0CPk0ny.js → analytics-D_VVN36A.js} +4 -4
  62. package/dist/assets/analyticsHelper-DcUdLdtd.js +1 -0
  63. package/dist/assets/{core-dsz2rYYM.js → core-Cc1CwF93.js} +1 -1
  64. package/dist/assets/{decodeURIComponentSafe-CSk02ORz.js → decodeURIComponentSafe-BhSMetwg.js} +1 -1
  65. package/dist/assets/{dnd-DUr07-Ux.js → dnd-AdUHoEcy.js} +1 -1
  66. package/dist/assets/{empty-C51ijV-4.js → empty-DhAh77JM.js} +1 -1
  67. package/dist/assets/{empty-C5ZeMLbg.js → empty-PD8ivveW.js} +1 -1
  68. package/dist/assets/{emptyVideoElement-vRcxF7l0.js → emptyVideoElement-BKPO_tn0.js} +1 -1
  69. package/dist/assets/epic-BJGEeb_3.js +2 -0
  70. package/dist/assets/expenseAutomationHelper-CCv2kRkH.js +1 -0
  71. package/dist/assets/getLocaleForTenant-CSUvt8Gt.js +1 -0
  72. package/dist/assets/{index-Chsq-x0k.js → index-BJ8vYoNR.js} +1 -1
  73. package/dist/assets/{index-pZFStg0J.js → index-BJg1S6MG.js} +2 -2
  74. package/dist/assets/{index-v1HbN3Vn.js → index-Bp8ijVbG.js} +1 -1
  75. package/dist/assets/{index-D-oQ1G_Y.js → index-Cxx08j41.js} +1 -1
  76. package/dist/assets/{index-CdtUo6YO.js → index-cHP9lO1h.js} +1 -1
  77. package/dist/assets/index-foi_vl2g.js +1 -0
  78. package/dist/assets/{index-BDr2vvtW.js → index-zhmkax0y.js} +1 -1
  79. package/dist/assets/{index-IKxgSEd_.js → index-zmOdoQIt.js} +14592 -14592
  80. package/dist/assets/{lexical-CIwM6M58.js → lexical-BRekJTpF.js} +1 -1
  81. package/dist/assets/{liveblocks-CZc5L51d.js → liveblocks-CM1vcHN_.js} +15 -15
  82. package/dist/assets/{lottie-BVVk98_s.js → lottie-BXg_FLck.js} +1 -1
  83. package/dist/assets/{mui-B4jiDQLi.js → mui-ehyt9jca.js} +2 -2
  84. package/dist/assets/{pathToGoBack-6GfLMQvu.js → pathToGoBack-jAeSfAQ9.js} +1 -1
  85. package/dist/assets/{pdf-DxscePpK.js → pdf-CHwZP-Er.js} +3 -3
  86. package/dist/assets/{pdf-lib-D9FuW6zp.js → pdf-lib-kwPPw7gn.js} +1 -1
  87. package/dist/assets/{plaid-BZ2eZHEz.js → plaid-WRjvFkFp.js} +1 -1
  88. package/dist/assets/{pusher-D9ZQflyT.js → pusher-C0WLqP6E.js} +1 -1
  89. package/dist/assets/{react-DqRRQREa.js → react-Bw2LIZU7.js} +1 -1
  90. package/dist/assets/{react-D2r4p5ak.js → react-CQgMB5FX.js} +1 -1
  91. package/dist/assets/{react-DJbBVOg0.js → react-CvCXtyEQ.js} +1 -1
  92. package/dist/assets/{react-D-Xv26tg.js → react-L2WtUuXe.js} +1 -1
  93. package/dist/assets/{react-DG7dIJZE.js → react-ZP71p6P6.js} +1 -1
  94. package/dist/assets/{react-BTqBihXq.js → react-miDI-z35.js} +1 -1
  95. package/dist/assets/{recharts-DT0PG5Sg.js → recharts-tLFME7sM.js} +1 -1
  96. package/dist/assets/{reportTimeframe-x_rei4m2.js → reportTimeframe-DX5pHUc_.js} +1 -1
  97. package/dist/assets/routePaths-RxstHRDw.js +1 -0
  98. package/dist/assets/{sentry-DTqVP-xp.js → sentry-Bh68thgn.js} +2 -2
  99. package/dist/assets/stripSplatSuffix-B0jus2nC.js +1 -0
  100. package/dist/assets/{url-RPCyKKBm.js → url-BTt3PKLo.js} +1 -1
  101. package/dist/assets/{url-Djmp7VBQ.js → url-DqRIAQ9M.js} +4 -4
  102. package/dist/assets/useActualMatchingMatchDetail-Dr6cKA7B.js +1 -0
  103. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CC8PIy8S.js +1 -0
  104. package/dist/assets/useAskAiCfoHostNavButtonProps-Bl76c5H-.js +1 -0
  105. package/dist/assets/useChargeCardPusherEvents-C6oeFa4_.js +1 -0
  106. package/dist/assets/{useDeviceId-BsOyZPFI.js → useDeviceId-B4dK-Ywm.js} +1 -1
  107. package/dist/assets/useEmailConnectResultRefresh-nv6tTKw5.js +1 -0
  108. package/dist/assets/useEnsureVendorListLoaded-zh5PaZPv.js +1 -0
  109. package/dist/assets/useInitialThreadRequest-DqCJRXyQ.js +1 -0
  110. package/dist/assets/useTaskManagerAccess-DhT542co.js +1 -0
  111. package/dist/assets/useTaskManagerPusherEvents-B9F1i19u.js +1 -0
  112. package/dist/assets/{utils-HDiOd5Q5.js → utils-CjDqL2uk.js} +2 -2
  113. package/dist/assets/withTransactionSidePanel-BaaDGWl5.js +25 -0
  114. package/dist/assets/{zeni-epic-state-whakGK9S.js → zeni-epic-state-DFhlE0W3.js} +7 -7
  115. package/dist/index.html +1 -1
  116. package/package.json +4 -4
  117. package/dist/assets/ActualMatchingMatchDetailScreen-CuuYVm1X.js +0 -1
  118. package/dist/assets/AddressRoutes-DAS2zzFd.js +0 -1
  119. package/dist/assets/AddressScreen-DSYx-aPt.js +0 -9
  120. package/dist/assets/AiCfoScreen-DJ4Wxixf.js +0 -22
  121. package/dist/assets/BillPayRoutes-BaFZZ0UE.js +0 -119
  122. package/dist/assets/BusinessVerificationPageScreen-B0cYenwh.js +0 -9
  123. package/dist/assets/CardsAiCfoScreen-C7bXATlM.js +0 -14
  124. package/dist/assets/ChargeCardRoutes-D-YYwHTn.js +0 -71
  125. package/dist/assets/CompanyPassportScreen-SbQRG5qR.js +0 -1
  126. package/dist/assets/ConnectionAuthScreen-DIduMgeS.js +0 -11
  127. package/dist/assets/CustomerOnboardingAuthScreen-DYHT-ozZ.js +0 -1
  128. package/dist/assets/CustomerOnboardingRoutes-jxqgxgwc.js +0 -30
  129. package/dist/assets/DomesticWireDetailScreen-DFLaoZZM.js +0 -18
  130. package/dist/assets/DrawerScreen-B7f5yjke.js +0 -1
  131. package/dist/assets/EntityDetailRoutes-DYABP7YK.js +0 -1
  132. package/dist/assets/FeaturePreviewScreen-sXy9E7Xr.js +0 -1
  133. package/dist/assets/HubSpotOAuthCallbackScreen-_pswbY8M.js +0 -1
  134. package/dist/assets/InvoicingRoutes-Dmnsgude.js +0 -3
  135. package/dist/assets/MagicLinkRoutes-CQH_KruH.js +0 -72
  136. package/dist/assets/MagicLinkSignInScreen-Co2FI6bG.js +0 -12
  137. package/dist/assets/MobileAppDrawer-D7h7gfJy.js +0 -1
  138. package/dist/assets/NotFoundScreen-CH2up1dK.js +0 -1
  139. package/dist/assets/NotificationRoutes-d0m0wZZh.js +0 -1
  140. package/dist/assets/OAuthConsentScreen-MoUetOwJ.js +0 -1
  141. package/dist/assets/PandLWithForecastRoutes-CLLdd2WR.js +0 -1
  142. package/dist/assets/PeopleRoutes-DrQHEQsP.js +0 -22
  143. package/dist/assets/PerformanceRoutes-CtIWBX2N.js +0 -1
  144. package/dist/assets/ReimbursementApprovalRoutes-CN8A_G5B.js +0 -1
  145. package/dist/assets/ReimbursementApprovalRuleDetailScreen-WU-Enuz8.js +0 -1
  146. package/dist/assets/ReimbursementRoutes-CtK13yJY.js +0 -68
  147. package/dist/assets/ReportsRoutes-DHjyHJeG.js +0 -1
  148. package/dist/assets/RewardsRoutes-1muDuH0P.js +0 -1
  149. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DHUcRGf6.js +0 -33
  150. package/dist/assets/ScreenRoutes-D99QVmmV.js +0 -2
  151. package/dist/assets/SettingsRoutes-Bq74y9S2.js +0 -49
  152. package/dist/assets/SignInScreen-CjUFPAmG.js +0 -1
  153. package/dist/assets/SignOutScreen-CwR9lXkx.js +0 -9
  154. package/dist/assets/TaskListScreen-CR2IWafh.js +0 -9
  155. package/dist/assets/TaskRoutes-WWpLR_QQ.js +0 -9
  156. package/dist/assets/TransactionDetailRoutes-BS82LbfE.js +0 -1
  157. package/dist/assets/TransactionDetailScreen-Bfwzupjg.js +0 -5
  158. package/dist/assets/TransactionListRoutes-5Giuxbw8.js +0 -1
  159. package/dist/assets/TreasuryRoutes-JWIf1bCw.js +0 -37
  160. package/dist/assets/WiseConfirmationScreen-aJL16k5l.js +0 -12
  161. package/dist/assets/ZeniAccountStatementScreen-D_pEe2Yw.js +0 -9
  162. package/dist/assets/analyticsHelper-DLd3XwIi.js +0 -1
  163. package/dist/assets/epic-tAJl3VgA.js +0 -2
  164. package/dist/assets/expenseAutomationHelper-DTwGLh9B.js +0 -1
  165. package/dist/assets/getLocaleForTenant-CIfc3XRi.js +0 -1
  166. package/dist/assets/index-BU66OVKF.js +0 -1
  167. package/dist/assets/routePaths-CXv9CF1b.js +0 -1
  168. package/dist/assets/stripSplatSuffix-pYLlsQ19.js +0 -1
  169. package/dist/assets/useActualMatchingMatchDetail-OdOnyf1C.js +0 -1
  170. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-q4LbR9Bm.js +0 -1
  171. package/dist/assets/useAskAiCfoHostNavButtonProps-CoZVLpal.js +0 -1
  172. package/dist/assets/useChargeCardPusherEvents-CDlrpYqX.js +0 -1
  173. package/dist/assets/useEmailConnectResultRefresh-B_r1-i8d.js +0 -1
  174. package/dist/assets/useEnsureVendorListLoaded-CHJK5JQg.js +0 -1
  175. package/dist/assets/useInitialThreadRequest-Cqn0xB6-.js +0 -1
  176. package/dist/assets/useTaskManagerAccess-6pX4FrD3.js +0 -1
  177. package/dist/assets/useTaskManagerPusherEvents-Cxa8ppmv.js +0 -1
  178. package/dist/assets/withTransactionSidePanel-46yL6X6U.js +0 -25
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-CZc5L51d.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-DTqVP-xp.js";import{L as ge,c1 as xc,fI as kc,UK as Tc,VB as jl,ca as xl}from"./zeni-epic-state-whakGK9S.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-HDiOd5Q5.js";import{r as cn}from"./empty-C51ijV-4.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-D9FuW6zp.js";import{a as Ye,r as Fl}from"./index-Chsq-x0k.js";import{r as Ul}from"./index-BU66OVKF.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-dsz2rYYM.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,E as Kl}from"./index-IKxgSEd_.js";import"./mui-B4jiDQLi.js";import{d as It}from"./decodeURIComponentSafe-CSk02ORz.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]="d145d988-d5f0-4c0c-af29-b51c5b17cc84",e._sentryDebugIdIdentifier="sentry-dbid-d145d988-d5f0-4c0c-af29-b51c5b17cc84")}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-CM1vcHN_.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-Bh68thgn.js";import{L as ge,d$ as xc,fI as kc,UP as Tc,a1h as jl,c7 as xl}from"./zeni-epic-state-DFhlE0W3.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-CjDqL2uk.js";import{r as cn}from"./empty-DhAh77JM.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-kwPPw7gn.js";import{r as Ye,a as Fl}from"./index-BJ8vYoNR.js";import{r as Ul}from"./index-foi_vl2g.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-Cc1CwF93.js";import{d4 as Zl,_ as Hl,u as Vl,z as Rc,c as Yl,d5 as Wl,O as Kl}from"./index-zmOdoQIt.js";import"./mui-ehyt9jca.js";import{d as It}from"./decodeURIComponentSafe-BhSMetwg.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]="e6b8b1ac-9966-48fc-9ff6-9d9adaac0894",e._sentryDebugIdIdentifier="sentry-dbid-e6b8b1ac-9966-48fc-9ff6-9d9adaac0894")}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
 
@@ -97,4 +97,4 @@ Found: ${h.toString().split(`
97
97
  `+ge.from(z,"hex").toString("base64").match(/.{1,64}/g).join(`
98
98
  `)+`
99
99
  -----END RSA PUBLIC KEY-----
100
- `}})()(a,d)},m.prototype.getTokenRequest=function(a){const d=new u({token:this.token});return new Promise((v=>{v(this.loadResponse(a))})).then((v=>{if(d.processResponse(v),!d.valid())throw new Error("Response has an Error");return d})).catch((v=>{throw v.authResponse||(v=this.createError(v,d)),v}))},m.prototype.validateToken=function(){if(!this.token.refreshToken())throw new Error("The Refresh token is missing");if(!this.token.isRefreshTokenValid())throw new Error("The Refresh token is invalid, please Authorize again.")},m.prototype.loadResponse=function(a){return g.get(a).then((d=>d))},m.prototype.loadResponseFromJWKsURI=function(a){return g.get(a).then((d=>d))},m.prototype.createError=function(a,d){return d&&d.body!==""?(a.authResponse=d,a.originalMessage=a.message,a.error="","error"in d.getJson()?a.error=d.getJson().error:d.response.statusText?a.error=d.response.statusText:a.message&&(a.error=a.message),a.error_description="","error_description"in d.getJson()?a.error_description=d.getJson().error_description:d.response.statusText&&(a.error_description=d.response.statusText),a.intuit_tid=d.headers().intuit_tid,a):(a.error=d&&d.response.statusText||a.message||"",a.authResponse=d||"",a.intuit_tid=d&&d.headers()&&d.headers().intuit_tid||"",a.originalMessage=a.message||"",a.error_description=d&&d.response.statusText||"",a)},m.prototype.isAccessTokenValid=function(){return this.token.isAccessTokenValid()},m.prototype.getToken=function(){return this.token},m.prototype.setToken=function(a){return this.token=new b(a),this.token},m.prototype.authHeader=function(){const a=`${this.clientId}:${this.clientSecret}`;return typeof btoa=="function"?btoa(a):ge.from(a).toString("base64")},m.prototype.log=function(a,d,v){this.logging&&this.logger.log(a,d+v)},Sc=m})();const rt=Sl(dp),El=(()=>{let e,o,h=!1;return{isInitiated:h,init:(n,c)=>{o=new rt({clientId:Wl.quickbooksKey,clientSecret:"",environment:Yl,redirectUri:window.location.origin+n}),e=o.authorizeUri({state:c,scope:[rt.scopes.Accounting,rt.scopes.OpenId,rt.scopes.Email,rt.scopes.Profile,"project-management.project"]}),h=!0},handleClick:()=>{window.open(e,"_self","noopener")}}})(),mp=zl((function(e){const o=kc(e),h=o?.companyName??"",n=Tc(e).tenantsInOrder.length>1,c=xl(o?.userRole??[]),p=o.externalConnections?.saveConnectionState;return{companyName:h,isGoBackAllowed:n,isAdmin:c,saveConnectionState:p}}),(function(e,o){const{tenantsInOrder:h,navigate:n,currentTenant:c}=o;return{handleOnConnectClick:()=>{El.handleClick()},handleGoBack:()=>{const p=h[0].tenantEmailDomain!==c.tenantEmailDomain?h[0]:h[1];Kl({dispatch:e,navigate:n,pathToNavigate:`/${p.tenantEmailDomain}`,selectedTenant:p,signedInUser:Rc.getSignedInUser()})}}}))(Vl);function yp(e){const o=xc(e,!0).query,h=o.code,n=o.realmId,c=o.state;return{code:h!=null?It(h):"",realmId:n!=null?It(n):"",state:c!=null?It(c):""}}function Rp(){const e=Bl(),o=ql(),h=Gl(),{code:n,realmId:c,state:p}=yp(o.search),{setLoading:y,clearAllLoading:g}=Zl(),s=_n((b=>kc(b))),r=_n((b=>Tc(b).tenantsInOrder)),t=s.externalConnections?.accounting[0],i=t?.connectionType,l=t?.connectionName,u=t?.connectionId??"",f=Rc.getSignedInUser()?.userId??"";return Ol.useEffect((()=>{gp(n,c,p,u,f)===!0&&s.externalConnections?.saveConnectionState!=="In-Progress"?(y(Hl.CONNECTION_AUTH),h(jl(s.tenantId,{connection_type:i??"accounting",connection_name:l??"quickbooks_online",authorization_code:n,realm_id:c,connection_id:u,user_id:f},xc(window.location.origin+"/connection/auth"),s.companyId)),e(o.pathname)):(g(),El.init("/connection/auth",s.tenantEmailDomain))}),[n,c,p,u,f,s.tenantId,s.companyId,s.externalConnections?.saveConnectionState,o.pathname]),_l.jsx(mp,{navigate:e,tenantsInOrder:r,currentTenant:s})}const gp=(e,o,h,n,c)=>e!=""&&o!=""&&h!=""&&n!=null&&n!=""&&c!=null&&c!="";export{Rp as Q,yp as g,gp as h,El as q};
100
+ `}})()(a,d)},m.prototype.getTokenRequest=function(a){const d=new u({token:this.token});return new Promise((v=>{v(this.loadResponse(a))})).then((v=>{if(d.processResponse(v),!d.valid())throw new Error("Response has an Error");return d})).catch((v=>{throw v.authResponse||(v=this.createError(v,d)),v}))},m.prototype.validateToken=function(){if(!this.token.refreshToken())throw new Error("The Refresh token is missing");if(!this.token.isRefreshTokenValid())throw new Error("The Refresh token is invalid, please Authorize again.")},m.prototype.loadResponse=function(a){return g.get(a).then((d=>d))},m.prototype.loadResponseFromJWKsURI=function(a){return g.get(a).then((d=>d))},m.prototype.createError=function(a,d){return d&&d.body!==""?(a.authResponse=d,a.originalMessage=a.message,a.error="","error"in d.getJson()?a.error=d.getJson().error:d.response.statusText?a.error=d.response.statusText:a.message&&(a.error=a.message),a.error_description="","error_description"in d.getJson()?a.error_description=d.getJson().error_description:d.response.statusText&&(a.error_description=d.response.statusText),a.intuit_tid=d.headers().intuit_tid,a):(a.error=d&&d.response.statusText||a.message||"",a.authResponse=d||"",a.intuit_tid=d&&d.headers()&&d.headers().intuit_tid||"",a.originalMessage=a.message||"",a.error_description=d&&d.response.statusText||"",a)},m.prototype.isAccessTokenValid=function(){return this.token.isAccessTokenValid()},m.prototype.getToken=function(){return this.token},m.prototype.setToken=function(a){return this.token=new b(a),this.token},m.prototype.authHeader=function(){const a=`${this.clientId}:${this.clientSecret}`;return typeof btoa=="function"?btoa(a):ge.from(a).toString("base64")},m.prototype.log=function(a,d,v){this.logging&&this.logger.log(a,d+v)},Sc=m})();const rt=Sl(dp),El=(()=>{let e,o,h=!1;return{isInitiated:h,init:(n,c)=>{o=new rt({clientId:Hl.quickbooksKey,clientSecret:"",environment:Zl,redirectUri:window.location.origin+n}),e=o.authorizeUri({state:c,scope:[rt.scopes.Accounting,rt.scopes.OpenId,rt.scopes.Email,rt.scopes.Profile,"project-management.project"]}),h=!0},handleClick:()=>{window.open(e,"_self","noopener")}}})(),mp=zl((function(e){const o=kc(e),h=o?.companyName??"",n=Tc(e).tenantsInOrder.length>1,c=xl(o?.userRole??[]),p=o.externalConnections?.saveConnectionState;return{companyName:h,isGoBackAllowed:n,isAdmin:c,saveConnectionState:p}}),(function(e,o){const{tenantsInOrder:h,navigate:n,currentTenant:c}=o;return{handleOnConnectClick:()=>{El.handleClick()},handleGoBack:()=>{const p=h[0].tenantEmailDomain!==c.tenantEmailDomain?h[0]:h[1];Kl({dispatch:e,navigate:n,pathToNavigate:`/${p.tenantEmailDomain}`,selectedTenant:p,signedInUser:Rc.getSignedInUser()})}}}))(Wl);function yp(e){const o=xc(e,!0).query,h=o.code,n=o.realmId,c=o.state;return{code:h!=null?It(h):"",realmId:n!=null?It(n):"",state:c!=null?It(c):""}}function Rp(){const e=Bl(),o=ql(),h=Gl(),{code:n,realmId:c,state:p}=yp(o.search),{setLoading:y,clearAllLoading:g}=Vl(),s=_n((b=>kc(b))),r=_n((b=>Tc(b).tenantsInOrder)),t=s.externalConnections?.accounting[0],i=t?.connectionType,l=t?.connectionName,u=t?.connectionId??"",f=Rc.getSignedInUser()?.userId??"";return Ol.useEffect((()=>{gp(n,c,p,u,f)===!0&&s.externalConnections?.saveConnectionState!=="In-Progress"?(y(Yl.CONNECTION_AUTH),h(jl(s.tenantId,{connection_type:i??"accounting",connection_name:l??"quickbooks_online",authorization_code:n,realm_id:c,connection_id:u,user_id:f},xc(window.location.origin+"/connection/auth"),s.companyId)),e(o.pathname)):(g(),El.init("/connection/auth",s.tenantEmailDomain))}),[n,c,p,u,f,s.tenantId,s.companyId,s.externalConnections?.saveConnectionState,o.pathname]),_l.jsx(mp,{navigate:e,tenantsInOrder:r,currentTenant:s})}const gp=(e,o,h,n,c)=>e!=""&&o!=""&&h!=""&&n!=null&&n!=""&&c!=null&&c!="";export{Rp as Q,yp as g,gp as h,El as q};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-CM1vcHN_.js";import X from"./NotFoundScreen-DD1ftXbM.js";import{a as p}from"./sentry-Bh68thgn.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as z,o as g}from"./core-Cc1CwF93.js";import{fI as E,Y7 as h,XL as w,On as L,Oj as N,Om as f,Oc as U,XN as B,Og as K,Op as Y}from"./zeni-epic-state-DFhlE0W3.js";import{z as T,w as $,bl as q,D as W,b0 as F,bm as G}from"./index-zmOdoQIt.js";import"./mui-ehyt9jca.js";import{u as H}from"./useEnsureVendorListLoaded-zh5PaZPv.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-CtdOG2XT.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]="33408bb8-619a-45c1-a774-9cabbc639915",e._sentryDebugIdIdentifier="sentry-dbid-33408bb8-619a-45c1-a774-9cabbc639915")}catch{}})();const j="reimbursement-approval-rule-update",J=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(U(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))($(q)),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)),c=u((o=>E(o))),d=u((o=>h(o))),S=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&a(L())}),[S]),p.useEffect((()=>{t||b!=="Not-Started"||e||(l(!0),a(N(!0,!1,!1,!1)))}),[t,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=O((function(e){const s=h(e),n=w(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(B(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(U(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(Y(t,!0))}}}))($(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=F(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,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),S=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));H();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(L())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(N(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||S!=="Not-Started"||e||(R(!0),a(K(!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||(c(!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(z,{children:[r.jsx(g,{path:"/",element:r.jsx(Q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(X,{})})]})}export{ue as R};
@@ -0,0 +1 @@
1
+ import{j as g}from"./liveblocks-CM1vcHN_.js";import{a as y}from"./sentry-Bh68thgn.js";import{h as x,u as _,g as C,i as V,j as R,l as k}from"./core-Cc1CwF93.js";import{XL as E,Y7 as T,Of as j,Os as B,On as A,Oo as w,YG as F,fI as Y,Om as z}from"./zeni-epic-state-DFhlE0W3.js";import{z as N,a8 as P,bn as G,D as $,b0 as K,bo as W}from"./index-zmOdoQIt.js";import{u as q}from"./mui-ehyt9jca.js";import{u as X}from"./useEnsureVendorListLoaded-zh5PaZPv.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]="7119c013-42d9-4757-a44c-0a0b2bbdf2c9",e._sentryDebugIdIdentifier="sentry-dbid-7119c013-42d9-4757-a44c-0a0b2bbdf2c9")}catch{}})();const H=k((function(e,o){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return o.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===o.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.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=(S=m.value,F(S)==null);var S;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("../")}}}))(G);function J(){const e=x(),o=_(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>E(n))),l=R((n=>T(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),o(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),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(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function se(e){return F(e)==null}const M=k((function(e,o){const t=E(e),p=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:p,allVendorIds:s,vendorNamesById:i,editingRuleId:p==="approval_update"?o.approvalRuleId:void 0,allApprovalRulesWithUser:T(e).allApprovalRules}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,L=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=L.map((O=>({type:"attribute",subType:O.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((O=>({type:"user",subType:void 0,userId:O.userId,idType:"user",isImplicitActor:!1}))));const U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="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`)}}}))(W);function ne(){const e=R((t=>Y(t))),{isApprovalRulesV3Enabled:o}=K(e?.tenantId);return o?g.jsx(Q,{}):g.jsx(J,{})}function Q(){const e=x(),o=_(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>E(n))),l=R((n=>T(n))),[a,d]=y.useState(!1);if(X(),y.useEffect((()=>{a||(d(!0),o(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),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:p,approverViewData:l,location:t},p??"new")}export{ne as R,se as i};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-CM1vcHN_.js";import{u as ae,j as A,h as Y,g as K,i as ie,N as $,l as ee,q as lt,n as mt,o as E}from"./core-Cc1CwF93.js";import{fI as Z,Oj as ct,Xm as ge,c7 as he,Np as Ue,ml as dt,NE as ce,ND as de,Xn as ut,bm as fe,gZ as Le,Xo as pt,VH as bt,ma as Ne,VJ as ke,VI as gt,kY as ht,Xd as ft,lb as St,Nd as It,CJ as yt,l3 as Rt,N_ as $e,Xp as Pe,Xq as Ce,Xr as vt,Xs as At,Xt as kt,NK as we,lh as Ct,Xu as wt,NC as xt,Nn as Et,Xv as Bt,Nm as Tt,Xw as Dt,Nu as xe,NO as jt,NN as Ft,NJ as Ut,Xx as Me,T8 as Lt,bn as Nt,Nx as $t,Og as Pt,Xy as Mt,Xz as _t,NW as Ot,NT as Ee,WJ as Xt,Nk as zt,XA as _e,OJ as Be,OR as Gt,XB as Vt,XC as J,XD as Zt,XE as Oe,XF as Wt,XG as Xe,XH as ze,O6 as ue,c$ as Ht,bK as Se,cD as Ie,eq as Ge,ep as Ve,XI as Jt,gk as qt,WW as Kt,XJ as Qt,XK as Ze,W_ as Yt,XL as en,XM as tn,XN as nn,OO as Te,ON as an,XO as sn,XP as on,XQ as rn,XR as ln,XS as mn,XT as cn,OE as dn,OI as un,bp as pn,bJ as bn,cx as gn,cl as hn,br as fn,ha as Sn,eb as In,ee as yn,ed as Rn,cw as vn}from"./zeni-epic-state-DFhlE0W3.js";import{b0 as An,k as We,a2 as He,p as oe,b as U,z as L,b1 as Je,a9 as re,e as x,aM as De,R as j,af as se,ag as kn,G as qe,b2 as Cn,v as q,al as Ke,b3 as wn,V as le,b4 as xn,aC as En,ac as Bn,a8 as ye,U as Qe,w as Tn,aP as Dn,aj as jn,az as Fn,b5 as Un,i as Ln}from"./index-zmOdoQIt.js";import{n as P,S as Nn,u as Ye}from"./mui-ehyt9jca.js";import pe from"./NotFoundScreen-DD1ftXbM.js";import{S as je}from"./SetupPagesScreen-CfUfKDWM.js";import{F as et}from"./FeaturePreviewScreen-CEvvSUOY.js";import{a as g}from"./sentry-Bh68thgn.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-Bl76c5H-.js";import{u as tt}from"./useInitialThreadRequest-DqCJRXyQ.js";import{D as $n}from"./DrawerScreen-DOVfIfbY.js";import{M as nt}from"./MobileAppDrawer-YElMwyTk.js";import{F as Pn}from"./FallBackRoute-BsefzYi4.js";import{R as Mn}from"./ReimbursementApprovalRoutes-lGHZV1sd.js";import"./recharts-tLFME7sM.js";import"./analytics-D_VVN36A.js";import"./plaid-WRjvFkFp.js";import"./dnd-AdUHoEcy.js";import"./stripe-cKAAJElX.js";import"./lottie-BXg_FLck.js";import"./lexical-BRekJTpF.js";import"./pdf-CHwZP-Er.js";import"./utils-CjDqL2uk.js";import"./BusinessVerificationPageScreen-NPjj2cPM.js";import"./routePaths-RxstHRDw.js";import"./analyticsHelper-DcUdLdtd.js";import"./InboxNotificationsProvider-CPjcPE2w.js";import"./useTaskManagerAccess-DhT542co.js";import"./useEnsureVendorListLoaded-zh5PaZPv.js";import"./ReimbursementApprovalRuleDetailScreen-CtdOG2XT.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]="b61f2bff-a5cf-4876-8eed-673a3212935c",e._sentryDebugIdIdentifier="sentry-dbid-b61f2bff-a5cf-4876-8eed-673a3212935c")}catch{}})();const at=e=>`/${e}/reimbursements`,_n=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:H,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=qe.getLocalizedStrings(),On=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:Ne(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(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ft())},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(At({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(vt({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($e(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 Fe(){const e=Y(),t=ae(),n=K(),{reimbursementId:r}=ie(),m=We(),c=He(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(U.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(U.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"}),B=K().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,R]=g.useState(!1),S=L.getSignedInUser(),w=A((b=>Z(b))),h=A((b=>ge(b,r))),N=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),F=he(w?.userRole??[]);(function(){const b=ae(),_=A((Q=>Z(Q))),O=_?.tenantId,{isApprovalRulesV3Enabled:X,isLoading:W}=An(O),z=A((Q=>Q.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,X))}),[O,W,X,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(R(!0),t(Ue(!1,I,u,r)))}));const v=A((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"||F&&h.billStatus==="rejected"||F===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx($,{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=>(_=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&_.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:H.upload,single:ne.dropReceipt.single,or:H.texts.or,multiple:ne.dropReceipt.multiple,receipts:H.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Zn,{onClick:()=>a(!1),children:s.jsx(_n,{})}),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:H.upload,single:ne.dropReceipt.single,or:H.texts.or,multiple:ne.dropReceipt.multiple,receipts:H.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:v,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Je,{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
+ `,Wn=P.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,Hn=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,_t(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:Ne(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($e(n))},cancelAndDeleteReport:a=>{a===!0?x.trackReimbursementCancelAndDeleteReimbursement(n):x.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{d.toggle()}}}))(wn);function Jn(){const e=Y(),t=ae(),n=K(),r=n.hash.substring(1),m=We(),{reimbursementId:c}=ie(),d=L.getSignedInUser(),i=A((v=>Z(v))),a=A((v=>Me(v,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"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=oe(),{isFeatureEnabled:T}=u(U.isLimitedCategoryForReimbursement),[y,B]=g.useState(!1),[D,k]=g.useState(!1),[C,R]=g.useState(!1),{isFeatureEnabled:S}=u(U.isShowDeletedReimbursementsFeatureEnabled),w=A((v=>ge(v,c??""))),h=Lt(i),N=Nt(i.userRole),F=a.fetchState;if(g.useEffect((()=>{y||c==null?y==1&&F==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t($t(c,!1,S)))}),[y,c,t,F]),g.useEffect((()=>{S&&a.remiDetails?.isDeleted===!0||i.isZeni===!0&&d?.userEmailDomain==="zeni.ai"&&h===!1?R(!1):R(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(N||a.allApprovers.find((v=>v.user.userId===d?.userId))!=null||a.remiDetails?.lastUpdatedBy===d?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,N,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(Ue(!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($,{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(Je,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:x,onLoad:v=>(M=>{c!=null&&M.trackReimbursementReimbursementDetails(c)})(v)}),s.jsx(Hn,{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:_e(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(J())},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 Kn({tenantEmailDomain:e}){const t=Y(),n=A((d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=A((d=>_e(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=Yt(),st="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:Qn,common:me}=qe.getLocalizedStrings(),Yn=Qn.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(J()),e(Oe(i))},onSubtabChange:i=>{e(J()),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(J())},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=Y(),t=ae(),n=K(),r=n.state,m=He(),[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(Oe(f)):console.log("Warning:Not a valid remiListTab");const G=Wt(r.subTab.toString());G!=null?t(Xe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(J())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:o}=a(U.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(U.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:p}=a(U.isReimbursementBulkActionEnabled),I=L.getSignedInUser(),u=A((f=>Z(f))),[T,y]=g.useState(!1),[B,D]=g.useState(!1),k=le(),C=k?.loggedInUserRole?.includes("admin")===!0,R=A((f=>ze(f,V,p))),{areTenantIdsInSync:S}=En(),w=R.fetchState,{isAiCfoAccessEnabled:h,onAskAiCfoClick:N}=Re({mobileExploreReferrer:"Reimbursement List"});if(Ke({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 F=!!u?.userRole&&Ht(u),v=Se(k?.loggedInUserRoleMap),M=Ie(k?.loggedInUserRoleMap),b=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,_=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,O=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,X=A((f=>Le(f.companyState,u.companyId))),W=X?.company.featuresActivationInfo.connectedAccountProvider,z=f=>{y(f)},{isFeatureEnabled:Q}=a(U.isDebitCardFeatureEnabled),it=Ge(Q,u),ot=Ve(u),{remisProcessed:te,remisProcessing:ve}=A((f=>Jt(f)));g.useEffect((()=>{te===ve&&c!=null&&(t(qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:Yn.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Kt(c)}]})),t(Qt()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),d(null))}),[te,ve]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(f,G,Ae)=>{f.endsWith(be)?Ae.onReimbursementApprovalRulesEventReceived?.(f):G.entity_type==="reimbursement"&&(d(G.operation_type),Ae.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(et,{}):_&&(!F||v)||M&&b?s.jsxs(s.Fragment,{children:[w==="Completed"?s.jsx(re,{analytics:x,onLoad:f=>(G=>G.trackPageLoaded(Qe.Event.reimbursementHome))(f)}):null,s.jsx(nt,{isAppContentDrawerOpen:T,handleDrawerToggle:z}),s.jsxs(ea,{windowSize:m,children:[s.jsx($n,{isOpen:i,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(J())},children:s.jsx(ia,{onClick:f=>f.stopPropagation(),children:s.jsx(Kn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:o,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:V,isAdmin:C,isEmployee:F,entity:"reimbursement",onClickMenuIcon:()=>{z(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:p,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:h,onAskAiCfoClick:N,...rt})]})]}):O&&v?s.jsx($,{to:"../setup"}):k!=null&&Ze(u,k.loggedInUserRoleMap)?s.jsx($,{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(Nn)`
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"})}}}))(Un),ra=()=>{const e=Fn(),t=Y(),n=K(),{tenantEmailDomain:r}=ie(),m=Ye(),[c,d]=g.useState(!1),i=A((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($,{to:"../../../reimbursements"}):D&&u?s.jsx($,{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(Qe.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 Ma(){const e=A((z=>Z(z))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ye(),m=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:d}=oe(),{isFeatureEnabled:i}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=d(U.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),N=D&&w,F=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&h,v=Rn(t?.loggedInUserRoleMap),M=vn(t?.loggedInUserRoleMap),b=Ie(t?.loggedInUserRoleMap),_=C&&v,{tenantEmailDomain:O}=ie(),X=K(),W=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:N,isUserHasBillPayAccess:M,isUserHasReimbursementAccess:b,showTreasuryRoute:F,isTenantBankingOnly:o,showChargeCardRoute:_,tenantEmailDomain:O??""})}),W&&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($,{to:"../promo"})}),m&&y&&s.jsx(E,{path:"*",element:s.jsx($,{to:"../setup"})})]}):X.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"new",element:s.jsx(Fe,{})}),s.jsx(E,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(E,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),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{Ma as default};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-CM1vcHN_.js";import{g as te,h as ve,u as Ve,i as Ue,j as _,l as Ze,n as xe,o as oe}from"./core-Cc1CwF93.js";import{fI as K,EM as S,W7 as ze,ma as ue,ur as he,vg as V,lR as F,l_ as D,lS as P,kV as A,kM as E,kL as Y,DP as U,vl as ye,bp as Ge,V$ as He,bm as Ne,F8 as $e,YH as qe,YI as Je,c9 as I,DI as ne,YJ as re,YK as Qe,YL as We,YM as Ke,YN as Xe,YO as ea,YP as aa,YQ as sa,YR as ta,YS as oa,YT as na,YU as ra,YV as la,YW as j,YX as Z,YY as x,YZ as z,Y_ as G,Y$ as H,Z0 as N,Z1 as $,Z2 as q,Z3 as J,ei as ca,EO as ia,EA as le,EB as ce,EU as da,EF as ie,bE as O,VN as de,d0 as pe,EG as _e,E_ as pa,Z4 as _a,Z5 as fa,Z6 as ba,Z7 as ma,Z8 as ua,Z9 as ha,Za as ya,Zb as Ca,Zc as wa,Zd as ga,eq as Ia,ep as Ra}from"./zeni-epic-state-DFhlE0W3.js";import{bp as Sa,at as Ta,bq as ja,j as Oa,a2 as ka,p as Ce,b as Q,z as we,aC as Fa,V as Da,a as Pa,ar as Aa,al as Ea,a9 as Ya,e as W,U as Ma,J as La,v as ge,br as Ba,ax as va,aj as Va}from"./index-zmOdoQIt.js";import"./mui-ehyt9jca.js";import Ua from"./NotFoundScreen-DD1ftXbM.js";import{F as Za}from"./FeaturePreviewScreen-CEvvSUOY.js";import{a as u}from"./sentry-Bh68thgn.js";import{u as xa}from"./useInitialThreadRequest-DqCJRXyQ.js";import{a as fe,c as be,b as za}from"./routePaths-RxstHRDw.js";import{t as me}from"./reportTimeframe-DX5pHUc_.js";import{M as Ga}from"./MobileAppDrawer-YElMwyTk.js";import"./recharts-tLFME7sM.js";import"./analytics-D_VVN36A.js";import"./plaid-WRjvFkFp.js";import"./dnd-AdUHoEcy.js";import"./stripe-cKAAJElX.js";import"./lottie-BXg_FLck.js";import"./lexical-BRekJTpF.js";import"./pdf-CHwZP-Er.js";import"./utils-CjDqL2uk.js";import"./InboxNotificationsProvider-CPjcPE2w.js";import"./useTaskManagerAccess-DhT542co.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]="178739df-11c8-4f22-9b6b-1cefcb7d25ee",e._sentryDebugIdIdentifier="sentry-dbid-178739df-11c8-4f22-9b6b-1cefcb7d25ee")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(J({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(Z({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(wa()),e(ga())},$a=Ze((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=K(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(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:W,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=O(a),i=O(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(U());break;case"balance_sheet":e(Y(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(Y(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(E());break;case"balance_sheet_by_projects":e(Y(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(A());break;case"cash_flow":e(F(r,!0,a,s));break;case"cash_flow_by_classes":e(F(r,!0,a,s)),o.isAccountingClassesEnabled&&e(P());break;case"cash_flow_by_projects":e(F(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(D())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(R(a)||I(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=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(J({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({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(Z({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(J({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({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(Z({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=R(t),r=I(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",k(t)),e(j(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e(Xe({classesToFilterOut:a})):R(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):R(o.selectedReportID)?e(We({projectsToFilterOut:a})):e(Ke({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?E():ne()),o.isAccountingProjectsEnabled&&e(s?D():a?A():U())},onUpdateDisplayOrder:a=>{e(Je(a))},onUpdateReportFormat:a=>{Na(e),e(qe(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"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):D(!0):P(!0):A(!0):E(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=ka(),m=va(b),a=ve(),s=Ve(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(Q.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(Q.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Ie]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>K(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=xa(L?.companyId),w=_((l=>S(l).fetchState)),je=_((l=>ze(l))),{areTenantIdsInSync:y}=Fa(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),ke=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(V(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(V(c.userId,!1,!0,!1)),Ie(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(Y(C.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":g&&s(A());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(D());break;case"cash_flow":s(F(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Da(),Fe=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:Ye}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ye),Be=u.useMemo((()=>se?Ha:void 0),[se]);ja({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Ea({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Ya,{analytics:W,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ga,{isAppContentDrawerOpen:De,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:ke,selectedReportID:B,analytics:W,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:Fe,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:je.reportsResyncFetchState,isAiCfoAccessEnabled:Ee&&Ae&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(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 k=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 ys(){const e=_((s=>K(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(Q.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(Za,{}):f.jsxs(xe,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-CM1vcHN_.js";import{z as b,a9 as N,e as u,U as S,eb as k,p as I,b as C}from"./index-zmOdoQIt.js";import"./mui-ehyt9jca.js";import g from"./NotFoundScreen-DD1ftXbM.js";import{a as c}from"./sentry-Bh68thgn.js";import{u as D,j as h,h as F,g as L,l as U,n as T,o as d,N as y}from"./core-Cc1CwF93.js";import{fI as _,a3i as j,a3j as p,Er as P,qd as V,a3k as q,Ep as z}from"./zeni-epic-state-DFhlE0W3.js";import"./recharts-tLFME7sM.js";import"./analytics-D_VVN36A.js";import"./plaid-WRjvFkFp.js";import"./dnd-AdUHoEcy.js";import"./stripe-cKAAJElX.js";import"./lottie-BXg_FLck.js";import"./lexical-BRekJTpF.js";import"./pdf-CHwZP-Er.js";import"./utils-CjDqL2uk.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]="9df8bb75-97d3-4215-8667-048167c217c1",e._sentryDebugIdIdentifier="sentry-dbid-9df8bb75-97d3-4215-8667-048167c217c1")}catch{}})();const G=U((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(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),R=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(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(G,{navigate:l,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{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(R,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -0,0 +1,33 @@
1
+ import{j as E}from"./liveblocks-CM1vcHN_.js";import{a as v}from"./sentry-Bh68thgn.js";import{i as M,u as Q,h as W,g as ee,j as r,l as te}from"./core-Cc1CwF93.js";import{_C as Ge,_S as Ve,ma as ae,sL as Fe,sX as Me,tb as $e,t9 as Re,tc as Ke,te as Ue,a0C as Ye,fI as K,$G as pe,a0D as Se,h2 as ne,cs as se,ct as le,FS as ve,a0E as Ce,FW as ze,gS as ce,sO as He,tn as qe,dn as Ze,dm as Xe,T$ as fe,FQ as Qe,FK as We,VH as De,FC as et,FB as tt,Fw as at,FH as nt,FX as st,VJ as Y,VI as ge,FD as lt,$H as oe,Gb as Ae,G4 as Ie,a0F as xe,sR as Te,F_ as Be,FY as Le,a0G as Je,Gi as we,Gf as be,F$ as je,Gh as _e}from"./zeni-epic-state-DFhlE0W3.js";import{a5 as de,cG as ie,cH as ct,z as ot,s as dt,a8 as it,a9 as ue,e as N,aj as ut,cI as rt,v as V,G as ye,k as Ee,cJ as ht,cK as mt,cL as pt}from"./index-zmOdoQIt.js";import{n as re}from"./mui-ehyt9jca.js";import{p as St}from"./pathToGoBack-jAeSfAQ9.js";import{a as ft}from"./useActualMatchingMatchDetail-Dr6cKA7B.js";import X from"./NotFoundScreen-DD1ftXbM.js";import{t as F}from"./routePaths-RxstHRDw.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]="836ba8da-366f-4913-9ac6-8f1cac2d6fa7",e._sentryDebugIdIdentifier="sentry-dbid-836ba8da-366f-4913-9ac6-8f1cac2d6fa7")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=Q(),i=W(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Ge(u,l??""))),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((()=>{l!=null&&d==null&&h.fetchState==="Not-Started"&&n(Fe(l))}),[l,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(X,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(X,{}):E.jsx(Dt,{children:E.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(l,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n(Re(l,u,f))},onSkip:(u,f)=>{n($e(l,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),s=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:s??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:s}=t;return{onTransactionSelect(l){e(Ce({selectedTransaction:l}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(ze()),c("..",{relative:"path"})},onTransactionClick:l=>{const n=`${F(l,t.tenantEmailDomain)}`,i=V(s.state?.pathnameStackToGoBack,s.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Yt=({setShouldNavigateBack:e})=>{const t=W(),c=ee(),{scheduleDetailId:s,tenantEmailDomain:l}=M(),{scheduleType:n}=M();if(l==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(s==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 E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&h!=null?E.jsxs(E.Fragment,{children:[C===!0?E.jsx(ue,{analytics:N,onLoad:()=>{Et(o,a,A)}}):null,E.jsx(yt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:l,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:N,controllerUserDetails:A,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[h]})]}):null})},Ne=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}},Et=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=e.selectedJELinkRowIndex;let n;l!=null&&s!=null&&(n=s.scheduledJournalEntry[l]);const{transactions:i}=e.linkBillExpenseView,a=i.some((h=>h.isRecommendedTransaction===!0)),d=se(c.controllers),o=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Ne(s)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:s.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function ke({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:s}){const l=Q(),{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(s);return h.current=s,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 Ze.includes(y)})(m)?(o.current=!0,a.current="ignore",void l(He(t,c,m,C))):void 0;e!=null&&(function(y){return Xe.includes(y)})(m)&&(o.current=!0,a.current="revert",l(qe(e,t,c,m,C)))}}),[l,e,t,c]),scheduleDecisionStatus:d}}const kt=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,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.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(l,n))},onDelete:n=>{e(lt(l,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(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${F(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.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:l,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:l}))}}}))(ht),zt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=v.useState(!1),d=e??i,o=t??a,h=W(),A=ee(),m=Q(),C=Ee(),{tenantEmailDomain:y}=M(),[S,I]=v.useState(!1);if(y==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:u}=M(),f=s??u;let D;f!=="new"&&(D=f);const J=vt(f),B=r((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),w="accrued_expenses",k=r((L=>Se(L,"accrued_expenses"))),b=r((L=>fe(L))),j=r((L=>L.classListState.fetchState)),x=r((L=>ae(L))),_=b!=="Completed"||j!=="Completed";v.useEffect((()=>{S===!1&&_?(m(Qe(w,D)),I(!0)):_===!1&&S===!1&&f!=="new"&&(m(We(w,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:H,scheduleDecisionStatus:q}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:w,onDecided:()=>{if(l==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 l()}}),G=k.fetchState,$=k.allAccountList,Z=k.allClassList,g=k.allAccruedAccountList,p=k.scheduleAccruedDetailsLocalData;if(J!==!0||k.fetchState==="Error")return E.jsx(X,{});const R=G==="Completed"&&S===!0,Oe=k.selectedJEAccruedSchedule!=null;return G==="Completed"||G==="Not-Started"||c===!0&&Oe?E.jsxs(kt,{children:[R===!0?E.jsx(ue,{analytics:N,onLoad:()=>{At(k,w,T)}}):null,E.jsx(Ct,{onScheduleDecision:U?H:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:A,navigate:h,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:g,scheduleLocalData:p,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:y,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},vt=e=>e!=null,At=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,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:s,vendorSearchAutoCompleteData:l,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(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(we(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${F(d,t.tenantEmailDomain)}`,h=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:h,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${F(d,t.tenantEmailDomain)}`,h=V(s.state?.pathnameStackToGoBack,s.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=l.entityAutoCompleteView.vendor.length>0?l.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},w=m.selectedOption!=null?t.classList.find((T=>T.classId===m.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,b=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}}))),_=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,P=f.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:w?.classId,selectedAccumulatedDepreciationCategory:b?.accountId,selectedDate:u,selectedMonths:j,assetId:S,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||b?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&w?.classId==null||u==null||j==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),Ht=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=W(),n=ee(),i=Q(),a=Ee(),{tenantEmailDomain:d}=M(),[o,h]=v.useState(!1),{scheduleDetailId:A}=M(),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"||l("../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)),w=r((g=>ae(g))),k=r((g=>ce(g).selectedPeriod)),b=J!=="Completed"||B!=="Completed";v.useEffect((()=>{o===!1&&b?(i(Ae(I,G,!0)),h(!0)):b===!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}=k;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else l("../schedules/fixed_assets")}),[u.markAsCompleteStatus.fetchState]);const j=r((g=>K(g))),x=r((g=>ne(g,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:u.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:u.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:I,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:g,year:p}=k;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else c()}}),O=u.fetchState,z=u.allAccountList,U=u.allClassList,H=u.allDepreciationAccountList,q=u.scheduleDetailsLocalData.fixed_assets;let G;if(m!=="new"&&(G=m),y!==!0||u.fetchState==="Error")return E.jsx(X,{});const $=O==="Completed"&&o===!0,Z=u.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?E.jsxs(It,{children:[$===!0?E.jsx(ue,{analytics:N,onLoad:()=>{Lt(u,I,x)}}):null,E.jsx(xt,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{i(Te(g,p))},accountList:z,depAccountList:H,scheduleLocalData:q,selectedJEScheduleKey:S,scheduleDetailId:G,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:w,status:u.selectedJEScheduleTransaction?.status.code})]}):E.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 s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Bt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{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:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.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,wt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,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(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(we(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${F(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${F(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.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=l.entityAutoCompleteView.vendor.length>0?l.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,w=h.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),k=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,b=S.type==="lastDayOfMonth"||void 0,j={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:y,selectedMonths:B,jeScheduleDetails:w,lastDayOfMonth:b,selectedVendor:f,selectedDayOfMonth:k};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||b!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),qt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=W(),i=ee(),a=Q(),d=Ee(),{tenantEmailDomain:o}=M(),[h,A]=v.useState(!1),m=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:y}=M(),S=t??y,I=bt(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"))),w=r((p=>fe(p))),k=r((p=>p.classListState.fetchState)),b=r((p=>ae(p))),j=r((p=>ce(p).selectedPeriod)),x=w!=="Completed"||k!=="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:R}=j;n(`../../month_end_close_checks/review/je_schedules/${p}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=r((p=>K(p))),P=r((p=>ne(p,_.companyId))),T=e||m,{onScheduleDecision:O,scheduleDecisionStatus:z}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:f,onDecided:()=>{if(s==null)if(m!==!0)n("../schedules/prepaid_expenses");else{const{month:p,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${p}-${R}`)}else s()}}),U=D.fetchState,H=D.allAccountList,q=D.allClassList,G=D.scheduleDetailsLocalData;let $;if(S!=="new"&&($=S),I!==!0||D.fetchState==="Error")return E.jsx(X,{});const Z=U==="Completed"&&h===!0,g=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&g?E.jsxs(Jt,{children:[Z===!0?E.jsx(ue,{analytics:N,onLoad:()=>{_t(D,f,P)}}):null,E.jsx(wt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:z,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:m,removeJeScheduleTransactionKey:(p,R)=>{a(Te(p,R))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:H,scheduleLocalData:G[f],selectedJEScheduleKey:u,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:f,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:b,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},bt=(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}),_t=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...jt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{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:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Ut as J,qt as S,Ht 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-DNhWXb3T.js","assets/sentry-Bh68thgn.js","assets/core-Cc1CwF93.js","assets/zeni-epic-state-DFhlE0W3.js","assets/index-zmOdoQIt.js","assets/mui-ehyt9jca.js","assets/analytics-D_VVN36A.js","assets/utils-CjDqL2uk.js","assets/NotFoundScreen-DD1ftXbM.js","assets/FeaturePreviewScreen-CEvvSUOY.js","assets/useInitialThreadRequest-DqCJRXyQ.js","assets/routePaths-RxstHRDw.js","assets/reportTimeframe-DX5pHUc_.js","assets/MobileAppDrawer-YElMwyTk.js","assets/InboxNotificationsProvider-CPjcPE2w.js","assets/useTaskManagerAccess-DhT542co.js","assets/index-BQ3cXEYt.css","assets/AddressRoutes-DZnn8xs0.js","assets/AddressScreen-DpzckL13.js","assets/PeopleRoutes-BbZuMgKW.js","assets/useAskAiCfoHostNavButtonProps-Bl76c5H-.js","assets/PandLWithForecastRoutes-CUitXoy8.js","assets/CustomerOnboardingRoutes-KQwdDIjg.js","assets/QBOConnectionScreen-DdhMvyre.js","assets/empty-DhAh77JM.js","assets/index-BJ8vYoNR.js","assets/url-DqRIAQ9M.js","assets/index-foi_vl2g.js","assets/decodeURIComponentSafe-BhSMetwg.js","assets/useEmailConnectResultRefresh-nv6tTKw5.js","assets/useChargeCardPusherEvents-C6oeFa4_.js","assets/VendorsRoutes-DWNg-EPe.js","assets/ScheduleDetailsPrepaidExpensesScreen-CkM33AZC.js","assets/pathToGoBack-jAeSfAQ9.js","assets/useActualMatchingMatchDetail-Dr6cKA7B.js","assets/stripSplatSuffix-B0jus2nC.js","assets/DrawerScreen-DOVfIfbY.js","assets/accountMappingHelper-DPBaxZAX.js","assets/TransactionDetailRoutes-B7AzD4hg.js","assets/useEnsureVendorListLoaded-zh5PaZPv.js","assets/TransactionDetailScreen-CpvJY1a3.js","assets/expenseAutomationHelper-CCv2kRkH.js","assets/EntityDetailRoutes-BKu8bIme.js","assets/withTransactionSidePanel-BaaDGWl5.js","assets/DashboardRoutes-VCRBM_Lo.js","assets/analyticsHelper-DcUdLdtd.js","assets/CompanyPassportScreen-d_xThxF-.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CC8PIy8S.js","assets/BillPayRoutes-CV19o_tt.js","assets/DomesticWireDetailScreen-FhF-Oy51.js","assets/BusinessVerificationPageScreen-NPjj2cPM.js","assets/SetupPagesScreen-CfUfKDWM.js","assets/BillPayApprovalRoutes-2Q-AgKCr.js","assets/ReimbursementApprovalRuleDetailScreen-CtdOG2XT.js","assets/FallBackRoute-BsefzYi4.js","assets/SettingsRoutes-DRSU5I7g.js","assets/AccountMappingScreen-BZk8jrAP.js","assets/ReimbursementApprovalRoutes-lGHZV1sd.js","assets/InvoicingRoutes-Cn0ho2Ac.js","assets/ReimbursementRoutes-DjGiFO3h.js","assets/ZeniAccountRoutes-BI00gqox.js","assets/ZeniAccountStatementScreen-BUg2sDXI.js","assets/TreasuryRoutes-DTax48Tc.js","assets/TransactionListRoutes-BejbKDzL.js","assets/ChargeCardRoutes-BRNnHx29.js","assets/NotificationRoutes-j31qfFA3.js","assets/PerformanceRoutes-D6iGCdx1.js","assets/ExpenseAutomationRoutes-C-dPVJak.js","assets/ActualMatchingMatchDetailScreen-DdqC6TYo.js","assets/RewardsRoutes-C0czxWPN.js","assets/TaskRoutes-Cu7kReic.js","assets/TaskListScreen-D8jqZbNF.js","assets/useTaskManagerPusherEvents-B9F1i19u.js","assets/AiCfoScreen-BuC0DF7-.js","assets/CardsAiCfoScreen-CadRu1yE.js"])))=>i.map(i=>d[i]);
2
+ import{bm as ms,fI as hs,eq as _s,ep as ps,h7 as xs,d2 as Es,c7 as gs,gM as js,gc as Is,eg as xe,cx as Rs,gq as As,cp as Ts,bE as bs,bv as fs,h8 as ys,v as ws,h9 as Cs,bp as Ds,ha as vs,bK as Us,bJ as ks,br as Fs,cl as Os,hb as Ps,hc as Hs,eb as Ss,ee as Bs,ed as Ls,cw as Ns,cD as Vs,hd as Ee,gl as ge,h0 as Ms,gn as je,gO as Ie,gP as Re,go as Zs,_ as r}from"./zeni-epic-state-DFhlE0W3.js";import{j as e}from"./liveblocks-CM1vcHN_.js";import{a as U}from"./sentry-Bh68thgn.js";import{u as zs,h as Gs,i as $s,g as Ys,j as z,q as Ae,N as d,n as qs,o as s}from"./core-Cc1CwF93.js";import{u as Ws,z as T,p as Js,a as Ks,f as Qs,b as L,i as Xs,L as en,V as sn,c as F,G as Te,t as c,d as nn,P as an,e as ae,r as tn,l as i,B as on,Z as rn}from"./index-zmOdoQIt.js";import{u as ln}from"./mui-ehyt9jca.js";import{f as be}from"./analyticsHelper-DcUdLdtd.js";import{t as dn}from"./getLocaleForTenant-CSUvt8Gt.js";import{F as C}from"./FallBackRoute-BsefzYi4.js";import"./recharts-tLFME7sM.js";import"./analytics-D_VVN36A.js";import"./plaid-WRjvFkFp.js";import"./dnd-AdUHoEcy.js";import"./stripe-cKAAJElX.js";import"./lottie-BXg_FLck.js";import"./lexical-BRekJTpF.js";import"./pdf-CHwZP-Er.js";import"./utils-CjDqL2uk.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new l.Error().stack;f&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[f]="bbe10438-4c0a-430c-85b9-b62f497c7093",l._sentryDebugIdIdentifier="sentry-dbid-bbe10438-4c0a-430c-85b9-b62f497c7093")}catch{}})();const cn=i((()=>r((()=>import("./ReportsRoutes-DNhWXb3T.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])))),un=i((()=>r((()=>import("./AddressRoutes-DZnn8xs0.js")),__vite__mapDeps([17,1,2,3,18,4,5,6,7,8,16])))),mn=i((()=>r((()=>import("./PeopleRoutes-BbZuMgKW.js")),__vite__mapDeps([19,1,2,3,4,5,6,7,8,20,13,14,15,16])))),hn=i((()=>r((()=>import("./PandLWithForecastRoutes-CUitXoy8.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,20,10,11,13,14,15,16])))),_n=i((()=>r((()=>import("./CustomerOnboardingRoutes-KQwdDIjg.js")),__vite__mapDeps([22,1,2,3,18,4,5,6,7,8,23,24,25,26,27,28,29,30,16])))),pn=i((()=>r((()=>import("./VendorsRoutes-DWNg-EPe.js")),__vite__mapDeps([31,1,2,3,4,5,6,7,18,8,9,32,33,34,35,28,11,20,13,14,15,36,37,16])))),xn=i((()=>r((()=>import("./TransactionDetailRoutes-B7AzD4hg.js")),__vite__mapDeps([38,1,2,3,8,4,5,6,7,28,39,40,20,10,11,41,16])))),fe=i((()=>r((()=>import("./EntityDetailRoutes-BKu8bIme.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,28,43,20,40,10,11,41,35,16])))),En=i((()=>r((()=>import("./DashboardRoutes-VCRBM_Lo.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,43,20,40,28,10,11,41,35,8,12,45,46,13,14,15,47,9,16])))),ye=i((()=>r((()=>import("./BillPayRoutes-CV19o_tt.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,18,8,49,20,10,50,11,13,14,15,36,9,51,45,52,39,53,54,16])))),gn=i((()=>r((()=>import("./SettingsRoutes-DRSU5I7g.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,15,56,13,14,23,24,25,26,27,28,37,18,8,45,50,11,46,29,52,39,53,57,16])))),jn=i((()=>r((()=>import("./InvoicingRoutes-Cn0ho2Ac.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,18,8,13,14,15,23,24,25,26,27,28,16])))),we=i((()=>r((()=>import("./ReimbursementRoutes-DjGiFO3h.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,9,20,10,36,54,57,39,53,16])))),In=i((()=>r((()=>import("./ZeniAccountRoutes-BI00gqox.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,9,49,18,20,61,16])))),Rn=i((()=>r((()=>import("./TreasuryRoutes-DTax48Tc.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,8,51,50,11,13,14,15,45,20,10,9,16])))),An=i((()=>r((()=>import("./TransactionListRoutes-BejbKDzL.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,43,20,40,28,10,11,41,35,61,16])))),Tn=i((()=>r((()=>import("./ChargeCardRoutes-BRNnHx29.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,20,13,14,15,51,50,11,8,45,10,30,18,16])))),bn=i((()=>r((()=>import("./NotificationRoutes-j31qfFA3.js")),__vite__mapDeps([65,1,2,3,8,4,5,6,7,20,15,16])))),fn=i((()=>r((()=>import("./PerformanceRoutes-D6iGCdx1.js")),__vite__mapDeps([66,1,2,3,8,4,5,6,7,20,13,14,15,16])))),yn=i((()=>r((()=>import("./ExpenseAutomationRoutes-C-dPVJak.js")),__vite__mapDeps([67,1,2,3,8,4,5,6,7,20,40,28,10,11,41,34,35,43,32,33,37,36,16])))),wn=i((()=>r((()=>import("./ActualMatchingMatchDetailScreen-DdqC6TYo.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,34,35,28,11,8,16])))),Cn=i((()=>r((()=>import("./RewardsRoutes-C0czxWPN.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,8,16])))),Dn=i((()=>r((()=>import("./TaskRoutes-Cu7kReic.js")),__vite__mapDeps([70,1,2,3,8,4,5,6,7,10,13,14,15,71,20,72,16])))),vn=i((()=>r((()=>import("./AiCfoScreen-BuC0DF7-.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,47,33,11,72,16])))),Ce=i((()=>r((()=>import("./CardsAiCfoScreen-CadRu1yE.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,16])))),b=i((()=>r((()=>import("./NotFoundScreen-DD1ftXbM.js")),__vite__mapDeps([8,1,2,3,4,5,6,7,16])))),Un=i((()=>r((()=>import("./TaskListScreen-D8jqZbNF.js").then((l=>l.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,20,13,14,15,72,16]))));function Qn({setTenantEmailDomain:l}){const f=zs(),N=Gs(),{tenantEmailDomain:o}=$s(),V=ln().mode,{setLoading:O,clearAllLoading:W,clearLoading:H}=Ws(),y=T.getSignedInUserTenant(o)?.tenantId,R=T.getSignedInUser(),J=ms(R),G=Ys(),[P,ve]=U.useState(!1),n=z((a=>hs(a))),{useFeatureGate:S}=Js(),M=Ks(),K=Qs(),Ue=!!n.company?.companyZeniAccountInfo?.isZeniAccountEnabled,ke=n.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Fe}=S(L.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=S(L.isDebitCardFeatureEnabled),A=z((a=>a.tenantState.fetchState)),p=z((a=>a.tenantState.activeTenantFetchState.fetchState)),m=p==="Completed"||A==="Completed"?_s(te,n):void 0,Q=p==="Completed"||A==="Completed"?ps(n):void 0,oe=p==="Completed"||A==="Completed"?xs(n)&&!Es(n):void 0,Oe=Xs(n,Fe,te),{isCardsHidden:Pe}=en(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=>js(a)));if(o!=null){const a=T.getSignedInUserTenant(o);R!=null&&a!=null&&be(R,n,V)}const Z={tenantId:y,userId:R?.userId,sessionId:R?.zeniSessionId},re=Is(),h=sn(),Ne=n.company==null||h?.loggedInUserRoleMap!=null&&xe(h.loggedInUserRole),Ve=Rs(h?.loggedInUserRoleMap),ee=Ae("/:tenantEmailDomain/onboarding/*")!==null,Me=Ae("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Me?.params.selectedPeriod,Ze=z((a=>Z.tenantId!=null?As(a,Z.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=Ts(Number(a[0])),w=Number(a[1]),t=bs(`01-${D<10?`0${D}`:D}-${w}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),_=fs();t.isAfter(_,"month")===!1?f(ys(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,Z,re,R,f,T]),U.useLayoutEffect((()=>{!ws(re,Z)&&T.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t){if(ge(D?.userId,D?.zeniSessionId,a.tenantId),w(Ms(!0)),w(je(a.tenantId)),a.tenantId!=null&&c.clearTenant(a.tenantId),a.tenantId!=null){const _=T.getSignedInUserTenantWithId(a.tenantId);t&&Te.updateAppLocaleID(dn(t)),_?.tenantEmailDomain!=null&&T.saveActiveTenantDomainForUser(_?.tenantEmailDomain)}a.userId!=null?ae.identify(a.userId,{tenant_id:a.tenantId}):ae.resetUserIdentity()})(Z,R,f,Ze))}),[y]),U.useEffect((()=>{T.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,D,w,t,_,is,B){if(w==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&_?.zeniSessionId!=null,ls=w==null||w.tenantId!==t,ds=w!=null&&w.excludedResources==null,cs=w!=null&&w.externalConnections==null;if(Y&&ls){B(je(t));const q=T.getSignedInUserTenantWithId(t);q?.tenantEmailDomain!=null&&T.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(_?.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&&ds&&c.shouldFetchExcludedResources(t)&&(c.markExcludedResourcesFetchStarted(t),B(Ie(_.userId,t))),Y&&cs&&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),is(F.TENANT_FETCHING),B(Zs(_.userId,t,_.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&c.shouldFetchAllTenants()){c.markAllTenantsFetchStarted();const{userId:us,zeniSessionId:pe}=_;tn((()=>{T.getSignedInUser()?.zeniSessionId===pe?B(Ee(us,pe)):c.markAllTenantsFetchFailed()}),kn)}}})(A,p,n,y,R,O,f))}),[y,p]),U.useEffect((()=>{T.isSignedIn()&&A==="Completed"&&$.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),T.saveSignedInUserTenants(Cs($.tenantsBaseInOrder)),R!=null&&be(R,n,V,void 0,$.tenantsBaseInOrder))}),[$,A,n,R]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(performance.mark("zeni:boot_tenant_data"),W(),c.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(c.markActiveTenantFetchFailed(y),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?c.markAllTenantsFetchCompleted():A==="Error"&&c.markAllTenantsFetchFailed())}),[p,A,y,P]);const ie=U.useRef(!1);U.useEffect((()=>{!ie.current&&p==="Completed"&&P&&(ie.current=!0,nn())}),[p,P]);const v=n?.userRole!=null&&Ds(n?.userRole),{isFeatureEnabled:ze}=S(L.isReferralFeatureEnabled),{isFeatureEnabled:Ge}=S(L.isAccrualEnabled),$e=n?.userRole!=null&&n.userRole.includes("charge_card_user"),Ye=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,qe=vs(h?.loggedInUserRoleMap),We=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&&Us(h?.loggedInUserRoleMap),me=Ue&&!v,Ke=ke&&!v,Qe=le&&ks(h?.loggedInUserRoleMap),Xe=de&&Fs(h?.loggedInUserRoleMap),es=me&&Os(h?.loggedInUserRoleMap),ss=Ps(h?.loggedInUserRoleMap),ns=Hs(h?.loggedInUserRoleMap),as=Ss(h?.loggedInUserRoleMap),ts=Bs(h?.loggedInUserRoleMap),os=Ls(h?.loggedInUserRoleMap),x=Ns(h?.loggedInUserRoleMap),E=Vs(h?.loggedInUserRoleMap),he=le&&x,_e=ce&&E,g=me&&as,j=Ke&&ts,u=de&&os,rs=n.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ve===!0||qe===!0||ss===!0||ns===!0;return T.isSignedIn()?y==null?A==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(R!=null&&A!=="In-Progress"&&f(Ee(R.userId,R.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||A==="Completed"?(ne===!0||J&&!ee)&&Je&&We!==!0&&m===!1&&Q===!1&&oe===!1?(l(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!P||oe!==!0||ne!==!0||ee||J?!P||ne!==!1||ee||J?P&&n?.userRole&&m!=null&&Q!=null&&o!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(qs,{children:e.jsxs(s,{element:e.jsx(an,{}),children:[e.jsx(s,{path:"/",element:e.jsx(Fn,{isDashboardAccess:k,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,isTenantCardsOnly:Q,showChargeCardRoute:u})}),e.jsx(s,{path:"dashboard/*",element:k?e.jsx(En,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reports/*",element:k?e.jsx(cn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"people/*",element:rs||k?e.jsx(mn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"forecast/*",element:k?e.jsx(hn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"onboarding/*",element:e.jsx(_n,{})}),e.jsx(s,{path:"transaction/*",element:k&&v===!1||$e||Ye?e.jsx(xn,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"transactions/*",element:k&&v===!1?e.jsx(An,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"customer/*",element:k&&v===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,isTenantBankingOnly:m,showTreasuryRoute:j,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"vendor/*",element:k&&v===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"tasks",element:e.jsx(Un,{})}),e.jsx(s,{path:"tasks/*",element:e.jsx(Dn,{})}),e.jsx(s,{path:"address/*",element:Qe||ue||es||Xe?e.jsx(un,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"checking/*",element:e.jsx(I,{isAllowed:g,fallback:e.jsx(b,{}),children:e.jsx(In,{})})}),e.jsx(s,{path:"treasury/*",element:e.jsx(I,{isAllowed:j,fallback:e.jsx(b,{}),children:e.jsx(Rn,{})})}),e.jsx(s,{path:"performance",element:e.jsx(I,{isAllowed:K,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(fn,{})})}),e.jsx(s,{path:"month_end_close_checks/review/*",element:e.jsx(I,{isAllowed:K&&!v,fallback:e.jsx(De,{tenantEmailDomain:o}),children:e.jsx(yn,{})})}),e.jsx(s,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(I,{isAllowed:K&&!v&&Ge,fallback:e.jsx(b,{}),children:e.jsx(wn,{})})}),e.jsx(s,{path:"notifications/*",element:e.jsx(bn,{})}),e.jsx(s,{path:"vendors/*",element:e.jsx(I,{isAllowed:Ne,fallback:e.jsx(b,{}),children:e.jsx(pn,{})})}),e.jsx(s,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursement/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"reimbursements/*",element:_e?e.jsx(we,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:E,showTreasuryRoute:j,isTenantBankingOnly:m,showChargeCardRoute:u,tenantEmailDomain:o})}),e.jsx(s,{path:"settings/*",element:e.jsx(I,{isAllowed:Se,fallback:e.jsx(b,{}),children:e.jsx(gn,{hasAdminLevelAccess:ue})})}),e.jsx(s,{path:"invoicing/*",element:e.jsx(I,{isAllowed:Be&&Le,fallback:e.jsx(b,{}),children:e.jsx(jn,{})})}),e.jsx(s,{path:"cards/ask",element:e.jsx(I,{isAllowed:u&&M,fallback:e.jsx(b,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/ask/:session_id",element:e.jsx(I,{isAllowed:u&&M,fallback:e.jsx(b,{}),children:e.jsx(Ce,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"cards/*",element:e.jsx(I,{isAllowed:u,fallback:e.jsx(b,{}),children:e.jsx(Tn,{})})}),e.jsx(s,{path:"rewards/*",element:e.jsx(I,{isAllowed:ze,fallback:e.jsx(b,{}),children:e.jsx(Cn,{})})}),e.jsx(s,{path:"/ai-cfo",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(b,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(b,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(s,{path:"/ai-cfo/:session_id",element:e.jsx(I,{isAllowed:M,fallback:e.jsx(b,{}),children:e.jsx(vn,{isFileUploadEnabled:X})})}),e.jsx(s,{path:"*",element:e.jsx(b,{})})]})}):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 kn=5e3,Fn=({isDashboardAccess:l,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:o,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:W,showChargeCardRoute:H})=>{if(O===!0){if(f)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"}):f?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"})},I=({children:l,fallback:f,isAllowed:N})=>{const o=on();return N?l:o?e.jsx(rn,{fetchState:"In-Progress"}):f},De=({tenantEmailDomain:l})=>e.jsx(d,{to:`/${l}/dashboard`});export{Qn as default};
@@ -0,0 +1,49 @@
1
+ import{j as a}from"./liveblocks-CM1vcHN_.js";import{a as d}from"./sentry-Bh68thgn.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-Cc1CwF93.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-DFhlE0W3.js";import{b0 as On,z as v,V as L,a8 as ne,b7 as Ln,e as H,p as te,b as V,i as be,L as Se,b8 as Gn,s as $n,_ as ye,b9 as Zn,az as Kn,ba as Hn,bb as qn,aC as zn,bc as Qn,v as Jn,m as Ie,bd as Wn}from"./index-zmOdoQIt.js";import{n as B}from"./mui-ehyt9jca.js";import{u as xe}from"./useTaskManagerAccess-DhT542co.js";import{U as Xn}from"./AccountMappingScreen-BZk8jrAP.js";import{t as et,A as nt}from"./AddressScreen-DpzckL13.js";import F from"./NotFoundScreen-DD1ftXbM.js";import{g as tt}from"./analyticsHelper-DcUdLdtd.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-NPjj2cPM.js";import{C as st}from"./CompanyPassportScreen-d_xThxF-.js";import{M as T}from"./MobileAppDrawer-YElMwyTk.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-nv6tTKw5.js";import{q as le}from"./QBOConnectionScreen-DdhMvyre.js";import{B as lt}from"./BillPayApprovalRoutes-2Q-AgKCr.js";import{R as ct}from"./ReimbursementApprovalRoutes-lGHZV1sd.js";import"./recharts-tLFME7sM.js";import"./analytics-D_VVN36A.js";import"./plaid-WRjvFkFp.js";import"./dnd-AdUHoEcy.js";import"./stripe-cKAAJElX.js";import"./lottie-BXg_FLck.js";import"./lexical-BRekJTpF.js";import"./pdf-CHwZP-Er.js";import"./utils-CjDqL2uk.js";import"./accountMappingHelper-DPBaxZAX.js";import"./routePaths-RxstHRDw.js";import"./InboxNotificationsProvider-CPjcPE2w.js";import"./empty-DhAh77JM.js";import"./pdf-lib-kwPPw7gn.js";import"./index-BJ8vYoNR.js";import"./url-DqRIAQ9M.js";import"./index-foi_vl2g.js";import"./decodeURIComponentSafe-BhSMetwg.js";import"./useEnsureVendorListLoaded-zh5PaZPv.js";import"./ReimbursementApprovalRuleDetailScreen-CtdOG2XT.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]="91e3a4a7-8c9e-4b38-9dd4-647a2071cea6",e._sentryDebugIdIdentifier="sentry-dbid-91e3a4a7-8c9e-4b38-9dd4-647a2071cea6")}catch{}})();const dt=B.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,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`
10
+ display: flex;
11
+ height: 100%;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,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`
18
+ display: flex;
19
+ height: 100%;
20
+ width: 100%;
21
+ flex: 1 1 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,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`
26
+ display: flex;
27
+ height: 100%;
28
+ width: 100%;
29
+ flex: 1 1 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,xt=B.div`
34
+ display: flex;
35
+ height: 100%;
36
+ width: 100%;
37
+ flex: 1 1 auto;
38
+ flex-direction: column;
39
+ align-items: center;
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`
42
+ display: flex;
43
+ height: 100%;
44
+ width: 100%;
45
+ flex: 1 1 auto;
46
+ flex-direction: column;
47
+ align-items: center;
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};