@zeniai/web-app-ui 5.3.55-dev → 5.3.55-qa

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 (71) hide show
  1. package/dist/assets/{AccountMappingScreen-DdQz2lM1.js → AccountMappingScreen-BxRledTj.js} +1 -1
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-CGBN-Q-7.js → ActualMatchingMatchDetailScreen-oIbSJaIb.js} +1 -1
  3. package/dist/assets/{AddressRoutes-CynmpoQu.js → AddressRoutes-DMjDwuiI.js} +1 -1
  4. package/dist/assets/{AddressScreen-DqZYCoSs.js → AddressScreen-CwA3IRwX.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-CtsJ7cDT.js → AiCfoScreen-DMPGHIZE.js} +1 -1
  6. package/dist/assets/{AppDrawer-CKP6jrbF.js → AppDrawer-CS8wipli.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-BpoA_nrV.js → BillPayApprovalRoutes-D4kOwTBO.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-B9NE4VxB.js → BillPayRoutes-Do640K9D.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-BldrMJdh.js → BusinessVerificationPageScreen-DeXHIi3R.js} +1 -1
  10. package/dist/assets/{CardsAiCfoScreen-oYxLbDwZ.js → CardsAiCfoScreen-BpdFcHVH.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-ljOxkkUf.js → ChargeCardRoutes-DZkHgl9s.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-CamQRzbi.js → CompanyPassportScreen-DSh6Ipzn.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-BoP4m4L6.js → ConnectionAuthScreen-BlJRL8Mn.js} +1 -1
  14. package/dist/assets/{CustomerOnboardingAuthScreen-CDb5FCfJ.js → CustomerOnboardingAuthScreen-CJH4ZFnL.js} +1 -1
  15. package/dist/assets/{CustomerOnboardingRoutes-UN9_koR-.js → CustomerOnboardingRoutes-L779kJOJ.js} +1 -1
  16. package/dist/assets/{DashboardRoutes-B00G02__.js → DashboardRoutes-C3KzBz6S.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-BvquDIuf.js → DefaultTenantHome-CHg3pC8G.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BBhvylGY.js → DomesticWireDetailScreen-CWU_ak_S.js} +1 -1
  19. package/dist/assets/{DrawerScreen-2p7xfq2O.js → DrawerScreen-74QNRylU.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-CLBqzGEu.js → EntityDetailRoutes-QM4GSAIU.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-CsO9a4nX.js → ExpenseAutomationRoutes-DrJlIKSY.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-8gjXA436.js → FeaturePreviewScreen-Bu4co2D3.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-CdBNaEnB.js → HubSpotOAuthCallbackScreen-BmluxXLG.js} +1 -1
  24. package/dist/assets/{InvoicingRoutes-BXUW-5w1.js → InvoicingRoutes-CKT_RLJi.js} +1 -1
  25. package/dist/assets/{MagicLinkRoutes-BxAzMNve.js → MagicLinkRoutes-D0Ens08J.js} +1 -1
  26. package/dist/assets/{MagicLinkSignInScreen-CBQx4xWX.js → MagicLinkSignInScreen-B4KeCwE8.js} +1 -1
  27. package/dist/assets/{MobileAppDrawer-fNaMEqpG.js → MobileAppDrawer-COi151oe.js} +1 -1
  28. package/dist/assets/{NotFoundScreen-BeP62Nz9.js → NotFoundScreen-DNVEwzIN.js} +1 -1
  29. package/dist/assets/{NotificationRoutes-GCk-IahK.js → NotificationRoutes-C0PDOFur.js} +1 -1
  30. package/dist/assets/{OAuthConsentScreen-DECI8j0I.js → OAuthConsentScreen--tcnvk2-.js} +1 -1
  31. package/dist/assets/{PandLWithForecastRoutes-Ca12AKcd.js → PandLWithForecastRoutes-CAv6HnFG.js} +1 -1
  32. package/dist/assets/{PaymentLinkScreen-0thjtbfK.js → PaymentLinkScreen-C6jtcPVb.js} +1 -1
  33. package/dist/assets/{PeopleRoutes-DYtmtMXx.js → PeopleRoutes-BemO_mDq.js} +1 -1
  34. package/dist/assets/{PerformanceRoutes-DP4OW2qD.js → PerformanceRoutes-CW_WQq6a.js} +1 -1
  35. package/dist/assets/{QBOConnectionScreen-a_jxuJVg.js → QBOConnectionScreen-BAF64NHf.js} +1 -1
  36. package/dist/assets/{ReimbursementApprovalRoutes-DHL_6iez.js → ReimbursementApprovalRoutes-Bu_MlS4C.js} +1 -1
  37. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-j72H8n28.js → ReimbursementApprovalRuleDetailScreen-Basp-Q4U.js} +1 -1
  38. package/dist/assets/{ReimbursementRoutes-Cyrl2qi_.js → ReimbursementRoutes-Bq2EqHO1.js} +1 -1
  39. package/dist/assets/{ReportsRoutes-DSY4nYh6.js → ReportsRoutes-B0F6dmdv.js} +1 -1
  40. package/dist/assets/{RewardsRoutes-DvJjiZGU.js → RewardsRoutes-DxjdRAJt.js} +1 -1
  41. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-C4z4GiyE.js → ScheduleDetailsPrepaidExpensesScreen-CpX86pSz.js} +1 -1
  42. package/dist/assets/{ScreenRoutes-C7oLHktw.js → ScreenRoutes-BgOuemMY.js} +2 -2
  43. package/dist/assets/{SettingsRoutes-DfnQIw3N.js → SettingsRoutes-BkkyebXa.js} +1 -1
  44. package/dist/assets/{SetupPagesScreen-Zigm3cB1.js → SetupPagesScreen-mUtIx0g7.js} +1 -1
  45. package/dist/assets/{SignInScreen-BRoXT-HL.js → SignInScreen-BT05e68g.js} +1 -1
  46. package/dist/assets/{SignOutScreen-DkRfW28z.js → SignOutScreen-kJg_YEBZ.js} +1 -1
  47. package/dist/assets/{TaskListScreen-WGfeq9_a.js → TaskListScreen-DQiYW5NR.js} +1 -1
  48. package/dist/assets/{TaskRoutes-C5PxGl6p.js → TaskRoutes-xsPPcGb9.js} +1 -1
  49. package/dist/assets/{TransactionDetailRoutes-BBdrsyNq.js → TransactionDetailRoutes-CaFbfMkp.js} +1 -1
  50. package/dist/assets/{TransactionDetailScreen-BDWEHK1J.js → TransactionDetailScreen-qryWPLpS.js} +1 -1
  51. package/dist/assets/{TransactionListRoutes-COxnLE0l.js → TransactionListRoutes-CsLIipC1.js} +1 -1
  52. package/dist/assets/{TreasuryRoutes-DmSouKJP.js → TreasuryRoutes-SaAnpSTn.js} +1 -1
  53. package/dist/assets/{VendorsRoutes-OsvLnOdY.js → VendorsRoutes-ZsiBTL9L.js} +1 -1
  54. package/dist/assets/{WiseConfirmationScreen-taiB3VxF.js → WiseConfirmationScreen-DShAzwdG.js} +1 -1
  55. package/dist/assets/{ZeniAccountRoutes-O9BxDbbv.js → ZeniAccountRoutes-CPGcNCoa.js} +1 -1
  56. package/dist/assets/{ZeniAccountStatementScreen-DzQsPHni.js → ZeniAccountStatementScreen-j3HmxqHy.js} +1 -1
  57. package/dist/assets/{analyticsHelper-DhzoozKy.js → analyticsHelper-4iM19yWB.js} +1 -1
  58. package/dist/assets/{getLocaleForTenant-DiPOVD9Y.js → getLocaleForTenant-B789-FKJ.js} +1 -1
  59. package/dist/assets/{index-BqEaHxIT.js → index-B6grZ9sx.js} +5 -5
  60. package/dist/assets/{routePaths-C1I3AVBw.js → routePaths-hwxApcva.js} +1 -1
  61. package/dist/assets/{useActualMatchingMatchDetail-BOc11rCC.js → useActualMatchingMatchDetail-CXEQCna3.js} +1 -1
  62. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DfcdcxeV.js → useAiCfoDashboardSuggestedQuestionsChips-j_HLw6hE.js} +1 -1
  63. package/dist/assets/{useAskAiCfoHostNavButtonProps-Biynu986.js → useAskAiCfoHostNavButtonProps-DycPeMu8.js} +1 -1
  64. package/dist/assets/{useChargeCardPusherEvents-N9Kbq9gN.js → useChargeCardPusherEvents-CeGBALEu.js} +1 -1
  65. package/dist/assets/{useEmailConnectResultRefresh-BtvKv8-C.js → useEmailConnectResultRefresh-VgqVnnGo.js} +1 -1
  66. package/dist/assets/{useInitialThreadRequest-CyHRajCC.js → useInitialThreadRequest-C01HUFbF.js} +1 -1
  67. package/dist/assets/{useTaskManagerAccess-Cs4MVKyS.js → useTaskManagerAccess-vvZ5G9JM.js} +1 -1
  68. package/dist/assets/{useTaskManagerPusherEvents-BPWIyNie.js → useTaskManagerPusherEvents-A5AmC0FP.js} +1 -1
  69. package/dist/assets/{withTransactionSidePanel-Dxu14DPo.js → withTransactionSidePanel-ByOeZF9g.js} +1 -1
  70. package/dist/index.html +1 -1
  71. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-C_txwMxP.js";import E from"./NotFoundScreen-BeP62Nz9.js";import{a as r}from"./sentry-D_60LtUS.js";import{h as _,g as v,j as p,i as M,u as U,N as O,l as P,n as V,o as h}from"./core-_lmxLuL7.js";import{fF as z,a0Y as b,bo as F,bn as N,iL as B,gh as L}from"./zeni-epic-state-CtlpRqoe.js";import{V as Y,z as I,at as $,dO as q}from"./index-BqEaHxIT.js";import"./mui-DbFwPEO7.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-Biynu986.js";import{M as H}from"./MobileAppDrawer-fNaMEqpG.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./useTaskManagerAccess-Cs4MVKyS.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]="02d9ac70-fb07-46fe-9928-9212fee328f1",e._sentryDebugIdIdentifier="sentry-dbid-02d9ac70-fb07-46fe-9928-9212fee328f1")}catch{}})();const J=P((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(q),K=()=>{const e=_(),t=v(),c=Y(),o=p((a=>z(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(B({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(L({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(O,{to:`/${m}/dashboard`,replace:!0})};function he(){return s.jsxs(V,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
1
+ import{j as s}from"./liveblocks-C_txwMxP.js";import E from"./NotFoundScreen-DNVEwzIN.js";import{a as r}from"./sentry-D_60LtUS.js";import{h as _,g as v,j as p,i as M,u as U,N as O,l as P,n as V,o as h}from"./core-_lmxLuL7.js";import{fF as z,a0Y as b,bo as F,bn as N,iL as B,gh as L}from"./zeni-epic-state-CtlpRqoe.js";import{V as Y,z as I,at as $,dO as q}from"./index-B6grZ9sx.js";import"./mui-DbFwPEO7.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DycPeMu8.js";import{M as H}from"./MobileAppDrawer-COi151oe.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./useTaskManagerAccess-vvZ5G9JM.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]="02d9ac70-fb07-46fe-9928-9212fee328f1",e._sentryDebugIdIdentifier="sentry-dbid-02d9ac70-fb07-46fe-9928-9212fee328f1")}catch{}})();const J=P((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(q),K=()=>{const e=_(),t=v(),c=Y(),o=p((a=>z(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(B({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(L({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(O,{to:`/${m}/dashboard`,replace:!0})};function he(){return s.jsxs(V,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-C_txwMxP.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-D_60LtUS.js";import{L as ge,b$ as xc,fF as kc,TT as Tc,UJ as jl,c8 as xl}from"./zeni-epic-state-CtlpRqoe.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-CPbtTTqo.js";import{r as cn}from"./empty-B3p_skJy.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-B5AjOY9Z.js";import{a as Ye,r as Fl}from"./index-sGFH656b.js";import{r as Ul}from"./index-Cg11XXLq.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-_lmxLuL7.js";import{u as Zl,z as Rc,L as Hl,al as Vl,am as Yl,_ as Wl,B as Kl}from"./index-BqEaHxIT.js";import"./mui-DbFwPEO7.js";import{d as It}from"./decodeURIComponentSafe-CNj7wDd5.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]="d311d2d0-81b6-4cba-afa8-65eb276258ff",e._sentryDebugIdIdentifier="sentry-dbid-d311d2d0-81b6-4cba-afa8-65eb276258ff")}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-C_txwMxP.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-D_60LtUS.js";import{L as ge,b$ as xc,fF as kc,TT as Tc,UJ as jl,c8 as xl}from"./zeni-epic-state-CtlpRqoe.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-CPbtTTqo.js";import{r as cn}from"./empty-B3p_skJy.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-B5AjOY9Z.js";import{a as Ye,r as Fl}from"./index-sGFH656b.js";import{r as Ul}from"./index-Cg11XXLq.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-_lmxLuL7.js";import{u as Zl,z as Rc,L as Hl,al as Vl,am as Yl,_ as Wl,B as Kl}from"./index-B6grZ9sx.js";import"./mui-DbFwPEO7.js";import{d as It}from"./decodeURIComponentSafe-CNj7wDd5.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]="d311d2d0-81b6-4cba-afa8-65eb276258ff",e._sentryDebugIdIdentifier="sentry-dbid-d311d2d0-81b6-4cba-afa8-65eb276258ff")}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
 
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-C_txwMxP.js";import Z from"./NotFoundScreen-BeP62Nz9.js";import{a as p}from"./sentry-D_60LtUS.js";import{h as C,g as D,u as N,j as u,N as V,l as k,n as z,o as b}from"./core-_lmxLuL7.js";import{fF as E,Z2 as h,Zj as w,NE as U,NA as L,ND as f,Nt as B,ZI as $,Nx as F,NG as G}from"./zeni-epic-state-CtlpRqoe.js";import{z as T,w as O,cb as K,n as W,bU as q,cc as H}from"./index-BqEaHxIT.js";import"./mui-DbFwPEO7.js";import{u as J,R as x}from"./ReimbursementApprovalRuleDetailScreen-j72H8n28.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]="970f50c1-393e-4bfd-a6ea-da65feaceaa1",e._sentryDebugIdIdentifier="sentry-dbid-970f50c1-393e-4bfd-a6ea-da65feaceaa1")}catch{}})();const j="reimbursement-approval-rule-update",M=k((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($(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(O(K)),P=({isLoading:e})=>{const s=C(),n=D(),a=N(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),g=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(U())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,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(V,{to:"../../promo"}):r.jsx(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",Q=k((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($(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(G(t,!0))}}}))(O(H)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=q(e?.tenantId);return s?r.jsx(Y,{isLoading:n}):r.jsx(P,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=D(),a=N(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));J();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(F(!1,!0)))}),[v,g,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,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(V,{to:"../../promo"}):r.jsx(Q,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(z,{children:[r.jsx(b,{path:"/",element:r.jsx(X,{})}),r.jsx(b,{path:"/new",element:r.jsx(x,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(b,{path:"*",element:r.jsx(Z,{})})]})}export{le as R};
1
+ import{j as r}from"./liveblocks-C_txwMxP.js";import Z from"./NotFoundScreen-DNVEwzIN.js";import{a as p}from"./sentry-D_60LtUS.js";import{h as C,g as D,u as N,j as u,N as V,l as k,n as z,o as b}from"./core-_lmxLuL7.js";import{fF as E,Z2 as h,Zj as w,NE as U,NA as L,ND as f,Nt as B,ZI as $,Nx as F,NG as G}from"./zeni-epic-state-CtlpRqoe.js";import{z as T,w as O,cb as K,n as W,bU as q,cc as H}from"./index-B6grZ9sx.js";import"./mui-DbFwPEO7.js";import{u as J,R as x}from"./ReimbursementApprovalRuleDetailScreen-Basp-Q4U.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]="970f50c1-393e-4bfd-a6ea-da65feaceaa1",e._sentryDebugIdIdentifier="sentry-dbid-970f50c1-393e-4bfd-a6ea-da65feaceaa1")}catch{}})();const j="reimbursement-approval-rule-update",M=k((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($(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(O(K)),P=({isLoading:e})=>{const s=C(),n=D(),a=N(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),g=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(U())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,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(V,{to:"../../promo"}):r.jsx(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",Q=k((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($(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(G(t,!0))}}}))(O(H)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=q(e?.tenantId);return s?r.jsx(Y,{isLoading:n}):r.jsx(P,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=D(),a=N(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));J();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(F(!1,!0)))}),[v,g,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,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(V,{to:"../../promo"}):r.jsx(Q,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(z,{children:[r.jsx(b,{path:"/",element:r.jsx(X,{})}),r.jsx(b,{path:"/new",element:r.jsx(x,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(b,{path:"*",element:r.jsx(Z,{})})]})}export{le as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-C_txwMxP.js";import{a as m}from"./sentry-D_60LtUS.js";import{u as U,j as g,h as _,g as O,i as V,l as N}from"./core-_lmxLuL7.js";import{mr as Z,Zj as w,Z2 as x,Nw as k,NJ as j,NE as A,NF as E,Zk as B,fF as z,ND as J}from"./zeni-epic-state-CtlpRqoe.js";import{z as F,E as P,a8 as $,c2 as K,n as q,bU as W,c3 as G}from"./index-BqEaHxIT.js";import"./mui-DbFwPEO7.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]="1265aea8-8018-470f-8be2-ae931cdade42",e._sentryDebugIdIdentifier="sentry-dbid-1265aea8-8018-470f-8be2-ae931cdade42")}catch{}})();function H(){const e=U(),s=m.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));m.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Z({})))}),[p,t,e])}const M=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((f=>({type:"user",subType:void 0,userId:f.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((f=>{const y=(I=f.value,B(I)==null);var I;return{type:y?"attribute":"role",subType:f.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(b);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},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(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function Q(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=m.useState(!1);if(m.useEffect((()=>{a||(d(!0),s(k(!0)))})),m.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return B(e)==null}const X=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const f=[];return c.forEach((y=>{const I=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];I==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):I==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const C=y.action??"require_approval";f.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})})),f},n=a.amountCriteria,v=a.vendorCriteria,S=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 R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const b=S?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),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(E(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(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(J(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(G);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(Q,{})}function Y(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=m.useState(!1);if(H(),m.useEffect((()=>{a||(d(!0),s(k(!1)))})),m.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as h}from"./liveblocks-C_txwMxP.js";import{a as m}from"./sentry-D_60LtUS.js";import{u as U,j as g,h as _,g as O,i as V,l as N}from"./core-_lmxLuL7.js";import{mr as Z,Zj as w,Z2 as x,Nw as k,NJ as j,NE as A,NF as E,Zk as B,fF as z,ND as J}from"./zeni-epic-state-CtlpRqoe.js";import{z as F,E as P,a8 as $,c2 as K,n as q,bU as W,c3 as G}from"./index-B6grZ9sx.js";import"./mui-DbFwPEO7.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]="1265aea8-8018-470f-8be2-ae931cdade42",e._sentryDebugIdIdentifier="sentry-dbid-1265aea8-8018-470f-8be2-ae931cdade42")}catch{}})();function H(){const e=U(),s=m.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));m.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Z({})))}),[p,t,e])}const M=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((f=>({type:"user",subType:void 0,userId:f.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((f=>{const y=(I=f.value,B(I)==null);var I;return{type:y?"attribute":"role",subType:f.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(b);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},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(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function Q(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=m.useState(!1);if(m.useEffect((()=>{a||(d(!0),s(k(!0)))})),m.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return B(e)==null}const X=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const f=[];return c.forEach((y=>{const I=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];I==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):I==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const C=y.action??"require_approval";f.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})})),f},n=a.amountCriteria,v=a.vendorCriteria,S=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 R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const b=S?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),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(E(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(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(J(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(G);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(Q,{})}function Y(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=m.useState(!1);if(H(),m.useEffect((()=>{a||(d(!0),s(k(!1)))})),m.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C_txwMxP.js";import{u as ae,j as v,h as X,g as Q,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-_lmxLuL7.js";import{fF as V,NA as ut,_N as ge,c8 as he,MG as $e,ma as pt,MV as ce,MU as de,_O as bt,bn as fe,gV as Le,_P as gt,WN as ht,l$ as _e,WO as Ce,WP as ft,kN as St,YQ as It,l0 as yt,Mu as Rt,C9 as vt,kU as At,Nf as Me,_Q as Pe,_R as Ee,_S as kt,_T as Ct,_U as Et,M$ as we,l6 as wt,YZ as xt,MT as Bt,ME as Tt,_V as Dt,MD as jt,_W as Ft,ML as xe,N3 as Ut,N2 as $t,M_ as Lt,_X as Ne,Sd as _t,bo as Mt,MO as Pt,Nx as Nt,_Y as Ot,_Z as Zt,Nb as Gt,N8 as Be,Yk as zt,MB as Vt,__ as Oe,N_ as Te,O6 as Wt,_$ as Ht,$0 as q,$1 as Yt,$2 as Ze,$3 as qt,$4 as Ge,$5 as ze,Nn as ue,bu as Jt,bK as Se,cM as Ie,d_ as Ve,dZ as We,$6 as Qt,gh as Kt,Yx as Xt,$7 as en,$8 as He,YB as tn,Zj as nn,$9 as an,ZI as sn,O3 as De,O2 as on,$a as rn,$b as ln,$c as mn,$d as cn,$e as dn,Z3 as un,NV as pn,NZ as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,Uc as yn,da as Rn,dd as vn,dc as An,cF as kn}from"./zeni-epic-state-CtlpRqoe.js";import{bU as Cn,V as Ye,a2 as qe,c as oe,v as x,z as L,cT as Je,a9 as re,j as C,aT as je,F,af as se,ag as En,G as Qe,cU as wn,p as J,at as Ke,cV as xn,Q as le,cW as Bn,ar as Tn,ac as Dn,a8 as ye,W as Xe,w as jn,bC as Fn,aw as Un,aj as $n,E as et,cX as Ln,g as _n}from"./index-BqEaHxIT.js";import{n as P,S as Mn}from"./mui-DbFwPEO7.js";import pe from"./NotFoundScreen-BeP62Nz9.js";import{S as Fe}from"./SetupPagesScreen-Zigm3cB1.js";import{F as tt}from"./FeaturePreviewScreen-8gjXA436.js";import{a as h}from"./sentry-D_60LtUS.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-Biynu986.js";import{u as nt}from"./useInitialThreadRequest-CyHRajCC.js";import{D as Pn}from"./DrawerScreen-2p7xfq2O.js";import{M as at}from"./MobileAppDrawer-fNaMEqpG.js";import{F as Nn}from"./ScreenRoutes-C7oLHktw.js";import{R as On}from"./ReimbursementApprovalRoutes-DHL_6iez.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./BusinessVerificationPageScreen-BldrMJdh.js";import"./routePaths-C1I3AVBw.js";import"./analyticsHelper-DhzoozKy.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./useTaskManagerAccess-Cs4MVKyS.js";import"./getLocaleForTenant-DiPOVD9Y.js";import"./ReimbursementApprovalRuleDetailScreen-j72H8n28.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]="e40563c2-eea5-4278-a2d5-f09869218bf1",e._sentryDebugIdIdentifier="sentry-dbid-e40563c2-eea5-4278-a2d5-f09869218bf1")}catch{}})();const st=e=>`/${e}/reimbursements`,Zn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Qe.getLocalizedStrings(),Gn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=L.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:_e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=L.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Lt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=J(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=X(),t=ae(),n=Q(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=Q().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=L.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),$=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,Z))}),[O,W,Z,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t($e(!1,b,y,r)))}));const _=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||$&&g.billStatus==="rejected"||$===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Je,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(Zn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:_,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const zn=P.div`
1
+ import{j as s}from"./liveblocks-C_txwMxP.js";import{u as ae,j as v,h as X,g as Q,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-_lmxLuL7.js";import{fF as V,NA as ut,_N as ge,c8 as he,MG as $e,ma as pt,MV as ce,MU as de,_O as bt,bn as fe,gV as Le,_P as gt,WN as ht,l$ as _e,WO as Ce,WP as ft,kN as St,YQ as It,l0 as yt,Mu as Rt,C9 as vt,kU as At,Nf as Me,_Q as Pe,_R as Ee,_S as kt,_T as Ct,_U as Et,M$ as we,l6 as wt,YZ as xt,MT as Bt,ME as Tt,_V as Dt,MD as jt,_W as Ft,ML as xe,N3 as Ut,N2 as $t,M_ as Lt,_X as Ne,Sd as _t,bo as Mt,MO as Pt,Nx as Nt,_Y as Ot,_Z as Zt,Nb as Gt,N8 as Be,Yk as zt,MB as Vt,__ as Oe,N_ as Te,O6 as Wt,_$ as Ht,$0 as q,$1 as Yt,$2 as Ze,$3 as qt,$4 as Ge,$5 as ze,Nn as ue,bu as Jt,bK as Se,cM as Ie,d_ as Ve,dZ as We,$6 as Qt,gh as Kt,Yx as Xt,$7 as en,$8 as He,YB as tn,Zj as nn,$9 as an,ZI as sn,O3 as De,O2 as on,$a as rn,$b as ln,$c as mn,$d as cn,$e as dn,Z3 as un,NV as pn,NZ as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,Uc as yn,da as Rn,dd as vn,dc as An,cF as kn}from"./zeni-epic-state-CtlpRqoe.js";import{bU as Cn,V as Ye,a2 as qe,c as oe,v as x,z as L,cT as Je,a9 as re,j as C,aT as je,F,af as se,ag as En,G as Qe,cU as wn,p as J,at as Ke,cV as xn,Q as le,cW as Bn,ar as Tn,ac as Dn,a8 as ye,W as Xe,w as jn,bC as Fn,aw as Un,aj as $n,E as et,cX as Ln,g as _n}from"./index-B6grZ9sx.js";import{n as P,S as Mn}from"./mui-DbFwPEO7.js";import pe from"./NotFoundScreen-DNVEwzIN.js";import{S as Fe}from"./SetupPagesScreen-mUtIx0g7.js";import{F as tt}from"./FeaturePreviewScreen-Bu4co2D3.js";import{a as h}from"./sentry-D_60LtUS.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-DycPeMu8.js";import{u as nt}from"./useInitialThreadRequest-C01HUFbF.js";import{D as Pn}from"./DrawerScreen-74QNRylU.js";import{M as at}from"./MobileAppDrawer-COi151oe.js";import{F as Nn}from"./ScreenRoutes-BgOuemMY.js";import{R as On}from"./ReimbursementApprovalRoutes-Bu_MlS4C.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./BusinessVerificationPageScreen-DeXHIi3R.js";import"./routePaths-hwxApcva.js";import"./analyticsHelper-4iM19yWB.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./useTaskManagerAccess-vvZ5G9JM.js";import"./getLocaleForTenant-B789-FKJ.js";import"./ReimbursementApprovalRuleDetailScreen-Basp-Q4U.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]="e40563c2-eea5-4278-a2d5-f09869218bf1",e._sentryDebugIdIdentifier="sentry-dbid-e40563c2-eea5-4278-a2d5-f09869218bf1")}catch{}})();const st=e=>`/${e}/reimbursements`,Zn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Qe.getLocalizedStrings(),Gn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=L.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:_e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=L.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Lt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=J(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=X(),t=ae(),n=Q(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=Q().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=L.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),$=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,Z))}),[O,W,Z,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t($e(!1,b,y,r)))}));const _=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||$&&g.billStatus==="rejected"||$===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Je,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(Zn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:_,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const zn=P.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-C_txwMxP.js";import{g as J,h as Oe,u as De,i as Ve,j as d,l as Ae,n as Pe,o as ee}from"./core-_lmxLuL7.js";import{fF as q,E5 as R,UK as Ee,l$ as le,u6 as ce,uX as V,lG as Ue,lP as A,lH as P,kK as E,kB as U,kA as Le,Df as ie,v0 as Me,bq as Be,UL as ve,bn as xe,Es as ze,UM as Ge,UN as He,ci as S,D8 as Ye,UO as ae,UP as Ne,UQ as $e,UR as qe,US as Ze,UT as Qe,UU as We,UV as Ke,UW as Xe,UX as Je,UY as ea,UZ as aa,U_ as sa,U$ as j,V0 as L,V1 as M,V2 as B,V3 as v,V4 as x,V5 as z,V6 as G,V7 as H,V8 as Y,ei as ta,E6 as oa,DV as se,DW as te,Ec as na,D_ as oe,Ei as ra,V9 as la,Va as ca,Vb as ia,Vc as da,Vd as pa,Ve as _a,Vf as fa,Vg as ma,Vh as ua,Vi as ba,d_ as ha,dZ as ya}from"./zeni-epic-state-CtlpRqoe.js";import{ao as wa,ap as Ca,aq as ga,a as Sa,a2 as Ia,c as de,v as N,z as pe,ar as Ra,Q as Ta,e as ja,as as ka,at as Fa,a9 as Oa,j as $,W as Da,s as Va,p as _e,au as Aa,av as Pa,aw as Ea}from"./index-BqEaHxIT.js";import"./mui-DbFwPEO7.js";import Ua from"./NotFoundScreen-BeP62Nz9.js";import{F as La}from"./FeaturePreviewScreen-8gjXA436.js";import{a as u}from"./sentry-D_60LtUS.js";import{u as Ma}from"./useInitialThreadRequest-CyHRajCC.js";import{t as ne,a as re,b as Ba}from"./routePaths-C1I3AVBw.js";import{M as va}from"./MobileAppDrawer-fNaMEqpG.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./useTaskManagerAccess-Cs4MVKyS.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]="4183a72f-e14e-421d-ac9a-9baae89e8961",e._sentryDebugIdIdentifier="sentry-dbid-4183a72f-e14e-421d-ac9a-9baae89e8961")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(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:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(V(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({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(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=S(t);l?(e(Ke({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Qe({classesToFilterOut:a})):e(We({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?U():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(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"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):U(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ve(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:Q}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,ue=F.company?.companyInfo.firstMonthOfFY??1,be=Ma(Q?F?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),g=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(V(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&C==="Completed"&&b&&(s(V(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,C,b]),u.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(U());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Ue(h.timeframe))}}),[c,O,D,b,T,g]);const W=Ta(),Ce=W?.loggedInUserRole!=null&&Be(W?.loggedInUserRole)!==!0,[ge,Se]=u.useState(!1),K=n=>{Se(n)},Ie=ja(),Re=ka();return(function(n){const{isDataReady:Te}=n,{pathname:je}=J(),X=wa(je??"")==="reports",ke=Ca(Te),Fe=u.useMemo((()=>X?xa:void 0),[X]);ga({canFetchSuggestedQuestions:ke,pageContexts:Fe})})({isDataReady:C==="Completed"}),Fa({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:ge,handleDrawerToggle:K}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:K,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Va({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Q,initialOpenThreadRequest:be})]})}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 _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Ua,{})})]})}export{_s as default};
1
+ import{j as p}from"./liveblocks-C_txwMxP.js";import{g as J,h as Oe,u as De,i as Ve,j as d,l as Ae,n as Pe,o as ee}from"./core-_lmxLuL7.js";import{fF as q,E5 as R,UK as Ee,l$ as le,u6 as ce,uX as V,lG as Ue,lP as A,lH as P,kK as E,kB as U,kA as Le,Df as ie,v0 as Me,bq as Be,UL as ve,bn as xe,Es as ze,UM as Ge,UN as He,ci as S,D8 as Ye,UO as ae,UP as Ne,UQ as $e,UR as qe,US as Ze,UT as Qe,UU as We,UV as Ke,UW as Xe,UX as Je,UY as ea,UZ as aa,U_ as sa,U$ as j,V0 as L,V1 as M,V2 as B,V3 as v,V4 as x,V5 as z,V6 as G,V7 as H,V8 as Y,ei as ta,E6 as oa,DV as se,DW as te,Ec as na,D_ as oe,Ei as ra,V9 as la,Va as ca,Vb as ia,Vc as da,Vd as pa,Ve as _a,Vf as fa,Vg as ma,Vh as ua,Vi as ba,d_ as ha,dZ as ya}from"./zeni-epic-state-CtlpRqoe.js";import{ao as wa,ap as Ca,aq as ga,a as Sa,a2 as Ia,c as de,v as N,z as pe,ar as Ra,Q as Ta,e as ja,as as ka,at as Fa,a9 as Oa,j as $,W as Da,s as Va,p as _e,au as Aa,av as Pa,aw as Ea}from"./index-B6grZ9sx.js";import"./mui-DbFwPEO7.js";import Ua from"./NotFoundScreen-DNVEwzIN.js";import{F as La}from"./FeaturePreviewScreen-Bu4co2D3.js";import{a as u}from"./sentry-D_60LtUS.js";import{u as Ma}from"./useInitialThreadRequest-C01HUFbF.js";import{t as ne,a as re,b as Ba}from"./routePaths-hwxApcva.js";import{M as va}from"./MobileAppDrawer-COi151oe.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./useTaskManagerAccess-vvZ5G9JM.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]="4183a72f-e14e-421d-ac9a-9baae89e8961",e._sentryDebugIdIdentifier="sentry-dbid-4183a72f-e14e-421d-ac9a-9baae89e8961")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(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:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(V(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({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(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=S(t);l?(e(Ke({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Qe({classesToFilterOut:a})):e(We({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?U():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(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"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):U(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ve(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:Q}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,ue=F.company?.companyInfo.firstMonthOfFY??1,be=Ma(Q?F?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),g=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(V(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&C==="Completed"&&b&&(s(V(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,C,b]),u.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(U());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Ue(h.timeframe))}}),[c,O,D,b,T,g]);const W=Ta(),Ce=W?.loggedInUserRole!=null&&Be(W?.loggedInUserRole)!==!0,[ge,Se]=u.useState(!1),K=n=>{Se(n)},Ie=ja(),Re=ka();return(function(n){const{isDataReady:Te}=n,{pathname:je}=J(),X=wa(je??"")==="reports",ke=Ca(Te),Fe=u.useMemo((()=>X?xa:void 0),[X]);ga({canFetchSuggestedQuestions:ke,pageContexts:Fe})})({isDataReady:C==="Completed"}),Fa({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:ge,handleDrawerToggle:K}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:K,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Va({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Q,initialOpenThreadRequest:be})]})}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 _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Ua,{})})]})}export{_s as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-C_txwMxP.js";import{z as j,a9 as b,j as d,W as D,e3 as E,c as k,v as I}from"./index-BqEaHxIT.js";import"./mui-DbFwPEO7.js";import g from"./NotFoundScreen-BeP62Nz9.js";import{a as m}from"./sentry-D_60LtUS.js";import{u as C,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-_lmxLuL7.js";import{fF as V,a1T as w,a1U as p,DM as _,p$ as P,a1V as z,DK as G}from"./zeni-epic-state-CtlpRqoe.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.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]="65486545-d227-4c33-8a70-6c4ffc6ef044",e._sentryDebugIdIdentifier="sentry-dbid-65486545-d227-4c33-8a70-6c4ffc6ef044")}catch{}})();const K=T((function(e,t){const n=w(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=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(E),M=()=>{const e=C(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>V(o))),c=F(),x=L(),u=j.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>w(o))),v=u?.firstName!=null?u.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(b,{analytics:d,onLoad:o=>(S=>S.trackPageLoaded(D.Event.inviteEmailViewed))(o)}):null,a.jsx(K,{navigate:c,location:x,currentTenant:r,companyName:N,userName:v,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(M,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-C_txwMxP.js";import{z as j,a9 as b,j as d,W as D,e3 as E,c as k,v as I}from"./index-B6grZ9sx.js";import"./mui-DbFwPEO7.js";import g from"./NotFoundScreen-DNVEwzIN.js";import{a as m}from"./sentry-D_60LtUS.js";import{u as C,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-_lmxLuL7.js";import{fF as V,a1T as w,a1U as p,DM as _,p$ as P,a1V as z,DK as G}from"./zeni-epic-state-CtlpRqoe.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.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]="65486545-d227-4c33-8a70-6c4ffc6ef044",e._sentryDebugIdIdentifier="sentry-dbid-65486545-d227-4c33-8a70-6c4ffc6ef044")}catch{}})();const K=T((function(e,t){const n=w(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=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(E),M=()=>{const e=C(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>V(o))),c=F(),x=L(),u=j.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>w(o))),v=u?.firstName!=null?u.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(b,{analytics:d,onLoad:o=>(S=>S.trackPageLoaded(D.Event.inviteEmailViewed))(o)}):null,a.jsx(K,{navigate:c,location:x,currentTenant:r,companyName:N,userName:v,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(M,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as y}from"./liveblocks-C_txwMxP.js";import{a as A}from"./sentry-D_60LtUS.js";import{i as G,u as H,h as X,g as ee,j as h,l as te}from"./core-_lmxLuL7.js";import{WI as Ve,WJ as Fe,l$ as ae,sr as Me,sD as Ge,sT as $e,sR as Re,sU as Ke,sW as Ue,WK as We,fF as K,VH as pe,WL as Se,g_ as ne,cB as se,cC as le,Fa as ve,WM as Ce,Fe as Ye,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Qe,T3 as fe,F8 as He,F2 as Xe,WN as De,EW as et,EV as tt,EQ as at,E$ as nt,Ff as st,WO as W,WP as ge,EX as lt,VI as oe,Fv as Ae,Fo as Ie,WQ as xe,sx as Te,Fi as Be,Fg as Le,WR as be,FC as we,Fz as Je,Fj as je,FB as _e}from"./zeni-epic-state-CtlpRqoe.js";import{a5 as de,aZ as ie,a_ as ct,z as ot,h as dt,a8 as it,a9 as ue,j as N,aw as ut,a$ as rt,p as F,G as Ee,V as ye,b0 as ht,b1 as mt,b2 as pt}from"./index-BqEaHxIT.js";import{n as re}from"./mui-DbFwPEO7.js";import{p as St}from"./pathToGoBack-W4B39XGQ.js";import Q from"./NotFoundScreen-BeP62Nz9.js";import{c as M}from"./routePaths-C1I3AVBw.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]="d913bd74-98eb-4ea3-bf7c-96c88c71c6c7",e._sentryDebugIdIdentifier="sentry-dbid-d913bd74-98eb-4ea3-bf7c-96c88c71c6c7")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=X(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Ve(u,l??""))),p=h((u=>Fe(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?y.jsx(Q,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?y.jsx(ie,{}):y.jsx(Q,{}):y.jsx(ft,{children:y.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(We({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
1
+ import{j as y}from"./liveblocks-C_txwMxP.js";import{a as A}from"./sentry-D_60LtUS.js";import{i as G,u as H,h as X,g as ee,j as h,l as te}from"./core-_lmxLuL7.js";import{WI as Ve,WJ as Fe,l$ as ae,sr as Me,sD as Ge,sT as $e,sR as Re,sU as Ke,sW as Ue,WK as We,fF as K,VH as pe,WL as Se,g_ as ne,cB as se,cC as le,Fa as ve,WM as Ce,Fe as Ye,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Qe,T3 as fe,F8 as He,F2 as Xe,WN as De,EW as et,EV as tt,EQ as at,E$ as nt,Ff as st,WO as W,WP as ge,EX as lt,VI as oe,Fv as Ae,Fo as Ie,WQ as xe,sx as Te,Fi as Be,Fg as Le,WR as be,FC as we,Fz as Je,Fj as je,FB as _e}from"./zeni-epic-state-CtlpRqoe.js";import{a5 as de,aZ as ie,a_ as ct,z as ot,h as dt,a8 as it,a9 as ue,j as N,aw as ut,a$ as rt,p as F,G as Ee,V as ye,b0 as ht,b1 as mt,b2 as pt}from"./index-B6grZ9sx.js";import{n as re}from"./mui-DbFwPEO7.js";import{p as St}from"./pathToGoBack-W4B39XGQ.js";import Q from"./NotFoundScreen-DNVEwzIN.js";import{c as M}from"./routePaths-hwxApcva.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]="d913bd74-98eb-4ea3-bf7c-96c88c71c6c7",e._sentryDebugIdIdentifier="sentry-dbid-d913bd74-98eb-4ea3-bf7c-96c88c71c6c7")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=X(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Ve(u,l??""))),p=h((u=>Fe(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?y.jsx(Q,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?y.jsx(ie,{}):y.jsx(Q,{}):y.jsx(ft,{children:y.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(We({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-BeP62Nz9.js","assets/sentry-D_60LtUS.js","assets/core-_lmxLuL7.js","assets/zeni-epic-state-CtlpRqoe.js","assets/index-BqEaHxIT.js","assets/mui-DbFwPEO7.js","assets/analytics-BLHCH9ZW.js","assets/utils-CPbtTTqo.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-B00G02__.js","assets/withTransactionSidePanel-Dxu14DPo.js","assets/useAskAiCfoHostNavButtonProps-Biynu986.js","assets/TransactionDetailScreen-BDWEHK1J.js","assets/decodeURIComponentSafe-CNj7wDd5.js","assets/useInitialThreadRequest-CyHRajCC.js","assets/routePaths-C1I3AVBw.js","assets/expenseAutomationHelper-C8o4PBoS.js","assets/stripSplatSuffix-BWXYYZxG.js","assets/analyticsHelper-DhzoozKy.js","assets/CompanyPassportScreen-CamQRzbi.js","assets/MobileAppDrawer-fNaMEqpG.js","assets/InboxNotificationsProvider-CvLL3Xda.js","assets/useTaskManagerAccess-Cs4MVKyS.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DfcdcxeV.js","assets/FeaturePreviewScreen-8gjXA436.js","assets/BillPayRoutes-B9NE4VxB.js","assets/AddressScreen-DqZYCoSs.js","assets/DomesticWireDetailScreen-BBhvylGY.js","assets/BusinessVerificationPageScreen-BldrMJdh.js","assets/DrawerScreen-2p7xfq2O.js","assets/SetupPagesScreen-Zigm3cB1.js","assets/BillPayApprovalRoutes-BpoA_nrV.js","assets/ReimbursementApprovalRuleDetailScreen-j72H8n28.js","assets/getLocaleForTenant-DiPOVD9Y.js","assets/ReimbursementRoutes-Cyrl2qi_.js","assets/ReimbursementApprovalRoutes-DHL_6iez.js","assets/TransactionListRoutes-COxnLE0l.js","assets/ZeniAccountStatementScreen-DzQsPHni.js","assets/SettingsRoutes-DfnQIw3N.js","assets/AccountMappingScreen-DdQz2lM1.js","assets/QBOConnectionScreen-a_jxuJVg.js","assets/empty-B3p_skJy.js","assets/index-sGFH656b.js","assets/url-BryZycM8.js","assets/index-Cg11XXLq.js","assets/accountMappingHelper-DTr2dybD.js","assets/useEmailConnectResultRefresh-BtvKv8-C.js","assets/ReportsRoutes-DSY4nYh6.js","assets/ChargeCardRoutes-ljOxkkUf.js","assets/useChargeCardPusherEvents-N9Kbq9gN.js","assets/PeopleRoutes-DYtmtMXx.js","assets/ExpenseAutomationRoutes-CsO9a4nX.js","assets/useActualMatchingMatchDetail-BOc11rCC.js","assets/ScheduleDetailsPrepaidExpensesScreen-C4z4GiyE.js","assets/pathToGoBack-W4B39XGQ.js","assets/TreasuryRoutes-DmSouKJP.js","assets/VendorsRoutes-OsvLnOdY.js","assets/ZeniAccountRoutes-O9BxDbbv.js","assets/AddressRoutes-CynmpoQu.js","assets/PandLWithForecastRoutes-Ca12AKcd.js","assets/CustomerOnboardingRoutes-UN9_koR-.js","assets/TransactionDetailRoutes-BBdrsyNq.js","assets/EntityDetailRoutes-CLBqzGEu.js","assets/InvoicingRoutes-BXUW-5w1.js","assets/NotificationRoutes-GCk-IahK.js","assets/PerformanceRoutes-DP4OW2qD.js","assets/ActualMatchingMatchDetailScreen-CGBN-Q-7.js","assets/RewardsRoutes-DvJjiZGU.js","assets/TaskRoutes-C5PxGl6p.js","assets/TaskListScreen-WGfeq9_a.js","assets/useTaskManagerPusherEvents-BPWIyNie.js","assets/AiCfoScreen-CtsJ7cDT.js","assets/CardsAiCfoScreen-oYxLbDwZ.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as hs,fF as ps,d_ as xs,dZ as gs,AZ as Rs,di as js,c8 as Is,gJ as Ts,g9 as As,df as pe,cG as fs,gn as bs,cy as Ds,bE as ys,br as vs,U8 as Cs,v as Os,Ub as Us,bq as Ps,Uc as ws,bK as Fs,bJ as Ls,bt as ks,cu as Hs,Ud as Vs,Ue as Ss,da as Bs,dd as Ns,dc as Ms,cF as Zs,cM as Gs,pS as xe,gi as ge,gY as $s,gk as Re,gL as je,gM as Ie,gl as zs}from"./zeni-epic-state-CtlpRqoe.js";import{j as e}from"./liveblocks-C_txwMxP.js";import{a as P}from"./sentry-D_60LtUS.js";import{N as u,u as Ys,h as qs,i as Js,g as Ws,j as G,q as Te,n as Ks,o as n}from"./core-_lmxLuL7.js";import{J as l,E as Qs,u as Xs,z as y,c as et,e as st,H as tt,v as B,g as nt,N as at,Q as ot,L as F,G as Ae,t as _,O as rt,P as it,S as lt,j as ne}from"./index-BqEaHxIT.js";import"./mui-DbFwPEO7.js";import{f as fe}from"./analyticsHelper-DhzoozKy.js";import{t as ut}from"./getLocaleForTenant-DiPOVD9Y.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new o.Error().stack;b&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[b]="4409e8bd-fca3-40ff-9996-386a2505e85f",o._sentryDebugIdIdentifier="sentry-dbid-4409e8bd-fca3-40ff-9996-386a2505e85f")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-BeP62Nz9.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:b,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(k===!0){if(o)return e.jsx(De,{tenantEmailDomain:C});if(i)return e.jsx(be,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(De,{tenantEmailDomain:C}):i?e.jsx(be,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):b?e.jsx(mt,{tenantEmailDomain:C}):N?e.jsx(ct,{tenantEmailDomain:C}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-B00G02__.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-B9NE4VxB.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-Cyrl2qi_.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-COxnLE0l.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-DfnQIw3N.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-DSY4nYh6.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-ljOxkkUf.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-DYtmtMXx.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CsO9a4nX.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-DmSouKJP.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-OsvLnOdY.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-O9BxDbbv.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},Et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},ht=l((()=>s((()=>import("./ReportsRoutes-DSY4nYh6.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),pt=l((()=>s((()=>import("./AddressRoutes-CynmpoQu.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-DYtmtMXx.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-Ca12AKcd.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-UN9_koR-.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),jt=l((()=>s((()=>import("./VendorsRoutes-OsvLnOdY.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),It=l((()=>s((()=>import("./TransactionDetailRoutes-BBdrsyNq.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-CLBqzGEu.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),Tt=l((()=>s((()=>import("./DashboardRoutes-B00G02__.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-B9NE4VxB.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),At=l((()=>s((()=>import("./SettingsRoutes-DfnQIw3N.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),ft=l((()=>s((()=>import("./InvoicingRoutes-BXUW-5w1.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-Cyrl2qi_.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),bt=l((()=>s((()=>import("./ZeniAccountRoutes-O9BxDbbv.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),Dt=l((()=>s((()=>import("./TreasuryRoutes-DmSouKJP.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),yt=l((()=>s((()=>import("./TransactionListRoutes-COxnLE0l.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),vt=l((()=>s((()=>import("./ChargeCardRoutes-ljOxkkUf.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),Ct=l((()=>s((()=>import("./NotificationRoutes-GCk-IahK.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ot=l((()=>s((()=>import("./PerformanceRoutes-DP4OW2qD.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ut=l((()=>s((()=>import("./ExpenseAutomationRoutes-CsO9a4nX.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Pt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-CGBN-Q-7.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),wt=l((()=>s((()=>import("./RewardsRoutes-DvJjiZGU.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Ft=l((()=>s((()=>import("./TaskRoutes-C5PxGl6p.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-CtsJ7cDT.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-oYxLbDwZ.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-BeP62Nz9.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),kt=l((()=>s((()=>import("./TaskListScreen-WGfeq9_a.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Ht=({isDashboardAccess:o,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(O===!0){if(b)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):b?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const b=Ys(),N=qs(),{tenantEmailDomain:i}=Js(),k=Qs().mode,{setLoading:O,clearAllLoading:C,clearLoading:H}=Xs(),D=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),W=hs(I),$=Ws(),[L,we]=P.useState(!1),r=G((a=>ps(a))),{useFeatureGate:V}=et(),M=st(),K=tt(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=V(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=V(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?xs(oe,r):void 0,Q=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!js(r):void 0,He=nt(r,ke,oe),{isCardsHidden:Ve}=at(r?.tenantId),Se=!He||!!Ve,{isFeatureEnabled:Be}=V(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=V(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=V(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||lt==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=G((a=>Ts(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&fe(I,r,k)}const Z={tenantId:D,userId:I?.userId,sessionId:I?.zeniSessionId},ie=As(),h=ot(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=fs(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=vs();t.isAfter(d,"month")===!1?b(Cs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,b,y]),P.useLayoutEffect((()=>{!Os(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(ut(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,b,Ye))}),[D]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,Es=c!=null&&c.externalConnections==null;if(q&&ms){S(Re(t));const J=y.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else q&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),q&&Es&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,I,O,b))}),[D,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&fe(I,r,k,void 0,z.tenantsBaseInOrder))}),[z,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(C(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=Et,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=_t[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:qe}=V(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=V(B.isAccrualEnabled),We=rt(),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Xe=ws(h?.loggedInUserRoleMap),es=r.externalConnections?.accounting[0]?.isValid,ss=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&Fs(h?.loggedInUserRoleMap),_e=Fe&&!U,ts=Le&&!U,ns=ue&&Ls(h?.loggedInUserRoleMap),as=de&&ks(h?.loggedInUserRoleMap),os=_e&&Hs(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),ds=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),g=Gs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&ls,j=ts&&us,m=de&&ds,cs=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Xe===!0||rs===!0||is===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&b(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&ss&&es!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(it,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Ht,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(Tt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Qe?e.jsx(It,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(yt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(kt,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ft,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(Dt,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ot,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&U===!1?e.jsx(Ut,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&U===!1&&Je===!0&&We===!0?e.jsx(Pt,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(Ct,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(jt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(At,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(vt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(wt,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,zt as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DNVEwzIN.js","assets/sentry-D_60LtUS.js","assets/core-_lmxLuL7.js","assets/zeni-epic-state-CtlpRqoe.js","assets/index-B6grZ9sx.js","assets/mui-DbFwPEO7.js","assets/analytics-BLHCH9ZW.js","assets/utils-CPbtTTqo.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-C3KzBz6S.js","assets/withTransactionSidePanel-ByOeZF9g.js","assets/useAskAiCfoHostNavButtonProps-DycPeMu8.js","assets/TransactionDetailScreen-qryWPLpS.js","assets/decodeURIComponentSafe-CNj7wDd5.js","assets/useInitialThreadRequest-C01HUFbF.js","assets/routePaths-hwxApcva.js","assets/expenseAutomationHelper-C8o4PBoS.js","assets/stripSplatSuffix-BWXYYZxG.js","assets/analyticsHelper-4iM19yWB.js","assets/CompanyPassportScreen-DSh6Ipzn.js","assets/MobileAppDrawer-COi151oe.js","assets/InboxNotificationsProvider-CvLL3Xda.js","assets/useTaskManagerAccess-vvZ5G9JM.js","assets/useAiCfoDashboardSuggestedQuestionsChips-j_HLw6hE.js","assets/FeaturePreviewScreen-Bu4co2D3.js","assets/BillPayRoutes-Do640K9D.js","assets/AddressScreen-CwA3IRwX.js","assets/DomesticWireDetailScreen-CWU_ak_S.js","assets/BusinessVerificationPageScreen-DeXHIi3R.js","assets/DrawerScreen-74QNRylU.js","assets/SetupPagesScreen-mUtIx0g7.js","assets/BillPayApprovalRoutes-D4kOwTBO.js","assets/ReimbursementApprovalRuleDetailScreen-Basp-Q4U.js","assets/getLocaleForTenant-B789-FKJ.js","assets/ReimbursementRoutes-Bq2EqHO1.js","assets/ReimbursementApprovalRoutes-Bu_MlS4C.js","assets/TransactionListRoutes-CsLIipC1.js","assets/ZeniAccountStatementScreen-j3HmxqHy.js","assets/SettingsRoutes-BkkyebXa.js","assets/AccountMappingScreen-BxRledTj.js","assets/QBOConnectionScreen-BAF64NHf.js","assets/empty-B3p_skJy.js","assets/index-sGFH656b.js","assets/url-BryZycM8.js","assets/index-Cg11XXLq.js","assets/accountMappingHelper-DTr2dybD.js","assets/useEmailConnectResultRefresh-VgqVnnGo.js","assets/ReportsRoutes-B0F6dmdv.js","assets/ChargeCardRoutes-DZkHgl9s.js","assets/useChargeCardPusherEvents-CeGBALEu.js","assets/PeopleRoutes-BemO_mDq.js","assets/ExpenseAutomationRoutes-DrJlIKSY.js","assets/useActualMatchingMatchDetail-CXEQCna3.js","assets/ScheduleDetailsPrepaidExpensesScreen-CpX86pSz.js","assets/pathToGoBack-W4B39XGQ.js","assets/TreasuryRoutes-SaAnpSTn.js","assets/VendorsRoutes-ZsiBTL9L.js","assets/ZeniAccountRoutes-CPGcNCoa.js","assets/AddressRoutes-DMjDwuiI.js","assets/PandLWithForecastRoutes-CAv6HnFG.js","assets/CustomerOnboardingRoutes-L779kJOJ.js","assets/TransactionDetailRoutes-CaFbfMkp.js","assets/EntityDetailRoutes-QM4GSAIU.js","assets/InvoicingRoutes-CKT_RLJi.js","assets/NotificationRoutes-C0PDOFur.js","assets/PerformanceRoutes-CW_WQq6a.js","assets/ActualMatchingMatchDetailScreen-oIbSJaIb.js","assets/RewardsRoutes-DxjdRAJt.js","assets/TaskRoutes-xsPPcGb9.js","assets/TaskListScreen-DQiYW5NR.js","assets/useTaskManagerPusherEvents-A5AmC0FP.js","assets/AiCfoScreen-DMPGHIZE.js","assets/CardsAiCfoScreen-BpdFcHVH.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fF as ps,d_ as xs,dZ as gs,AZ as Rs,di as js,c8 as Is,gJ as Ts,g9 as As,df as pe,cG as fs,gn as bs,cy as Ds,bE as ys,br as vs,U8 as Cs,v as Os,Ub as Us,bq as Ps,Uc as ws,bK as Fs,bJ as Ls,bt as ks,cu as Hs,Ud as Vs,Ue as Ss,da as Bs,dd as Ns,dc as Ms,cF as Zs,cM as Gs,pS as xe,gi as ge,gY as $s,gk as Re,gL as je,gM as Ie,gl as zs}from"./zeni-epic-state-CtlpRqoe.js";import{j as e}from"./liveblocks-C_txwMxP.js";import{a as P}from"./sentry-D_60LtUS.js";import{N as u,u as Ys,h as qs,i as Js,g as Ws,j as G,q as Te,n as Ks,o as n}from"./core-_lmxLuL7.js";import{J as l,E as Qs,u as Xs,z as y,c as et,e as st,H as tt,v as B,g as nt,N as at,Q as ot,L as F,G as Ae,t as _,O as rt,P as it,S as lt,j as ne}from"./index-B6grZ9sx.js";import"./mui-DbFwPEO7.js";import{f as fe}from"./analyticsHelper-4iM19yWB.js";import{t as ut}from"./getLocaleForTenant-B789-FKJ.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new o.Error().stack;b&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[b]="4409e8bd-fca3-40ff-9996-386a2505e85f",o._sentryDebugIdIdentifier="sentry-dbid-4409e8bd-fca3-40ff-9996-386a2505e85f")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-DNVEwzIN.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:b,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(k===!0){if(o)return e.jsx(De,{tenantEmailDomain:C});if(i)return e.jsx(be,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(De,{tenantEmailDomain:C}):i?e.jsx(be,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):b?e.jsx(mt,{tenantEmailDomain:C}):N?e.jsx(ct,{tenantEmailDomain:C}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-C3KzBz6S.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-Do640K9D.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-Bq2EqHO1.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-CsLIipC1.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-BkkyebXa.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-B0F6dmdv.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-DZkHgl9s.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-BemO_mDq.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-DrJlIKSY.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-SaAnpSTn.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-ZsiBTL9L.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-CPGcNCoa.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},Et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},ht=l((()=>s((()=>import("./ReportsRoutes-B0F6dmdv.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),pt=l((()=>s((()=>import("./AddressRoutes-DMjDwuiI.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-BemO_mDq.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-CAv6HnFG.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-L779kJOJ.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),jt=l((()=>s((()=>import("./VendorsRoutes-ZsiBTL9L.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),It=l((()=>s((()=>import("./TransactionDetailRoutes-CaFbfMkp.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-QM4GSAIU.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),Tt=l((()=>s((()=>import("./DashboardRoutes-C3KzBz6S.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-Do640K9D.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),At=l((()=>s((()=>import("./SettingsRoutes-BkkyebXa.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),ft=l((()=>s((()=>import("./InvoicingRoutes-CKT_RLJi.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-Bq2EqHO1.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),bt=l((()=>s((()=>import("./ZeniAccountRoutes-CPGcNCoa.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),Dt=l((()=>s((()=>import("./TreasuryRoutes-SaAnpSTn.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),yt=l((()=>s((()=>import("./TransactionListRoutes-CsLIipC1.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),vt=l((()=>s((()=>import("./ChargeCardRoutes-DZkHgl9s.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),Ct=l((()=>s((()=>import("./NotificationRoutes-C0PDOFur.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ot=l((()=>s((()=>import("./PerformanceRoutes-CW_WQq6a.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ut=l((()=>s((()=>import("./ExpenseAutomationRoutes-DrJlIKSY.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Pt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-oIbSJaIb.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),wt=l((()=>s((()=>import("./RewardsRoutes-DxjdRAJt.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Ft=l((()=>s((()=>import("./TaskRoutes-xsPPcGb9.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-DMPGHIZE.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-BpdFcHVH.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-DNVEwzIN.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),kt=l((()=>s((()=>import("./TaskListScreen-DQiYW5NR.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Ht=({isDashboardAccess:o,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(O===!0){if(b)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):b?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const b=Ys(),N=qs(),{tenantEmailDomain:i}=Js(),k=Qs().mode,{setLoading:O,clearAllLoading:C,clearLoading:H}=Xs(),D=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),W=hs(I),$=Ws(),[L,we]=P.useState(!1),r=G((a=>ps(a))),{useFeatureGate:V}=et(),M=st(),K=tt(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=V(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=V(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?xs(oe,r):void 0,Q=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!js(r):void 0,He=nt(r,ke,oe),{isCardsHidden:Ve}=at(r?.tenantId),Se=!He||!!Ve,{isFeatureEnabled:Be}=V(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=V(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=V(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||lt==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=G((a=>Ts(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&fe(I,r,k)}const Z={tenantId:D,userId:I?.userId,sessionId:I?.zeniSessionId},ie=As(),h=ot(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=fs(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=vs();t.isAfter(d,"month")===!1?b(Cs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,b,y]),P.useLayoutEffect((()=>{!Os(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(ut(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,b,Ye))}),[D]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,Es=c!=null&&c.externalConnections==null;if(q&&ms){S(Re(t));const J=y.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else q&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),q&&Es&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,I,O,b))}),[D,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&fe(I,r,k,void 0,z.tenantsBaseInOrder))}),[z,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(C(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=Et,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=_t[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:qe}=V(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=V(B.isAccrualEnabled),We=rt(),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Xe=ws(h?.loggedInUserRoleMap),es=r.externalConnections?.accounting[0]?.isValid,ss=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&Fs(h?.loggedInUserRoleMap),_e=Fe&&!U,ts=Le&&!U,ns=ue&&Ls(h?.loggedInUserRoleMap),as=de&&ks(h?.loggedInUserRoleMap),os=_e&&Hs(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),ds=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),g=Gs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&ls,j=ts&&us,m=de&&ds,cs=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Xe===!0||rs===!0||is===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&b(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&ss&&es!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(it,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Ht,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(Tt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Qe?e.jsx(It,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(yt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(kt,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ft,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(Dt,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ot,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&U===!1?e.jsx(Ut,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&U===!1&&Je===!0&&We===!0?e.jsx(Pt,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(Ct,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(jt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(At,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(vt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(wt,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,zt as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-C_txwMxP.js";import{a as d}from"./sentry-D_60LtUS.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-_lmxLuL7.js";import{fF as w,Zl as ve,NA as Pe,YV as we,Z2 as Ae,c8 as X,cT as De,cU as Ue,bq as _e,de as Me,FV as Re,Zm as Te,P1 as Be,Mr as Ze,Mi as de,Mf as Fe,FZ as ue,Ml as pe,Mo as ge,Mu as W,C9 as ee,FY as Ve,lu as $,lx as me,Zn as Ne,mH as Oe,Ge as Le,VB as Ge,VC as $e,ls as He,Zo as Ke,lv as qe,uA as ze,Vw as Qe,Vx as Ye,uE as Je,hV as Xe,Uv as Q,hN as ae,hK as We,hS as en,Uw as nn,Gb as tn,Zp as an,Zq as on,MI as sn,l$ as rn,dZ as fe,d_ as he,Zr as ln,gC as cn,UL as dn,Ga as oe,gH as se,gG as un,G9 as pn,gF as gn,gE as mn,Zs as fn,TX as Ce,Zt as hn,Zu as Cn,Zv as yn,Zw as Sn,Zx as bn,Zy as In,Gh as xn,Zz as En,G8 as ie,G2 as G,ZA as kn,ZB as jn,ZC as re,ZD as vn,dS as Pn,ZE as wn,ZF as An,ZG as Dn,U7 as Un,c0 as _n,c7 as Mn,c6 as Rn,c1 as Tn,ZH as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-CtlpRqoe.js";import{bU as On,z as P,Q as L,a8 as ne,c4 as Ln,j as q,c as te,v as F,g as ye,N as Se,c5 as Gn,h as $n,_ as be,c6 as Hn,aj as Kn,c7 as qn,c8 as zn,ar as Qn,c9 as Yn,p as Jn,d as Ie,ca as Xn}from"./index-BqEaHxIT.js";import{n as B}from"./mui-DbFwPEO7.js";import{u as xe}from"./useTaskManagerAccess-Cs4MVKyS.js";import{U as Wn}from"./AccountMappingScreen-DdQz2lM1.js";import{t as et,A as nt}from"./AddressScreen-DqZYCoSs.js";import V from"./NotFoundScreen-BeP62Nz9.js";import{g as tt}from"./analyticsHelper-DhzoozKy.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BldrMJdh.js";import{C as st}from"./CompanyPassportScreen-CamQRzbi.js";import{M as R}from"./MobileAppDrawer-fNaMEqpG.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-BtvKv8-C.js";import{q as le}from"./QBOConnectionScreen-a_jxuJVg.js";import{B as lt}from"./BillPayApprovalRoutes-BpoA_nrV.js";import{R as ct}from"./ReimbursementApprovalRoutes-DHL_6iez.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./accountMappingHelper-DTr2dybD.js";import"./routePaths-C1I3AVBw.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./empty-B3p_skJy.js";import"./pdf-lib-B5AjOY9Z.js";import"./index-sGFH656b.js";import"./url-BryZycM8.js";import"./index-Cg11XXLq.js";import"./decodeURIComponentSafe-CNj7wDd5.js";import"./ReimbursementApprovalRuleDetailScreen-j72H8n28.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]="23c3db3f-1b28-4a28-aeac-bd23ff192d51",e._sentryDebugIdIdentifier="sentry-dbid-23c3db3f-1b28-4a28-aeac-bd23ff192d51")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-C_txwMxP.js";import{a as d}from"./sentry-D_60LtUS.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-_lmxLuL7.js";import{fF as w,Zl as ve,NA as Pe,YV as we,Z2 as Ae,c8 as X,cT as De,cU as Ue,bq as _e,de as Me,FV as Re,Zm as Te,P1 as Be,Mr as Ze,Mi as de,Mf as Fe,FZ as ue,Ml as pe,Mo as ge,Mu as W,C9 as ee,FY as Ve,lu as $,lx as me,Zn as Ne,mH as Oe,Ge as Le,VB as Ge,VC as $e,ls as He,Zo as Ke,lv as qe,uA as ze,Vw as Qe,Vx as Ye,uE as Je,hV as Xe,Uv as Q,hN as ae,hK as We,hS as en,Uw as nn,Gb as tn,Zp as an,Zq as on,MI as sn,l$ as rn,dZ as fe,d_ as he,Zr as ln,gC as cn,UL as dn,Ga as oe,gH as se,gG as un,G9 as pn,gF as gn,gE as mn,Zs as fn,TX as Ce,Zt as hn,Zu as Cn,Zv as yn,Zw as Sn,Zx as bn,Zy as In,Gh as xn,Zz as En,G8 as ie,G2 as G,ZA as kn,ZB as jn,ZC as re,ZD as vn,dS as Pn,ZE as wn,ZF as An,ZG as Dn,U7 as Un,c0 as _n,c7 as Mn,c6 as Rn,c1 as Tn,ZH as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-CtlpRqoe.js";import{bU as On,z as P,Q as L,a8 as ne,c4 as Ln,j as q,c as te,v as F,g as ye,N as Se,c5 as Gn,h as $n,_ as be,c6 as Hn,aj as Kn,c7 as qn,c8 as zn,ar as Qn,c9 as Yn,p as Jn,d as Ie,ca as Xn}from"./index-B6grZ9sx.js";import{n as B}from"./mui-DbFwPEO7.js";import{u as xe}from"./useTaskManagerAccess-vvZ5G9JM.js";import{U as Wn}from"./AccountMappingScreen-BxRledTj.js";import{t as et,A as nt}from"./AddressScreen-CwA3IRwX.js";import V from"./NotFoundScreen-DNVEwzIN.js";import{g as tt}from"./analyticsHelper-4iM19yWB.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DeXHIi3R.js";import{C as st}from"./CompanyPassportScreen-DSh6Ipzn.js";import{M as R}from"./MobileAppDrawer-COi151oe.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-VgqVnnGo.js";import{q as le}from"./QBOConnectionScreen-BAF64NHf.js";import{B as lt}from"./BillPayApprovalRoutes-D4kOwTBO.js";import{R as ct}from"./ReimbursementApprovalRoutes-Bu_MlS4C.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";import"./accountMappingHelper-DTr2dybD.js";import"./routePaths-hwxApcva.js";import"./InboxNotificationsProvider-CvLL3Xda.js";import"./empty-B3p_skJy.js";import"./pdf-lib-B5AjOY9Z.js";import"./index-sGFH656b.js";import"./url-BryZycM8.js";import"./index-Cg11XXLq.js";import"./decodeURIComponentSafe-CNj7wDd5.js";import"./ReimbursementApprovalRuleDetailScreen-Basp-Q4U.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]="23c3db3f-1b28-4a28-aeac-bd23ff192d51",e._sentryDebugIdIdentifier="sentry-dbid-23c3db3f-1b28-4a28-aeac-bd23ff192d51")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-C_txwMxP.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as G,t as Xe}from"./core-_lmxLuL7.js";import{bJ as en,fF as F,cG as nn,HN as $,YV as tn,YY as an,uT as ne,uH as te,mz as ae,BH as R,Y_ as Ce,gG as He,gF as We,gE as Ge,Y$ as sn,HW as on,Mr as he,Mi as Ie,Mf as Ae,LZ as J,Ml as _e,Mo as ke,Mu as ve,C9 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,Z0 as mn,KZ as de,LB as yn,Z1 as fn,bK as gn,NM as le,NA as Sn,Z2 as bn,Z3 as Cn,NQ as hn,NU as In,Z4 as je,BA as An,Sg as _n,Oq as be,Pf as pe,Z5 as kn,Z6 as vn,Z7 as Pn,Z8 as Ye,Z9 as Tn,Vk as En,Ya as Dn,Vz as Un,Za as Ke,M1 as On,VA as wn,M5 as Fn,Zb as we,OA as qe,mH as Vn,uK as Je,BJ as xn,bE as Ne,BV as Re,cE as Bn,Zc as Qe,O7 as jn,O8 as Nn,Oc as Rn,Zd as Ln,Ot as Le,Ze as Mn,Zf as zn,Zg as Zn,Zh as $n,gV as Hn,J6 as Wn,Zi as Gn,Jb as Yn,Ja as Kn}from"./zeni-epic-state-CtlpRqoe.js";import{aj as Te,Q as ie,c as me,v as q,E as Ee,z as E,a9 as se,j as D,a8 as De,W as H,bR as qn,af as oe,bS as V,bj as Ve,bT as Jn,bU as Qn,bV as Xn,n as Be,bW as et,p as Me,aH as ze,a2 as nt,ac as tt,bX as at,bY as it,bZ as st,w as ot}from"./index-BqEaHxIT.js";import{a as h}from"./sentry-D_60LtUS.js";import{n as xe,D as ct,S as rt}from"./mui-DbFwPEO7.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-BldrMJdh.js";import{M as ye}from"./MobileAppDrawer-fNaMEqpG.js";import N from"./NotFoundScreen-BeP62Nz9.js";import{a as Ze}from"./analyticsHelper-DhzoozKy.js";import{d as $e}from"./routePaths-C1I3AVBw.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]="28d5c3f9-ca39-4224-957a-40f15402d492",e._sentryDebugIdIdentifier="sentry-dbid-28d5c3f9-ca39-4224-957a-40f15402d492")}catch{}})();const dt=xe.div`
1
+ import{j as u}from"./liveblocks-C_txwMxP.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as G,t as Xe}from"./core-_lmxLuL7.js";import{bJ as en,fF as F,cG as nn,HN as $,YV as tn,YY as an,uT as ne,uH as te,mz as ae,BH as R,Y_ as Ce,gG as He,gF as We,gE as Ge,Y$ as sn,HW as on,Mr as he,Mi as Ie,Mf as Ae,LZ as J,Ml as _e,Mo as ke,Mu as ve,C9 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,Z0 as mn,KZ as de,LB as yn,Z1 as fn,bK as gn,NM as le,NA as Sn,Z2 as bn,Z3 as Cn,NQ as hn,NU as In,Z4 as je,BA as An,Sg as _n,Oq as be,Pf as pe,Z5 as kn,Z6 as vn,Z7 as Pn,Z8 as Ye,Z9 as Tn,Vk as En,Ya as Dn,Vz as Un,Za as Ke,M1 as On,VA as wn,M5 as Fn,Zb as we,OA as qe,mH as Vn,uK as Je,BJ as xn,bE as Ne,BV as Re,cE as Bn,Zc as Qe,O7 as jn,O8 as Nn,Oc as Rn,Zd as Ln,Ot as Le,Ze as Mn,Zf as zn,Zg as Zn,Zh as $n,gV as Hn,J6 as Wn,Zi as Gn,Jb as Yn,Ja as Kn}from"./zeni-epic-state-CtlpRqoe.js";import{aj as Te,Q as ie,c as me,v as q,E as Ee,z as E,a9 as se,j as D,a8 as De,W as H,bR as qn,af as oe,bS as V,bj as Ve,bT as Jn,bU as Qn,bV as Xn,n as Be,bW as et,p as Me,aH as ze,a2 as nt,ac as tt,bX as at,bY as it,bZ as st,w as ot}from"./index-B6grZ9sx.js";import{a as h}from"./sentry-D_60LtUS.js";import{n as xe,D as ct,S as rt}from"./mui-DbFwPEO7.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-DeXHIi3R.js";import{M as ye}from"./MobileAppDrawer-COi151oe.js";import N from"./NotFoundScreen-DNVEwzIN.js";import{a as Ze}from"./analyticsHelper-4iM19yWB.js";import{d as $e}from"./routePaths-hwxApcva.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]="28d5c3f9-ca39-4224-957a-40f15402d492",e._sentryDebugIdIdentifier="sentry-dbid-28d5c3f9-ca39-4224-957a-40f15402d492")}catch{}})();const dt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-C_txwMxP.js";import{a as u,R as T,q as A}from"./sentry-D_60LtUS.js";import{u as j,h as z,j as l,g as D,N as F,l as M}from"./core-_lmxLuL7.js";import{u as O,z as s,E as P,j as w,G as _,U as N,W as B,X as $,Y as V,Z as W,_ as v}from"./index-BqEaHxIT.js";import{fF as q,TT as J,Ub as R,gi as X,gk as G,Ug as H,gU as Y,dj as Z,Uh as y,Ui as K,Uj as Q,b$ as U}from"./zeni-epic-state-CtlpRqoe.js";import"./mui-DbFwPEO7.js";import{u as ee}from"./useDeviceId-Dks2onQn.js";import{f as te}from"./analyticsHelper-DhzoozKy.js";import{t as ne}from"./getLocaleForTenant-DiPOVD9Y.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="0d3ff2b3-076d-4833-a40e-57b5d00f8584",t._sentryDebugIdIdentifier="sentry-dbid-0d3ff2b3-076d-4833-a40e-57b5d00f8584")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(K(n,a)))},clearSignInError:()=>{t(y())}}}))(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=j(),d=z(),{clearAllLoading:g}=O(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=D(),E=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Y().then((()=>{const e=V();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",Z(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(F,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx($,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-C_txwMxP.js";import{a as u,R as T,q as A}from"./sentry-D_60LtUS.js";import{u as j,h as z,j as l,g as D,N as F,l as M}from"./core-_lmxLuL7.js";import{u as O,z as s,E as P,j as w,G as _,U as N,W as B,X as $,Y as V,Z as W,_ as v}from"./index-B6grZ9sx.js";import{fF as q,TT as J,Ub as R,gi as X,gk as G,Ug as H,gU as Y,dj as Z,Uh as y,Ui as K,Uj as Q,b$ as U}from"./zeni-epic-state-CtlpRqoe.js";import"./mui-DbFwPEO7.js";import{u as ee}from"./useDeviceId-Dks2onQn.js";import{f as te}from"./analyticsHelper-4iM19yWB.js";import{t as ne}from"./getLocaleForTenant-B789-FKJ.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="0d3ff2b3-076d-4833-a40e-57b5d00f8584",t._sentryDebugIdIdentifier="sentry-dbid-0d3ff2b3-076d-4833-a40e-57b5d00f8584")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(K(n,a)))},clearSignInError:()=>{t(y())}}}))(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=j(),d=z(),{clearAllLoading:g}=O(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=D(),E=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Y().then((()=>{const e=V();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",Z(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(F,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx($,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C_txwMxP.js";import{a as i}from"./sentry-D_60LtUS.js";import{u as f,g as l,N as u}from"./core-_lmxLuL7.js";import{z as n,j as a,W as m,a8 as p}from"./index-BqEaHxIT.js";import{gX as g,Ux as b}from"./zeni-epic-state-CtlpRqoe.js";import{n as y}from"./mui-DbFwPEO7.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.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]="20beedd5-6178-4f71-a2a5-5bcccb68bdba",e._sentryDebugIdIdentifier="sentry-dbid-20beedd5-6178-4f71-a2a5-5bcccb68bdba")}catch{}})();function N(){const e=f(),t=l(),r=i.useRef(!1),c=n.isSignedIn(),o=t.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
1
+ import{j as s}from"./liveblocks-C_txwMxP.js";import{a as i}from"./sentry-D_60LtUS.js";import{u as f,g as l,N as u}from"./core-_lmxLuL7.js";import{z as n,j as a,W as m,a8 as p}from"./index-B6grZ9sx.js";import{gX as g,Ux as b}from"./zeni-epic-state-CtlpRqoe.js";import{n as y}from"./mui-DbFwPEO7.js";import"./recharts-B43pV0TY.js";import"./analytics-BLHCH9ZW.js";import"./plaid-DHbQ1Fnc.js";import"./dnd-4_dRT_p_.js";import"./stripe-cKAAJElX.js";import"./lottie-CyJj6i4R.js";import"./lexical-BibO8P7-.js";import"./pdf-BfgO0ZZE.js";import"./utils-CPbtTTqo.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]="20beedd5-6178-4f71-a2a5-5bcccb68bdba",e._sentryDebugIdIdentifier="sentry-dbid-20beedd5-6178-4f71-a2a5-5bcccb68bdba")}catch{}})();function N(){const e=f(),t=l(),r=i.useRef(!1),c=n.isSignedIn(),o=t.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as g}from"./liveblocks-C_txwMxP.js";import{a as A}from"./sentry-D_60LtUS.js";import{h as pa,u as Ta,g as fa,k as ga,j as v,i as _a,l as ma}from"./core-_lmxLuL7.js";import{z as R,c as Da,v as _,at as Sa,a9 as ya,j as Ea,W as ba,e6 as ha,p as C,a5 as Aa}from"./index-BqEaHxIT.js";import{fF as Ca,a1$ as V,R2 as D,a20 as W,a1X as Ga,Qq as N,a21 as Ia,Qy as O,Q8 as Ba,PM as La,R3 as Q,a22 as z,gh as Ka,QV as va,Q_ as wa,QN as Ra,QL as Z,Q$ as Ua,QI as Pa,a23 as Fa,a24 as ja,a25 as $a,a26 as xa,a27 as m,dx as Na,dw as Oa,a28 as Qa,Q5 as za}from"./zeni-epic-state-CtlpRqoe.js";import{n as Za}from"./mui-DbFwPEO7.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-Biynu986.js";import{M as Va}from"./MobileAppDrawer-fNaMEqpG.js";import{u as Wa}from"./useTaskManagerPusherEvents-BPWIyNie.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="08932f2d-a3d8-4a00-b49f-94d50592f874",e._sentryDebugIdIdentifier="sentry-dbid-08932f2d-a3d8-4a00-b49f-94d50592f874")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},qa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ha=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ya=Za.div`
1
+ import{j as g}from"./liveblocks-C_txwMxP.js";import{a as A}from"./sentry-D_60LtUS.js";import{h as pa,u as Ta,g as fa,k as ga,j as v,i as _a,l as ma}from"./core-_lmxLuL7.js";import{z as R,c as Da,v as _,at as Sa,a9 as ya,j as Ea,W as ba,e6 as ha,p as C,a5 as Aa}from"./index-B6grZ9sx.js";import{fF as Ca,a1$ as V,R2 as D,a20 as W,a1X as Ga,Qq as N,a21 as Ia,Qy as O,Q8 as Ba,PM as La,R3 as Q,a22 as z,gh as Ka,QV as va,Q_ as wa,QN as Ra,QL as Z,Q$ as Ua,QI as Pa,a23 as Fa,a24 as ja,a25 as $a,a26 as xa,a27 as m,dx as Na,dw as Oa,a28 as Qa,Q5 as za}from"./zeni-epic-state-CtlpRqoe.js";import{n as Za}from"./mui-DbFwPEO7.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-DycPeMu8.js";import{M as Va}from"./MobileAppDrawer-COi151oe.js";import{u as Wa}from"./useTaskManagerPusherEvents-A5AmC0FP.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="08932f2d-a3d8-4a00-b49f-94d50592f874",e._sentryDebugIdIdentifier="sentry-dbid-08932f2d-a3d8-4a00-b49f-94d50592f874")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},qa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ha=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ya=Za.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;