@zeniai/web-app-ui 5.3.99-dev → 5.3.99-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-Cwa6Sncr.js → AccountMappingScreen-BkDkFrFJ.js} +1 -1
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-JAoGrJi3.js → ActualMatchingMatchDetailScreen-D5qXBMmf.js} +1 -1
  3. package/dist/assets/{AddressRoutes-D0QZxsbK.js → AddressRoutes-BauVlHZ9.js} +1 -1
  4. package/dist/assets/{AddressScreen-hby_CR8D.js → AddressScreen-BVI08KOj.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-DNDihu3K.js → AiCfoScreen-BM8X0l_M.js} +1 -1
  6. package/dist/assets/{AppDrawer-Cupbn6L3.js → AppDrawer-IgFoNmoU.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-sOvVtkKV.js → BillPayApprovalRoutes-D9-VveJq.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-DAZ2LiAE.js → BillPayRoutes-C4asT9KO.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-CpAzjlh5.js → BusinessVerificationPageScreen-CWXmaf4U.js} +1 -1
  10. package/dist/assets/{CardsAiCfoScreen-BP02_M1s.js → CardsAiCfoScreen-DsznFOdz.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-Ba3x5MoU.js → ChargeCardRoutes-BFj7SQT_.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-B7KOuZR_.js → CompanyPassportScreen-CrbGMPCk.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-CDQ0Sa51.js → ConnectionAuthScreen-CaChuRRr.js} +1 -1
  14. package/dist/assets/{CustomerOnboardingAuthScreen-CzX3lGuD.js → CustomerOnboardingAuthScreen-Cy2yXNUw.js} +1 -1
  15. package/dist/assets/{CustomerOnboardingRoutes-B3teunq3.js → CustomerOnboardingRoutes-j2eujk3K.js} +1 -1
  16. package/dist/assets/{DashboardRoutes-DnxyUY7k.js → DashboardRoutes-szc-1AzX.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-DNm_mIU1.js → DefaultTenantHome-DgZZzSS3.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-Cb0F3Rod.js → DomesticWireDetailScreen-COcrGUh-.js} +1 -1
  19. package/dist/assets/{DrawerScreen-B5Qgxoe2.js → DrawerScreen-BisD9BlZ.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes--Mqqoc0l.js → EntityDetailRoutes-DCNh3BwN.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-Ce113KIS.js → ExpenseAutomationRoutes-DS-VvjPP.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-Bu-JxAVw.js → FeaturePreviewScreen-DHyyRYim.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-B12KbAGI.js → HubSpotOAuthCallbackScreen-3hGk6JKH.js} +1 -1
  24. package/dist/assets/{InvoicingRoutes-IUj-CS51.js → InvoicingRoutes-BHc9WH_Q.js} +1 -1
  25. package/dist/assets/{MagicLinkRoutes-6bWvZ6Ex.js → MagicLinkRoutes-6zPm7Mq6.js} +1 -1
  26. package/dist/assets/{MagicLinkSignInScreen-kYQNLgBh.js → MagicLinkSignInScreen-D3EUW5Lx.js} +1 -1
  27. package/dist/assets/{MobileAppDrawer-D4DOSbVQ.js → MobileAppDrawer-tz9GmHDM.js} +1 -1
  28. package/dist/assets/{NotFoundScreen-D92eiixV.js → NotFoundScreen-DiDzsmTQ.js} +1 -1
  29. package/dist/assets/{NotificationRoutes-BV6tu0jZ.js → NotificationRoutes-BwMNmTMU.js} +1 -1
  30. package/dist/assets/{OAuthConsentScreen-BKzEKwhD.js → OAuthConsentScreen-WkoAUQ1C.js} +1 -1
  31. package/dist/assets/{PandLWithForecastRoutes-CcRkLhpt.js → PandLWithForecastRoutes-BlQEN4ZR.js} +1 -1
  32. package/dist/assets/{PaymentLinkScreen-DVW3u8lI.js → PaymentLinkScreen-DKlYcyU-.js} +1 -1
  33. package/dist/assets/{PeopleRoutes-DPu9dF6W.js → PeopleRoutes-BhozwT2h.js} +1 -1
  34. package/dist/assets/{PerformanceRoutes-D8D-QN7a.js → PerformanceRoutes-BybLFxoL.js} +1 -1
  35. package/dist/assets/{QBOConnectionScreen-BbOyxErb.js → QBOConnectionScreen-D1O6bt7C.js} +1 -1
  36. package/dist/assets/{ReimbursementApprovalRoutes-CixN0rww.js → ReimbursementApprovalRoutes-CFEzKEIR.js} +1 -1
  37. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-XsqK1nGV.js → ReimbursementApprovalRuleDetailScreen-BReOftYM.js} +1 -1
  38. package/dist/assets/{ReimbursementRoutes-B2FNn_0P.js → ReimbursementRoutes-D4TyOUBY.js} +1 -1
  39. package/dist/assets/{ReportsRoutes-CJrunnvK.js → ReportsRoutes-BtXBZfhs.js} +1 -1
  40. package/dist/assets/{RewardsRoutes-8HmabMf6.js → RewardsRoutes-BbrnCETe.js} +1 -1
  41. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DHpH5oJw.js → ScheduleDetailsPrepaidExpensesScreen-BYfVzzkg.js} +1 -1
  42. package/dist/assets/{ScreenRoutes-DAK3aVc9.js → ScreenRoutes-BETRDGIK.js} +2 -2
  43. package/dist/assets/{SettingsRoutes-6-0ys-s5.js → SettingsRoutes-DHbF39FQ.js} +1 -1
  44. package/dist/assets/{SetupPagesScreen-BbFcVR26.js → SetupPagesScreen-B0Baphh_.js} +1 -1
  45. package/dist/assets/{SignInScreen-mTQjLuAc.js → SignInScreen-CsHUYOP8.js} +1 -1
  46. package/dist/assets/{SignOutScreen-C7lCXdn2.js → SignOutScreen-hEqypkGs.js} +1 -1
  47. package/dist/assets/{TaskListScreen-CW5lbYvD.js → TaskListScreen-DbQ_Vji7.js} +1 -1
  48. package/dist/assets/{TaskRoutes-ssEkwrEi.js → TaskRoutes-Wz2rUEal.js} +1 -1
  49. package/dist/assets/{TransactionDetailRoutes-DBqh72Ke.js → TransactionDetailRoutes-DqlTEkLS.js} +1 -1
  50. package/dist/assets/{TransactionDetailScreen-B1no9UdL.js → TransactionDetailScreen-DgVpYIwj.js} +1 -1
  51. package/dist/assets/{TransactionListRoutes-DCMjmg_J.js → TransactionListRoutes-g16F1PqI.js} +1 -1
  52. package/dist/assets/{TreasuryRoutes-BUhJHYkV.js → TreasuryRoutes-CHjx786J.js} +1 -1
  53. package/dist/assets/{VendorsRoutes-C1J2HapW.js → VendorsRoutes-t7Emyx55.js} +1 -1
  54. package/dist/assets/{WiseConfirmationScreen-DgUBxs8P.js → WiseConfirmationScreen-BulJKPGJ.js} +1 -1
  55. package/dist/assets/{ZeniAccountRoutes-C4aExMdo.js → ZeniAccountRoutes-Gv-e-xMQ.js} +1 -1
  56. package/dist/assets/{ZeniAccountStatementScreen-Vi4F2dbO.js → ZeniAccountStatementScreen-B9byQtF9.js} +1 -1
  57. package/dist/assets/{analyticsHelper-drNlDujn.js → analyticsHelper-DJg-y5OM.js} +1 -1
  58. package/dist/assets/{getLocaleForTenant-7mVUFLO-.js → getLocaleForTenant-VEtlPr-d.js} +1 -1
  59. package/dist/assets/{index-DmFy--fV.js → index-C1XAfugK.js} +5 -5
  60. package/dist/assets/{routePaths-DQh6iYo4.js → routePaths-D9MDrQwY.js} +1 -1
  61. package/dist/assets/{useActualMatchingMatchDetail-CN5JVNal.js → useActualMatchingMatchDetail-0lCJi4qB.js} +1 -1
  62. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-3GfaqAPj.js → useAiCfoDashboardSuggestedQuestionsChips-CxjKgYgG.js} +1 -1
  63. package/dist/assets/{useAskAiCfoHostNavButtonProps-CgHJ-iCU.js → useAskAiCfoHostNavButtonProps-DL_-SXBI.js} +1 -1
  64. package/dist/assets/{useChargeCardPusherEvents-JxJnisR-.js → useChargeCardPusherEvents-lx0W0oNg.js} +1 -1
  65. package/dist/assets/{useEmailConnectResultRefresh-Dv9IT8_0.js → useEmailConnectResultRefresh-DMm4oCVO.js} +1 -1
  66. package/dist/assets/{useInitialThreadRequest-DA5FMzag.js → useInitialThreadRequest-CPJRbiPZ.js} +1 -1
  67. package/dist/assets/{useTaskManagerAccess-CpacCRSq.js → useTaskManagerAccess-B4qnBqXa.js} +1 -1
  68. package/dist/assets/{useTaskManagerPusherEvents-CcIRdnMY.js → useTaskManagerPusherEvents-DRAANaIB.js} +1 -1
  69. package/dist/assets/{withTransactionSidePanel-BOIdrs8l.js → withTransactionSidePanel-DPzo8PmT.js} +1 -1
  70. package/dist/index.html +1 -1
  71. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-Bym0XjRt.js";import{h as G,u as Y,g as z,i as H,j as d,l as J,n as K,o as S}from"./core-C9Jt3gNb.js";import{fI as v,Az as O,vc as Q,Wg as w,v7 as T,bq as X,c1 as Z,v8 as ee,Wh as ae,V_ as C,ek as te,Es as se,Wi as oe,ER as re,e1 as ne,e0 as ce}from"./zeni-epic-state-OTisIlmp.js";import{ag as ie,z as le,ao as de,aq as me,V as fe,a6 as pe,l as M,aB as ue,p as he,d as ge,P as Fe}from"./index-DmFy--fV.js";import"./mui-BsgiBiT9.js";import Ie from"./NotFoundScreen-D92eiixV.js";import{F as be}from"./FeaturePreviewScreen-Bu-JxAVw.js";import{a as g}from"./sentry-CoKtZcTW.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CgHJ-iCU.js";import{u as Ce}from"./useInitialThreadRequest-DA5FMzag.js";import{t as Te}from"./routePaths-DQh6iYo4.js";import{M as ye}from"./MobileAppDrawer-D4DOSbVQ.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-CpacCRSq.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="0785181e-1cb7-42a5-960c-71da6fa95691",s._sentryDebugIdIdentifier="sentry-dbid-0785181e-1cb7-42a5-960c-71da6fa95691")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=G(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=g.useState(!1),[m,A]=g.useState(!1),F=le.getSignedInUser(),x=d((t=>v(t))),q=x.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),D=d((t=>t.profitAndLossState)),P=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>D.pandLByForecastID[t]!=null&&ee(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Se({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!m){A(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex((b=>b.id===L)):R!=null?f.forecasts.findIndex((b=>b.id===R)):f.forecasts.length>0?0:-1)(i,r,P?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=P?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!k(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,O,T,I]);const j=fe(),W=j?.loggedInUserRole!=null&&X(j.loggedInUserRole),N=Ce(x?.companyId,{clearParams:l&&m}),[V,$]=g.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",F?.firstName??""),h.searchParams.set("lastname",F?.lastName??""),h.searchParams.set("email",F?.userEmail??"");const E=t=>{$(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(Ae,{firstMonthOfFY:q,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:k,meetingUrl:Z(h.toString()),hasTransactionAccess:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,initialOpenThreadRequest:N,onClickMenuIcon:()=>{E(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=ge(),{isFeatureEnabled:a}=e(Fe.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
1
+ import{j as n}from"./liveblocks-Bym0XjRt.js";import{h as G,u as Y,g as z,i as H,j as d,l as J,n as K,o as S}from"./core-C9Jt3gNb.js";import{fI as v,Az as O,vc as Q,Wg as w,v7 as T,bq as X,c1 as Z,v8 as ee,Wh as ae,V_ as C,ek as te,Es as se,Wi as oe,ER as re,e1 as ne,e0 as ce}from"./zeni-epic-state-OTisIlmp.js";import{ag as ie,z as le,ao as de,aq as me,V as fe,a6 as pe,l as M,aB as ue,p as he,d as ge,P as Fe}from"./index-C1XAfugK.js";import"./mui-BsgiBiT9.js";import Ie from"./NotFoundScreen-DiDzsmTQ.js";import{F as be}from"./FeaturePreviewScreen-DHyyRYim.js";import{a as g}from"./sentry-CoKtZcTW.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DL_-SXBI.js";import{u as Ce}from"./useInitialThreadRequest-CPJRbiPZ.js";import{t as Te}from"./routePaths-D9MDrQwY.js";import{M as ye}from"./MobileAppDrawer-tz9GmHDM.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-B4qnBqXa.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="0785181e-1cb7-42a5-960c-71da6fa95691",s._sentryDebugIdIdentifier="sentry-dbid-0785181e-1cb7-42a5-960c-71da6fa95691")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=G(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=g.useState(!1),[m,A]=g.useState(!1),F=le.getSignedInUser(),x=d((t=>v(t))),q=x.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),D=d((t=>t.profitAndLossState)),P=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>D.pandLByForecastID[t]!=null&&ee(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Se({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!m){A(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex((b=>b.id===L)):R!=null?f.forecasts.findIndex((b=>b.id===R)):f.forecasts.length>0?0:-1)(i,r,P?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=P?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!k(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,O,T,I]);const j=fe(),W=j?.loggedInUserRole!=null&&X(j.loggedInUserRole),N=Ce(x?.companyId,{clearParams:l&&m}),[V,$]=g.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",F?.firstName??""),h.searchParams.set("lastname",F?.lastName??""),h.searchParams.set("email",F?.userEmail??"");const E=t=>{$(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(Ae,{firstMonthOfFY:q,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:k,meetingUrl:Z(h.toString()),hasTransactionAccess:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,initialOpenThreadRequest:N,onClickMenuIcon:()=>{E(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=ge(),{isFeatureEnabled:a}=e(Fe.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-Bym0XjRt.js";import{a as d}from"./sentry-CoKtZcTW.js";import{D as a,a7 as u,ab as f,ac as h}from"./index-DmFy--fV.js";import{s as l}from"./mui-BsgiBiT9.js";import{i as y}from"./core-C9Jt3gNb.js";import"./zeni-epic-state-OTisIlmp.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.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]="bce1c899-3c5c-477f-9ab0-f862a1a5746e",e._sentryDebugIdIdentifier="sentry-dbid-bce1c899-3c5c-477f-9ab0-f862a1a5746e")}catch{}})();const g=l("div")`
1
+ import{j as r}from"./liveblocks-Bym0XjRt.js";import{a as d}from"./sentry-CoKtZcTW.js";import{D as a,a7 as u,ab as f,ac as h}from"./index-C1XAfugK.js";import{s as l}from"./mui-BsgiBiT9.js";import{i as y}from"./core-C9Jt3gNb.js";import"./zeni-epic-state-OTisIlmp.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.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]="bce1c899-3c5c-477f-9ab0-f862a1a5746e",e._sentryDebugIdIdentifier="sentry-dbid-bce1c899-3c5c-477f-9ab0-f862a1a5746e")}catch{}})();const g=l("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Bym0XjRt.js";import{Wc as re,fI as Y,m3 as H,e1 as N,e0 as le,T2 as Q,VB as ce,Di as Ee,Wd as J,D7 as je,Ds as Le,Dm as de,Db as pe,Dq as ve,Dn as Te,We as ue,sx as Ae,g9 as Ve,gG as Re,Wf as W,Df as me,De as ge,Dv as Fe,ca as Oe}from"./zeni-epic-state-OTisIlmp.js";import{$ as fe,d as X,P as G,z as _,h as he,J as Ce,ad as ye,ax as be,ay as Be,a9 as De,D as F,ae as Se,G as K,az as Ze,ao as Ue,aq as $e,a6 as ze,l as we,Q as We,p as Ge,aA as He,V as _e}from"./index-DmFy--fV.js";import{D as xe,n as M,S as Ie}from"./mui-BsgiBiT9.js";import ae from"./NotFoundScreen-D92eiixV.js";import{a as c}from"./sentry-CoKtZcTW.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-C9Jt3gNb.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-CgHJ-iCU.js";import{M as Ne}from"./MobileAppDrawer-D4DOSbVQ.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-CpacCRSq.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]="02bc6042-9985-49ea-a504-1b76d9ff1619",e._sentryDebugIdIdentifier="sentry-dbid-02bc6042-9985-49ea-a504-1b76d9ff1619")}catch{}})();const Qe={overlayWidth:new De(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,B]=c.useState(!1),[k,D]=c.useState(!1),{userId:S}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),P=g((l=>H(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(G.isDebitCardFeatureEnabled),E=N(I,p),v=le(p),T=Q(p),Z=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!E&&P&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{O===!0?D(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(G.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:V}=Ce(p?.tenantId),y=!L||V,R=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:P,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return c.useEffect((()=>{w===!1&&S!=null&&m(Ee(S))}),[w,S]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Pe,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Be,{...s})]})})},ea=M(Ie)`
1
+ import{j as a}from"./liveblocks-Bym0XjRt.js";import{Wc as re,fI as Y,m3 as H,e1 as N,e0 as le,T2 as Q,VB as ce,Di as Ee,Wd as J,D7 as je,Ds as Le,Dm as de,Db as pe,Dq as ve,Dn as Te,We as ue,sx as Ae,g9 as Ve,gG as Re,Wf as W,Df as me,De as ge,Dv as Fe,ca as Oe}from"./zeni-epic-state-OTisIlmp.js";import{$ as fe,d as X,P as G,z as _,h as he,J as Ce,ad as ye,ax as be,ay as Be,a9 as De,D as F,ae as Se,G as K,az as Ze,ao as Ue,aq as $e,a6 as ze,l as we,Q as We,p as Ge,aA as He,V as _e}from"./index-C1XAfugK.js";import{D as xe,n as M,S as Ie}from"./mui-BsgiBiT9.js";import ae from"./NotFoundScreen-DiDzsmTQ.js";import{a as c}from"./sentry-CoKtZcTW.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-C9Jt3gNb.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DL_-SXBI.js";import{M as Ne}from"./MobileAppDrawer-tz9GmHDM.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-B4qnBqXa.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]="02bc6042-9985-49ea-a504-1b76d9ff1619",e._sentryDebugIdIdentifier="sentry-dbid-02bc6042-9985-49ea-a504-1b76d9ff1619")}catch{}})();const Qe={overlayWidth:new De(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,B]=c.useState(!1),[k,D]=c.useState(!1),{userId:S}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),P=g((l=>H(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(G.isDebitCardFeatureEnabled),E=N(I,p),v=le(p),T=Q(p),Z=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!E&&P&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{O===!0?D(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(G.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:V}=Ce(p?.tenantId),y=!L||V,R=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:P,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return c.useEffect((()=>{w===!1&&S!=null&&m(Ee(S))}),[w,S]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Pe,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Be,{...s})]})})},ea=M(Ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-Bym0XjRt.js";import E from"./NotFoundScreen-D92eiixV.js";import{a as r}from"./sentry-CoKtZcTW.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as N,o as b}from"./core-C9Jt3gNb.js";import{fI as O,a1Y as h,bo as B,bn as F,iP as V,gk as q}from"./zeni-epic-state-OTisIlmp.js";import{c as Y,z as I,aq as $,dN as G}from"./index-DmFy--fV.js";import"./mui-BsgiBiT9.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-CgHJ-iCU.js";import{M as J}from"./MobileAppDrawer-D4DOSbVQ.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-CpacCRSq.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]="209bb55a-d7ef-49fb-b8f2-ddecd4e75167",e._sentryDebugIdIdentifier="sentry-dbid-209bb55a-d7ef-49fb-b8f2-ddecd4e75167")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),L=()=>{const e=_(),t=v(),d=Y(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=M(),u=P(),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=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=F(l),y=C||k||x,c=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(q({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"||c(a,i,!0),f.current=!0}),[n?.fetchState,c]),j=r.useCallback(((a,i)=>{c(a,i,!1)}),[c]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:d,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function be(){return s.jsxs(N,{children:[s.jsx(b,{path:"*",element:s.jsx(L,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
1
+ import{j as s}from"./liveblocks-Bym0XjRt.js";import E from"./NotFoundScreen-DiDzsmTQ.js";import{a as r}from"./sentry-CoKtZcTW.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as N,o as b}from"./core-C9Jt3gNb.js";import{fI as O,a1Y as h,bo as B,bn as F,iP as V,gk as q}from"./zeni-epic-state-OTisIlmp.js";import{c as Y,z as I,aq as $,dN as G}from"./index-C1XAfugK.js";import"./mui-BsgiBiT9.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-DL_-SXBI.js";import{M as J}from"./MobileAppDrawer-tz9GmHDM.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-B4qnBqXa.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]="209bb55a-d7ef-49fb-b8f2-ddecd4e75167",e._sentryDebugIdIdentifier="sentry-dbid-209bb55a-d7ef-49fb-b8f2-ddecd4e75167")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),L=()=>{const e=_(),t=v(),d=Y(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=M(),u=P(),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=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=F(l),y=C||k||x,c=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(q({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"||c(a,i,!0),f.current=!0}),[n?.fetchState,c]),j=r.useCallback(((a,i)=>{c(a,i,!1)}),[c]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:d,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function be(){return s.jsxs(N,{children:[s.jsx(b,{path:"*",element:s.jsx(L,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-Bym0XjRt.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-CoKtZcTW.js";import{L as ge,c1 as xc,fI as kc,UJ as Tc,Vz as jl,ca as xl}from"./zeni-epic-state-OTisIlmp.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-CNqTTzSx.js";import{r as cn}from"./empty-D0s_5kET.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-CRTLGVrP.js";import{a as Ye,r as Fl}from"./index-B3Xhbg9K.js";import{r as Ul}from"./index-CIoiM__n.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-C9Jt3gNb.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,B as Kl}from"./index-DmFy--fV.js";import"./mui-BsgiBiT9.js";import{d as It}from"./decodeURIComponentSafe-Cr8jQXNX.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]="2c4da1c8-a2d7-4a51-9b9d-9c44fa31ec89",e._sentryDebugIdIdentifier="sentry-dbid-2c4da1c8-a2d7-4a51-9b9d-9c44fa31ec89")}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-Bym0XjRt.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-CoKtZcTW.js";import{L as ge,c1 as xc,fI as kc,UJ as Tc,Vz as jl,ca as xl}from"./zeni-epic-state-OTisIlmp.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-CNqTTzSx.js";import{r as cn}from"./empty-D0s_5kET.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-CRTLGVrP.js";import{a as Ye,r as Fl}from"./index-B3Xhbg9K.js";import{r as Ul}from"./index-CIoiM__n.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-C9Jt3gNb.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,B as Kl}from"./index-C1XAfugK.js";import"./mui-BsgiBiT9.js";import{d as It}from"./decodeURIComponentSafe-Cr8jQXNX.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]="2c4da1c8-a2d7-4a51-9b9d-9c44fa31ec89",e._sentryDebugIdIdentifier="sentry-dbid-2c4da1c8-a2d7-4a51-9b9d-9c44fa31ec89")}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-Bym0XjRt.js";import q from"./NotFoundScreen-D92eiixV.js";import{a as p}from"./sentry-CoKtZcTW.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as z,o as g}from"./core-C9Jt3gNb.js";import{fI as E,_0 as h,_i as w,Oe as U,Oa as L,Od as f,O3 as N,_H as B,O7 as H,Og as K}from"./zeni-epic-state-OTisIlmp.js";import{z as T,w as _,ca as F,q as $,bT as G,cb as J}from"./index-DmFy--fV.js";import"./mui-BsgiBiT9.js";import{u as M}from"./useEnsureVendorListLoaded-YOFp3iHN.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-XsqK1nGV.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]="6519fc8b-588f-4a9b-96f6-a90f7a1127ab",e._sentryDebugIdIdentifier="sentry-dbid-6519fc8b-588f-4a9b-96f6-a90f7a1127ab")}catch{}})();const j="reimbursement-approval-rule-update",P=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(_(F)),Q=({isLoading:e})=>{const s=C(),n=D(),a=V(),[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))),b=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),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(k,{to:"../../promo"}):r.jsx(P,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(_(J)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=G(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(Q,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));M();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||b!=="Not-Started"||e||(R(!0),a(H(!1,!0)))}),[v,b,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,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(Y,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(q,{})})]})}export{ue as R};
1
+ import{j as r}from"./liveblocks-Bym0XjRt.js";import q from"./NotFoundScreen-DiDzsmTQ.js";import{a as p}from"./sentry-CoKtZcTW.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as z,o as g}from"./core-C9Jt3gNb.js";import{fI as E,_0 as h,_i as w,Oe as U,Oa as L,Od as f,O3 as N,_H as B,O7 as H,Og as K}from"./zeni-epic-state-OTisIlmp.js";import{z as T,w as _,ca as F,q as $,bT as G,cb as J}from"./index-C1XAfugK.js";import"./mui-BsgiBiT9.js";import{u as M}from"./useEnsureVendorListLoaded-YOFp3iHN.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-BReOftYM.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]="6519fc8b-588f-4a9b-96f6-a90f7a1127ab",e._sentryDebugIdIdentifier="sentry-dbid-6519fc8b-588f-4a9b-96f6-a90f7a1127ab")}catch{}})();const j="reimbursement-approval-rule-update",P=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(_(F)),Q=({isLoading:e})=>{const s=C(),n=D(),a=V(),[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))),b=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),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(k,{to:"../../promo"}):r.jsx(P,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(_(J)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=G(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(Q,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));M();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||b!=="Not-Started"||e||(R(!0),a(H(!1,!0)))}),[v,b,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,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(Y,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(q,{})})]})}export{ue as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-Bym0XjRt.js";import{a as y}from"./sentry-CoKtZcTW.js";import{h as U,u as x,g as C,i as V,j as R,l as j}from"./core-C9Jt3gNb.js";import{_i as _,_0 as O,O6 as k,Oj as B,Oe as A,Of as E,_j as F,fI as K,Od as L}from"./zeni-epic-state-OTisIlmp.js";import{z as N,a5 as P,c1 as W,q,bT as G,c2 as H}from"./index-DmFy--fV.js";import{u as $}from"./mui-BsgiBiT9.js";import{u as J}from"./useEnsureVendorListLoaded-YOFp3iHN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="52253a2e-9123-4c39-8270-17e6bac1a613",e._sentryDebugIdIdentifier="sentry-dbid-52253a2e-9123-4c39-8270-17e6bac1a613")}catch{}})();const M=j((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(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("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(k(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=j((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,z=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=z.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const T=f.action??"require_approval";m.push({action:T,actors:D,operator:D.length>1?T==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.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("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=R((t=>K(t))),{isApprovalRulesV3Enabled:p}=G(e?.tenantId);return p?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),p(k(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
1
+ import{j as g}from"./liveblocks-Bym0XjRt.js";import{a as y}from"./sentry-CoKtZcTW.js";import{h as U,u as x,g as C,i as V,j as R,l as j}from"./core-C9Jt3gNb.js";import{_i as _,_0 as O,O6 as k,Oj as B,Oe as A,Of as E,_j as F,fI as K,Od as L}from"./zeni-epic-state-OTisIlmp.js";import{z as N,a5 as P,c1 as W,q,bT as G,c2 as H}from"./index-C1XAfugK.js";import{u as $}from"./mui-BsgiBiT9.js";import{u as J}from"./useEnsureVendorListLoaded-YOFp3iHN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="52253a2e-9123-4c39-8270-17e6bac1a613",e._sentryDebugIdIdentifier="sentry-dbid-52253a2e-9123-4c39-8270-17e6bac1a613")}catch{}})();const M=j((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(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("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(k(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=j((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,z=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=z.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const T=f.action??"require_approval";m.push({action:T,actors:D,operator:D.length>1?T==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.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("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=R((t=>K(t))),{isApprovalRulesV3Enabled:p}=G(e?.tenantId);return p?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),p(k(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-Bym0XjRt.js";import{u as ae,j as A,h as J,g as K,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-C9Jt3gNb.js";import{fI as H,Oa as ct,$N as ge,ca as he,Ng as Ue,me as dt,Nv as ce,Nu as de,$O as ut,bn as fe,gZ as Le,$P as pt,XD as bt,m3 as $e,XE as ke,XF as gt,kR as ht,ZO as ft,l4 as St,N4 as It,CA as yt,kY as vt,NR as Ne,$Q as Pe,$R as Ce,$S as Rt,$T as At,$U as kt,NB as we,la as Ct,ZX as wt,Nt as Et,Ne as xt,$V as Bt,Nd as Tt,$W as Dt,Nl as Ee,NF as jt,NE as Ft,NA as Ut,$X as _e,T2 as Lt,bo as $t,No as Nt,O7 as Pt,$Y as _t,$Z as Mt,NN as Ot,NK as xe,Zi as Zt,Nb as zt,$_ as Me,OA as Be,OI as Gt,$$ as Vt,a00 as X,a01 as Ht,a02 as Oe,a03 as Wt,a04 as Ze,a05 as ze,NZ as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a06 as Xt,gk as Qt,Zv as Kt,a07 as Yt,a08 as He,Zz as Jt,_i as en,a09 as tn,_H as nn,OF as Te,OE as an,a0a as sn,a0b as on,a0c as rn,a0d as ln,a0e as mn,_1 as cn,Ov as dn,Oz as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,V2 as Sn,dc as In,df as yn,de as vn,cH as Rn}from"./zeni-epic-state-OTisIlmp.js";import{bT as An,c as We,$ as qe,d as oe,P as U,z as L,cS as Xe,a6 as re,l as E,aQ as De,D as j,ac as se,ad as kn,G as Qe,cT as Cn,p as Q,aq as Ke,cU as wn,V as le,cV as En,ao as xn,a9 as Bn,a5 as ye,Q as Ye,w as Tn,bB as Dn,at as jn,ag as Fn,cW as Un,h as Ln}from"./index-DmFy--fV.js";import{n as P,S as $n,u as Je}from"./mui-BsgiBiT9.js";import pe from"./NotFoundScreen-D92eiixV.js";import{S as je}from"./SetupPagesScreen-BbFcVR26.js";import{F as et}from"./FeaturePreviewScreen-Bu-JxAVw.js";import{a as g}from"./sentry-CoKtZcTW.js";import{u as ve}from"./useAskAiCfoHostNavButtonProps-CgHJ-iCU.js";import{u as tt}from"./useInitialThreadRequest-DA5FMzag.js";import{D as Nn}from"./DrawerScreen-B5Qgxoe2.js";import{M as nt}from"./MobileAppDrawer-D4DOSbVQ.js";import{F as Pn}from"./ScreenRoutes-DAK3aVc9.js";import{R as _n}from"./ReimbursementApprovalRoutes-CixN0rww.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./BusinessVerificationPageScreen-CpAzjlh5.js";import"./routePaths-DQh6iYo4.js";import"./analyticsHelper-drNlDujn.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-CpacCRSq.js";import"./getLocaleForTenant-7mVUFLO-.js";import"./useEnsureVendorListLoaded-YOFp3iHN.js";import"./ReimbursementApprovalRuleDetailScreen-XsqK1nGV.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]="9ed279e5-8471-490d-a70d-897bd77a3e37",e._sentryDebugIdIdentifier="sentry-dbid-9ed279e5-8471-490d-a70d-897bd77a3e37")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Qe.getLocalizedStrings(),On=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),m=L.getSignedInUser(),c=fe(m),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,m?.userId??"");let I=`${m?.firstName} ${m?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=m?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:E,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(Ee(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ft())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(At({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(Rt({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=Q(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Fe(){const e=J(),t=ae(),n=K(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(U.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(U.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=ve({mobileExploreReferrer:"Reimbursement Details"}),B=K().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,v]=g.useState(!1),S=L.getSignedInUser(),w=A((b=>H(b))),h=A((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),F=he(w?.userRole??[]);(function(){const b=ae(),M=A((Y=>H(Y))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=An(O),z=A((Y=>Y.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(v(!0),t(Ue(!1,I,u,r)))}));const R=A((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const _={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||F&&h.billStatus==="rejected"||F===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:c,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:R,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const Zn=P.div`
1
+ import{j as s}from"./liveblocks-Bym0XjRt.js";import{u as ae,j as A,h as J,g as K,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-C9Jt3gNb.js";import{fI as H,Oa as ct,$N as ge,ca as he,Ng as Ue,me as dt,Nv as ce,Nu as de,$O as ut,bn as fe,gZ as Le,$P as pt,XD as bt,m3 as $e,XE as ke,XF as gt,kR as ht,ZO as ft,l4 as St,N4 as It,CA as yt,kY as vt,NR as Ne,$Q as Pe,$R as Ce,$S as Rt,$T as At,$U as kt,NB as we,la as Ct,ZX as wt,Nt as Et,Ne as xt,$V as Bt,Nd as Tt,$W as Dt,Nl as Ee,NF as jt,NE as Ft,NA as Ut,$X as _e,T2 as Lt,bo as $t,No as Nt,O7 as Pt,$Y as _t,$Z as Mt,NN as Ot,NK as xe,Zi as Zt,Nb as zt,$_ as Me,OA as Be,OI as Gt,$$ as Vt,a00 as X,a01 as Ht,a02 as Oe,a03 as Wt,a04 as Ze,a05 as ze,NZ as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a06 as Xt,gk as Qt,Zv as Kt,a07 as Yt,a08 as He,Zz as Jt,_i as en,a09 as tn,_H as nn,OF as Te,OE as an,a0a as sn,a0b as on,a0c as rn,a0d as ln,a0e as mn,_1 as cn,Ov as dn,Oz as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,V2 as Sn,dc as In,df as yn,de as vn,cH as Rn}from"./zeni-epic-state-OTisIlmp.js";import{bT as An,c as We,$ as qe,d as oe,P as U,z as L,cS as Xe,a6 as re,l as E,aQ as De,D as j,ac as se,ad as kn,G as Qe,cT as Cn,p as Q,aq as Ke,cU as wn,V as le,cV as En,ao as xn,a9 as Bn,a5 as ye,Q as Ye,w as Tn,bB as Dn,at as jn,ag as Fn,cW as Un,h as Ln}from"./index-C1XAfugK.js";import{n as P,S as $n,u as Je}from"./mui-BsgiBiT9.js";import pe from"./NotFoundScreen-DiDzsmTQ.js";import{S as je}from"./SetupPagesScreen-B0Baphh_.js";import{F as et}from"./FeaturePreviewScreen-DHyyRYim.js";import{a as g}from"./sentry-CoKtZcTW.js";import{u as ve}from"./useAskAiCfoHostNavButtonProps-DL_-SXBI.js";import{u as tt}from"./useInitialThreadRequest-CPJRbiPZ.js";import{D as Nn}from"./DrawerScreen-BisD9BlZ.js";import{M as nt}from"./MobileAppDrawer-tz9GmHDM.js";import{F as Pn}from"./ScreenRoutes-BETRDGIK.js";import{R as _n}from"./ReimbursementApprovalRoutes-CFEzKEIR.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./BusinessVerificationPageScreen-CWXmaf4U.js";import"./routePaths-D9MDrQwY.js";import"./analyticsHelper-DJg-y5OM.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-B4qnBqXa.js";import"./getLocaleForTenant-VEtlPr-d.js";import"./useEnsureVendorListLoaded-YOFp3iHN.js";import"./ReimbursementApprovalRuleDetailScreen-BReOftYM.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]="9ed279e5-8471-490d-a70d-897bd77a3e37",e._sentryDebugIdIdentifier="sentry-dbid-9ed279e5-8471-490d-a70d-897bd77a3e37")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Qe.getLocalizedStrings(),On=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),m=L.getSignedInUser(),c=fe(m),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,m?.userId??"");let I=`${m?.firstName} ${m?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=m?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:E,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(Ee(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ft())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(At({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(Rt({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=Q(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Fe(){const e=J(),t=ae(),n=K(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(U.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(U.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=ve({mobileExploreReferrer:"Reimbursement Details"}),B=K().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,v]=g.useState(!1),S=L.getSignedInUser(),w=A((b=>H(b))),h=A((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),F=he(w?.userRole??[]);(function(){const b=ae(),M=A((Y=>H(Y))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=An(O),z=A((Y=>Y.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(v(!0),t(Ue(!1,I,u,r)))}));const R=A((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const _={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||F&&h.billStatus==="rejected"||F===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:c,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:R,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}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-Bym0XjRt.js";import{g as K,h as je,u as Fe,i as Oe,j as d,l as De,n as Ae,o as J}from"./core-C9Jt3gNb.js";import{fI as N,ED as R,VA as Pe,m3 as ne,uh as re,v6 as D,lK as Ee,lT as A,lL as P,kO as E,kF as L,kE as Le,DG as le,vb as Me,bq as Be,VB as ve,bn as Ue,E$ as xe,VC as ze,VD as Ge,ck as I,Dz as He,VE as X,VF as We,VG as Ye,VH as Ne,VI as $e,VJ as qe,VK as Qe,VL as Ze,VM as Ke,VN as Je,VO as Xe,VP as ea,VQ as aa,VR as k,VS as M,VT as B,VU as v,VV as U,VW as x,VX as z,VY as G,VZ as H,V_ as W,ek as sa,EF as ta,Er as ee,Es as ae,EL as oa,Ew as se,ER as na,V$ as ra,W0 as la,W1 as ca,W2 as ia,W3 as da,W4 as pa,W5 as _a,W6 as fa,W7 as ma,W8 as ua,e1 as ba,e0 as ha}from"./zeni-epic-state-OTisIlmp.js";import{al as ya,am as wa,an as Ca,a as Sa,$ as Ia,d as ce,P as ie,z as de,ao as ga,V as Ra,f as Ta,ap as ka,aq as Va,a6 as ja,l as Y,Q as Fa,v as Oa,p as pe,ar as Da,as as Aa,at as Pa}from"./index-DmFy--fV.js";import"./mui-BsgiBiT9.js";import Ea from"./NotFoundScreen-D92eiixV.js";import{F as La}from"./FeaturePreviewScreen-Bu-JxAVw.js";import{a as u}from"./sentry-CoKtZcTW.js";import{u as Ma}from"./useInitialThreadRequest-DA5FMzag.js";import{t as te,a as oe,b as Ba}from"./routePaths-DQh6iYo4.js";import{M as va}from"./MobileAppDrawer-D4DOSbVQ.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-CpacCRSq.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]="968345e4-a973-470c-9af0-57a814e7b4f8",e._sentryDebugIdIdentifier="sentry-dbid-968345e4-a973-470c-9af0-57a814e7b4f8")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(W({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(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:Y,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(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(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(k(a)),(g(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(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?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:V(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(W({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(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(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(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({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=g(t),l=I(t);l?(e(Ze({viewMode:a})),e(Ke({viewMode:a}))):r?(e(Je({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",V(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",V(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",V(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(qe({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(We({projectsToFilterOut:a})):g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Aa(_),a=je(),s=Fe(),t=K(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[$,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const j=d((n=>N(n))),fe=j.masterTOSInfo?.isMasterTOSAccepted??!1,me=j.company?.companyInfo.firstMonthOfFY??1,ue=Ma(j?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!$&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,F,O,b,T,S]);const q=Ra(),we=q?.loggedInUserRole!=null&&Be(q?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),Q=n=>{Se(n)},Ie=Ta(),ge=ka();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=K(),Z=ya(Te??"")==="reports",ke=wa(Re),Ve=u.useMemo((()=>Z?Ua:void 0),[Z]);Ca({canFetchSuggestedQuestions:ke,pageContexts:Ve})})({isDataReady:C==="Completed"}),Va({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ja,{analytics:Y,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Q}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:Y,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Q,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Ie&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}const V=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 ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(J,{path:"/",element:p.jsx(Ga,{})}),p.jsx(J,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
1
+ import{j as p}from"./liveblocks-Bym0XjRt.js";import{g as K,h as je,u as Fe,i as Oe,j as d,l as De,n as Ae,o as J}from"./core-C9Jt3gNb.js";import{fI as N,ED as R,VA as Pe,m3 as ne,uh as re,v6 as D,lK as Ee,lT as A,lL as P,kO as E,kF as L,kE as Le,DG as le,vb as Me,bq as Be,VB as ve,bn as Ue,E$ as xe,VC as ze,VD as Ge,ck as I,Dz as He,VE as X,VF as We,VG as Ye,VH as Ne,VI as $e,VJ as qe,VK as Qe,VL as Ze,VM as Ke,VN as Je,VO as Xe,VP as ea,VQ as aa,VR as k,VS as M,VT as B,VU as v,VV as U,VW as x,VX as z,VY as G,VZ as H,V_ as W,ek as sa,EF as ta,Er as ee,Es as ae,EL as oa,Ew as se,ER as na,V$ as ra,W0 as la,W1 as ca,W2 as ia,W3 as da,W4 as pa,W5 as _a,W6 as fa,W7 as ma,W8 as ua,e1 as ba,e0 as ha}from"./zeni-epic-state-OTisIlmp.js";import{al as ya,am as wa,an as Ca,a as Sa,$ as Ia,d as ce,P as ie,z as de,ao as ga,V as Ra,f as Ta,ap as ka,aq as Va,a6 as ja,l as Y,Q as Fa,v as Oa,p as pe,ar as Da,as as Aa,at as Pa}from"./index-C1XAfugK.js";import"./mui-BsgiBiT9.js";import Ea from"./NotFoundScreen-DiDzsmTQ.js";import{F as La}from"./FeaturePreviewScreen-DHyyRYim.js";import{a as u}from"./sentry-CoKtZcTW.js";import{u as Ma}from"./useInitialThreadRequest-CPJRbiPZ.js";import{t as te,a as oe,b as Ba}from"./routePaths-D9MDrQwY.js";import{M as va}from"./MobileAppDrawer-tz9GmHDM.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./useTaskManagerAccess-B4qnBqXa.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]="968345e4-a973-470c-9af0-57a814e7b4f8",e._sentryDebugIdIdentifier="sentry-dbid-968345e4-a973-470c-9af0-57a814e7b4f8")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],g=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(W({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(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:Y,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(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(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(k(a)),(g(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(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?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:V(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(W({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(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(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(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({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=g(t),l=I(t);l?(e(Ze({viewMode:a})),e(Ke({viewMode:a}))):r?(e(Je({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",V(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",V(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",V(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e($e({classesToFilterOut:a})):g(o.selectedReportID)?e(qe({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(We({projectsToFilterOut:a})):g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=g(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Aa(_),a=je(),s=Fe(),t=K(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[$,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const j=d((n=>N(n))),fe=j.masterTOSInfo?.isMasterTOSAccepted??!1,me=j.company?.companyInfo.firstMonthOfFY??1,ue=Ma(j?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=ga(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!$&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,F,O,b,T,S]);const q=Ra(),we=q?.loggedInUserRole!=null&&Be(q?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),Q=n=>{Se(n)},Ie=Ta(),ge=ka();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=K(),Z=ya(Te??"")==="reports",ke=wa(Re),Ve=u.useMemo((()=>Z?Ua:void 0),[Z]);Ca({canFetchSuggestedQuestions:ke,pageContexts:Ve})})({isDataReady:C==="Completed"}),Va({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ja,{analytics:Y,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Q}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:Y,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Q,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:ge&&Ie&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}const V=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 ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(J,{path:"/",element:p.jsx(Ga,{})}),p.jsx(J,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-Bym0XjRt.js";import{z as b,a6 as N,l as u,Q as S,e3 as I,d as k,P as C}from"./index-DmFy--fV.js";import"./mui-BsgiBiT9.js";import g from"./NotFoundScreen-D92eiixV.js";import{a as c}from"./sentry-CoKtZcTW.js";import{u as D,j as h,h as F,g as L,l as _,n as P,o as f,N as y}from"./core-C9Jt3gNb.js";import{fI as T,a2_ as j,a2$ as p,Ei as U,q3 as V,a30 as q,Eg as z}from"./zeni-epic-state-OTisIlmp.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.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]="b72cf96b-90f3-417f-aa20-d71057d32767",e._sentryDebugIdIdentifier="sentry-dbid-b72cf96b-90f3-417f-aa20-d71057d32767")}catch{}})();const G=_((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),Q=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>T(o))),l=F(),w=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(U()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(P,{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(Q,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-Bym0XjRt.js";import{z as b,a6 as N,l as u,Q as S,e3 as I,d as k,P as C}from"./index-C1XAfugK.js";import"./mui-BsgiBiT9.js";import g from"./NotFoundScreen-DiDzsmTQ.js";import{a as c}from"./sentry-CoKtZcTW.js";import{u as D,j as h,h as F,g as L,l as _,n as P,o as f,N as y}from"./core-C9Jt3gNb.js";import{fI as T,a2_ as j,a2$ as p,Ei as U,q3 as V,a30 as q,Eg as z}from"./zeni-epic-state-OTisIlmp.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.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]="b72cf96b-90f3-417f-aa20-d71057d32767",e._sentryDebugIdIdentifier="sentry-dbid-b72cf96b-90f3-417f-aa20-d71057d32767")}catch{}})();const G=_((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),Q=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>T(o))),l=F(),w=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(U()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(P,{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(Q,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as E}from"./liveblocks-Bym0XjRt.js";import{a as A}from"./sentry-CoKtZcTW.js";import{i as M,u as W,h as Q,g as ee,j as h,l as te}from"./core-C9Jt3gNb.js";import{Xy as Fe,Xz as Ge,m3 as ae,sB as Ve,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,XA as Ye,fI as K,Wx as pe,XB as Se,h2 as ne,cD as se,cE as le,FJ as ve,XC as Ce,FN as Xe,gS as ce,sE as ze,td as qe,dF as Ze,dE as He,TV as fe,FH as We,FB as Qe,XD as De,Ft as et,Fs as tt,Fn as at,Fy as nt,FO as st,XE as Y,XF as ge,Fu as lt,Wy as oe,G2 as Ae,FX as Ie,XG as xe,sH as Te,FR as Be,FP as Le,XH as Je,G9 as we,G6 as je,FS as be,G8 as Ne}from"./zeni-epic-state-OTisIlmp.js";import{a2 as de,aW as ie,aX as ct,z as ot,j as dt,a5 as it,a6 as ue,l as _,at as ut,aY as rt,p as G,G as ye,c as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-DmFy--fV.js";import{n as re}from"./mui-BsgiBiT9.js";import{p as St}from"./pathToGoBack-CMP2hETE.js";import H from"./NotFoundScreen-D92eiixV.js";import{c as V}from"./routePaths-DQh6iYo4.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]="3368c70e-68f6-4f26-86c8-234d55728a19",e._sentryDebugIdIdentifier="sentry-dbid-3368c70e-68f6-4f26-86c8-234d55728a19")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=W(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ge(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(Ve(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(H,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(H,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({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 E}from"./liveblocks-Bym0XjRt.js";import{a as A}from"./sentry-CoKtZcTW.js";import{i as M,u as W,h as Q,g as ee,j as h,l as te}from"./core-C9Jt3gNb.js";import{Xy as Fe,Xz as Ge,m3 as ae,sB as Ve,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,XA as Ye,fI as K,Wx as pe,XB as Se,h2 as ne,cD as se,cE as le,FJ as ve,XC as Ce,FN as Xe,gS as ce,sE as ze,td as qe,dF as Ze,dE as He,TV as fe,FH as We,FB as Qe,XD as De,Ft as et,Fs as tt,Fn as at,Fy as nt,FO as st,XE as Y,XF as ge,Fu as lt,Wy as oe,G2 as Ae,FX as Ie,XG as xe,sH as Te,FR as Be,FP as Le,XH as Je,G9 as we,G6 as je,FS as be,G8 as Ne}from"./zeni-epic-state-OTisIlmp.js";import{a2 as de,aW as ie,aX as ct,z as ot,j as dt,a5 as it,a6 as ue,l as _,at as ut,aY as rt,p as G,G as ye,c as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-C1XAfugK.js";import{n as re}from"./mui-BsgiBiT9.js";import{p as St}from"./pathToGoBack-CMP2hETE.js";import H from"./NotFoundScreen-DiDzsmTQ.js";import{c as V}from"./routePaths-D9MDrQwY.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]="3368c70e-68f6-4f26-86c8-234d55728a19",e._sentryDebugIdIdentifier="sentry-dbid-3368c70e-68f6-4f26-86c8-234d55728a19")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=W(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ge(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(Ve(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(H,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(H,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({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-D92eiixV.js","assets/sentry-CoKtZcTW.js","assets/core-C9Jt3gNb.js","assets/zeni-epic-state-OTisIlmp.js","assets/index-DmFy--fV.js","assets/mui-BsgiBiT9.js","assets/analytics-DbFSqIth.js","assets/utils-CNqTTzSx.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-DnxyUY7k.js","assets/withTransactionSidePanel-BOIdrs8l.js","assets/useAskAiCfoHostNavButtonProps-CgHJ-iCU.js","assets/TransactionDetailScreen-B1no9UdL.js","assets/decodeURIComponentSafe-Cr8jQXNX.js","assets/useInitialThreadRequest-DA5FMzag.js","assets/routePaths-DQh6iYo4.js","assets/expenseAutomationHelper-D-1MzDTJ.js","assets/stripSplatSuffix-B7IfcJr8.js","assets/analyticsHelper-drNlDujn.js","assets/CompanyPassportScreen-B7KOuZR_.js","assets/MobileAppDrawer-D4DOSbVQ.js","assets/InboxNotificationsProvider-Bz8aI0zf.js","assets/useTaskManagerAccess-CpacCRSq.js","assets/useAiCfoDashboardSuggestedQuestionsChips-3GfaqAPj.js","assets/FeaturePreviewScreen-Bu-JxAVw.js","assets/BillPayRoutes-DAZ2LiAE.js","assets/AddressScreen-hby_CR8D.js","assets/DomesticWireDetailScreen-Cb0F3Rod.js","assets/BusinessVerificationPageScreen-CpAzjlh5.js","assets/DrawerScreen-B5Qgxoe2.js","assets/SetupPagesScreen-BbFcVR26.js","assets/BillPayApprovalRoutes-sOvVtkKV.js","assets/useEnsureVendorListLoaded-YOFp3iHN.js","assets/ReimbursementApprovalRuleDetailScreen-XsqK1nGV.js","assets/getLocaleForTenant-7mVUFLO-.js","assets/ReimbursementRoutes-B2FNn_0P.js","assets/ReimbursementApprovalRoutes-CixN0rww.js","assets/TransactionListRoutes-DCMjmg_J.js","assets/ZeniAccountStatementScreen-Vi4F2dbO.js","assets/SettingsRoutes-6-0ys-s5.js","assets/AccountMappingScreen-Cwa6Sncr.js","assets/QBOConnectionScreen-BbOyxErb.js","assets/empty-D0s_5kET.js","assets/index-B3Xhbg9K.js","assets/url-llYM4lhi.js","assets/index-CIoiM__n.js","assets/accountMappingHelper-CvrKmWxH.js","assets/useEmailConnectResultRefresh-Dv9IT8_0.js","assets/ReportsRoutes-CJrunnvK.js","assets/ChargeCardRoutes-Ba3x5MoU.js","assets/useChargeCardPusherEvents-JxJnisR-.js","assets/PeopleRoutes-DPu9dF6W.js","assets/ExpenseAutomationRoutes-Ce113KIS.js","assets/useActualMatchingMatchDetail-CN5JVNal.js","assets/ScheduleDetailsPrepaidExpensesScreen-DHpH5oJw.js","assets/pathToGoBack-CMP2hETE.js","assets/TreasuryRoutes-BUhJHYkV.js","assets/VendorsRoutes-C1J2HapW.js","assets/ZeniAccountRoutes-C4aExMdo.js","assets/AddressRoutes-D0QZxsbK.js","assets/PandLWithForecastRoutes-CcRkLhpt.js","assets/CustomerOnboardingRoutes-B3teunq3.js","assets/TransactionDetailRoutes-DBqh72Ke.js","assets/EntityDetailRoutes--Mqqoc0l.js","assets/InvoicingRoutes-IUj-CS51.js","assets/NotificationRoutes-BV6tu0jZ.js","assets/PerformanceRoutes-D8D-QN7a.js","assets/ActualMatchingMatchDetailScreen-JAoGrJi3.js","assets/RewardsRoutes-8HmabMf6.js","assets/TaskRoutes-ssEkwrEi.js","assets/TaskListScreen-CW5lbYvD.js","assets/useTaskManagerPusherEvents-CcIRdnMY.js","assets/AiCfoScreen-DNDihu3K.js","assets/CardsAiCfoScreen-BP02_M1s.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bo as Rs,dk as gs,ca as Is,gM as js,gc as Ts,dh as pe,cI as As,gq as bs,cA as fs,bG as Ds,br as ys,U_ as Cs,v as vs,V1 as Os,bq as Ps,V2 as Us,bM as ws,bL as Fs,bu as Ls,cw as Vs,V3 as Hs,V4 as ks,dc as Bs,df as Ss,de as Ns,cH as Ms,cO as Zs,pW as xe,gl as Re,h0 as Gs,gn as ge,gO as Ie,gP as je,go as $s}from"./zeni-epic-state-OTisIlmp.js";import{j as e}from"./liveblocks-Bym0XjRt.js";import{a as U}from"./sentry-CoKtZcTW.js";import{N as u,u as zs,h as qs,i as Ws,g as Ys,j as G,q as Te,n as Js,o as n}from"./core-C9Jt3gNb.js";import{H as l,u as Ks,z as y,d as Xs,f as Qs,_ as et,P as S,h as st,J as tt,V as nt,L as F,G as Ae,t as _,K as at,M as ot,l as ne}from"./index-DmFy--fV.js";import{u as rt}from"./mui-BsgiBiT9.js";import{f as be}from"./analyticsHelper-drNlDujn.js";import{t as it}from"./getLocaleForTenant-7mVUFLO-.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="f8ad392e-b695-4a94-9e08-1c77b8b86ca8",o._sentryDebugIdIdentifier="sentry-dbid-f8ad392e-b695-4a94-9e08-1c77b8b86ca8")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-D92eiixV.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({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`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(fe,{tenantEmailDomain:v});if(O)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(fe,{tenantEmailDomain:v}):O?e.jsx(ye,{tenantEmailDomain:v}):f?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-DnxyUY7k.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-DAZ2LiAE.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,34,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-B2FNn_0P.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,36,32,33,34,8])),transactions:()=>s((()=>import("./TransactionListRoutes-DCMjmg_J.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,38,8])),settings:()=>s((()=>import("./SettingsRoutes-6-0ys-s5.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,22,40,20,21,41,42,43,44,45,13,46,26,0,18,28,15,19,47,31,32,33,36,8])),reports:()=>s((()=>import("./ReportsRoutes-CJrunnvK.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-Ba3x5MoU.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,50,26,8])),people:()=>s((()=>import("./PeopleRoutes-DPu9dF6W.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-Ce113KIS.js")),__vite__mapDeps([52,1,2,3,0,4,5,6,7,11,12,13,14,15,16,53,17,10,54,55,46,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-BUhJHYkV.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-C1J2HapW.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,26,0,24,54,55,15,11,20,21,22,29,46,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-C4aExMdo.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,38,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-CJrunnvK.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),ht=l((()=>s((()=>import("./AddressRoutes-D0QZxsbK.js")),__vite__mapDeps([59,1,2,3,26,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-DPu9dF6W.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-CcRkLhpt.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-B3teunq3.js")),__vite__mapDeps([61,1,2,3,26,4,5,6,7,0,41,42,43,44,45,13,47,50,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-C1J2HapW.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,26,0,24,54,55,15,11,20,21,22,29,46,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-DBqh72Ke.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,13,32,12,11,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes--Mqqoc0l.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-DnxyUY7k.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])))),ve=l((()=>s((()=>import("./BillPayRoutes-DAZ2LiAE.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,34,8])))),jt=l((()=>s((()=>import("./SettingsRoutes-6-0ys-s5.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,22,40,20,21,41,42,43,44,45,13,46,26,0,18,28,15,19,47,31,32,33,36,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-IUj-CS51.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,26,0,20,21,22,41,42,43,44,45,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-B2FNn_0P.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,36,32,33,34,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-C4aExMdo.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,38,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-BUhJHYkV.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-DCMjmg_J.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,38,8])))),Dt=l((()=>s((()=>import("./ChargeCardRoutes-Ba3x5MoU.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,50,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-BV6tu0jZ.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,22,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-D8D-QN7a.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,20,21,22,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-Ce113KIS.js")),__vite__mapDeps([52,1,2,3,0,4,5,6,7,11,12,13,14,15,16,53,17,10,54,55,46,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-JAoGrJi3.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,53,17,13,15,0,8])))),Pt=l((()=>s((()=>import("./RewardsRoutes-8HmabMf6.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,0,8])))),Ut=l((()=>s((()=>import("./TaskRoutes-ssEkwrEi.js")),__vite__mapDeps([69,1,2,3,0,4,5,6,7,14,20,21,22,70,11,71,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-DNDihu3K.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,23,55,15,71,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-BP02_M1s.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-D92eiixV.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-CW5lbYvD.js").then((o=>o.f))),__vite__mapDeps([70,1,2,3,4,5,6,7,11,20,21,22,71,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:H})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return v===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):V?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"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=zs(),N=qs(),{tenantEmailDomain:i}=Ws(),V=rt().mode,{setLoading:O,clearAllLoading:v,clearLoading:H}=Ks(),D=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),J=hs(j),$=Ys(),[L,we]=U.useState(!1),r=G((a=>Es(a))),{useFeatureGate:k}=Xs(),M=Qs(),K=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=k(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(S.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,X=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,He=st(r,Ve,oe),{isCardsHidden:ke}=tt(r?.tenantId),Be=!He||!!ke,{isFeatureEnabled:Se}=k(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=k(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=G((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,V)}const Z={tenantId:D,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),Ge=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),$e=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=G((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=Ds(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?f(Cs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),U.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,f,y]),U.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,f,qe))}),[D]),U.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){B(ge(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),Re(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B($s(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,j,O,f))}),[D,p]),U.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&be(j,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(v(),_.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=U.useRef(!1);U.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const P=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:We}=k(S.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=k(S.isAccrualEnabled),Je=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Be&&!P,Xe=Us(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!P,ss=Le&&!P,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Vs(E?.loggedInUserRoleMap),os=Hs(E?.loggedInUserRoleMap),rs=ks(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Xe===!0||os===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&T!=="In-Progress"&&f(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||J&&!ee)&&es&&Qe!==!0&&h===!1&&X===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||J?!L||te!==!1||ee||J?L&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Js,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Je||Ke?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(ft,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ut,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&P===!1?e.jsx(vt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&P===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Pt,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):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{C as F,Gt as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DiDzsmTQ.js","assets/sentry-CoKtZcTW.js","assets/core-C9Jt3gNb.js","assets/zeni-epic-state-OTisIlmp.js","assets/index-C1XAfugK.js","assets/mui-BsgiBiT9.js","assets/analytics-DbFSqIth.js","assets/utils-CNqTTzSx.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-szc-1AzX.js","assets/withTransactionSidePanel-DPzo8PmT.js","assets/useAskAiCfoHostNavButtonProps-DL_-SXBI.js","assets/TransactionDetailScreen-DgVpYIwj.js","assets/decodeURIComponentSafe-Cr8jQXNX.js","assets/useInitialThreadRequest-CPJRbiPZ.js","assets/routePaths-D9MDrQwY.js","assets/expenseAutomationHelper-D-1MzDTJ.js","assets/stripSplatSuffix-B7IfcJr8.js","assets/analyticsHelper-DJg-y5OM.js","assets/CompanyPassportScreen-CrbGMPCk.js","assets/MobileAppDrawer-tz9GmHDM.js","assets/InboxNotificationsProvider-Bz8aI0zf.js","assets/useTaskManagerAccess-B4qnBqXa.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CxjKgYgG.js","assets/FeaturePreviewScreen-DHyyRYim.js","assets/BillPayRoutes-C4asT9KO.js","assets/AddressScreen-BVI08KOj.js","assets/DomesticWireDetailScreen-COcrGUh-.js","assets/BusinessVerificationPageScreen-CWXmaf4U.js","assets/DrawerScreen-BisD9BlZ.js","assets/SetupPagesScreen-B0Baphh_.js","assets/BillPayApprovalRoutes-D9-VveJq.js","assets/useEnsureVendorListLoaded-YOFp3iHN.js","assets/ReimbursementApprovalRuleDetailScreen-BReOftYM.js","assets/getLocaleForTenant-VEtlPr-d.js","assets/ReimbursementRoutes-D4TyOUBY.js","assets/ReimbursementApprovalRoutes-CFEzKEIR.js","assets/TransactionListRoutes-g16F1PqI.js","assets/ZeniAccountStatementScreen-B9byQtF9.js","assets/SettingsRoutes-DHbF39FQ.js","assets/AccountMappingScreen-BkDkFrFJ.js","assets/QBOConnectionScreen-D1O6bt7C.js","assets/empty-D0s_5kET.js","assets/index-B3Xhbg9K.js","assets/url-llYM4lhi.js","assets/index-CIoiM__n.js","assets/accountMappingHelper-CvrKmWxH.js","assets/useEmailConnectResultRefresh-DMm4oCVO.js","assets/ReportsRoutes-BtXBZfhs.js","assets/ChargeCardRoutes-BFj7SQT_.js","assets/useChargeCardPusherEvents-lx0W0oNg.js","assets/PeopleRoutes-BhozwT2h.js","assets/ExpenseAutomationRoutes-DS-VvjPP.js","assets/useActualMatchingMatchDetail-0lCJi4qB.js","assets/ScheduleDetailsPrepaidExpensesScreen-BYfVzzkg.js","assets/pathToGoBack-CMP2hETE.js","assets/TreasuryRoutes-CHjx786J.js","assets/VendorsRoutes-t7Emyx55.js","assets/ZeniAccountRoutes-Gv-e-xMQ.js","assets/AddressRoutes-BauVlHZ9.js","assets/PandLWithForecastRoutes-BlQEN4ZR.js","assets/CustomerOnboardingRoutes-j2eujk3K.js","assets/TransactionDetailRoutes-DqlTEkLS.js","assets/EntityDetailRoutes-DCNh3BwN.js","assets/InvoicingRoutes-BHc9WH_Q.js","assets/NotificationRoutes-BwMNmTMU.js","assets/PerformanceRoutes-BybLFxoL.js","assets/ActualMatchingMatchDetailScreen-D5qXBMmf.js","assets/RewardsRoutes-BbrnCETe.js","assets/TaskRoutes-Wz2rUEal.js","assets/TaskListScreen-DbQ_Vji7.js","assets/useTaskManagerPusherEvents-DRAANaIB.js","assets/AiCfoScreen-BM8X0l_M.js","assets/CardsAiCfoScreen-DsznFOdz.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bo as Rs,dk as gs,ca as Is,gM as js,gc as Ts,dh as pe,cI as As,gq as bs,cA as fs,bG as Ds,br as ys,U_ as Cs,v as vs,V1 as Os,bq as Ps,V2 as Us,bM as ws,bL as Fs,bu as Ls,cw as Vs,V3 as Hs,V4 as ks,dc as Bs,df as Ss,de as Ns,cH as Ms,cO as Zs,pW as xe,gl as Re,h0 as Gs,gn as ge,gO as Ie,gP as je,go as $s}from"./zeni-epic-state-OTisIlmp.js";import{j as e}from"./liveblocks-Bym0XjRt.js";import{a as U}from"./sentry-CoKtZcTW.js";import{N as u,u as zs,h as qs,i as Ws,g as Ys,j as G,q as Te,n as Js,o as n}from"./core-C9Jt3gNb.js";import{H as l,u as Ks,z as y,d as Xs,f as Qs,_ as et,P as S,h as st,J as tt,V as nt,L as F,G as Ae,t as _,K as at,M as ot,l as ne}from"./index-C1XAfugK.js";import{u as rt}from"./mui-BsgiBiT9.js";import{f as be}from"./analyticsHelper-DJg-y5OM.js";import{t as it}from"./getLocaleForTenant-VEtlPr-d.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="f8ad392e-b695-4a94-9e08-1c77b8b86ca8",o._sentryDebugIdIdentifier="sentry-dbid-f8ad392e-b695-4a94-9e08-1c77b8b86ca8")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-DiDzsmTQ.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({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`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(fe,{tenantEmailDomain:v});if(O)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(fe,{tenantEmailDomain:v}):O?e.jsx(ye,{tenantEmailDomain:v}):f?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-szc-1AzX.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-C4asT9KO.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,34,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-D4TyOUBY.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,36,32,33,34,8])),transactions:()=>s((()=>import("./TransactionListRoutes-g16F1PqI.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,38,8])),settings:()=>s((()=>import("./SettingsRoutes-DHbF39FQ.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,22,40,20,21,41,42,43,44,45,13,46,26,0,18,28,15,19,47,31,32,33,36,8])),reports:()=>s((()=>import("./ReportsRoutes-BtXBZfhs.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-BFj7SQT_.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,50,26,8])),people:()=>s((()=>import("./PeopleRoutes-BhozwT2h.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-DS-VvjPP.js")),__vite__mapDeps([52,1,2,3,0,4,5,6,7,11,12,13,14,15,16,53,17,10,54,55,46,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CHjx786J.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-t7Emyx55.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,26,0,24,54,55,15,11,20,21,22,29,46,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-Gv-e-xMQ.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,38,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-BtXBZfhs.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),ht=l((()=>s((()=>import("./AddressRoutes-BauVlHZ9.js")),__vite__mapDeps([59,1,2,3,26,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-BhozwT2h.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-BlQEN4ZR.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-j2eujk3K.js")),__vite__mapDeps([61,1,2,3,26,4,5,6,7,0,41,42,43,44,45,13,47,50,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-t7Emyx55.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,26,0,24,54,55,15,11,20,21,22,29,46,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-DqlTEkLS.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,13,32,12,11,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-DCNh3BwN.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-szc-1AzX.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])))),ve=l((()=>s((()=>import("./BillPayRoutes-C4asT9KO.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,34,8])))),jt=l((()=>s((()=>import("./SettingsRoutes-DHbF39FQ.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,22,40,20,21,41,42,43,44,45,13,46,26,0,18,28,15,19,47,31,32,33,36,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-BHc9WH_Q.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,26,0,20,21,22,41,42,43,44,45,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-D4TyOUBY.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,36,32,33,34,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-Gv-e-xMQ.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,38,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-CHjx786J.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-g16F1PqI.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,38,8])))),Dt=l((()=>s((()=>import("./ChargeCardRoutes-BFj7SQT_.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,50,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-BwMNmTMU.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,22,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-BybLFxoL.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,20,21,22,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-DS-VvjPP.js")),__vite__mapDeps([52,1,2,3,0,4,5,6,7,11,12,13,14,15,16,53,17,10,54,55,46,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-D5qXBMmf.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,53,17,13,15,0,8])))),Pt=l((()=>s((()=>import("./RewardsRoutes-BbrnCETe.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,0,8])))),Ut=l((()=>s((()=>import("./TaskRoutes-Wz2rUEal.js")),__vite__mapDeps([69,1,2,3,0,4,5,6,7,14,20,21,22,70,11,71,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-BM8X0l_M.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,23,55,15,71,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-DsznFOdz.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-DiDzsmTQ.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-DbQ_Vji7.js").then((o=>o.f))),__vite__mapDeps([70,1,2,3,4,5,6,7,11,20,21,22,71,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:H})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return v===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):V?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"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=zs(),N=qs(),{tenantEmailDomain:i}=Ws(),V=rt().mode,{setLoading:O,clearAllLoading:v,clearLoading:H}=Ks(),D=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),J=hs(j),$=Ys(),[L,we]=U.useState(!1),r=G((a=>Es(a))),{useFeatureGate:k}=Xs(),M=Qs(),K=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=k(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(S.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,X=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,He=st(r,Ve,oe),{isCardsHidden:ke}=tt(r?.tenantId),Be=!He||!!ke,{isFeatureEnabled:Se}=k(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=k(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=G((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,V)}const Z={tenantId:D,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),Ge=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),$e=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=G((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=Ds(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?f(Cs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),U.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,f,y]),U.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,f,qe))}),[D]),U.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){B(ge(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),Re(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B($s(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,j,O,f))}),[D,p]),U.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&be(j,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(v(),_.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=U.useRef(!1);U.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const P=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:We}=k(S.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=k(S.isAccrualEnabled),Je=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Be&&!P,Xe=Us(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!P,ss=Le&&!P,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Vs(E?.loggedInUserRoleMap),os=Hs(E?.loggedInUserRoleMap),rs=ks(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Xe===!0||os===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&T!=="In-Progress"&&f(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||J&&!ee)&&es&&Qe!==!0&&h===!1&&X===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||J?!L||te!==!1||ee||J?L&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Js,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Je||Ke?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(ft,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ut,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&P===!1?e.jsx(vt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&P===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Pt,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):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{C as F,Gt as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Bym0XjRt.js";import{a as d}from"./sentry-CoKtZcTW.js";import{h as O,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-C9Jt3gNb.js";import{fI as v,_k as Pe,Oa as je,ZT as ve,_0 as we,ca as X,cV as Ae,cW as De,bq as Ue,dg as Re,Gs as Te,_l as Me,PD as Be,N1 as Ne,MU as de,MR as Ve,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Fe,ly as $,lB as me,_m as Oe,mL as Le,GN as Ge,Wr as Ze,Ws as $e,lw as He,_n as Ke,lz as We,uL as ze,Wm as qe,Wn as Je,uP as Qe,hZ as Xe,Vl as q,hR as ae,hO as Ye,hW as en,Vm as nn,GK as tn,_o as an,_p as on,Ni as sn,m3 as rn,e0 as fe,e1 as he,_q as ln,gF as cn,VB as dn,GJ as oe,gK as se,gJ as un,GI as pn,gI as gn,gH as mn,_r as fn,UN as Ce,_s as hn,_t as Cn,_u as yn,_v as Sn,_w as bn,_x as In,GQ as xn,_y as En,GH as ie,GB as Z,_z as kn,_A as _n,_B as re,_C as Pn,dV as jn,_D as vn,_E as wn,_F as An,UZ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_G as Bn,c6 as Nn,c5 as Vn,c7 as Fn,c4 as On}from"./zeni-epic-state-OTisIlmp.js";import{bT as Ln,z as j,V as G,a5 as ne,c3 as Gn,l as W,d as te,P as V,h as ye,J as Se,c4 as Zn,j as $n,W as be,c5 as Hn,ag as Kn,c6 as Wn,c7 as zn,ao as qn,c8 as Jn,p as Qn,e as Ie,c9 as Xn}from"./index-DmFy--fV.js";import{n as B}from"./mui-BsgiBiT9.js";import{u as xe}from"./useTaskManagerAccess-CpacCRSq.js";import{U as Yn}from"./AccountMappingScreen-Cwa6Sncr.js";import{t as et,A as nt}from"./AddressScreen-hby_CR8D.js";import F from"./NotFoundScreen-D92eiixV.js";import{g as tt}from"./analyticsHelper-drNlDujn.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-CpAzjlh5.js";import{C as st}from"./CompanyPassportScreen-B7KOuZR_.js";import{M as T}from"./MobileAppDrawer-D4DOSbVQ.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-Dv9IT8_0.js";import{q as le}from"./QBOConnectionScreen-BbOyxErb.js";import{B as lt}from"./BillPayApprovalRoutes-sOvVtkKV.js";import{R as ct}from"./ReimbursementApprovalRoutes-CixN0rww.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./accountMappingHelper-CvrKmWxH.js";import"./routePaths-DQh6iYo4.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./empty-D0s_5kET.js";import"./pdf-lib-CRTLGVrP.js";import"./index-B3Xhbg9K.js";import"./url-llYM4lhi.js";import"./index-CIoiM__n.js";import"./decodeURIComponentSafe-Cr8jQXNX.js";import"./useEnsureVendorListLoaded-YOFp3iHN.js";import"./ReimbursementApprovalRuleDetailScreen-XsqK1nGV.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]="477e46aa-1e5a-4abf-afde-bf27f3dbd450",e._sentryDebugIdIdentifier="sentry-dbid-477e46aa-1e5a-4abf-afde-bf27f3dbd450")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-Bym0XjRt.js";import{a as d}from"./sentry-CoKtZcTW.js";import{h as O,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-C9Jt3gNb.js";import{fI as v,_k as Pe,Oa as je,ZT as ve,_0 as we,ca as X,cV as Ae,cW as De,bq as Ue,dg as Re,Gs as Te,_l as Me,PD as Be,N1 as Ne,MU as de,MR as Ve,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Fe,ly as $,lB as me,_m as Oe,mL as Le,GN as Ge,Wr as Ze,Ws as $e,lw as He,_n as Ke,lz as We,uL as ze,Wm as qe,Wn as Je,uP as Qe,hZ as Xe,Vl as q,hR as ae,hO as Ye,hW as en,Vm as nn,GK as tn,_o as an,_p as on,Ni as sn,m3 as rn,e0 as fe,e1 as he,_q as ln,gF as cn,VB as dn,GJ as oe,gK as se,gJ as un,GI as pn,gI as gn,gH as mn,_r as fn,UN as Ce,_s as hn,_t as Cn,_u as yn,_v as Sn,_w as bn,_x as In,GQ as xn,_y as En,GH as ie,GB as Z,_z as kn,_A as _n,_B as re,_C as Pn,dV as jn,_D as vn,_E as wn,_F as An,UZ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_G as Bn,c6 as Nn,c5 as Vn,c7 as Fn,c4 as On}from"./zeni-epic-state-OTisIlmp.js";import{bT as Ln,z as j,V as G,a5 as ne,c3 as Gn,l as W,d as te,P as V,h as ye,J as Se,c4 as Zn,j as $n,W as be,c5 as Hn,ag as Kn,c6 as Wn,c7 as zn,ao as qn,c8 as Jn,p as Qn,e as Ie,c9 as Xn}from"./index-C1XAfugK.js";import{n as B}from"./mui-BsgiBiT9.js";import{u as xe}from"./useTaskManagerAccess-B4qnBqXa.js";import{U as Yn}from"./AccountMappingScreen-BkDkFrFJ.js";import{t as et,A as nt}from"./AddressScreen-BVI08KOj.js";import F from"./NotFoundScreen-DiDzsmTQ.js";import{g as tt}from"./analyticsHelper-DJg-y5OM.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-CWXmaf4U.js";import{C as st}from"./CompanyPassportScreen-CrbGMPCk.js";import{M as T}from"./MobileAppDrawer-tz9GmHDM.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DMm4oCVO.js";import{q as le}from"./QBOConnectionScreen-D1O6bt7C.js";import{B as lt}from"./BillPayApprovalRoutes-D9-VveJq.js";import{R as ct}from"./ReimbursementApprovalRoutes-CFEzKEIR.js";import"./recharts-GCccddBO.js";import"./analytics-DbFSqIth.js";import"./plaid-C8X6T_ms.js";import"./dnd-KhFMfpEU.js";import"./stripe-cKAAJElX.js";import"./lottie-CvA92JCl.js";import"./lexical-CpBrNOz8.js";import"./pdf-O569E9WB.js";import"./utils-CNqTTzSx.js";import"./accountMappingHelper-CvrKmWxH.js";import"./routePaths-D9MDrQwY.js";import"./InboxNotificationsProvider-Bz8aI0zf.js";import"./empty-D0s_5kET.js";import"./pdf-lib-CRTLGVrP.js";import"./index-B3Xhbg9K.js";import"./url-llYM4lhi.js";import"./index-CIoiM__n.js";import"./decodeURIComponentSafe-Cr8jQXNX.js";import"./useEnsureVendorListLoaded-YOFp3iHN.js";import"./ReimbursementApprovalRuleDetailScreen-BReOftYM.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]="477e46aa-1e5a-4abf-afde-bf27f3dbd450",e._sentryDebugIdIdentifier="sentry-dbid-477e46aa-1e5a-4abf-afde-bf27f3dbd450")}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-Bym0XjRt.js";import{h as X,g as Y,u as ee,i as W,j as k,N as R,l as G,t as en}from"./core-C9Jt3gNb.js";import{bL as nn,fI as V,cI as tn,Ik as J,ZT as an,ZW as sn,v2 as ne,uS as te,mD as ae,C6 as N,ZY as be,gJ as Ge,gI as He,gH as Ke,ZZ as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as Q,MX as Ae,M_ as _e,N4 as ke,CA as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,Z_ as yn,Lw as fe,M8 as fn,Z$ as gn,bM as Sn,Om as ge,Oa as bn,_0 as Cn,_1 as hn,Oq as In,Ou as An,_2 as je,B$ as _n,T6 as kn,_3 as vn,_4 as Pn,_5 as Tn,_6 as qe,_7 as En,_8 as Dn,Wa as Un,Z8 as On,Wp as wn,_9 as Je,MI as Fn,MA as Vn,Wq as xn,ME as Bn,_a as Oe,Pa as Qe,mL as jn,uV as Xe,C8 as Rn,bG as Re,Ck as Le,cG as Ln,_b as Ye,P0 as we,OJ as Nn,OK as Mn,OO as zn,_c as Zn,P3 as Ne,_d as $n,_e as Wn,_f as Gn,PR as Se,_g as Hn,gZ as Kn,JF as qn,_h as Jn,JK as Qn,JJ as Xn}from"./zeni-epic-state-OTisIlmp.js";import{ag as Pe,V as ie,d as de,P as q,z as E,a6 as se,l as D,a5 as Te,Q as $,bQ as Yn,ac as oe,bR as x,bi as Ve,bS as et,bT as nt,bU as tt,q as Be,bV as at,p as Me,aE as ze,$ as it,a9 as st,bW as ot,bX as ct,bY as rt,w as ut}from"./index-DmFy--fV.js";import{a as h}from"./sentry-CoKtZcTW.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-BsgiBiT9.js";import{u as pt,d as Ze,B as Ue}from"./BusinessVerificationPageScreen-CpAzjlh5.js";import{M as le}from"./MobileAppDrawer-D4DOSbVQ.js";import L from"./NotFoundScreen-D92eiixV.js";import{a as $e}from"./analyticsHelper-drNlDujn.js";import{d as We}from"./routePaths-DQh6iYo4.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]="68b6dec9-fec4-453a-a43c-b63a8b23adbb",e._sentryDebugIdIdentifier="sentry-dbid-68b6dec9-fec4-453a-a43c-b63a8b23adbb")}catch{}})();const mt=xe.div`
1
+ import{j as u}from"./liveblocks-Bym0XjRt.js";import{h as X,g as Y,u as ee,i as W,j as k,N as R,l as G,t as en}from"./core-C9Jt3gNb.js";import{bL as nn,fI as V,cI as tn,Ik as J,ZT as an,ZW as sn,v2 as ne,uS as te,mD as ae,C6 as N,ZY as be,gJ as Ge,gI as He,gH as Ke,ZZ as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as Q,MX as Ae,M_ as _e,N4 as ke,CA as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,Z_ as yn,Lw as fe,M8 as fn,Z$ as gn,bM as Sn,Om as ge,Oa as bn,_0 as Cn,_1 as hn,Oq as In,Ou as An,_2 as je,B$ as _n,T6 as kn,_3 as vn,_4 as Pn,_5 as Tn,_6 as qe,_7 as En,_8 as Dn,Wa as Un,Z8 as On,Wp as wn,_9 as Je,MI as Fn,MA as Vn,Wq as xn,ME as Bn,_a as Oe,Pa as Qe,mL as jn,uV as Xe,C8 as Rn,bG as Re,Ck as Le,cG as Ln,_b as Ye,P0 as we,OJ as Nn,OK as Mn,OO as zn,_c as Zn,P3 as Ne,_d as $n,_e as Wn,_f as Gn,PR as Se,_g as Hn,gZ as Kn,JF as qn,_h as Jn,JK as Qn,JJ as Xn}from"./zeni-epic-state-OTisIlmp.js";import{ag as Pe,V as ie,d as de,P as q,z as E,a6 as se,l as D,a5 as Te,Q as $,bQ as Yn,ac as oe,bR as x,bi as Ve,bS as et,bT as nt,bU as tt,q as Be,bV as at,p as Me,aE as ze,$ as it,a9 as st,bW as ot,bX as ct,bY as rt,w as ut}from"./index-C1XAfugK.js";import{a as h}from"./sentry-CoKtZcTW.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-BsgiBiT9.js";import{u as pt,d as Ze,B as Ue}from"./BusinessVerificationPageScreen-CWXmaf4U.js";import{M as le}from"./MobileAppDrawer-tz9GmHDM.js";import L from"./NotFoundScreen-DiDzsmTQ.js";import{a as $e}from"./analyticsHelper-DJg-y5OM.js";import{d as We}from"./routePaths-D9MDrQwY.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]="68b6dec9-fec4-453a-a43c-b63a8b23adbb",e._sentryDebugIdIdentifier="sentry-dbid-68b6dec9-fec4-453a-a43c-b63a8b23adbb")}catch{}})();const mt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;