@zeniai/web-app-ui 5.4.10-dev → 5.4.10-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-BT4O8HTD.js → AccountMappingScreen-BfHCfPsu.js} +1 -1
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-Ce_XDU4u.js → ActualMatchingMatchDetailScreen-DBAaee0M.js} +1 -1
  3. package/dist/assets/{AddressRoutes-BQEPn0Yr.js → AddressRoutes-DOm5AZgQ.js} +1 -1
  4. package/dist/assets/{AddressScreen-D2FVWJY-.js → AddressScreen-Ju4jFptC.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-RbcUBAdM.js → AiCfoScreen-D_KqWkI-.js} +1 -1
  6. package/dist/assets/{AppDrawer-Sa4LLULj.js → AppDrawer-oA95yA6g.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-BbNV-MR5.js → BillPayApprovalRoutes-Rjc_1Yzv.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-uNYLvj5o.js → BillPayRoutes-8ZFPDbnM.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-ibSIK2nI.js → BusinessVerificationPageScreen-CB5WZqPo.js} +1 -1
  10. package/dist/assets/{CardsAiCfoScreen-CkEc2DEo.js → CardsAiCfoScreen-DnoKV_J5.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-CO87Ou5-.js → ChargeCardRoutes-BRi9WDmi.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-DJeoMdCg.js → CompanyPassportScreen-Gun56s5v.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-Bf2Ucb1Q.js → ConnectionAuthScreen-Bucvj8Dz.js} +1 -1
  14. package/dist/assets/{CustomerOnboardingAuthScreen-D3RbfqTk.js → CustomerOnboardingAuthScreen-D-0FBa6b.js} +1 -1
  15. package/dist/assets/{CustomerOnboardingRoutes-BynW3iC3.js → CustomerOnboardingRoutes-Dqomvbod.js} +1 -1
  16. package/dist/assets/{DashboardRoutes-ndbO6Qws.js → DashboardRoutes-DtvyLimf.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-2hNb0a3U.js → DefaultTenantHome-O9WegKb8.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BqDioG6P.js → DomesticWireDetailScreen-D2Dn8IMD.js} +1 -1
  19. package/dist/assets/{DrawerScreen-b7QdOhuW.js → DrawerScreen-Cs1uPkqR.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-aGFvyTv5.js → EntityDetailRoutes-BA7EyzY4.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-C6_zyg5Q.js → ExpenseAutomationRoutes-4gdW3X3Q.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-B5U7lEG-.js → FeaturePreviewScreen-BVEGNpWU.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-Dr1Xep8u.js → HubSpotOAuthCallbackScreen-DtZgOlse.js} +1 -1
  24. package/dist/assets/{InvoicingRoutes-C4zfN1Wc.js → InvoicingRoutes-Cff8iSMe.js} +1 -1
  25. package/dist/assets/{MagicLinkRoutes-BDl3Flj2.js → MagicLinkRoutes-DFrpOeug.js} +1 -1
  26. package/dist/assets/{MagicLinkSignInScreen-Bie6nkkJ.js → MagicLinkSignInScreen-CtYWM4hc.js} +1 -1
  27. package/dist/assets/{MobileAppDrawer-DVldqyUl.js → MobileAppDrawer-CEOkBGJa.js} +1 -1
  28. package/dist/assets/{NotFoundScreen-BXfz4Cwt.js → NotFoundScreen-CEOan4Mu.js} +1 -1
  29. package/dist/assets/{NotificationRoutes-UAhv091T.js → NotificationRoutes-Bt2YMSc3.js} +1 -1
  30. package/dist/assets/{OAuthConsentScreen-yv2un5zc.js → OAuthConsentScreen-kw-J69N9.js} +1 -1
  31. package/dist/assets/{PandLWithForecastRoutes-DZO_Ak_R.js → PandLWithForecastRoutes-CLURQtqS.js} +1 -1
  32. package/dist/assets/{PaymentLinkScreen-DgjQbdJS.js → PaymentLinkScreen-CgClyHiL.js} +1 -1
  33. package/dist/assets/{PeopleRoutes-CBBW0nYr.js → PeopleRoutes-BUL3FQWt.js} +1 -1
  34. package/dist/assets/{PerformanceRoutes-CIoRY1pR.js → PerformanceRoutes-DLQRK-sT.js} +1 -1
  35. package/dist/assets/{QBOConnectionScreen-CI47ZrlS.js → QBOConnectionScreen-CuXeVOld.js} +1 -1
  36. package/dist/assets/{ReimbursementApprovalRoutes-DrsMWkl8.js → ReimbursementApprovalRoutes-CXC_z3iO.js} +1 -1
  37. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Dw7QQEoQ.js → ReimbursementApprovalRuleDetailScreen-DJgn7dOu.js} +1 -1
  38. package/dist/assets/{ReimbursementRoutes-BiacT-VJ.js → ReimbursementRoutes-BTLSdYpS.js} +1 -1
  39. package/dist/assets/{ReportsRoutes-B5lACyrL.js → ReportsRoutes-ByluKWnc.js} +1 -1
  40. package/dist/assets/{RewardsRoutes-26PBDRkk.js → RewardsRoutes-CTBSsyDI.js} +1 -1
  41. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-LwZh192V.js → ScheduleDetailsPrepaidExpensesScreen-CNEP1b-I.js} +1 -1
  42. package/dist/assets/{ScreenRoutes-CdEeBqiV.js → ScreenRoutes-BO7UJYet.js} +2 -2
  43. package/dist/assets/{SettingsRoutes-DEHUtOgG.js → SettingsRoutes-BYgsL7BJ.js} +1 -1
  44. package/dist/assets/{SetupPagesScreen-Dv6lGRG5.js → SetupPagesScreen-96sboBlC.js} +1 -1
  45. package/dist/assets/{SignInScreen-CzvdRg4U.js → SignInScreen-DHLJXIf4.js} +1 -1
  46. package/dist/assets/{SignOutScreen-DfTRMdjb.js → SignOutScreen-NqfNO--P.js} +1 -1
  47. package/dist/assets/{TaskListScreen-8hq6cEbk.js → TaskListScreen-CtK0rsCx.js} +1 -1
  48. package/dist/assets/{TaskRoutes-C1KzEFV7.js → TaskRoutes-CqNIBzDs.js} +1 -1
  49. package/dist/assets/{TransactionDetailRoutes-BB45JvGj.js → TransactionDetailRoutes-QtrdUsWY.js} +1 -1
  50. package/dist/assets/{TransactionDetailScreen-It6ORIbN.js → TransactionDetailScreen-DxeHwsiS.js} +1 -1
  51. package/dist/assets/{TransactionListRoutes-BTjkHFVX.js → TransactionListRoutes-QLO901y7.js} +1 -1
  52. package/dist/assets/{TreasuryRoutes-Bys8F57E.js → TreasuryRoutes-CgQJltjn.js} +1 -1
  53. package/dist/assets/{VendorsRoutes-abjQ1HGQ.js → VendorsRoutes-g5OjsOsT.js} +1 -1
  54. package/dist/assets/{WiseConfirmationScreen-DewxnFTy.js → WiseConfirmationScreen-BsnqVz6T.js} +1 -1
  55. package/dist/assets/{ZeniAccountRoutes-DlvpS2Bq.js → ZeniAccountRoutes-CORKXHKc.js} +1 -1
  56. package/dist/assets/{ZeniAccountStatementScreen-DVR6RIK2.js → ZeniAccountStatementScreen-CvaKxSxd.js} +1 -1
  57. package/dist/assets/{analyticsHelper-exrV7AE9.js → analyticsHelper-Clz3U3cN.js} +1 -1
  58. package/dist/assets/{getLocaleForTenant-CBmE-ohA.js → getLocaleForTenant-C98BJYuO.js} +1 -1
  59. package/dist/assets/{index-Bx2gJO4r.js → index-BngORT8V.js} +5 -5
  60. package/dist/assets/{routePaths-DBf4ybcn.js → routePaths-CuLkZiYm.js} +1 -1
  61. package/dist/assets/{useActualMatchingMatchDetail-DBoUtV2d.js → useActualMatchingMatchDetail-CLI4Eufh.js} +1 -1
  62. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D_VhexUa.js → useAiCfoDashboardSuggestedQuestionsChips-CxSRGQ__.js} +1 -1
  63. package/dist/assets/{useAskAiCfoHostNavButtonProps-B6lOnQ69.js → useAskAiCfoHostNavButtonProps-Dv4wLrz_.js} +1 -1
  64. package/dist/assets/{useChargeCardPusherEvents-B6OwhCNo.js → useChargeCardPusherEvents-BcTvXaUj.js} +1 -1
  65. package/dist/assets/{useEmailConnectResultRefresh-t37-D3lN.js → useEmailConnectResultRefresh-Bzi-NygF.js} +1 -1
  66. package/dist/assets/{useInitialThreadRequest-C3w5IRp7.js → useInitialThreadRequest-BoUSReRA.js} +1 -1
  67. package/dist/assets/{useTaskManagerAccess-By_NjZen.js → useTaskManagerAccess-DJ65Kf61.js} +1 -1
  68. package/dist/assets/{useTaskManagerPusherEvents-LOx5aVW8.js → useTaskManagerPusherEvents-CiqcqtGX.js} +1 -1
  69. package/dist/assets/{withTransactionSidePanel-CVCleugc.js → withTransactionSidePanel-DUEbH6wg.js} +1 -1
  70. package/dist/index.html +1 -1
  71. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BdMPZzDQ.js";import{a as p}from"./sentry-Buwow292.js";import{K as r,a8 as u,ac as f,ad as h}from"./index-Bx2gJO4r.js";import{s as c}from"./mui-cK5UWUvi.js";import{i as y}from"./core-o-ca34AJ.js";import"./zeni-epic-state-MQ0qdl-Q.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.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]="8af2dafc-aba9-4230-9e3f-56b54d849982",e._sentryDebugIdIdentifier="sentry-dbid-8af2dafc-aba9-4230-9e3f-56b54d849982")}catch{}})();const g=c("div")`
1
+ import{j as a}from"./liveblocks-BdMPZzDQ.js";import{a as p}from"./sentry-Buwow292.js";import{K as r,a8 as u,ac as f,ad as h}from"./index-BngORT8V.js";import{s as c}from"./mui-cK5UWUvi.js";import{i as y}from"./core-o-ca34AJ.js";import"./zeni-epic-state-MQ0qdl-Q.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.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]="8af2dafc-aba9-4230-9e3f-56b54d849982",e._sentryDebugIdIdentifier="sentry-dbid-8af2dafc-aba9-4230-9e3f-56b54d849982")}catch{}})();const g=c("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-BdMPZzDQ.js";import{Wf as re,fI as Y,m3 as H,e1 as N,e0 as le,T3 as Q,VD as ce,Dm as Pe,Wg as J,Db as je,Dw as Le,Dq as de,Df as pe,Du as Te,Dr as ve,Wh as ue,sB as Ae,g9 as Ve,gG as Oe,Wi as W,Dj as me,Di as ge,Dz as Re,ca as Fe}from"./zeni-epic-state-MQ0qdl-Q.js";import{a0 as fe,p as X,c as G,z as _,j as he,O as Ce,ae as ye,ay as be,az as Be,aa as De,K as R,af as Se,G as K,aA as Ze,ap as Ue,ar as ze,a7 as $e,m as we,S as We,n as Ge,aB as He,V as _e}from"./index-Bx2gJO4r.js";import{D as xe,n as M,S as Ie}from"./mui-cK5UWUvi.js";import ae from"./NotFoundScreen-BXfz4Cwt.js";import{a as c}from"./sentry-Buwow292.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 $}from"./core-o-ca34AJ.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-B6lOnQ69.js";import{M as Ne}from"./MobileAppDrawer-DVldqyUl.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-By_NjZen.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]="c1e44180-a768-40fb-8dae-fd0ac5330d61",e._sentryDebugIdIdentifier="sentry-dbid-c1e44180-a768-40fb-8dae-fd0ac5330d61")}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(),[F,B]=c.useState(!1),[k,D]=c.useState(!1),{userId:S}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),E=g((l=>H(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(G.isDebitCardFeatureEnabled),P=N(I,p),T=le(p),v=Q(p),Z=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&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=()=>{F===!0?D(!0):C()},z=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,O=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:z,mode:f,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,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(v))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return c.useEffect((()=>{w===!1&&S!=null&&m(Pe(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(Ee,{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-BdMPZzDQ.js";import{Wf as re,fI as Y,m3 as H,e1 as N,e0 as le,T3 as Q,VD as ce,Dm as Pe,Wg as J,Db as je,Dw as Le,Dq as de,Df as pe,Du as Te,Dr as ve,Wh as ue,sB as Ae,g9 as Ve,gG as Oe,Wi as W,Dj as me,Di as ge,Dz as Re,ca as Fe}from"./zeni-epic-state-MQ0qdl-Q.js";import{a0 as fe,p as X,c as G,z as _,j as he,O as Ce,ae as ye,ay as be,az as Be,aa as De,K as R,af as Se,G as K,aA as Ze,ap as Ue,ar as ze,a7 as $e,m as we,S as We,n as Ge,aB as He,V as _e}from"./index-BngORT8V.js";import{D as xe,n as M,S as Ie}from"./mui-cK5UWUvi.js";import ae from"./NotFoundScreen-CEOan4Mu.js";import{a as c}from"./sentry-Buwow292.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 $}from"./core-o-ca34AJ.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-Dv4wLrz_.js";import{M as Ne}from"./MobileAppDrawer-CEOkBGJa.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-DJ65Kf61.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]="c1e44180-a768-40fb-8dae-fd0ac5330d61",e._sentryDebugIdIdentifier="sentry-dbid-c1e44180-a768-40fb-8dae-fd0ac5330d61")}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(),[F,B]=c.useState(!1),[k,D]=c.useState(!1),{userId:S}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),E=g((l=>H(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(G.isDebitCardFeatureEnabled),P=N(I,p),T=le(p),v=Q(p),Z=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&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=()=>{F===!0?D(!0):C()},z=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,O=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:z,mode:f,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,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(v))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return c.useEffect((()=>{w===!1&&S!=null&&m(Pe(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(Ee,{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-BdMPZzDQ.js";import E from"./NotFoundScreen-BXfz4Cwt.js";import{a as r}from"./sentry-Buwow292.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as O,n as z,o as b}from"./core-o-ca34AJ.js";import{fI as B,a25 as h,bo as F,bn as N,iP as V,gk as $}from"./zeni-epic-state-MQ0qdl-Q.js";import{g as q,z as I,ar as G,dO as H}from"./index-Bx2gJO4r.js";import"./mui-cK5UWUvi.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-B6lOnQ69.js";import{M as K}from"./MobileAppDrawer-DVldqyUl.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-By_NjZen.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]="ebf9d0f3-b118-4ca1-bff1-292097055034",e._sentryDebugIdIdentifier="sentry-dbid-ebf9d0f3-b118-4ca1-bff1-292097055034")}catch{}})();const L=O((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(H),Q=()=>{const e=_(),t=v(),c=q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=M(),g=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=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{g(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(g($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),u=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=J({mobileExploreReferrer:"Performance"});return G({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:u}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:u,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function be(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(Q,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
1
+ import{j as s}from"./liveblocks-BdMPZzDQ.js";import E from"./NotFoundScreen-CEOan4Mu.js";import{a as r}from"./sentry-Buwow292.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as O,n as z,o as b}from"./core-o-ca34AJ.js";import{fI as B,a25 as h,bo as F,bn as N,iP as V,gk as $}from"./zeni-epic-state-MQ0qdl-Q.js";import{g as q,z as I,ar as G,dO as H}from"./index-BngORT8V.js";import"./mui-cK5UWUvi.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-Dv4wLrz_.js";import{M as K}from"./MobileAppDrawer-CEOkBGJa.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-DJ65Kf61.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]="ebf9d0f3-b118-4ca1-bff1-292097055034",e._sentryDebugIdIdentifier="sentry-dbid-ebf9d0f3-b118-4ca1-bff1-292097055034")}catch{}})();const L=O((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(H),Q=()=>{const e=_(),t=v(),c=q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=M(),g=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=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{g(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(g($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),u=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=J({mobileExploreReferrer:"Performance"});return G({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:u}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:u,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function be(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(Q,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-BdMPZzDQ.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-Buwow292.js";import{L as ge,c1 as xc,fI as kc,UK as Tc,VB as jl,ca as xl}from"./zeni-epic-state-MQ0qdl-Q.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-D4KfE2cr.js";import{r as cn}from"./empty-BnmFWJHQ.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-C69QvBGc.js";import{a as Ye,r as Fl}from"./index-BLrePuqf.js";import{r as Ul}from"./index-Cmb8jqqj.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-o-ca34AJ.js";import{u as Zl,z as Rc,L as Hl,aj as Vl,ak as Yl,X as Kl,I as Wl}from"./index-Bx2gJO4r.js";import"./mui-cK5UWUvi.js";import{d as It}from"./decodeURIComponentSafe-CdLVPaCS.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]="4f61fbc8-9bf0-4c3e-b30a-f790ee64f324",e._sentryDebugIdIdentifier="sentry-dbid-4f61fbc8-9bf0-4c3e-b30a-f790ee64f324")}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,Kn,Wn,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-BdMPZzDQ.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-Buwow292.js";import{L as ge,c1 as xc,fI as kc,UK as Tc,VB as jl,ca as xl}from"./zeni-epic-state-MQ0qdl-Q.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-D4KfE2cr.js";import{r as cn}from"./empty-BnmFWJHQ.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-C69QvBGc.js";import{a as Ye,r as Fl}from"./index-BLrePuqf.js";import{r as Ul}from"./index-Cmb8jqqj.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-o-ca34AJ.js";import{u as Zl,z as Rc,L as Hl,aj as Vl,ak as Yl,X as Kl,I as Wl}from"./index-BngORT8V.js";import"./mui-cK5UWUvi.js";import{d as It}from"./decodeURIComponentSafe-CdLVPaCS.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]="4f61fbc8-9bf0-4c3e-b30a-f790ee64f324",e._sentryDebugIdIdentifier="sentry-dbid-4f61fbc8-9bf0-4c3e-b30a-f790ee64f324")}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,Kn,Wn,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-BdMPZzDQ.js";import z from"./NotFoundScreen-BXfz4Cwt.js";import{a as p}from"./sentry-Buwow292.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as K,o as h}from"./core-o-ca34AJ.js";import{fI as E,_9 as b,_r as w,Oi as U,Oe as L,Oh as f,O7 as N,_Q as B,Ob as Q,Ok as q}from"./zeni-epic-state-MQ0qdl-Q.js";import{z as _,w as T,cc as F,x as $,bV as G,cd as H}from"./index-Bx2gJO4r.js";import"./mui-cK5UWUvi.js";import{u as J}from"./useEnsureVendorListLoaded-BmranjK0.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-Dw7QQEoQ.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]="02c3e997-adf3-48d6-a932-67c3e01f8fd4",e._sentryDebugIdIdentifier="sentry-dbid-02c3e997-adf3-48d6-a932-67c3e01f8fd4")}catch{}})();const j="reimbursement-approval-rule-update",M=O((function(e){return{approvalView:b(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"))}}}))(T(F)),P=({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=>b(o))),g=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(U())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),_.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(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=b(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(q(t,!0))}}}))(T(H)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=G(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(P,{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)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>b(i)));J();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(Q(!1,!0)))}),[v,g,e,a]),_.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(K,{children:[r.jsx(h,{path:"/",element:r.jsx(Y,{})}),r.jsx(h,{path:"/new",element:r.jsx(x,{})}),r.jsx(h,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(h,{path:"*",element:r.jsx(z,{})})]})}export{ue as R};
1
+ import{j as r}from"./liveblocks-BdMPZzDQ.js";import z from"./NotFoundScreen-CEOan4Mu.js";import{a as p}from"./sentry-Buwow292.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as K,o as h}from"./core-o-ca34AJ.js";import{fI as E,_9 as b,_r as w,Oi as U,Oe as L,Oh as f,O7 as N,_Q as B,Ob as Q,Ok as q}from"./zeni-epic-state-MQ0qdl-Q.js";import{z as _,w as T,cc as F,x as $,bV as G,cd as H}from"./index-BngORT8V.js";import"./mui-cK5UWUvi.js";import{u as J}from"./useEnsureVendorListLoaded-BmranjK0.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-DJgn7dOu.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]="02c3e997-adf3-48d6-a932-67c3e01f8fd4",e._sentryDebugIdIdentifier="sentry-dbid-02c3e997-adf3-48d6-a932-67c3e01f8fd4")}catch{}})();const j="reimbursement-approval-rule-update",M=O((function(e){return{approvalView:b(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"))}}}))(T(F)),P=({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=>b(o))),g=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(U())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),_.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(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=b(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(q(t,!0))}}}))(T(H)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=G(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(P,{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)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>b(i)));J();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(Q(!1,!0)))}),[v,g,e,a]),_.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(K,{children:[r.jsx(h,{path:"/",element:r.jsx(Y,{})}),r.jsx(h,{path:"/new",element:r.jsx(x,{})}),r.jsx(h,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(h,{path:"*",element:r.jsx(z,{})})]})}export{ue as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-BdMPZzDQ.js";import{a as y}from"./sentry-Buwow292.js";import{h as U,u as x,g as C,i as V,j as R,l as k}from"./core-o-ca34AJ.js";import{_r as _,_9 as O,Oa as j,On as B,Oi as A,Oj as E,_s as F,fI as K,Oh as L}from"./zeni-epic-state-MQ0qdl-Q.js";import{z as N,a6 as P,c3 as W,x as $,bV as G,c4 as H}from"./index-Bx2gJO4r.js";import{u as q}from"./mui-cK5UWUvi.js";import{u as J}from"./useEnsureVendorListLoaded-BmranjK0.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]="a1ac6167-a07a-40f7-895b-28b1843db551",e._sentryDebugIdIdentifier="sentry-dbid-a1ac6167-a07a-40f7-895b-28b1843db551")}catch{}})();const M=k((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=$(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=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((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=$(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=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),p(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(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-BdMPZzDQ.js";import{a as y}from"./sentry-Buwow292.js";import{h as U,u as x,g as C,i as V,j as R,l as k}from"./core-o-ca34AJ.js";import{_r as _,_9 as O,Oa as j,On as B,Oi as A,Oj as E,_s as F,fI as K,Oh as L}from"./zeni-epic-state-MQ0qdl-Q.js";import{z as N,a6 as P,c3 as W,x as $,bV as G,c4 as H}from"./index-BngORT8V.js";import{u as q}from"./mui-cK5UWUvi.js";import{u as J}from"./useEnsureVendorListLoaded-BmranjK0.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]="a1ac6167-a07a-40f7-895b-28b1843db551",e._sentryDebugIdIdentifier="sentry-dbid-a1ac6167-a07a-40f7-895b-28b1843db551")}catch{}})();const M=k((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=$(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=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((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=$(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=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),p(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(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-BdMPZzDQ.js";import{u as ae,j as v,h as Q,g as K,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-o-ca34AJ.js";import{fI as H,Oe as ct,$W as ge,ca as he,Nk as Ue,me as dt,Nz as ce,Ny as de,$X as ut,bn as fe,gZ as Le,$Y as pt,XG as bt,m3 as $e,XH as Ae,XI as gt,kR as ht,ZX as ft,l4 as St,N8 as It,CE as yt,kY as Rt,NV as Ne,$Z as Pe,$_ as Ce,$$ as kt,a00 as vt,a01 as At,NF as we,la as Ct,_4 as wt,Nx as Et,Ni as xt,a02 as Bt,Nh as Tt,a03 as Dt,Np as Ee,NJ as jt,NI as Ft,NE as Ut,a04 as _e,T3 as Lt,bo as $t,Ns as Nt,Ob as Pt,a05 as _t,a06 as Mt,NR as Ot,NO as xe,Zr as zt,Nf as Zt,a07 as Me,OE as Be,OM as Gt,a08 as Vt,a09 as q,a0a as Ht,a0b as Oe,a0c as Wt,a0d as ze,a0e as Ze,O1 as ue,bv as Xt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a0f as qt,gk as Jt,ZE as Kt,a0g as Yt,a0h as He,ZI as Qt,_r as en,a0i as tn,_Q as nn,OJ as Te,OI as an,a0j as sn,a0k as on,a0l as rn,a0m as ln,a0n as mn,_a as cn,Oz as dn,OD as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,V3 as Sn,dc as In,df as yn,de as Rn,cH as kn}from"./zeni-epic-state-MQ0qdl-Q.js";import{bV as vn,g as We,a0 as Xe,p as oe,c as U,z as L,cT as qe,a7 as re,m as E,aR as De,K as j,ad as se,ae as An,G as Je,cU as Cn,n as J,ar as Ke,cV as wn,V as le,cW as En,ap as xn,aa as Bn,a6 as ye,S as Ye,w as Tn,bD as Dn,au as jn,ah as Fn,cX as Un,j as Ln}from"./index-Bx2gJO4r.js";import{n as P,S as $n,u as Qe}from"./mui-cK5UWUvi.js";import pe from"./NotFoundScreen-BXfz4Cwt.js";import{S as je}from"./SetupPagesScreen-Dv6lGRG5.js";import{F as et}from"./FeaturePreviewScreen-B5U7lEG-.js";import{a as g}from"./sentry-Buwow292.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-B6lOnQ69.js";import{u as tt}from"./useInitialThreadRequest-C3w5IRp7.js";import{D as Nn}from"./DrawerScreen-b7QdOhuW.js";import{M as nt}from"./MobileAppDrawer-DVldqyUl.js";import{F as Pn}from"./ScreenRoutes-CdEeBqiV.js";import{R as _n}from"./ReimbursementApprovalRoutes-DrsMWkl8.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./BusinessVerificationPageScreen-ibSIK2nI.js";import"./routePaths-DBf4ybcn.js";import"./analyticsHelper-exrV7AE9.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-By_NjZen.js";import"./getLocaleForTenant-CBmE-ohA.js";import"./useEnsureVendorListLoaded-BmranjK0.js";import"./ReimbursementApprovalRuleDetailScreen-Dw7QQEoQ.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]="889371fc-3512-4aa6-a1fd-d8ef83438e87",e._sentryDebugIdIdentifier="sentry-dbid-889371fc-3512-4aa6-a1fd-d8ef83438e87")}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:X,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.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(At({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(vt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(kt({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=J(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(Rt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function Fe(){const e=Q(),t=ae(),n=K(),{reimbursementId:r}=ie(),m=We(),c=Xe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(U.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(U.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"}),B=K().pathname,D=B.includes("edit"),A=B.includes("reimbursement/new"),[C,R]=g.useState(!1),S=L.getSignedInUser(),w=v((b=>H(b))),h=v((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),F=he(w?.userRole??[]);(function(){const b=ae(),M=v((Y=>H(Y))),O=M?.tenantId,{isApprovalRulesV3Enabled:z,isLoading:W}=vn(O),Z=v((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((()=>{(A&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(R(!0),t(Ue(!1,I,u,r)))}));const k=v((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:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.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:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.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:k,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(qe,{isNewReimbursement:r==null})}const zn=P.div`
1
+ import{j as s}from"./liveblocks-BdMPZzDQ.js";import{u as ae,j as v,h as Q,g as K,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-o-ca34AJ.js";import{fI as H,Oe as ct,$W as ge,ca as he,Nk as Ue,me as dt,Nz as ce,Ny as de,$X as ut,bn as fe,gZ as Le,$Y as pt,XG as bt,m3 as $e,XH as Ae,XI as gt,kR as ht,ZX as ft,l4 as St,N8 as It,CE as yt,kY as Rt,NV as Ne,$Z as Pe,$_ as Ce,$$ as kt,a00 as vt,a01 as At,NF as we,la as Ct,_4 as wt,Nx as Et,Ni as xt,a02 as Bt,Nh as Tt,a03 as Dt,Np as Ee,NJ as jt,NI as Ft,NE as Ut,a04 as _e,T3 as Lt,bo as $t,Ns as Nt,Ob as Pt,a05 as _t,a06 as Mt,NR as Ot,NO as xe,Zr as zt,Nf as Zt,a07 as Me,OE as Be,OM as Gt,a08 as Vt,a09 as q,a0a as Ht,a0b as Oe,a0c as Wt,a0d as ze,a0e as Ze,O1 as ue,bv as Xt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a0f as qt,gk as Jt,ZE as Kt,a0g as Yt,a0h as He,ZI as Qt,_r as en,a0i as tn,_Q as nn,OJ as Te,OI as an,a0j as sn,a0k as on,a0l as rn,a0m as ln,a0n as mn,_a as cn,Oz as dn,OD as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,V3 as Sn,dc as In,df as yn,de as Rn,cH as kn}from"./zeni-epic-state-MQ0qdl-Q.js";import{bV as vn,g as We,a0 as Xe,p as oe,c as U,z as L,cT as qe,a7 as re,m as E,aR as De,K as j,ad as se,ae as An,G as Je,cU as Cn,n as J,ar as Ke,cV as wn,V as le,cW as En,ap as xn,aa as Bn,a6 as ye,S as Ye,w as Tn,bD as Dn,au as jn,ah as Fn,cX as Un,j as Ln}from"./index-BngORT8V.js";import{n as P,S as $n,u as Qe}from"./mui-cK5UWUvi.js";import pe from"./NotFoundScreen-CEOan4Mu.js";import{S as je}from"./SetupPagesScreen-96sboBlC.js";import{F as et}from"./FeaturePreviewScreen-BVEGNpWU.js";import{a as g}from"./sentry-Buwow292.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-Dv4wLrz_.js";import{u as tt}from"./useInitialThreadRequest-BoUSReRA.js";import{D as Nn}from"./DrawerScreen-Cs1uPkqR.js";import{M as nt}from"./MobileAppDrawer-CEOkBGJa.js";import{F as Pn}from"./ScreenRoutes-BO7UJYet.js";import{R as _n}from"./ReimbursementApprovalRoutes-CXC_z3iO.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./BusinessVerificationPageScreen-CB5WZqPo.js";import"./routePaths-CuLkZiYm.js";import"./analyticsHelper-Clz3U3cN.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-DJ65Kf61.js";import"./getLocaleForTenant-C98BJYuO.js";import"./useEnsureVendorListLoaded-BmranjK0.js";import"./ReimbursementApprovalRuleDetailScreen-DJgn7dOu.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]="889371fc-3512-4aa6-a1fd-d8ef83438e87",e._sentryDebugIdIdentifier="sentry-dbid-889371fc-3512-4aa6-a1fd-d8ef83438e87")}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:X,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.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(At({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(vt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(kt({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=J(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(Rt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function Fe(){const e=Q(),t=ae(),n=K(),{reimbursementId:r}=ie(),m=We(),c=Xe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(U.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(U.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"}),B=K().pathname,D=B.includes("edit"),A=B.includes("reimbursement/new"),[C,R]=g.useState(!1),S=L.getSignedInUser(),w=v((b=>H(b))),h=v((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),F=he(w?.userRole??[]);(function(){const b=ae(),M=v((Y=>H(Y))),O=M?.tenantId,{isApprovalRulesV3Enabled:z,isLoading:W}=vn(O),Z=v((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((()=>{(A&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(R(!0),t(Ue(!1,I,u,r)))}));const k=v((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:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.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:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.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:k,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(qe,{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 f}from"./liveblocks-BdMPZzDQ.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as We,o as oe}from"./core-o-ca34AJ.js";import{fI as Q,EH as S,VC as ze,m3 as ue,ul as he,va as Y,lK as j,lT as F,lL as V,kO as P,kF as A,kE as E,DK as U,vf as ye,bq as Ge,VD as He,bn as Ne,F3 as qe,VE as $e,VF as Ke,ck as I,DD as ne,VG as re,VH as Ze,VI as Je,VJ as Qe,VK as Xe,VL as ea,VM as aa,VN as sa,VO as ta,VP as oa,VQ as na,VR as ra,VS as la,VT as k,VU as x,VV as W,VW as z,VX as G,VY as H,VZ as N,V_ as q,V$ as $,W0 as K,ek as ca,EJ as ia,Ev as le,Ew as ce,EP as da,EA as ie,bG as O,W1 as de,di as pe,EB as _e,EV as pa,W2 as _a,W3 as fa,W4 as ba,W5 as ma,W6 as ua,W7 as ha,W8 as ya,W9 as Ca,Wa as wa,Wb as ga,e1 as Ia,e0 as Ra}from"./zeni-epic-state-MQ0qdl-Q.js";import{am as Sa,an as Ta,ao as ka,a as Oa,a0 as Da,p as Ce,c as Z,z as we,ap as ja,V as Fa,e as Va,aq as Pa,ar as Aa,a7 as Ea,m as J,S as Ma,D as La,n as ge,as as Ba,at as va,au as Ya}from"./index-Bx2gJO4r.js";import"./mui-cK5UWUvi.js";import Ua from"./NotFoundScreen-BXfz4Cwt.js";import{F as xa}from"./FeaturePreviewScreen-B5U7lEG-.js";import{a as u}from"./sentry-Buwow292.js";import{u as Wa}from"./useInitialThreadRequest-C3w5IRp7.js";import{t as fe,a as be,b as za}from"./routePaths-DBf4ybcn.js";import{t as me}from"./reportTimeframe-6FnDbaGY.js";import{M as Ga}from"./MobileAppDrawer-DVldqyUl.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-By_NjZen.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]="ef104167-9f60-4417-85bc-fa83fd25ae63",e._sentryDebugIdIdentifier="sentry-dbid-ef104167-9f60-4417-85bc-fa83fd25ae63")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(K({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(W({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},qa=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=Q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=He(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:J,isZeniUser:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=O(a),i=O(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(E(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(E(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(A());break;case"balance_sheet_by_projects":e(E(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(P());break;case"cash_flow":e(j(r,!0,a,s));break;case"cash_flow_by_classes":e(j(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(j(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(F())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(R(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?za(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:D(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(K({scrollPosition:s}));break;case"profit_and_loss_by_classes":e($({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(G({scrollPosition:s}));break;case"cash_flow_by_classes":e(z({scrollPosition:s}));break;case"cash_flow_by_projects":e(W({scrollPosition:s}));break;case"cash_flow":e(x({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(K({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=R(t),r=I(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",D(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",D(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",D(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e(Xe({classesToFilterOut:a})):R(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Ze({projectsToFilterOut:a})):R(o.selectedReportID)?e(Je({projectsToFilterOut:a})):e(Qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?A():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?P():U())},onUpdateDisplayOrder:a=>{e(Ke(a))},onUpdateReportFormat:a=>{Na(e),e($e(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?qe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):P(!0):A(!0))}}}))(Ba);function $a(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=Da(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(Z.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(Z.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Ie]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>Q(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=Wa(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>ze(l))),{areTenantIdsInSync:y}=ja(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),De=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Ie(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(E(C.timeframe));break;case"balance_sheet_by_classes":T&&s(A());break;case"balance_sheet_by_projects":g&&s(P());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(j(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Fa(),je=ee?.loggedInUserRole!=null&&Ge(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Pe=Va(),Ae=Pa();return(function(l){const{isDataReady:Ee}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ee),Be=u.useMemo((()=>se?Ha:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Aa({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Ea,{analytics:J,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ga,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx(qa,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:De,selectedReportID:B,analytics:J,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:je,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ae&&Pe&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const D=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ys(){const e=_((s=>Q(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(Z.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(We,{children:[f.jsx(oe,{path:"/",element:f.jsx($a,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
1
+ import{j as f}from"./liveblocks-BdMPZzDQ.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as We,o as oe}from"./core-o-ca34AJ.js";import{fI as Q,EH as S,VC as ze,m3 as ue,ul as he,va as Y,lK as j,lT as F,lL as V,kO as P,kF as A,kE as E,DK as U,vf as ye,bq as Ge,VD as He,bn as Ne,F3 as qe,VE as $e,VF as Ke,ck as I,DD as ne,VG as re,VH as Ze,VI as Je,VJ as Qe,VK as Xe,VL as ea,VM as aa,VN as sa,VO as ta,VP as oa,VQ as na,VR as ra,VS as la,VT as k,VU as x,VV as W,VW as z,VX as G,VY as H,VZ as N,V_ as q,V$ as $,W0 as K,ek as ca,EJ as ia,Ev as le,Ew as ce,EP as da,EA as ie,bG as O,W1 as de,di as pe,EB as _e,EV as pa,W2 as _a,W3 as fa,W4 as ba,W5 as ma,W6 as ua,W7 as ha,W8 as ya,W9 as Ca,Wa as wa,Wb as ga,e1 as Ia,e0 as Ra}from"./zeni-epic-state-MQ0qdl-Q.js";import{am as Sa,an as Ta,ao as ka,a as Oa,a0 as Da,p as Ce,c as Z,z as we,ap as ja,V as Fa,e as Va,aq as Pa,ar as Aa,a7 as Ea,m as J,S as Ma,D as La,n as ge,as as Ba,at as va,au as Ya}from"./index-BngORT8V.js";import"./mui-cK5UWUvi.js";import Ua from"./NotFoundScreen-CEOan4Mu.js";import{F as xa}from"./FeaturePreviewScreen-BVEGNpWU.js";import{a as u}from"./sentry-Buwow292.js";import{u as Wa}from"./useInitialThreadRequest-BoUSReRA.js";import{t as fe,a as be,b as za}from"./routePaths-CuLkZiYm.js";import{t as me}from"./reportTimeframe-6FnDbaGY.js";import{M as Ga}from"./MobileAppDrawer-CEOkBGJa.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./useTaskManagerAccess-DJ65Kf61.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]="ef104167-9f60-4417-85bc-fa83fd25ae63",e._sentryDebugIdIdentifier="sentry-dbid-ef104167-9f60-4417-85bc-fa83fd25ae63")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(K({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(W({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},qa=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=Q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=He(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:J,isZeniUser:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=O(a),i=O(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(E(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(E(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(A());break;case"balance_sheet_by_projects":e(E(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(P());break;case"cash_flow":e(j(r,!0,a,s));break;case"cash_flow_by_classes":e(j(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(j(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(F())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(R(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?za(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:D(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(K({scrollPosition:s}));break;case"profit_and_loss_by_classes":e($({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(G({scrollPosition:s}));break;case"cash_flow_by_classes":e(z({scrollPosition:s}));break;case"cash_flow_by_projects":e(W({scrollPosition:s}));break;case"cash_flow":e(x({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(K({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=R(t),r=I(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",D(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",D(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",D(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e(Xe({classesToFilterOut:a})):R(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Ze({projectsToFilterOut:a})):R(o.selectedReportID)?e(Je({projectsToFilterOut:a})):e(Qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?A():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?P():U())},onUpdateDisplayOrder:a=>{e(Ke(a))},onUpdateReportFormat:a=>{Na(e),e($e(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?qe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):P(!0):A(!0))}}}))(Ba);function $a(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=Da(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(Z.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(Z.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Ie]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>Q(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=Wa(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>ze(l))),{areTenantIdsInSync:y}=ja(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),De=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Ie(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(E(C.timeframe));break;case"balance_sheet_by_classes":T&&s(A());break;case"balance_sheet_by_projects":g&&s(P());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(j(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Fa(),je=ee?.loggedInUserRole!=null&&Ge(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Pe=Va(),Ae=Pa();return(function(l){const{isDataReady:Ee}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ee),Be=u.useMemo((()=>se?Ha:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Aa({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Ea,{analytics:J,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ga,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx(qa,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:De,selectedReportID:B,analytics:J,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:je,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ae&&Pe&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const D=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ys(){const e=_((s=>Q(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(Z.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(We,{children:[f.jsx(oe,{path:"/",element:f.jsx($a,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-BdMPZzDQ.js";import{z as b,a7 as v,m as d,S as N,e6 as k,p as I,c as C}from"./index-Bx2gJO4r.js";import"./mui-cK5UWUvi.js";import g from"./NotFoundScreen-BXfz4Cwt.js";import{a as c}from"./sentry-Buwow292.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-o-ca34AJ.js";import{fI as _,a32 as j,a33 as p,Em as P,q7 as V,a34 as q,Ek as z}from"./zeni-epic-state-MQ0qdl-Q.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.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]="ee5afa39-db48-4b39-be32-ae4f4306a01f",e._sentryDebugIdIdentifier="sentry-dbid-ee5afa39-db48-4b39-be32-ae4f4306a01f")}catch{}})();const G=T((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((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(k),R=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),m=F(),w=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),x=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(v,{analytics:d,onLoad:o=>(S=>S.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-BdMPZzDQ.js";import{z as b,a7 as v,m as d,S as N,e6 as k,p as I,c as C}from"./index-BngORT8V.js";import"./mui-cK5UWUvi.js";import g from"./NotFoundScreen-CEOan4Mu.js";import{a as c}from"./sentry-Buwow292.js";import{u as D,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-o-ca34AJ.js";import{fI as _,a32 as j,a33 as p,Em as P,q7 as V,a34 as q,Ek as z}from"./zeni-epic-state-MQ0qdl-Q.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.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]="ee5afa39-db48-4b39-be32-ae4f4306a01f",e._sentryDebugIdIdentifier="sentry-dbid-ee5afa39-db48-4b39-be32-ae4f4306a01f")}catch{}})();const G=T((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((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(k),R=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),m=F(),w=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),x=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(v,{analytics:d,onLoad:o=>(S=>S.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(R,{}):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-BdMPZzDQ.js";import{a as v}from"./sentry-Buwow292.js";import{i as M,u as H,h as Q,g as ee,j as r,l as te}from"./core-o-ca34AJ.js";import{XB as Fe,XC as Ge,m3 as ae,sF as Ve,sR as Me,t5 as Re,t3 as $e,t6 as Ke,t8 as Ue,XD as Ye,fI as K,WA as pe,XE as Se,h2 as ne,cD as le,cE as se,FN as ve,XF as Ce,FR as Xe,gS as ce,sI as qe,th as ze,dF as We,dE as Ze,TW as fe,FL as He,FF as Qe,XG as De,Fx as et,Fw as tt,Fr as at,FC as nt,FS as lt,XH as Y,XI as ge,Fy as st,WB as oe,G6 as Ae,F$ as Ie,XJ as xe,sL as Te,FV as Be,FT as Le,XK as Je,Gd as be,Ga as we,FW as je,Gc as Ne}from"./zeni-epic-state-MQ0qdl-Q.js";import{a3 as de,aX as ie,aY as ct,z as ot,l as dt,a6 as it,a7 as ue,m as _,au as ut,aZ as rt,n as G,G as ye,g as Ee,a_ as ht,a$ as mt,b0 as pt}from"./index-Bx2gJO4r.js";import{n as re}from"./mui-cK5UWUvi.js";import{p as St}from"./pathToGoBack-Bk8jMuE9.js";import{u as ft}from"./useActualMatchingMatchDetail-DBoUtV2d.js";import Z from"./NotFoundScreen-BXfz4Cwt.js";import{c as V}from"./routePaths-DBf4ybcn.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]="7f4593ab-559e-4044-b479-c1bcf86ca9c5",e._sentryDebugIdIdentifier="sentry-dbid-7f4593ab-559e-4044-b479-c1bcf86ca9c5")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Fe(u,s??""))),m=r((u=>Ge(u))),C=r((u=>ae(u))),y=ft(),S=v.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),I=v.useRef(!1);return v.useEffect((()=>{o.fetchState!=="In-Progress"&&I.current&&o.fetchState==="Completed"&&(I.current=!1,S())}),[o.fetchState,S]),v.useEffect((()=>{s!=null&&d==null&&h.fetchState==="Not-Started"&&n(Ve(s))}),[s,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(Z,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(Z,{}):E.jsx(Dt,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n($e(s,u,f))},onSkip:(u,f)=>{n(Re(s,u,f))}})})}const Dt=re.div`
1
+ import{j as E}from"./liveblocks-BdMPZzDQ.js";import{a as v}from"./sentry-Buwow292.js";import{i as M,u as H,h as Q,g as ee,j as r,l as te}from"./core-o-ca34AJ.js";import{XB as Fe,XC as Ge,m3 as ae,sF as Ve,sR as Me,t5 as Re,t3 as $e,t6 as Ke,t8 as Ue,XD as Ye,fI as K,WA as pe,XE as Se,h2 as ne,cD as le,cE as se,FN as ve,XF as Ce,FR as Xe,gS as ce,sI as qe,th as ze,dF as We,dE as Ze,TW as fe,FL as He,FF as Qe,XG as De,Fx as et,Fw as tt,Fr as at,FC as nt,FS as lt,XH as Y,XI as ge,Fy as st,WB as oe,G6 as Ae,F$ as Ie,XJ as xe,sL as Te,FV as Be,FT as Le,XK as Je,Gd as be,Ga as we,FW as je,Gc as Ne}from"./zeni-epic-state-MQ0qdl-Q.js";import{a3 as de,aX as ie,aY as ct,z as ot,l as dt,a6 as it,a7 as ue,m as _,au as ut,aZ as rt,n as G,G as ye,g as Ee,a_ as ht,a$ as mt,b0 as pt}from"./index-BngORT8V.js";import{n as re}from"./mui-cK5UWUvi.js";import{p as St}from"./pathToGoBack-Bk8jMuE9.js";import{u as ft}from"./useActualMatchingMatchDetail-CLI4Eufh.js";import Z from"./NotFoundScreen-CEOan4Mu.js";import{c as V}from"./routePaths-CuLkZiYm.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]="7f4593ab-559e-4044-b479-c1bcf86ca9c5",e._sentryDebugIdIdentifier="sentry-dbid-7f4593ab-559e-4044-b479-c1bcf86ca9c5")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Fe(u,s??""))),m=r((u=>Ge(u))),C=r((u=>ae(u))),y=ft(),S=v.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),I=v.useRef(!1);return v.useEffect((()=>{o.fetchState!=="In-Progress"&&I.current&&o.fetchState==="Completed"&&(I.current=!1,S())}),[o.fetchState,S]),v.useEffect((()=>{s!=null&&d==null&&h.fetchState==="Not-Started"&&n(Ve(s))}),[s,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(Z,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(Z,{}):E.jsx(Dt,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n($e(s,u,f))},onSkip:(u,f)=>{n(Re(s,u,f))}})})}const Dt=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-BXfz4Cwt.js","assets/sentry-Buwow292.js","assets/core-o-ca34AJ.js","assets/zeni-epic-state-MQ0qdl-Q.js","assets/index-Bx2gJO4r.js","assets/mui-cK5UWUvi.js","assets/analytics-C3OBHjEG.js","assets/utils-D4KfE2cr.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-ndbO6Qws.js","assets/withTransactionSidePanel-CVCleugc.js","assets/useAskAiCfoHostNavButtonProps-B6lOnQ69.js","assets/TransactionDetailScreen-It6ORIbN.js","assets/decodeURIComponentSafe-CdLVPaCS.js","assets/useInitialThreadRequest-C3w5IRp7.js","assets/routePaths-DBf4ybcn.js","assets/expenseAutomationHelper-8n6GRk1T.js","assets/stripSplatSuffix-BKbpznmZ.js","assets/reportTimeframe-6FnDbaGY.js","assets/analyticsHelper-exrV7AE9.js","assets/CompanyPassportScreen-DJeoMdCg.js","assets/MobileAppDrawer-DVldqyUl.js","assets/InboxNotificationsProvider-Cph6MP0g.js","assets/useTaskManagerAccess-By_NjZen.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D_VhexUa.js","assets/FeaturePreviewScreen-B5U7lEG-.js","assets/BillPayRoutes-uNYLvj5o.js","assets/AddressScreen-D2FVWJY-.js","assets/DomesticWireDetailScreen-BqDioG6P.js","assets/BusinessVerificationPageScreen-ibSIK2nI.js","assets/DrawerScreen-b7QdOhuW.js","assets/SetupPagesScreen-Dv6lGRG5.js","assets/BillPayApprovalRoutes-BbNV-MR5.js","assets/useEnsureVendorListLoaded-BmranjK0.js","assets/ReimbursementApprovalRuleDetailScreen-Dw7QQEoQ.js","assets/getLocaleForTenant-CBmE-ohA.js","assets/ReimbursementRoutes-BiacT-VJ.js","assets/ReimbursementApprovalRoutes-DrsMWkl8.js","assets/TransactionListRoutes-BTjkHFVX.js","assets/ZeniAccountStatementScreen-DVR6RIK2.js","assets/SettingsRoutes-DEHUtOgG.js","assets/AccountMappingScreen-BT4O8HTD.js","assets/QBOConnectionScreen-CI47ZrlS.js","assets/empty-BnmFWJHQ.js","assets/index-BLrePuqf.js","assets/url-C7oPARVv.js","assets/index-Cmb8jqqj.js","assets/accountMappingHelper-C9fFA6EC.js","assets/useEmailConnectResultRefresh-t37-D3lN.js","assets/ReportsRoutes-B5lACyrL.js","assets/ChargeCardRoutes-CO87Ou5-.js","assets/useChargeCardPusherEvents-B6OwhCNo.js","assets/PeopleRoutes-CBBW0nYr.js","assets/ExpenseAutomationRoutes-C6_zyg5Q.js","assets/useActualMatchingMatchDetail-DBoUtV2d.js","assets/ScheduleDetailsPrepaidExpensesScreen-LwZh192V.js","assets/pathToGoBack-Bk8jMuE9.js","assets/TreasuryRoutes-Bys8F57E.js","assets/VendorsRoutes-abjQ1HGQ.js","assets/ZeniAccountRoutes-DlvpS2Bq.js","assets/AddressRoutes-BQEPn0Yr.js","assets/PandLWithForecastRoutes-DZO_Ak_R.js","assets/CustomerOnboardingRoutes-BynW3iC3.js","assets/TransactionDetailRoutes-BB45JvGj.js","assets/EntityDetailRoutes-aGFvyTv5.js","assets/InvoicingRoutes-C4zfN1Wc.js","assets/NotificationRoutes-UAhv091T.js","assets/PerformanceRoutes-CIoRY1pR.js","assets/ActualMatchingMatchDetailScreen-Ce_XDU4u.js","assets/RewardsRoutes-26PBDRkk.js","assets/TaskRoutes-C1KzEFV7.js","assets/TaskListScreen-8hq6cEbk.js","assets/useTaskManagerPusherEvents-LOx5aVW8.js","assets/AiCfoScreen-RbcUBAdM.js","assets/CardsAiCfoScreen-CkEc2DEo.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bs as js,dk as gs,ca as Rs,gM as As,gc as Is,dh as xe,cI as Ts,gq as fs,cA as bs,bG as Ds,br as ys,U$ as Cs,v as vs,V2 as ws,bq as Os,V3 as Ps,bM as Us,bL as ks,bu as Fs,cw as Ls,V4 as Vs,V5 as Hs,dc as Ss,df as Bs,de as Ns,cH as Ms,cO as Zs,p_ as je,gl as ge,h0 as $s,gn as Re,gO as Ae,gP as Ie,go as Gs}from"./zeni-epic-state-MQ0qdl-Q.js";import{j as e}from"./liveblocks-BdMPZzDQ.js";import{a as U}from"./sentry-Buwow292.js";import{N as d,u as zs,h as qs,i as Ys,g as Ws,j as G,q as Te,n as Qs,o as a}from"./core-o-ca34AJ.js";import{N as l,u as Xs,z as C,p as Js,e as Ks,f as en,c as M,j as sn,O as nn,V as tn,L as F,G as fe,t as _,P as an,m as ae,Q as on,Z as rn}from"./index-Bx2gJO4r.js";import{u as ln}from"./mui-cK5UWUvi.js";import{f as be}from"./analyticsHelper-exrV7AE9.js";import{t as dn}from"./getLocaleForTenant-CBmE-ohA.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new t.Error().stack;p&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[p]="61396639-22ab-4338-87f3-93f79feccc74",t._sentryDebugIdIdentifier="sentry-dbid-61396639-22ab-4338-87f3-93f79feccc74")}catch{}})();const cn=l((()=>s((()=>import("./NotFoundScreen-BXfz4Cwt.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),un=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/reimbursements`}),mn=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/bills`}),De=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/treasury`}),ye=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/checking`}),Ce=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/cards`}),v=({showZeniAccountRoute:t,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:L,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:w})=>{if(H===!0){if(t)return e.jsx(ye,{tenantEmailDomain:w});if(i)return e.jsx(De,{tenantEmailDomain:w});if(O)return e.jsx(Ce,{tenantEmailDomain:w})}return t?e.jsx(ye,{tenantEmailDomain:w}):i?e.jsx(De,{tenantEmailDomain:w}):O?e.jsx(Ce,{tenantEmailDomain:w}):p?e.jsx(mn,{tenantEmailDomain:w}):L?e.jsx(un,{tenantEmailDomain:w}):e.jsx(cn,{})},_n={dashboard:()=>s((()=>import("./DashboardRoutes-ndbO6Qws.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,25,8])),bills:()=>s((()=>import("./BillPayRoutes-uNYLvj5o.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-BiacT-VJ.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])),transactions:()=>s((()=>import("./TransactionListRoutes-BTjkHFVX.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])),settings:()=>s((()=>import("./SettingsRoutes-DEHUtOgG.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])),reports:()=>s((()=>import("./ReportsRoutes-B5lACyrL.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CO87Ou5-.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])),people:()=>s((()=>import("./PeopleRoutes-CBBW0nYr.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-C6_zyg5Q.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])),treasury:()=>s((()=>import("./TreasuryRoutes-Bys8F57E.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])),vendors:()=>s((()=>import("./VendorsRoutes-abjQ1HGQ.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-DlvpS2Bq.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8]))},hn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],oe=t=>{"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(t,100)},En=l((()=>s((()=>import("./ReportsRoutes-B5lACyrL.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),pn=l((()=>s((()=>import("./AddressRoutes-BQEPn0Yr.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),xn=l((()=>s((()=>import("./PeopleRoutes-CBBW0nYr.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),jn=l((()=>s((()=>import("./PandLWithForecastRoutes-DZO_Ak_R.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),gn=l((()=>s((()=>import("./CustomerOnboardingRoutes-BynW3iC3.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),Rn=l((()=>s((()=>import("./VendorsRoutes-abjQ1HGQ.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])))),An=l((()=>s((()=>import("./TransactionDetailRoutes-BB45JvGj.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-aGFvyTv5.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),In=l((()=>s((()=>import("./DashboardRoutes-ndbO6Qws.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,25,8])))),we=l((()=>s((()=>import("./BillPayRoutes-uNYLvj5o.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])))),Tn=l((()=>s((()=>import("./SettingsRoutes-DEHUtOgG.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])))),fn=l((()=>s((()=>import("./InvoicingRoutes-C4zfN1Wc.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,27,0,21,22,23,42,43,44,45,46,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-BiacT-VJ.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])))),bn=l((()=>s((()=>import("./ZeniAccountRoutes-DlvpS2Bq.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8])))),Dn=l((()=>s((()=>import("./TreasuryRoutes-Bys8F57E.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),yn=l((()=>s((()=>import("./TransactionListRoutes-BTjkHFVX.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),Cn=l((()=>s((()=>import("./ChargeCardRoutes-CO87Ou5-.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),vn=l((()=>s((()=>import("./NotificationRoutes-UAhv091T.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),wn=l((()=>s((()=>import("./PerformanceRoutes-CIoRY1pR.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),On=l((()=>s((()=>import("./ExpenseAutomationRoutes-C6_zyg5Q.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])))),Pn=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-Ce_XDU4u.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Un=l((()=>s((()=>import("./RewardsRoutes-26PBDRkk.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),kn=l((()=>s((()=>import("./TaskRoutes-C1KzEFV7.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),Fn=l((()=>s((()=>import("./AiCfoScreen-RbcUBAdM.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-CkEc2DEo.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),D=l((()=>s((()=>import("./NotFoundScreen-BXfz4Cwt.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ln=l((()=>s((()=>import("./TaskListScreen-8hq6cEbk.js").then((t=>t.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Vn=({isDashboardAccess:t,showZeniAccountRoute:p,isUserHasBillPayAccess:L,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:w,showChargeCardRoute:S})=>{if(O===!0){if(p)return e.jsx(d,{to:"checking"});if(H)return e.jsx(d,{to:"treasury"});if(S)return e.jsx(d,{to:"cards"})}return w===!0&&S?e.jsx(d,{to:"cards"}):t?e.jsx(d,{to:"dashboard"}):p?e.jsx(d,{to:"checking"}):H?e.jsx(d,{to:"treasury"}):S?e.jsx(d,{to:"cards"}):L?e.jsx(d,{to:"bills"}):i?e.jsx(d,{to:"reimbursements"}):e.jsx(d,{to:"dashboard"})},I=({children:t,fallback:p,isAllowed:L})=>{const i=on();return L?t:i?e.jsx(rn,{fetchState:"In-Progress"}):p},Ue=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/dashboard`}),zn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:t}){const p=zs(),L=qs(),{tenantEmailDomain:i}=Ys(),H=ln().mode,{setLoading:O,clearAllLoading:w,clearLoading:S}=Xs(),y=C.getSignedInUserTenant(i)?.tenantId,T=C.getSignedInUser(),X=hs(T),z=Ws(),[V,ke]=U.useState(!1),r=G((o=>Es(o))),{useFeatureGate:B}=Js(),Z=Ks(),J=en(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=B(M.isChargeCardFeatureEnabled),{isFeatureEnabled:ie}=B(M.isDebitCardFeatureEnabled),f=G((o=>o.tenantState.fetchState)),x=G((o=>o.tenantState.activeTenantFetchState.fetchState)),h=x==="Completed"||f==="Completed"?ps(ie,r):void 0,K=x==="Completed"||f==="Completed"?xs(r):void 0,re=x==="Completed"||f==="Completed"?js(r)&&!gs(r):void 0,He=sn(r,Ve,ie),{isCardsHidden:Se}=nn(r?.tenantId),Be=!He||!!Se,{isFeatureEnabled:Ne}=B(M.isSettingsFeatureEnabled),{isFeatureEnabled:ee}=B(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Me}=B(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Ze=r?.userRole!=null&&Rs(r.userRole),q=G((o=>As(o)));if(i!=null){const o=C.getSignedInUserTenant(i);T!=null&&o!=null&&be(T,r,H)}const $={tenantId:y,userId:T?.userId,sessionId:T?.zeniSessionId},le=Is(),E=tn(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&xe(E.loggedInUserRole),Ge=Ts(E?.loggedInUserRoleMap),se=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ne=ze?.params.selectedPeriod,qe=G((o=>$.tenantId!=null?fs(o,$.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),t(i)}),[i]),U.useEffect((()=>{if(ne!=null&&y!=null){const o=ne.split("-");if(o.length===2){const b=bs(Number(o[0])),u=Number(o[1]),n=Ds(`01-${b<10?`0${b}`:b}-${u}`,fe.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),c=ys();n.isAfter(c,"month")===!1?p(Cs(y,{month:b,year:u})):L(`/${i}/month_end_close_checks/review`)}}}),[ne,i,y]),U.useEffect((()=>{V||(ke(!0),O(F.TENANT_FETCHING))}),[V,$,le,T,p,C]),U.useLayoutEffect((()=>{!vs(le,$)&&C.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,b,u,n){if(ge(b?.userId,b?.zeniSessionId,o.tenantId),u($s(!0)),u(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=C.getSignedInUserTenantWithId(o.tenantId);n&&fe.updateAppLocaleID(dn(n)),c?.tenantEmailDomain!=null&&C.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ae.identify(o.userId,{tenant_id:o.tenantId}):ae.resetUserIdentity()})($,T,p,qe))}),[y]),U.useEffect((()=>{C.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,b,u,n,c,Y,N){if(u==null&&n==null)return void console.warn("There is no current tenant selected!!");const W=n!=null&&c?.zeniSessionId!=null,us=u==null||u.tenantId!==n,ms=u!=null&&u.excludedResources==null,_s=u!=null&&u.externalConnections==null;if(W&&us){N(Re(n));const Q=C.getSignedInUserTenantWithId(n);Q?.tenantEmailDomain!=null&&C.saveActiveTenantDomainForUser(Q?.tenantEmailDomain),ge(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),N(Ae(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),N(Ie(c.userId,n)))}else W&&ms&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),N(Ae(c.userId,n))),W&&_s&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),N(Ie(c.userId,n)));if(W){ae.identify(c.userId,{tenant_id:n});const Q=n==null||n!=null&&(b==="Completed"||b==="Error");o==="Completed"||b!=="Not-Started"&&b!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),Y(F.TENANT_FETCHING),N(Gs(c.userId,n,c.zeniSessionId))),Q&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),N(je(c.userId,c.zeniSessionId)))}})(f,x,r,y,T,O,p))}),[y,x]),U.useEffect((()=>{C.isSignedIn()&&f==="Completed"&&q.tenantsBaseInOrder.length>0&&(S(F.TENANT_FETCHING),C.saveSignedInUserTenants(ws(q.tenantsBaseInOrder)),T!=null&&be(T,r,H,void 0,q.tenantsBaseInOrder))}),[q,f,r,T]),U.useEffect((()=>{x==="In-Progress"&&O(F.TENANT_FETCHING),x!=="Completed"&&x!=="Error"||(x==="Completed"&&y!=null?(w(),_.markActiveTenantFetchCompleted(y)):x==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),S(F.TENANT_FETCHING),S(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[x,f,y,V]);const de=U.useRef(!1);U.useEffect((()=>{!de.current&&x==="Completed"&&V&&(de.current=!0,(function(o=hn,b=3e3){setTimeout((()=>{const u=n=>{if(n>=o.length)return;const c=o[n],Y=_n[c];Y!=null?Y().then((()=>oe((()=>u(n+1))))).catch((()=>oe((()=>u(n+1))))):u(n+1)};oe((()=>u(0)))}),b)})())}),[x,V]);const P=r?.userRole!=null&&Os(r?.userRole),{isFeatureEnabled:Ye}=B(M.isReferralFeatureEnabled),{isFeatureEnabled:We}=B(M.isAccrualEnabled),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),k=r?.userRole!=null&&xe(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,ue=!Be&&!P,Je=Ps(E?.loggedInUserRoleMap),Ke=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,me=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,_e=me&&Us(E?.loggedInUserRoleMap),he=Fe&&!P,ss=Le&&!P,ns=ce&&ks(E?.loggedInUserRoleMap),ts=ue&&Fs(E?.loggedInUserRoleMap),as=he&&Ls(E?.loggedInUserRoleMap),os=Vs(E?.loggedInUserRoleMap),is=Hs(E?.loggedInUserRoleMap),rs=Ss(E?.loggedInUserRoleMap),ls=Bs(E?.loggedInUserRoleMap),ds=Ns(E?.loggedInUserRoleMap),j=Ms(E?.loggedInUserRoleMap),g=Zs(E?.loggedInUserRoleMap),Ee=ce&&j,pe=me&&g,R=he&&rs,A=ss&&ls,m=ue&&ds,cs=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||Ge===!0||Je===!0||os===!0||is===!0;return C.isSignedIn()?y==null?f==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(T!=null&&f!=="In-Progress"&&p(je(T.userId,T.zeniSessionId)),null):x!=="In-Progress"&&x!=="Not-Started"||f==="Completed"?(te===!0||X&&!se)&&es&&Ke!==!0&&h===!1&&K===!1&&re===!1?(t(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!V||re!==!0||te!==!0||se||X?!V||te!==!1||se||X?V&&r?.userRole&&h!=null&&K!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Qs,{children:e.jsxs(a,{element:e.jsx(an,{}),children:[e.jsx(a,{path:"/",element:e.jsx(Vn,{isDashboardAccess:k,showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:k?e.jsx(In,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:k?e.jsx(En,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:cs||k?e.jsx(xn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:k?e.jsx(jn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(gn,{})}),e.jsx(a,{path:"transaction/*",element:k&&P===!1||Qe||Xe?e.jsx(An,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:k&&P===!1?e.jsx(yn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:k&&P===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,isTenantBankingOnly:h,showTreasuryRoute:A,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:k&&P===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(Ln,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(kn,{})}),e.jsx(a,{path:"address/*",element:ns||_e||as||ts?e.jsx(pn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:e.jsx(I,{isAllowed:R,fallback:e.jsx(D,{}),children:e.jsx(bn,{})})}),e.jsx(a,{path:"treasury/*",element:e.jsx(I,{isAllowed:A,fallback:e.jsx(D,{}),children:e.jsx(Dn,{})})}),e.jsx(a,{path:"performance",element:e.jsx(I,{isAllowed:J,fallback:e.jsx(Ue,{tenantEmailDomain:i}),children:e.jsx(wn,{})})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:e.jsx(I,{isAllowed:J&&!P,fallback:e.jsx(Ue,{tenantEmailDomain:i}),children:e.jsx(On,{})})}),e.jsx(a,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(I,{isAllowed:J&&!P&&We,fallback:e.jsx(D,{}),children:e.jsx(Pn,{})})}),e.jsx(a,{path:"notifications/*",element:e.jsx(vn,{})}),e.jsx(a,{path:"vendors/*",element:e.jsx(I,{isAllowed:$e,fallback:e.jsx(D,{}),children:e.jsx(Rn,{})})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(we,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(we,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:e.jsx(I,{isAllowed:Ne,fallback:e.jsx(D,{}),children:e.jsx(Tn,{hasAdminLevelAccess:_e})})}),e.jsx(a,{path:"invoicing/*",element:e.jsx(I,{isAllowed:Me&&Ze,fallback:e.jsx(D,{}),children:e.jsx(fn,{})})}),e.jsx(a,{path:"cards/ask",element:e.jsx(I,{isAllowed:m&&Z,fallback:e.jsx(D,{}),children:e.jsx(Pe,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"cards/ask/:session_id",element:e.jsx(I,{isAllowed:m&&Z,fallback:e.jsx(D,{}),children:e.jsx(Pe,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"cards/*",element:e.jsx(I,{isAllowed:m,fallback:e.jsx(D,{}),children:e.jsx(Cn,{})})}),e.jsx(a,{path:"rewards/*",element:e.jsx(I,{isAllowed:Ye,fallback:e.jsx(D,{}),children:e.jsx(Un,{})})}),e.jsx(a,{path:"/ai-cfo",element:e.jsx(I,{isAllowed:Z,fallback:e.jsx(D,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(a,{path:"/ai-cfo/",element:e.jsx(I,{isAllowed:Z,fallback:e.jsx(D,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:e.jsx(I,{isAllowed:Z,fallback:e.jsx(D,{}),children:e.jsx(Fn,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"*",element:e.jsx(D,{})})]})}):null:(t(void 0),e.jsx(d,{to:`/${i}/onboarding`,replace:!0})):(t(void 0),e.jsx(d,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),t(void 0),e.jsx(d,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,zn as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-CEOan4Mu.js","assets/sentry-Buwow292.js","assets/core-o-ca34AJ.js","assets/zeni-epic-state-MQ0qdl-Q.js","assets/index-BngORT8V.js","assets/mui-cK5UWUvi.js","assets/analytics-C3OBHjEG.js","assets/utils-D4KfE2cr.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-DtvyLimf.js","assets/withTransactionSidePanel-DUEbH6wg.js","assets/useAskAiCfoHostNavButtonProps-Dv4wLrz_.js","assets/TransactionDetailScreen-DxeHwsiS.js","assets/decodeURIComponentSafe-CdLVPaCS.js","assets/useInitialThreadRequest-BoUSReRA.js","assets/routePaths-CuLkZiYm.js","assets/expenseAutomationHelper-8n6GRk1T.js","assets/stripSplatSuffix-BKbpznmZ.js","assets/reportTimeframe-6FnDbaGY.js","assets/analyticsHelper-Clz3U3cN.js","assets/CompanyPassportScreen-Gun56s5v.js","assets/MobileAppDrawer-CEOkBGJa.js","assets/InboxNotificationsProvider-Cph6MP0g.js","assets/useTaskManagerAccess-DJ65Kf61.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CxSRGQ__.js","assets/FeaturePreviewScreen-BVEGNpWU.js","assets/BillPayRoutes-8ZFPDbnM.js","assets/AddressScreen-Ju4jFptC.js","assets/DomesticWireDetailScreen-D2Dn8IMD.js","assets/BusinessVerificationPageScreen-CB5WZqPo.js","assets/DrawerScreen-Cs1uPkqR.js","assets/SetupPagesScreen-96sboBlC.js","assets/BillPayApprovalRoutes-Rjc_1Yzv.js","assets/useEnsureVendorListLoaded-BmranjK0.js","assets/ReimbursementApprovalRuleDetailScreen-DJgn7dOu.js","assets/getLocaleForTenant-C98BJYuO.js","assets/ReimbursementRoutes-BTLSdYpS.js","assets/ReimbursementApprovalRoutes-CXC_z3iO.js","assets/TransactionListRoutes-QLO901y7.js","assets/ZeniAccountStatementScreen-CvaKxSxd.js","assets/SettingsRoutes-BYgsL7BJ.js","assets/AccountMappingScreen-BfHCfPsu.js","assets/QBOConnectionScreen-CuXeVOld.js","assets/empty-BnmFWJHQ.js","assets/index-BLrePuqf.js","assets/url-C7oPARVv.js","assets/index-Cmb8jqqj.js","assets/accountMappingHelper-C9fFA6EC.js","assets/useEmailConnectResultRefresh-Bzi-NygF.js","assets/ReportsRoutes-ByluKWnc.js","assets/ChargeCardRoutes-BRi9WDmi.js","assets/useChargeCardPusherEvents-BcTvXaUj.js","assets/PeopleRoutes-BUL3FQWt.js","assets/ExpenseAutomationRoutes-4gdW3X3Q.js","assets/useActualMatchingMatchDetail-CLI4Eufh.js","assets/ScheduleDetailsPrepaidExpensesScreen-CNEP1b-I.js","assets/pathToGoBack-Bk8jMuE9.js","assets/TreasuryRoutes-CgQJltjn.js","assets/VendorsRoutes-g5OjsOsT.js","assets/ZeniAccountRoutes-CORKXHKc.js","assets/AddressRoutes-DOm5AZgQ.js","assets/PandLWithForecastRoutes-CLURQtqS.js","assets/CustomerOnboardingRoutes-Dqomvbod.js","assets/TransactionDetailRoutes-QtrdUsWY.js","assets/EntityDetailRoutes-BA7EyzY4.js","assets/InvoicingRoutes-Cff8iSMe.js","assets/NotificationRoutes-Bt2YMSc3.js","assets/PerformanceRoutes-DLQRK-sT.js","assets/ActualMatchingMatchDetailScreen-DBAaee0M.js","assets/RewardsRoutes-CTBSsyDI.js","assets/TaskRoutes-CqNIBzDs.js","assets/TaskListScreen-CtK0rsCx.js","assets/useTaskManagerPusherEvents-CiqcqtGX.js","assets/AiCfoScreen-D_KqWkI-.js","assets/CardsAiCfoScreen-DnoKV_J5.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bs as js,dk as gs,ca as Rs,gM as As,gc as Is,dh as xe,cI as Ts,gq as fs,cA as bs,bG as Ds,br as ys,U$ as Cs,v as vs,V2 as ws,bq as Os,V3 as Ps,bM as Us,bL as ks,bu as Fs,cw as Ls,V4 as Vs,V5 as Hs,dc as Ss,df as Bs,de as Ns,cH as Ms,cO as Zs,p_ as je,gl as ge,h0 as $s,gn as Re,gO as Ae,gP as Ie,go as Gs}from"./zeni-epic-state-MQ0qdl-Q.js";import{j as e}from"./liveblocks-BdMPZzDQ.js";import{a as U}from"./sentry-Buwow292.js";import{N as d,u as zs,h as qs,i as Ys,g as Ws,j as G,q as Te,n as Qs,o as a}from"./core-o-ca34AJ.js";import{N as l,u as Xs,z as C,p as Js,e as Ks,f as en,c as M,j as sn,O as nn,V as tn,L as F,G as fe,t as _,P as an,m as ae,Q as on,Z as rn}from"./index-BngORT8V.js";import{u as ln}from"./mui-cK5UWUvi.js";import{f as be}from"./analyticsHelper-Clz3U3cN.js";import{t as dn}from"./getLocaleForTenant-C98BJYuO.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new t.Error().stack;p&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[p]="61396639-22ab-4338-87f3-93f79feccc74",t._sentryDebugIdIdentifier="sentry-dbid-61396639-22ab-4338-87f3-93f79feccc74")}catch{}})();const cn=l((()=>s((()=>import("./NotFoundScreen-CEOan4Mu.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),un=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/reimbursements`}),mn=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/bills`}),De=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/treasury`}),ye=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/checking`}),Ce=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/cards`}),v=({showZeniAccountRoute:t,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:L,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:w})=>{if(H===!0){if(t)return e.jsx(ye,{tenantEmailDomain:w});if(i)return e.jsx(De,{tenantEmailDomain:w});if(O)return e.jsx(Ce,{tenantEmailDomain:w})}return t?e.jsx(ye,{tenantEmailDomain:w}):i?e.jsx(De,{tenantEmailDomain:w}):O?e.jsx(Ce,{tenantEmailDomain:w}):p?e.jsx(mn,{tenantEmailDomain:w}):L?e.jsx(un,{tenantEmailDomain:w}):e.jsx(cn,{})},_n={dashboard:()=>s((()=>import("./DashboardRoutes-DtvyLimf.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,25,8])),bills:()=>s((()=>import("./BillPayRoutes-8ZFPDbnM.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-BTLSdYpS.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])),transactions:()=>s((()=>import("./TransactionListRoutes-QLO901y7.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])),settings:()=>s((()=>import("./SettingsRoutes-BYgsL7BJ.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])),reports:()=>s((()=>import("./ReportsRoutes-ByluKWnc.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-BRi9WDmi.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])),people:()=>s((()=>import("./PeopleRoutes-BUL3FQWt.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-4gdW3X3Q.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CgQJltjn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])),vendors:()=>s((()=>import("./VendorsRoutes-g5OjsOsT.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-CORKXHKc.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8]))},hn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],oe=t=>{"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(t,100)},En=l((()=>s((()=>import("./ReportsRoutes-ByluKWnc.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),pn=l((()=>s((()=>import("./AddressRoutes-DOm5AZgQ.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),xn=l((()=>s((()=>import("./PeopleRoutes-BUL3FQWt.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),jn=l((()=>s((()=>import("./PandLWithForecastRoutes-CLURQtqS.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),gn=l((()=>s((()=>import("./CustomerOnboardingRoutes-Dqomvbod.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),Rn=l((()=>s((()=>import("./VendorsRoutes-g5OjsOsT.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])))),An=l((()=>s((()=>import("./TransactionDetailRoutes-QtrdUsWY.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-BA7EyzY4.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),In=l((()=>s((()=>import("./DashboardRoutes-DtvyLimf.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,25,8])))),we=l((()=>s((()=>import("./BillPayRoutes-8ZFPDbnM.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])))),Tn=l((()=>s((()=>import("./SettingsRoutes-BYgsL7BJ.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])))),fn=l((()=>s((()=>import("./InvoicingRoutes-Cff8iSMe.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,27,0,21,22,23,42,43,44,45,46,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-BTLSdYpS.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])))),bn=l((()=>s((()=>import("./ZeniAccountRoutes-CORKXHKc.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8])))),Dn=l((()=>s((()=>import("./TreasuryRoutes-CgQJltjn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),yn=l((()=>s((()=>import("./TransactionListRoutes-QLO901y7.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),Cn=l((()=>s((()=>import("./ChargeCardRoutes-BRi9WDmi.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),vn=l((()=>s((()=>import("./NotificationRoutes-Bt2YMSc3.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),wn=l((()=>s((()=>import("./PerformanceRoutes-DLQRK-sT.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),On=l((()=>s((()=>import("./ExpenseAutomationRoutes-4gdW3X3Q.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])))),Pn=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-DBAaee0M.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Un=l((()=>s((()=>import("./RewardsRoutes-CTBSsyDI.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),kn=l((()=>s((()=>import("./TaskRoutes-CqNIBzDs.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),Fn=l((()=>s((()=>import("./AiCfoScreen-D_KqWkI-.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-DnoKV_J5.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),D=l((()=>s((()=>import("./NotFoundScreen-CEOan4Mu.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ln=l((()=>s((()=>import("./TaskListScreen-CtK0rsCx.js").then((t=>t.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Vn=({isDashboardAccess:t,showZeniAccountRoute:p,isUserHasBillPayAccess:L,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:w,showChargeCardRoute:S})=>{if(O===!0){if(p)return e.jsx(d,{to:"checking"});if(H)return e.jsx(d,{to:"treasury"});if(S)return e.jsx(d,{to:"cards"})}return w===!0&&S?e.jsx(d,{to:"cards"}):t?e.jsx(d,{to:"dashboard"}):p?e.jsx(d,{to:"checking"}):H?e.jsx(d,{to:"treasury"}):S?e.jsx(d,{to:"cards"}):L?e.jsx(d,{to:"bills"}):i?e.jsx(d,{to:"reimbursements"}):e.jsx(d,{to:"dashboard"})},I=({children:t,fallback:p,isAllowed:L})=>{const i=on();return L?t:i?e.jsx(rn,{fetchState:"In-Progress"}):p},Ue=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/dashboard`}),zn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:t}){const p=zs(),L=qs(),{tenantEmailDomain:i}=Ys(),H=ln().mode,{setLoading:O,clearAllLoading:w,clearLoading:S}=Xs(),y=C.getSignedInUserTenant(i)?.tenantId,T=C.getSignedInUser(),X=hs(T),z=Ws(),[V,ke]=U.useState(!1),r=G((o=>Es(o))),{useFeatureGate:B}=Js(),Z=Ks(),J=en(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=B(M.isChargeCardFeatureEnabled),{isFeatureEnabled:ie}=B(M.isDebitCardFeatureEnabled),f=G((o=>o.tenantState.fetchState)),x=G((o=>o.tenantState.activeTenantFetchState.fetchState)),h=x==="Completed"||f==="Completed"?ps(ie,r):void 0,K=x==="Completed"||f==="Completed"?xs(r):void 0,re=x==="Completed"||f==="Completed"?js(r)&&!gs(r):void 0,He=sn(r,Ve,ie),{isCardsHidden:Se}=nn(r?.tenantId),Be=!He||!!Se,{isFeatureEnabled:Ne}=B(M.isSettingsFeatureEnabled),{isFeatureEnabled:ee}=B(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Me}=B(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Ze=r?.userRole!=null&&Rs(r.userRole),q=G((o=>As(o)));if(i!=null){const o=C.getSignedInUserTenant(i);T!=null&&o!=null&&be(T,r,H)}const $={tenantId:y,userId:T?.userId,sessionId:T?.zeniSessionId},le=Is(),E=tn(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&xe(E.loggedInUserRole),Ge=Ts(E?.loggedInUserRoleMap),se=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ne=ze?.params.selectedPeriod,qe=G((o=>$.tenantId!=null?fs(o,$.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),t(i)}),[i]),U.useEffect((()=>{if(ne!=null&&y!=null){const o=ne.split("-");if(o.length===2){const b=bs(Number(o[0])),u=Number(o[1]),n=Ds(`01-${b<10?`0${b}`:b}-${u}`,fe.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),c=ys();n.isAfter(c,"month")===!1?p(Cs(y,{month:b,year:u})):L(`/${i}/month_end_close_checks/review`)}}}),[ne,i,y]),U.useEffect((()=>{V||(ke(!0),O(F.TENANT_FETCHING))}),[V,$,le,T,p,C]),U.useLayoutEffect((()=>{!vs(le,$)&&C.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,b,u,n){if(ge(b?.userId,b?.zeniSessionId,o.tenantId),u($s(!0)),u(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=C.getSignedInUserTenantWithId(o.tenantId);n&&fe.updateAppLocaleID(dn(n)),c?.tenantEmailDomain!=null&&C.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ae.identify(o.userId,{tenant_id:o.tenantId}):ae.resetUserIdentity()})($,T,p,qe))}),[y]),U.useEffect((()=>{C.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,b,u,n,c,Y,N){if(u==null&&n==null)return void console.warn("There is no current tenant selected!!");const W=n!=null&&c?.zeniSessionId!=null,us=u==null||u.tenantId!==n,ms=u!=null&&u.excludedResources==null,_s=u!=null&&u.externalConnections==null;if(W&&us){N(Re(n));const Q=C.getSignedInUserTenantWithId(n);Q?.tenantEmailDomain!=null&&C.saveActiveTenantDomainForUser(Q?.tenantEmailDomain),ge(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),N(Ae(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),N(Ie(c.userId,n)))}else W&&ms&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),N(Ae(c.userId,n))),W&&_s&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),N(Ie(c.userId,n)));if(W){ae.identify(c.userId,{tenant_id:n});const Q=n==null||n!=null&&(b==="Completed"||b==="Error");o==="Completed"||b!=="Not-Started"&&b!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),Y(F.TENANT_FETCHING),N(Gs(c.userId,n,c.zeniSessionId))),Q&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),N(je(c.userId,c.zeniSessionId)))}})(f,x,r,y,T,O,p))}),[y,x]),U.useEffect((()=>{C.isSignedIn()&&f==="Completed"&&q.tenantsBaseInOrder.length>0&&(S(F.TENANT_FETCHING),C.saveSignedInUserTenants(ws(q.tenantsBaseInOrder)),T!=null&&be(T,r,H,void 0,q.tenantsBaseInOrder))}),[q,f,r,T]),U.useEffect((()=>{x==="In-Progress"&&O(F.TENANT_FETCHING),x!=="Completed"&&x!=="Error"||(x==="Completed"&&y!=null?(w(),_.markActiveTenantFetchCompleted(y)):x==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),S(F.TENANT_FETCHING),S(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[x,f,y,V]);const de=U.useRef(!1);U.useEffect((()=>{!de.current&&x==="Completed"&&V&&(de.current=!0,(function(o=hn,b=3e3){setTimeout((()=>{const u=n=>{if(n>=o.length)return;const c=o[n],Y=_n[c];Y!=null?Y().then((()=>oe((()=>u(n+1))))).catch((()=>oe((()=>u(n+1))))):u(n+1)};oe((()=>u(0)))}),b)})())}),[x,V]);const P=r?.userRole!=null&&Os(r?.userRole),{isFeatureEnabled:Ye}=B(M.isReferralFeatureEnabled),{isFeatureEnabled:We}=B(M.isAccrualEnabled),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),k=r?.userRole!=null&&xe(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,ue=!Be&&!P,Je=Ps(E?.loggedInUserRoleMap),Ke=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,me=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,_e=me&&Us(E?.loggedInUserRoleMap),he=Fe&&!P,ss=Le&&!P,ns=ce&&ks(E?.loggedInUserRoleMap),ts=ue&&Fs(E?.loggedInUserRoleMap),as=he&&Ls(E?.loggedInUserRoleMap),os=Vs(E?.loggedInUserRoleMap),is=Hs(E?.loggedInUserRoleMap),rs=Ss(E?.loggedInUserRoleMap),ls=Bs(E?.loggedInUserRoleMap),ds=Ns(E?.loggedInUserRoleMap),j=Ms(E?.loggedInUserRoleMap),g=Zs(E?.loggedInUserRoleMap),Ee=ce&&j,pe=me&&g,R=he&&rs,A=ss&&ls,m=ue&&ds,cs=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||Ge===!0||Je===!0||os===!0||is===!0;return C.isSignedIn()?y==null?f==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(T!=null&&f!=="In-Progress"&&p(je(T.userId,T.zeniSessionId)),null):x!=="In-Progress"&&x!=="Not-Started"||f==="Completed"?(te===!0||X&&!se)&&es&&Ke!==!0&&h===!1&&K===!1&&re===!1?(t(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!V||re!==!0||te!==!0||se||X?!V||te!==!1||se||X?V&&r?.userRole&&h!=null&&K!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Qs,{children:e.jsxs(a,{element:e.jsx(an,{}),children:[e.jsx(a,{path:"/",element:e.jsx(Vn,{isDashboardAccess:k,showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:k?e.jsx(In,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:k?e.jsx(En,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:cs||k?e.jsx(xn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:k?e.jsx(jn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(gn,{})}),e.jsx(a,{path:"transaction/*",element:k&&P===!1||Qe||Xe?e.jsx(An,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:k&&P===!1?e.jsx(yn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:k&&P===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,isTenantBankingOnly:h,showTreasuryRoute:A,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:k&&P===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(Ln,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(kn,{})}),e.jsx(a,{path:"address/*",element:ns||_e||as||ts?e.jsx(pn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:e.jsx(I,{isAllowed:R,fallback:e.jsx(D,{}),children:e.jsx(bn,{})})}),e.jsx(a,{path:"treasury/*",element:e.jsx(I,{isAllowed:A,fallback:e.jsx(D,{}),children:e.jsx(Dn,{})})}),e.jsx(a,{path:"performance",element:e.jsx(I,{isAllowed:J,fallback:e.jsx(Ue,{tenantEmailDomain:i}),children:e.jsx(wn,{})})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:e.jsx(I,{isAllowed:J&&!P,fallback:e.jsx(Ue,{tenantEmailDomain:i}),children:e.jsx(On,{})})}),e.jsx(a,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(I,{isAllowed:J&&!P&&We,fallback:e.jsx(D,{}),children:e.jsx(Pn,{})})}),e.jsx(a,{path:"notifications/*",element:e.jsx(vn,{})}),e.jsx(a,{path:"vendors/*",element:e.jsx(I,{isAllowed:$e,fallback:e.jsx(D,{}),children:e.jsx(Rn,{})})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(we,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(we,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:A,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:e.jsx(I,{isAllowed:Ne,fallback:e.jsx(D,{}),children:e.jsx(Tn,{hasAdminLevelAccess:_e})})}),e.jsx(a,{path:"invoicing/*",element:e.jsx(I,{isAllowed:Me&&Ze,fallback:e.jsx(D,{}),children:e.jsx(fn,{})})}),e.jsx(a,{path:"cards/ask",element:e.jsx(I,{isAllowed:m&&Z,fallback:e.jsx(D,{}),children:e.jsx(Pe,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"cards/ask/:session_id",element:e.jsx(I,{isAllowed:m&&Z,fallback:e.jsx(D,{}),children:e.jsx(Pe,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"cards/*",element:e.jsx(I,{isAllowed:m,fallback:e.jsx(D,{}),children:e.jsx(Cn,{})})}),e.jsx(a,{path:"rewards/*",element:e.jsx(I,{isAllowed:Ye,fallback:e.jsx(D,{}),children:e.jsx(Un,{})})}),e.jsx(a,{path:"/ai-cfo",element:e.jsx(I,{isAllowed:Z,fallback:e.jsx(D,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(a,{path:"/ai-cfo/",element:e.jsx(I,{isAllowed:Z,fallback:e.jsx(D,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:e.jsx(I,{isAllowed:Z,fallback:e.jsx(D,{}),children:e.jsx(Fn,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"*",element:e.jsx(D,{})})]})}):null:(t(void 0),e.jsx(d,{to:`/${i}/onboarding`,replace:!0})):(t(void 0),e.jsx(d,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),t(void 0),e.jsx(d,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,zn as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BdMPZzDQ.js";import{a as d}from"./sentry-Buwow292.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-o-ca34AJ.js";import{fI as v,_t as Pe,Oe as je,_0 as ve,_9 as we,ca as X,cV as Ae,cW as De,bq as Ue,dg as Re,Gw as Te,_u as Me,PH as Be,N5 as Oe,MY as de,MV as Ve,GA as ue,M$ as pe,N2 as ge,N8 as Y,CE as ee,Gz as Ne,ly as Z,lB as me,_v as Fe,mL as Le,GR as Ge,Wu as $e,Wv as Ze,lw as He,_w as Ke,lz as ze,uP as We,Wp as qe,Wq as Je,uT as Qe,hZ as Xe,Vm as q,hR as ae,hO as Ye,hW as en,Vn as nn,GO as tn,_x as an,_y as on,Nm as sn,m3 as rn,e0 as fe,e1 as he,_z as ln,gF as cn,VD as dn,GN as oe,gK as se,gJ as un,GM as pn,gI as gn,gH as mn,_A as fn,UO as Ce,_B as hn,_C as Cn,_D as yn,_E as Sn,_F as bn,_G as In,GU as xn,_H as En,GL as ie,GF as $,_I as kn,_J as _n,_K as re,_L as Pn,dV as jn,_M as vn,_N as wn,_O as An,U_ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_P as Bn,c6 as On,c5 as Vn,c7 as Nn,c4 as Fn}from"./zeni-epic-state-MQ0qdl-Q.js";import{bV as Ln,z as j,V as G,a6 as ne,c5 as Gn,m as z,p as te,c as V,j as ye,O as Se,c6 as $n,l as Zn,X as be,c7 as Hn,ah as Kn,c8 as zn,c9 as Wn,ap as qn,ca as Jn,n as Qn,d as Ie,cb as Xn}from"./index-Bx2gJO4r.js";import{n as B}from"./mui-cK5UWUvi.js";import{u as xe}from"./useTaskManagerAccess-By_NjZen.js";import{U as Yn}from"./AccountMappingScreen-BT4O8HTD.js";import{t as et,A as nt}from"./AddressScreen-D2FVWJY-.js";import N from"./NotFoundScreen-BXfz4Cwt.js";import{g as tt}from"./analyticsHelper-exrV7AE9.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-ibSIK2nI.js";import{C as st}from"./CompanyPassportScreen-DJeoMdCg.js";import{M as T}from"./MobileAppDrawer-DVldqyUl.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-t37-D3lN.js";import{q as le}from"./QBOConnectionScreen-CI47ZrlS.js";import{B as lt}from"./BillPayApprovalRoutes-BbNV-MR5.js";import{R as ct}from"./ReimbursementApprovalRoutes-DrsMWkl8.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./accountMappingHelper-C9fFA6EC.js";import"./routePaths-DBf4ybcn.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./empty-BnmFWJHQ.js";import"./pdf-lib-C69QvBGc.js";import"./index-BLrePuqf.js";import"./url-C7oPARVv.js";import"./index-Cmb8jqqj.js";import"./decodeURIComponentSafe-CdLVPaCS.js";import"./useEnsureVendorListLoaded-BmranjK0.js";import"./ReimbursementApprovalRuleDetailScreen-Dw7QQEoQ.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]="125b8564-4e1a-4ec4-97f7-695131b8ff14",e._sentryDebugIdIdentifier="sentry-dbid-125b8564-4e1a-4ec4-97f7-695131b8ff14")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-BdMPZzDQ.js";import{a as d}from"./sentry-Buwow292.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-o-ca34AJ.js";import{fI as v,_t as Pe,Oe as je,_0 as ve,_9 as we,ca as X,cV as Ae,cW as De,bq as Ue,dg as Re,Gw as Te,_u as Me,PH as Be,N5 as Oe,MY as de,MV as Ve,GA as ue,M$ as pe,N2 as ge,N8 as Y,CE as ee,Gz as Ne,ly as Z,lB as me,_v as Fe,mL as Le,GR as Ge,Wu as $e,Wv as Ze,lw as He,_w as Ke,lz as ze,uP as We,Wp as qe,Wq as Je,uT as Qe,hZ as Xe,Vm as q,hR as ae,hO as Ye,hW as en,Vn as nn,GO as tn,_x as an,_y as on,Nm as sn,m3 as rn,e0 as fe,e1 as he,_z as ln,gF as cn,VD as dn,GN as oe,gK as se,gJ as un,GM as pn,gI as gn,gH as mn,_A as fn,UO as Ce,_B as hn,_C as Cn,_D as yn,_E as Sn,_F as bn,_G as In,GU as xn,_H as En,GL as ie,GF as $,_I as kn,_J as _n,_K as re,_L as Pn,dV as jn,_M as vn,_N as wn,_O as An,U_ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_P as Bn,c6 as On,c5 as Vn,c7 as Nn,c4 as Fn}from"./zeni-epic-state-MQ0qdl-Q.js";import{bV as Ln,z as j,V as G,a6 as ne,c5 as Gn,m as z,p as te,c as V,j as ye,O as Se,c6 as $n,l as Zn,X as be,c7 as Hn,ah as Kn,c8 as zn,c9 as Wn,ap as qn,ca as Jn,n as Qn,d as Ie,cb as Xn}from"./index-BngORT8V.js";import{n as B}from"./mui-cK5UWUvi.js";import{u as xe}from"./useTaskManagerAccess-DJ65Kf61.js";import{U as Yn}from"./AccountMappingScreen-BfHCfPsu.js";import{t as et,A as nt}from"./AddressScreen-Ju4jFptC.js";import N from"./NotFoundScreen-CEOan4Mu.js";import{g as tt}from"./analyticsHelper-Clz3U3cN.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-CB5WZqPo.js";import{C as st}from"./CompanyPassportScreen-Gun56s5v.js";import{M as T}from"./MobileAppDrawer-CEOkBGJa.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-Bzi-NygF.js";import{q as le}from"./QBOConnectionScreen-CuXeVOld.js";import{B as lt}from"./BillPayApprovalRoutes-Rjc_1Yzv.js";import{R as ct}from"./ReimbursementApprovalRoutes-CXC_z3iO.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";import"./accountMappingHelper-C9fFA6EC.js";import"./routePaths-CuLkZiYm.js";import"./InboxNotificationsProvider-Cph6MP0g.js";import"./empty-BnmFWJHQ.js";import"./pdf-lib-C69QvBGc.js";import"./index-BLrePuqf.js";import"./url-C7oPARVv.js";import"./index-Cmb8jqqj.js";import"./decodeURIComponentSafe-CdLVPaCS.js";import"./useEnsureVendorListLoaded-BmranjK0.js";import"./ReimbursementApprovalRuleDetailScreen-DJgn7dOu.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]="125b8564-4e1a-4ec4-97f7-695131b8ff14",e._sentryDebugIdIdentifier="sentry-dbid-125b8564-4e1a-4ec4-97f7-695131b8ff14")}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-BdMPZzDQ.js";import{h as X,g as Q,u as ee,i as W,j as k,N,l as G,t as en}from"./core-o-ca34AJ.js";import{bL as nn,fI as x,cI as tn,Io as J,_0 as an,_3 as sn,v6 as ne,uW as te,mD as ae,Ca as L,_5 as be,gJ as Ge,gI as He,gH as qe,_6 as on,Ix as cn,N5 as Ce,MY as he,MV as Ie,MA as Y,M$ as Ae,N2 as _e,N8 as ke,CE as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,_7 as yn,LA as fe,Mc as fn,_8 as gn,bM as Sn,Oq as ge,Oe as bn,_9 as Cn,_a as hn,Ou as In,Oy as An,_b as je,C3 as _n,T7 as kn,_c as vn,_d as Pn,_e as Tn,_f as Ke,_g as En,_h as Dn,Wd as On,Zh as Un,Ws as wn,_i as Je,MM as Fn,ME as xn,Wt as Vn,MI as Bn,_j as Ue,Pe as Ye,mL as jn,uZ as Xe,Cc as Nn,bG as Ne,Co as Re,cG as Rn,_k as Qe,P4 as we,ON as Ln,OO as Mn,OS as zn,_l as Zn,P7 as Le,_m as $n,_n as Wn,_o as Gn,PV as Se,_p as Hn,gZ as qn,JJ as Kn,_q as Jn,JO as Yn,JN as Xn}from"./zeni-epic-state-MQ0qdl-Q.js";import{ah as Pe,V as ie,p as de,c as K,z as E,a7 as se,m as D,a6 as Te,S as $,bS as Qn,ad as oe,bT as V,bk as xe,bU as et,bV as nt,bW as tt,x as Be,bX as at,n as Me,aF as ze,a0 as it,aa as st,bY as ot,bZ as ct,b_ as rt,w as ut}from"./index-Bx2gJO4r.js";import{a as h}from"./sentry-Buwow292.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-cK5UWUvi.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-ibSIK2nI.js";import{M as le}from"./MobileAppDrawer-DVldqyUl.js";import R from"./NotFoundScreen-BXfz4Cwt.js";import{a as $e}from"./analyticsHelper-exrV7AE9.js";import{d as We}from"./routePaths-DBf4ybcn.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]="6dbdf8bd-6c43-427a-88ca-b10faa584290",e._sentryDebugIdIdentifier="sentry-dbid-6dbdf8bd-6c43-427a-88ca-b10faa584290")}catch{}})();const mt=Ve.div`
1
+ import{j as u}from"./liveblocks-BdMPZzDQ.js";import{h as X,g as Q,u as ee,i as W,j as k,N,l as G,t as en}from"./core-o-ca34AJ.js";import{bL as nn,fI as x,cI as tn,Io as J,_0 as an,_3 as sn,v6 as ne,uW as te,mD as ae,Ca as L,_5 as be,gJ as Ge,gI as He,gH as qe,_6 as on,Ix as cn,N5 as Ce,MY as he,MV as Ie,MA as Y,M$ as Ae,N2 as _e,N8 as ke,CE as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,_7 as yn,LA as fe,Mc as fn,_8 as gn,bM as Sn,Oq as ge,Oe as bn,_9 as Cn,_a as hn,Ou as In,Oy as An,_b as je,C3 as _n,T7 as kn,_c as vn,_d as Pn,_e as Tn,_f as Ke,_g as En,_h as Dn,Wd as On,Zh as Un,Ws as wn,_i as Je,MM as Fn,ME as xn,Wt as Vn,MI as Bn,_j as Ue,Pe as Ye,mL as jn,uZ as Xe,Cc as Nn,bG as Ne,Co as Re,cG as Rn,_k as Qe,P4 as we,ON as Ln,OO as Mn,OS as zn,_l as Zn,P7 as Le,_m as $n,_n as Wn,_o as Gn,PV as Se,_p as Hn,gZ as qn,JJ as Kn,_q as Jn,JO as Yn,JN as Xn}from"./zeni-epic-state-MQ0qdl-Q.js";import{ah as Pe,V as ie,p as de,c as K,z as E,a7 as se,m as D,a6 as Te,S as $,bS as Qn,ad as oe,bT as V,bk as xe,bU as et,bV as nt,bW as tt,x as Be,bX as at,n as Me,aF as ze,a0 as it,aa as st,bY as ot,bZ as ct,b_ as rt,w as ut}from"./index-BngORT8V.js";import{a as h}from"./sentry-Buwow292.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-cK5UWUvi.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-CB5WZqPo.js";import{M as le}from"./MobileAppDrawer-CEOkBGJa.js";import R from"./NotFoundScreen-CEOan4Mu.js";import{a as $e}from"./analyticsHelper-Clz3U3cN.js";import{d as We}from"./routePaths-CuLkZiYm.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]="6dbdf8bd-6c43-427a-88ca-b10faa584290",e._sentryDebugIdIdentifier="sentry-dbid-6dbdf8bd-6c43-427a-88ca-b10faa584290")}catch{}})();const mt=Ve.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as u}from"./liveblocks-BdMPZzDQ.js";import{a as f,R as b,t as A}from"./sentry-Buwow292.js";import{u as z,h as D,j as l,g as M,N as O,l as V}from"./core-o-ca34AJ.js";import{u as j,z as s,m as E,G as P,R as F,S as _,T as B,U as N,W as R,X as v}from"./index-Bx2gJO4r.js";import{fI as W,UK as $,V2 as J,gl as K,gn as X,V7 as Y,gY as G,dl as H,V8 as U,V9 as q,Va as Q,c1 as y}from"./zeni-epic-state-MQ0qdl-Q.js";import{u as Z}from"./mui-cK5UWUvi.js";import{u as ee}from"./useDeviceId-CeB6LWI8.js";import{f as te}from"./analyticsHelper-exrV7AE9.js";import{t as ne}from"./getLocaleForTenant-CBmE-ohA.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="73e29855-563e-4463-8371-5f113505c817",t._sentryDebugIdIdentifier="sentry-dbid-73e29855-563e-4463-8371-5f113505c817")}catch{}})();const ie=V((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(q(n,a)))},clearSignInError:()=>{t(U())}}}))(R),ae=b.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:C,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>W(e))),I=l((e=>$(e))),m=M(),w=Z().mode,x=m.state?.magicLinkExpired,T=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),K(o.userId,o.zeniSessionId,r.tenantId),i(X(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Y("Completed")),P.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=N();e!=null&&F(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(r.productSettings))}),2e3))}),[S,p,h,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!T,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?u.jsx(B,{onClose:()=>i(U()),unlockDate:L}):null]})}export{ve as default};
1
+ import{j as u}from"./liveblocks-BdMPZzDQ.js";import{a as f,R as b,t as A}from"./sentry-Buwow292.js";import{u as z,h as D,j as l,g as M,N as O,l as V}from"./core-o-ca34AJ.js";import{u as j,z as s,m as E,G as P,R as F,S as _,T as B,U as N,W as R,X as v}from"./index-BngORT8V.js";import{fI as W,UK as $,V2 as J,gl as K,gn as X,V7 as Y,gY as G,dl as H,V8 as U,V9 as q,Va as Q,c1 as y}from"./zeni-epic-state-MQ0qdl-Q.js";import{u as Z}from"./mui-cK5UWUvi.js";import{u as ee}from"./useDeviceId-CeB6LWI8.js";import{f as te}from"./analyticsHelper-Clz3U3cN.js";import{t as ne}from"./getLocaleForTenant-C98BJYuO.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="73e29855-563e-4463-8371-5f113505c817",t._sentryDebugIdIdentifier="sentry-dbid-73e29855-563e-4463-8371-5f113505c817")}catch{}})();const ie=V((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(q(n,a)))},clearSignInError:()=>{t(U())}}}))(R),ae=b.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:C,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>W(e))),I=l((e=>$(e))),m=M(),w=Z().mode,x=m.state?.magicLinkExpired,T=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),K(o.userId,o.zeniSessionId,r.tenantId),i(X(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Y("Completed")),P.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=N();e!=null&&F(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",H(r.productSettings))}),2e3))}),[S,p,h,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!T,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?u.jsx(B,{onClose:()=>i(U()),unlockDate:L}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BdMPZzDQ.js";import{a as i}from"./sentry-Buwow292.js";import{u as d,g as c,N as u}from"./core-o-ca34AJ.js";import{z as n,m as a,S as m,a6 as p}from"./index-Bx2gJO4r.js";import{g$ as g,Vo as b}from"./zeni-epic-state-MQ0qdl-Q.js";import{n as y}from"./mui-cK5UWUvi.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1252b546-b136-4188-9f0d-57b04fb8b9b1",t._sentryDebugIdIdentifier="sentry-dbid-1252b546-b136-4188-9f0d-57b04fb8b9b1")}catch{}})();function N(){const t=d(),e=c(),o=i.useRef(!1),f=n.isSignedIn(),r=e.state?.message==="logout"||f;return i.useEffect((()=>{if(r&&!o.current){o.current=!0;try{t(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[r,t]),r?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
1
+ import{j as s}from"./liveblocks-BdMPZzDQ.js";import{a as i}from"./sentry-Buwow292.js";import{u as d,g as c,N as u}from"./core-o-ca34AJ.js";import{z as n,m as a,S as m,a6 as p}from"./index-BngORT8V.js";import{g$ as g,Vo as b}from"./zeni-epic-state-MQ0qdl-Q.js";import{n as y}from"./mui-cK5UWUvi.js";import"./recharts-DK1tbN_A.js";import"./analytics-C3OBHjEG.js";import"./plaid-C8bTkbCG.js";import"./dnd-sqKp8sUm.js";import"./stripe-cKAAJElX.js";import"./lottie-Dl8uwTmw.js";import"./lexical-CEO4_NFb.js";import"./pdf-BNJo5ucI.js";import"./utils-D4KfE2cr.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1252b546-b136-4188-9f0d-57b04fb8b9b1",t._sentryDebugIdIdentifier="sentry-dbid-1252b546-b136-4188-9f0d-57b04fb8b9b1")}catch{}})();function N(){const t=d(),e=c(),o=i.useRef(!1),f=n.isSignedIn(),r=e.state?.message==="logout"||f;return i.useEffect((()=>{if(r&&!o.current){o.current=!0;try{t(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[r,t]),r?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;