@zeniai/web-app-ui 5.4.9-dev → 5.4.9-next

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 (118) hide show
  1. package/dist/assets/{AccountMappingScreen-BVoif-LS.js → AccountMappingScreen-DgVWUa5y.js} +1 -1
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-37ukErZ3.js → ActualMatchingMatchDetailScreen-DvQ9M9-A.js} +1 -1
  3. package/dist/assets/AddressRoutes-B9C6RRJ_.js +1 -0
  4. package/dist/assets/{AddressScreen-DIx8pAlP.js → AddressScreen-DeDeG-XR.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-bkTvdFWM.js → AiCfoScreen-DrbIK8x6.js} +1 -1
  6. package/dist/assets/{AppDrawer-Bqkq0J1O.js → AppDrawer-rIEWFoaf.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-nVb6rKwz.js → BillPayApprovalRoutes-TRXWH-VY.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-D7EPBDh7.js → BillPayRoutes-BuBG1IC0.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-DMccZcIL.js → BusinessVerificationPageScreen-89ePZPDL.js} +1 -1
  10. package/dist/assets/{CardsAiCfoScreen-Cys2hC2x.js → CardsAiCfoScreen-DX5vDEdF.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-rF3I93wy.js → ChargeCardRoutes-BmRjwPqQ.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-DzTS_PxV.js → CompanyPassportScreen-hEm4apSc.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-B7H-_PrY.js → ConnectionAuthScreen-R-i5VDJR.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-B0JbgS0U.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-DyQugrQS.js → CustomerOnboardingRoutes-B0e21wY_.js} +1 -1
  16. package/dist/assets/{DashboardRoutes-B7G0hGYD.js → DashboardRoutes-DTuwgG58.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-Dpr9pT2f.js → DefaultTenantHome-CDFFLTS5.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BNWRfTvg.js → DomesticWireDetailScreen-BNS_qk21.js} +1 -1
  19. package/dist/assets/{DrawerScreen-DEMkXBuJ.js → DrawerScreen-C0qnwAy6.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-DlCSk6Xj.js → EntityDetailRoutes-BqtBHlH-.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-DcYDpqvS.js → ExpenseAutomationRoutes-CLHRK7OQ.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-CZZbV-Lj.js → FeaturePreviewScreen-BObKMLAH.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-XzCI6Wqi.js → HubSpotOAuthCallbackScreen-DepuPoKb.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-CzZNeGt1.js → InboxNotificationsProvider-D3zL6WrJ.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-BZEd2Xd_.js → InvoicingRoutes-QtaDX-CT.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-Ch_9Qa7Y.js → MagicLinkRoutes-BHCZaQRc.js} +1 -1
  27. package/dist/assets/{MagicLinkSignInScreen-D7qEtB4W.js → MagicLinkSignInScreen-BFUa5LGh.js} +1 -1
  28. package/dist/assets/{MobileAppDrawer-DYOb_3zl.js → MobileAppDrawer-DosePlrQ.js} +1 -1
  29. package/dist/assets/NotFoundScreen-aNGbN_zE.js +1 -0
  30. package/dist/assets/{NotificationRoutes-DdgV7jbI.js → NotificationRoutes-0YyWjFjS.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-CQqkncrK.js → OAuthConsentScreen-DO-PJqpM.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-77IqlyFS.js → PandLWithForecastRoutes-ByzBxefz.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-DMvOIo--.js → PaymentLinkScreen-D_6tbaKZ.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-BWw5-zAe.js → PeopleRoutes-GpfmZrhl.js} +1 -1
  35. package/dist/assets/{PerformanceRoutes-DMlk1Yfb.js → PerformanceRoutes-hCnsbHyb.js} +1 -1
  36. package/dist/assets/{Preview-SrROl7l3.js → Preview-Dej7REJc.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-BJEzxzvn.js → QBOConnectionScreen-CYlwll2k.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-BikedZ_D.js → ReimbursementApprovalRoutes-CAcLiboU.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BVAueb7P.js → ReimbursementApprovalRuleDetailScreen-BpQcXp03.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-B8-BBslS.js → ReimbursementRoutes-CkP2voMl.js} +1 -1
  41. package/dist/assets/{ReportsRoutes-BLQeDL9q.js → ReportsRoutes-B4N1RhcC.js} +1 -1
  42. package/dist/assets/{RewardsRoutes-BeComSZ4.js → RewardsRoutes-CPMf7r7a.js} +1 -1
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-BTeNJoD-.js → ScheduleDetailsPrepaidExpensesScreen-BV2oCu5B.js} +1 -1
  44. package/dist/assets/{ScreenRoutes-C_Y9Ih-I.js → ScreenRoutes-IJQcrw3-.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-D1KLQYfe.js → SettingsRoutes-90A2f0TW.js} +1 -1
  46. package/dist/assets/{SetupPagesScreen-D-sIYsOb.js → SetupPagesScreen-DJoEUyNN.js} +1 -1
  47. package/dist/assets/{SignInScreen-DYkAG0ir.js → SignInScreen-BmEqHPFi.js} +1 -1
  48. package/dist/assets/{SignOutScreen-CnE9aVZf.js → SignOutScreen-uM4YuMy_.js} +1 -1
  49. package/dist/assets/{TaskListScreen-3oMHbvzs.js → TaskListScreen-RmY47KcA.js} +1 -1
  50. package/dist/assets/{TaskRoutes-gD6fXeIa.js → TaskRoutes-Pc6Ssunb.js} +1 -1
  51. package/dist/assets/{TransactionDetailRoutes-CPgOmOJv.js → TransactionDetailRoutes-DFsMqUzD.js} +1 -1
  52. package/dist/assets/{TransactionDetailScreen-DKDiKxK4.js → TransactionDetailScreen-2sQ-Mt7I.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-dt9sGf6m.js → TransactionListRoutes-XEXTkljY.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-CuCdm5Gl.js → TreasuryRoutes-DmOGKdEC.js} +1 -1
  55. package/dist/assets/{VendorsRoutes--pMAMDSH.js → VendorsRoutes-BMO8xM6w.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-BOUXMp2T.js → WiseConfirmationScreen-E-gETj_v.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-CWyEeR9A.js → ZeniAccountRoutes-BKpndSn1.js} +1 -1
  58. package/dist/assets/{ZeniAccountStatementScreen-qY5rQsAd.js → ZeniAccountStatementScreen-CpeKlroP.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-BV1cQq3A.js → accountMappingHelper-BwNhMocq.js} +1 -1
  60. package/dist/assets/{analytics-Cfs2G4_3.js → analytics-LExiZ3ZJ.js} +1 -1
  61. package/dist/assets/{analyticsHelper-USl63sKg.js → analyticsHelper-D5rI-ENk.js} +1 -1
  62. package/dist/assets/{core-C1WlT0Gj.js → core-8RY6xs4-.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-7TTqX1My.js → decodeURIComponentSafe-EETpxpfb.js} +1 -1
  64. package/dist/assets/{dnd-B-4X27-9.js → dnd-kzApZ30A.js} +1 -1
  65. package/dist/assets/{empty-CY_o0w8p.js → empty-CHwSQ8Uo.js} +1 -1
  66. package/dist/assets/{empty-P6T33YMO.js → empty-xZmlxrHW.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-DXwM8vzz.js → emptyVideoElement-Bt8Yv5oY.js} +1 -1
  68. package/dist/assets/{epic-C_ztG9Vn.js → epic-eDJz53T0.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-DNfzvs5h.js → expenseAutomationHelper-jyZ4R3Ja.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-GRoZrOtf.js → getLocaleForTenant-D6WnKMyI.js} +1 -1
  71. package/dist/assets/{index-Cqlg1yss.js → index-BN41kO2p.js} +1 -1
  72. package/dist/assets/{index-BaogokNB.js → index-Bh_fLBtD.js} +8 -8
  73. package/dist/assets/{index-rFi6I5F-.js → index-C1W9HMNL.js} +1 -1
  74. package/dist/assets/{index-D6d3wrtH.js → index-DIz6bcrV.js} +1 -1
  75. package/dist/assets/{index-CLZ8aHkZ.js → index-DNk5uENT.js} +1 -1
  76. package/dist/assets/{index-CBN1-9DQ.js → index-DSAF6ewm.js} +2 -2
  77. package/dist/assets/{index-BXFluF17.js → index-Dper9bLO.js} +1 -1
  78. package/dist/assets/{index-C7OizTrs.js → index-pySAvyZk.js} +1 -1
  79. package/dist/assets/{lexical-Dmnf9NSK.js → lexical-CfpKXz7n.js} +1 -1
  80. package/dist/assets/{liveblocks-DQb3Em37.js → liveblocks-DIQuw_Y9.js} +1 -1
  81. package/dist/assets/{lottie-B_xwqN2A.js → lottie-BTborGkK.js} +1 -1
  82. package/dist/assets/{mui-D2HFTrjh.js → mui-DlnMF8jT.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Djr4VFL1.js → pathToGoBack-BQTQkAq4.js} +1 -1
  84. package/dist/assets/{pdf-DDFs-jyU.js → pdf-CkEJTjrf.js} +3 -3
  85. package/dist/assets/{pdf-lib-uEuVq1x5.js → pdf-lib-BnMOX36_.js} +1 -1
  86. package/dist/assets/{plaid-D36sgvQh.js → plaid-Cml2d2AI.js} +1 -1
  87. package/dist/assets/{pusher-Bmhf7zdt.js → pusher-AOMBOAjU.js} +1 -1
  88. package/dist/assets/{react-DQ4Bdeyq.js → react-CTvKHp8D.js} +1 -1
  89. package/dist/assets/{react-Dypy880L.js → react-CVlUsWTB.js} +1 -1
  90. package/dist/assets/{react-ABjTKzj0.js → react-CvrKlH7q.js} +1 -1
  91. package/dist/assets/{react-DEkQrWnb.js → react-D-y-jU6p.js} +1 -1
  92. package/dist/assets/{react-_dplkTkE.js → react-DxXY-5xK.js} +1 -1
  93. package/dist/assets/{react-BNxhEAR6.js → react-U5NbebhC.js} +1 -1
  94. package/dist/assets/{recharts-Cqzw8WNA.js → recharts-eszpIgqD.js} +1 -1
  95. package/dist/assets/{reportTimeframe-C4q_PyKL.js → reportTimeframe-BU3vOF4Q.js} +1 -1
  96. package/dist/assets/{routePaths-B56KGAwY.js → routePaths-Cc8-vBzD.js} +1 -1
  97. package/dist/assets/{sentry-bn66aQBn.js → sentry-BFx1l1Aw.js} +1 -1
  98. package/dist/assets/{stripSplatSuffix-Bc1c61un.js → stripSplatSuffix-ogsvQMku.js} +1 -1
  99. package/dist/assets/{url-DQxeYqWJ.js → url-BagnspMF.js} +1 -1
  100. package/dist/assets/{url-alEaciYB.js → url-DaHSLsIc.js} +1 -1
  101. package/dist/assets/{useActualMatchingMatchDetail-DC73Os7S.js → useActualMatchingMatchDetail-CprHhbVG.js} +1 -1
  102. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Cj21wv_W.js → useAiCfoDashboardSuggestedQuestionsChips-ByRfEwhA.js} +1 -1
  103. package/dist/assets/{useAskAiCfoHostNavButtonProps-GW3aOOUV.js → useAskAiCfoHostNavButtonProps-D0weyruJ.js} +1 -1
  104. package/dist/assets/{useChargeCardPusherEvents-BkaiNEUC.js → useChargeCardPusherEvents-CuGZv5rZ.js} +1 -1
  105. package/dist/assets/{useDeviceId-nnRIPwcw.js → useDeviceId-BziBGEbA.js} +1 -1
  106. package/dist/assets/{useEmailConnectResultRefresh-BL7F1fI2.js → useEmailConnectResultRefresh-DxZYJWI7.js} +1 -1
  107. package/dist/assets/{useEnsureVendorListLoaded-DT9MJB3G.js → useEnsureVendorListLoaded-BrBoOaNm.js} +1 -1
  108. package/dist/assets/{useInitialThreadRequest-rwXc-zR2.js → useInitialThreadRequest-DlNol2qu.js} +1 -1
  109. package/dist/assets/{useTaskManagerAccess-Bq4KBSvW.js → useTaskManagerAccess-D4gSk69T.js} +1 -1
  110. package/dist/assets/{useTaskManagerPusherEvents-DiYOmCQ4.js → useTaskManagerPusherEvents-Bi0TYVNl.js} +1 -1
  111. package/dist/assets/{utils-C55XrdHj.js → utils-DTvrFNdP.js} +1 -1
  112. package/dist/assets/{withTransactionSidePanel-LJitfor3.js → withTransactionSidePanel-Du9j39QN.js} +1 -1
  113. package/dist/assets/{zeni-epic-state-VpP2uC41.js → zeni-epic-state-uqmWoDAg.js} +3 -3
  114. package/dist/index.html +1 -1
  115. package/package.json +1 -1
  116. package/dist/assets/AddressRoutes-CTdswws_.js +0 -1
  117. package/dist/assets/CustomerOnboardingAuthScreen-CqKrvs3q.js +0 -1
  118. package/dist/assets/NotFoundScreen-hP5G-uHy.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-DQb3Em37.js";import{a as p}from"./sentry-bn66aQBn.js";import{H as a,a7 as u,ab as f,ac as h}from"./index-BaogokNB.js";import{s as c}from"./mui-D2HFTrjh.js";import{i as y}from"./core-C1WlT0Gj.js";import"./zeni-epic-state-VpP2uC41.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.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]="4e512d53-3495-4744-9907-d08633789fa6",e._sentryDebugIdIdentifier="sentry-dbid-4e512d53-3495-4744-9907-d08633789fa6")}catch{}})();const g=c("div")`
1
+ import{j as r}from"./liveblocks-DIQuw_Y9.js";import{a as p}from"./sentry-BFx1l1Aw.js";import{H as a,a7 as u,ab as f,ac as h}from"./index-Bh_fLBtD.js";import{s as c}from"./mui-DlnMF8jT.js";import{i as y}from"./core-8RY6xs4-.js";import"./zeni-epic-state-uqmWoDAg.js";import"./recharts-eszpIgqD.js";import"./analytics-LExiZ3ZJ.js";import"./plaid-Cml2d2AI.js";import"./dnd-kzApZ30A.js";import"./stripe-cKAAJElX.js";import"./lottie-BTborGkK.js";import"./lexical-CfpKXz7n.js";import"./pdf-CkEJTjrf.js";import"./utils-DTvrFNdP.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]="4e512d53-3495-4744-9907-d08633789fa6",e._sentryDebugIdIdentifier="sentry-dbid-4e512d53-3495-4744-9907-d08633789fa6")}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-DQb3Em37.js";import{Wa as re,fI as Y,m3 as G,e1 as N,e0 as le,S$ as Q,Vy as ce,Di as Pe,Wb as J,D7 as je,Ds as Le,Dm as de,Db as pe,Dq as ve,Dn as Te,Wc as ue,sx as Ae,g9 as Ve,gG as Oe,Wd as H,Df as me,De as ge,Dv as Re,ca as Fe}from"./zeni-epic-state-VpP2uC41.js";import{$ as fe,p as X,c as W,z as _,g as he,K as Ce,ad as ye,ax as be,ay as Ze,a9 as Se,H as R,ae as De,G as K,az as Be,ao as Ue,aq as $e,a6 as ze,j as we,O as He,k as We,aA as Ge,V as _e}from"./index-BaogokNB.js";import{D as xe,n as M,S as Ie}from"./mui-D2HFTrjh.js";import ae from"./NotFoundScreen-hP5G-uHy.js";import{a as c}from"./sentry-bn66aQBn.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-C1WlT0Gj.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{M as Ne}from"./MobileAppDrawer-DYOb_3zl.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.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]="14a9be6f-38d0-4a71-9b80-9cecf8046086",e._sentryDebugIdIdentifier="sentry-dbid-14a9be6f-38d0-4a71-9b80-9cecf8046086")}catch{}})();const Qe={overlayWidth:new Se(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,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),E=g((l=>G(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(W.isDebitCardFeatureEnabled),P=N(I,p),v=le(p),T=Q(p),B=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?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(W.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:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),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(Ze,{...s})]})})},ea=M(Ie)`
1
+ import{j as a}from"./liveblocks-DIQuw_Y9.js";import{Wa as re,fI as Y,m3 as G,e1 as N,e0 as le,S$ as Q,Vy as ce,Di as Pe,Wb as J,D7 as je,Ds as Le,Dm as de,Db as pe,Dq as ve,Dn as Te,Wc as ue,sx as Ae,g9 as Ve,gG as Oe,Wd as H,Df as me,De as ge,Dv as Re,ca as Fe}from"./zeni-epic-state-uqmWoDAg.js";import{$ as fe,p as X,c as W,z as _,g as he,K as Ce,ad as ye,ax as be,ay as Ze,a9 as Se,H as R,ae as De,G as K,az as Be,ao as Ue,aq as $e,a6 as ze,j as we,O as He,k as We,aA as Ge,V as _e}from"./index-Bh_fLBtD.js";import{D as xe,n as M,S as Ie}from"./mui-DlnMF8jT.js";import ae from"./NotFoundScreen-aNGbN_zE.js";import{a as c}from"./sentry-BFx1l1Aw.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-8RY6xs4-.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-D0weyruJ.js";import{M as Ne}from"./MobileAppDrawer-DosePlrQ.js";import"./recharts-eszpIgqD.js";import"./analytics-LExiZ3ZJ.js";import"./plaid-Cml2d2AI.js";import"./dnd-kzApZ30A.js";import"./stripe-cKAAJElX.js";import"./lottie-BTborGkK.js";import"./lexical-CfpKXz7n.js";import"./pdf-CkEJTjrf.js";import"./utils-DTvrFNdP.js";import"./InboxNotificationsProvider-D3zL6WrJ.js";import"./useTaskManagerAccess-D4gSk69T.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]="14a9be6f-38d0-4a71-9b80-9cecf8046086",e._sentryDebugIdIdentifier="sentry-dbid-14a9be6f-38d0-4a71-9b80-9cecf8046086")}catch{}})();const Qe={overlayWidth:new Se(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,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:D}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),E=g((l=>G(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(W.isDebitCardFeatureEnabled),P=N(I,p),v=le(p),T=Q(p),B=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?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(W.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:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),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(Ze,{...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-DQb3Em37.js";import E from"./NotFoundScreen-hP5G-uHy.js";import{a as r}from"./sentry-bn66aQBn.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-C1WlT0Gj.js";import{fI as B,a20 as h,bo as F,bn as N,iP as V,gk as q}from"./zeni-epic-state-VpP2uC41.js";import{s as $,z as I,aq as G,dO as H}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{M as K}from"./MobileAppDrawer-DYOb_3zl.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.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]="c9538f22-6d4e-47c9-92b4-19b509b7f0ed",e._sentryDebugIdIdentifier="sentry-dbid-c9538f22-6d4e-47c9-92b4-19b509b7f0ed")}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=$(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:f}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=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:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/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-DIQuw_Y9.js";import E from"./NotFoundScreen-aNGbN_zE.js";import{a as r}from"./sentry-BFx1l1Aw.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-8RY6xs4-.js";import{fI as B,a20 as h,bo as F,bn as N,iP as V,gk as q}from"./zeni-epic-state-uqmWoDAg.js";import{s as $,z as I,aq as G,dO as H}from"./index-Bh_fLBtD.js";import"./mui-DlnMF8jT.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-D0weyruJ.js";import{M as K}from"./MobileAppDrawer-DosePlrQ.js";import"./recharts-eszpIgqD.js";import"./analytics-LExiZ3ZJ.js";import"./plaid-Cml2d2AI.js";import"./dnd-kzApZ30A.js";import"./stripe-cKAAJElX.js";import"./lottie-BTborGkK.js";import"./lexical-CfpKXz7n.js";import"./pdf-CkEJTjrf.js";import"./utils-DTvrFNdP.js";import"./InboxNotificationsProvider-D3zL6WrJ.js";import"./useTaskManagerAccess-D4gSk69T.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]="c9538f22-6d4e-47c9-92b4-19b509b7f0ed",e._sentryDebugIdIdentifier="sentry-dbid-c9538f22-6d4e-47c9-92b4-19b509b7f0ed")}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=$(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:f}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=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:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/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 +1 @@
1
- import{a as h,R as a}from"./sentry-bn66aQBn.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
1
+ import{a as h,R as a}from"./sentry-BFx1l1Aw.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-DQb3Em37.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-bn66aQBn.js";import{L as ge,c1 as xc,fI as kc,UG as Tc,Vw as jl,ca as xl}from"./zeni-epic-state-VpP2uC41.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-C55XrdHj.js";import{r as cn}from"./empty-CY_o0w8p.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-uEuVq1x5.js";import{a as Ye,r as Fl}from"./index-BXFluF17.js";import{r as Ul}from"./index-C7OizTrs.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-C1WlT0Gj.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,E as Kl}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import{d as It}from"./decodeURIComponentSafe-7TTqX1My.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]="c36e4af9-1f6c-4892-9598-42626486282e",e._sentryDebugIdIdentifier="sentry-dbid-c36e4af9-1f6c-4892-9598-42626486282e")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
1
+ import{j as _l}from"./liveblocks-DIQuw_Y9.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-BFx1l1Aw.js";import{L as ge,c1 as xc,fI as kc,UG as Tc,Vw as jl,ca as xl}from"./zeni-epic-state-uqmWoDAg.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-DTvrFNdP.js";import{r as cn}from"./empty-CHwSQ8Uo.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-BnMOX36_.js";import{a as Ye,r as Fl}from"./index-Dper9bLO.js";import{r as Ul}from"./index-pySAvyZk.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-8RY6xs4-.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,E as Kl}from"./index-Bh_fLBtD.js";import"./mui-DlnMF8jT.js";import{d as It}from"./decodeURIComponentSafe-EETpxpfb.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]="c36e4af9-1f6c-4892-9598-42626486282e",e._sentryDebugIdIdentifier="sentry-dbid-c36e4af9-1f6c-4892-9598-42626486282e")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
2
2
  `),I=S(E).split(`
3
3
  `),k=0,C="";if(O==="strictEqual"&&l(j)==="object"&&l(E)==="object"&&j!==null&&E!==null&&(O="strictEqualObject"),R.length===1&&I.length===1&&R[0]!==I[0]){var H=R[0].length+I[0].length;if(H<=10){if(!(l(j)==="object"&&j!==null||l(E)==="object"&&E!==null||j===0&&E===0))return"".concat(_[O],`
4
4
 
@@ -1 +1 @@
1
- import{j as o}from"./liveblocks-DQb3Em37.js";import z from"./NotFoundScreen-hP5G-uHy.js";import{a as p}from"./sentry-bn66aQBn.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 g}from"./core-C1WlT0Gj.js";import{fI as E,_4 as h,_m as w,Oe as U,Oa as L,Od as f,O3 as N,_L as B,O7 as q,Og as F}from"./zeni-epic-state-VpP2uC41.js";import{z as _,w as T,cb as G,o as $,bU as H,cc as J}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import{u as M}from"./useEnsureVendorListLoaded-DT9MJB3G.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-BVAueb7P.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]="2988ffe3-3d4d-48b7-9c61-8a67a83ff2b5",e._sentryDebugIdIdentifier="sentry-dbid-2988ffe3-3d4d-48b7-9c61-8a67a83ff2b5")}catch{}})();const j="reimbursement-approval-rule-update",P=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(G)),Q=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>h(r))),b=u((r=>w(r).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),_.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:(r,y,I)=>{r.endsWith(j)&&I.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(P,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(F(t,!0))}}}))(T(J)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=H(e?.tenantId);return s?o.jsx(Z,{isLoading:n}):o.jsx(Q,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),r=u((i=>h(i)));M();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(q(!1,!0)))}),[v,b,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,r,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?o.jsx(k,{to:"../../promo"}):o.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return o.jsxs(K,{children:[o.jsx(g,{path:"/",element:o.jsx(Y,{})}),o.jsx(g,{path:"/new",element:o.jsx(x,{})}),o.jsx(g,{path:"/:approvalRuleId/edit",element:o.jsx(x,{})}),o.jsx(g,{path:"*",element:o.jsx(z,{})})]})}export{ue as R};
1
+ import{j as o}from"./liveblocks-DIQuw_Y9.js";import z from"./NotFoundScreen-aNGbN_zE.js";import{a as p}from"./sentry-BFx1l1Aw.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 g}from"./core-8RY6xs4-.js";import{fI as E,_4 as h,_m as w,Oe as U,Oa as L,Od as f,O3 as N,_L as B,O7 as q,Og as F}from"./zeni-epic-state-uqmWoDAg.js";import{z as _,w as T,cb as G,o as $,bU as H,cc as J}from"./index-Bh_fLBtD.js";import"./mui-DlnMF8jT.js";import{u as M}from"./useEnsureVendorListLoaded-BrBoOaNm.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-BpQcXp03.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]="2988ffe3-3d4d-48b7-9c61-8a67a83ff2b5",e._sentryDebugIdIdentifier="sentry-dbid-2988ffe3-3d4d-48b7-9c61-8a67a83ff2b5")}catch{}})();const j="reimbursement-approval-rule-update",P=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(G)),Q=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>h(r))),b=u((r=>w(r).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),_.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:(r,y,I)=>{r.endsWith(j)&&I.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(k,{to:"../../promo"}):o.jsx(P,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(F(t,!0))}}}))(T(J)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=H(e?.tenantId);return s?o.jsx(Z,{isLoading:n}):o.jsx(Q,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),r=u((i=>h(i)));M();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(q(!1,!0)))}),[v,b,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,r,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?o.jsx(k,{to:"../../promo"}):o.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return o.jsxs(K,{children:[o.jsx(g,{path:"/",element:o.jsx(Y,{})}),o.jsx(g,{path:"/new",element:o.jsx(x,{})}),o.jsx(g,{path:"/:approvalRuleId/edit",element:o.jsx(x,{})}),o.jsx(g,{path:"*",element:o.jsx(z,{})})]})}export{ue as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-DQb3Em37.js";import{a as y}from"./sentry-bn66aQBn.js";import{h as T,u as x,g as C,i as V,j as R,l as k}from"./core-C1WlT0Gj.js";import{_m as _,_4 as O,O6 as j,Oj as B,Oe as A,Of as E,_n as F,fI as K,Od as L}from"./zeni-epic-state-VpP2uC41.js";import{z as N,a5 as P,c2 as W,o as $,bU as G,c3 as H}from"./index-BaogokNB.js";import{u as q}from"./mui-D2HFTrjh.js";import{u as J}from"./useEnsureVendorListLoaded-DT9MJB3G.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]="a47cc9ed-4ade-4eaa-9950-28e8a2b273d6",e._sentryDebugIdIdentifier="sentry-dbid-a47cc9ed-4ade-4eaa-9950-28e8a2b273d6")}catch{}})();const M=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return o.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===o.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const 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=T(),o=x(),t=C(),{approvalRuleId:p}=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),o(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:s,vendorNamesById:i,editingRuleId:p==="approval_update"?o.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,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 U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const 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:o}=G(e?.tenantId);return o?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=T(),o=x(),t=C(),{approvalRuleId:p}=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),o(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,se as i};
1
+ import{j as g}from"./liveblocks-DIQuw_Y9.js";import{a as y}from"./sentry-BFx1l1Aw.js";import{h as T,u as x,g as C,i as V,j as R,l as k}from"./core-8RY6xs4-.js";import{_m as _,_4 as O,O6 as j,Oj as B,Oe as A,Of as E,_n as F,fI as K,Od as L}from"./zeni-epic-state-uqmWoDAg.js";import{z as N,a5 as P,c2 as W,o as $,bU as G,c3 as H}from"./index-Bh_fLBtD.js";import{u as q}from"./mui-DlnMF8jT.js";import{u as J}from"./useEnsureVendorListLoaded-BrBoOaNm.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]="a47cc9ed-4ade-4eaa-9950-28e8a2b273d6",e._sentryDebugIdIdentifier="sentry-dbid-a47cc9ed-4ade-4eaa-9950-28e8a2b273d6")}catch{}})();const M=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return o.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===o.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const 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=T(),o=x(),t=C(),{approvalRuleId:p}=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),o(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:s,vendorNamesById:i,editingRuleId:p==="approval_update"?o.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,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 U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const 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:o}=G(e?.tenantId);return o?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=T(),o=x(),t=C(),{approvalRuleId:p}=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),o(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,se as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-DQb3Em37.js";import{u as ae,j as R,h as Q,g as Y,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-C1WlT0Gj.js";import{fI as H,Oa as ct,$R as ge,ca as he,Ng as Fe,me as dt,Nv as ce,Nu as de,$S as ut,bn as fe,gZ as Le,$T as pt,XB as bt,m3 as $e,XC as ke,XD as gt,kR as ht,ZS as ft,l4 as St,N4 as It,CA as yt,kY as vt,NR as Ne,$U as Pe,$V as Ce,$W as At,$X as Rt,$Y as kt,NB as we,la as Ct,Z$ as wt,Nt as Et,Ne as xt,$Z as Bt,Nd as Tt,$_ as Dt,Nl as Ee,NF as jt,NE as Ut,NA as Ft,$$ as _e,S$ as Lt,bo as $t,No as Nt,O7 as Pt,a00 as _t,a01 as Mt,NN as Ot,NK as xe,Zm as Zt,Nb as zt,a02 as Me,OA as Be,OI as Gt,a03 as Vt,a04 as X,a05 as Ht,a06 as Oe,a07 as Wt,a08 as Ze,a09 as ze,NZ as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a0a as Xt,gk as Kt,Zz as Yt,a0b as Jt,a0c as He,ZD as Qt,_m as en,a0d as tn,_L as nn,OF as Te,OE as an,a0e as sn,a0f as on,a0g as rn,a0h as ln,a0i as mn,_5 as cn,Ov as dn,Oz as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,U$ as Sn,dc as In,df as yn,de as vn,cH as An}from"./zeni-epic-state-VpP2uC41.js";import{bU as Rn,s as We,$ as qe,p as oe,c as F,z as L,cT as Xe,a6 as re,j as E,aQ as De,H as j,ac as se,ad as kn,G as Ke,cU as Cn,k as K,aq as Ye,cV as wn,V as le,cW as En,ao as xn,a9 as Bn,a5 as ye,O as Je,w as Tn,bC as Dn,at as jn,ag as Un,cX as Fn,g as Ln}from"./index-BaogokNB.js";import{n as P,S as $n,u as Qe}from"./mui-D2HFTrjh.js";import pe from"./NotFoundScreen-hP5G-uHy.js";import{S as je}from"./SetupPagesScreen-D-sIYsOb.js";import{F as et}from"./FeaturePreviewScreen-CZZbV-Lj.js";import{a as g}from"./sentry-bn66aQBn.js";import{u as ve}from"./useAskAiCfoHostNavButtonProps-GW3aOOUV.js";import{u as tt}from"./useInitialThreadRequest-rwXc-zR2.js";import{D as Nn}from"./DrawerScreen-DEMkXBuJ.js";import{M as nt}from"./MobileAppDrawer-DYOb_3zl.js";import{F as Pn}from"./ScreenRoutes-C_Y9Ih-I.js";import{R as _n}from"./ReimbursementApprovalRoutes-BikedZ_D.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./BusinessVerificationPageScreen-DMccZcIL.js";import"./routePaths-B56KGAwY.js";import"./analyticsHelper-USl63sKg.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.js";import"./getLocaleForTenant-GRoZrOtf.js";import"./useEnsureVendorListLoaded-DT9MJB3G.js";import"./ReimbursementApprovalRuleDetailScreen-BVAueb7P.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]="3a752fc9-887a-4092-96c3-069fd58623df",e._sentryDebugIdIdentifier="sentry-dbid-3a752fc9-887a-4092-96c3-069fd58623df")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ke.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(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(Rt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(At({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=K(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Ue(){const e=Q(),t=ae(),n=Y(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(F.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(F.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=ve({mobileExploreReferrer:"Reimbursement Details"}),B=Y().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,v]=g.useState(!1),S=L.getSignedInUser(),w=R((b=>H(b))),h=R((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),U=he(w?.userRole??[]);(function(){const b=ae(),M=R((J=>H(J))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=Rn(O),z=R((J=>J.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(v(!0),t(Fe(!1,I,u,r)))}));const A=R((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"||U&&h.billStatus==="rejected"||U===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:c,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const Zn=P.div`
1
+ import{j as s}from"./liveblocks-DIQuw_Y9.js";import{u as ae,j as R,h as Q,g as Y,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-8RY6xs4-.js";import{fI as H,Oa as ct,$R as ge,ca as he,Ng as Fe,me as dt,Nv as ce,Nu as de,$S as ut,bn as fe,gZ as Le,$T as pt,XB as bt,m3 as $e,XC as ke,XD as gt,kR as ht,ZS as ft,l4 as St,N4 as It,CA as yt,kY as vt,NR as Ne,$U as Pe,$V as Ce,$W as At,$X as Rt,$Y as kt,NB as we,la as Ct,Z$ as wt,Nt as Et,Ne as xt,$Z as Bt,Nd as Tt,$_ as Dt,Nl as Ee,NF as jt,NE as Ut,NA as Ft,$$ as _e,S$ as Lt,bo as $t,No as Nt,O7 as Pt,a00 as _t,a01 as Mt,NN as Ot,NK as xe,Zm as Zt,Nb as zt,a02 as Me,OA as Be,OI as Gt,a03 as Vt,a04 as X,a05 as Ht,a06 as Oe,a07 as Wt,a08 as Ze,a09 as ze,NZ as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a0a as Xt,gk as Kt,Zz as Yt,a0b as Jt,a0c as He,ZD as Qt,_m as en,a0d as tn,_L as nn,OF as Te,OE as an,a0e as sn,a0f as on,a0g as rn,a0h as ln,a0i as mn,_5 as cn,Ov as dn,Oz as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,U$ as Sn,dc as In,df as yn,de as vn,cH as An}from"./zeni-epic-state-uqmWoDAg.js";import{bU as Rn,s as We,$ as qe,p as oe,c as F,z as L,cT as Xe,a6 as re,j as E,aQ as De,H as j,ac as se,ad as kn,G as Ke,cU as Cn,k as K,aq as Ye,cV as wn,V as le,cW as En,ao as xn,a9 as Bn,a5 as ye,O as Je,w as Tn,bC as Dn,at as jn,ag as Un,cX as Fn,g as Ln}from"./index-Bh_fLBtD.js";import{n as P,S as $n,u as Qe}from"./mui-DlnMF8jT.js";import pe from"./NotFoundScreen-aNGbN_zE.js";import{S as je}from"./SetupPagesScreen-DJoEUyNN.js";import{F as et}from"./FeaturePreviewScreen-BObKMLAH.js";import{a as g}from"./sentry-BFx1l1Aw.js";import{u as ve}from"./useAskAiCfoHostNavButtonProps-D0weyruJ.js";import{u as tt}from"./useInitialThreadRequest-DlNol2qu.js";import{D as Nn}from"./DrawerScreen-C0qnwAy6.js";import{M as nt}from"./MobileAppDrawer-DosePlrQ.js";import{F as Pn}from"./ScreenRoutes-IJQcrw3-.js";import{R as _n}from"./ReimbursementApprovalRoutes-CAcLiboU.js";import"./recharts-eszpIgqD.js";import"./analytics-LExiZ3ZJ.js";import"./plaid-Cml2d2AI.js";import"./dnd-kzApZ30A.js";import"./stripe-cKAAJElX.js";import"./lottie-BTborGkK.js";import"./lexical-CfpKXz7n.js";import"./pdf-CkEJTjrf.js";import"./utils-DTvrFNdP.js";import"./BusinessVerificationPageScreen-89ePZPDL.js";import"./routePaths-Cc8-vBzD.js";import"./analyticsHelper-D5rI-ENk.js";import"./InboxNotificationsProvider-D3zL6WrJ.js";import"./useTaskManagerAccess-D4gSk69T.js";import"./getLocaleForTenant-D6WnKMyI.js";import"./useEnsureVendorListLoaded-BrBoOaNm.js";import"./ReimbursementApprovalRuleDetailScreen-BpQcXp03.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]="3a752fc9-887a-4092-96c3-069fd58623df",e._sentryDebugIdIdentifier="sentry-dbid-3a752fc9-887a-4092-96c3-069fd58623df")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ke.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(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(Rt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(At({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=K(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Ue(){const e=Q(),t=ae(),n=Y(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(F.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(F.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=ve({mobileExploreReferrer:"Reimbursement Details"}),B=Y().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,v]=g.useState(!1),S=L.getSignedInUser(),w=R((b=>H(b))),h=R((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),U=he(w?.userRole??[]);(function(){const b=ae(),M=R((J=>H(J))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=Rn(O),z=R((J=>J.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(v(!0),t(Fe(!1,I,u,r)))}));const A=R((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"||U&&h.billStatus==="rejected"||U===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:c,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const Zn=P.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-DQb3Em37.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as ze,o as oe}from"./core-C1WlT0Gj.js";import{fI as J,ED as S,Vx as Ge,m3 as ue,uh as he,v6 as Y,lK as D,lT as F,lL as V,kO as A,kF as E,kE as P,DG as U,vb as ye,bq as He,Vy as Ne,bn as We,E$ as $e,Vz as qe,VA as Ze,ck as I,Dz as ne,VB as re,VC as Ke,VD as Qe,VE as Je,VF as Xe,VG as ea,VH as aa,VI as sa,VJ as ta,VK as oa,VL as na,VM as ra,VN as la,VO as k,VP as x,VQ as z,VR as G,VS as H,VT as N,VU as W,VV as $,VW as q,VX as Z,ek as ca,EF as ia,Er as le,Es as ce,EL as da,Ew as ie,bG as O,VY as de,di as pe,Ex as _e,ER as pa,VZ as _a,V_ as fa,V$ as ba,W0 as ma,W1 as ua,W2 as ha,W3 as ya,W4 as Ca,W5 as wa,W6 as ga,e1 as Ia,e0 as Ra}from"./zeni-epic-state-VpP2uC41.js";import{al as Sa,am as Ta,an as ka,a as Oa,$ as ja,p as Ce,c as K,z as we,ao as Da,V as Fa,e as Va,ap as Aa,aq as Ea,a6 as Pa,j as Q,O as Ma,A as La,k as ge,ar as Ba,as as va,at as Ya}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import Ua from"./NotFoundScreen-hP5G-uHy.js";import{F as xa}from"./FeaturePreviewScreen-CZZbV-Lj.js";import{a as u}from"./sentry-bn66aQBn.js";import{u as za}from"./useInitialThreadRequest-rwXc-zR2.js";import{t as fe,a as be,b as Ga}from"./routePaths-B56KGAwY.js";import{t as me}from"./reportTimeframe-C4q_PyKL.js";import{M as Ha}from"./MobileAppDrawer-DYOb_3zl.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./useTaskManagerAccess-Bq4KBSvW.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]="ff1e1143-08ca-47e8-908b-76ec3582ea52",e._sentryDebugIdIdentifier="sentry-dbid-ff1e1143-08ca-47e8-908b-76ec3582ea52")}catch{}})();const Na=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(Z({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(W({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0}))},Wa=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=J(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=Ne(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:Q,isZeniUser:We(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(P(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(P(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(E());break;case"balance_sheet_by_projects":e(P(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(A());break;case"cash_flow":e(D(r,!0,a,s));break;case"cash_flow_by_classes":e(D(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(D(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?Ga(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:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Z({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(W({scrollPosition:s}));break;case"balance_sheet_by_classes":e(N({scrollPosition:s}));break;case"balance_sheet_by_projects":e(H({scrollPosition:s}));break;case"cash_flow_by_classes":e(G({scrollPosition:s}));break;case"cash_flow_by_projects":e(z({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(Z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(z({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",j(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(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(Ke({projectsToFilterOut:a})):R(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):e(Je({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?E():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?A():U())},onUpdateDisplayOrder:a=>{e(Ze(a))},onUpdateReportFormat:a=>{Wa(e),e(qe(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):A(!0):E(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=ja(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(K.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(K.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=>J(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=za(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>Ge(l))),{areTenantIdsInSync:y}=Da(),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)),je=_((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(P(C.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":g&&s(A());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(D(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Fa(),De=ee?.loggedInUserRole!=null&&He(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Ae=Va(),Ee=Aa();return(function(l){const{isDataReady:Pe}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Pe),Be=u.useMemo((()=>se?Na:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Ea({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Pa,{analytics:Q,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ha,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:je,selectedReportID:B,analytics:Q,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:De,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ee&&Ae&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const j=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=>J(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(K.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(ze,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
1
+ import{j as f}from"./liveblocks-DIQuw_Y9.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as ze,o as oe}from"./core-8RY6xs4-.js";import{fI as J,ED as S,Vx as Ge,m3 as ue,uh as he,v6 as Y,lK as D,lT as F,lL as V,kO as A,kF as E,kE as P,DG as U,vb as ye,bq as He,Vy as Ne,bn as We,E$ as $e,Vz as qe,VA as Ze,ck as I,Dz as ne,VB as re,VC as Ke,VD as Qe,VE as Je,VF as Xe,VG as ea,VH as aa,VI as sa,VJ as ta,VK as oa,VL as na,VM as ra,VN as la,VO as k,VP as x,VQ as z,VR as G,VS as H,VT as N,VU as W,VV as $,VW as q,VX as Z,ek as ca,EF as ia,Er as le,Es as ce,EL as da,Ew as ie,bG as O,VY as de,di as pe,Ex as _e,ER as pa,VZ as _a,V_ as fa,V$ as ba,W0 as ma,W1 as ua,W2 as ha,W3 as ya,W4 as Ca,W5 as wa,W6 as ga,e1 as Ia,e0 as Ra}from"./zeni-epic-state-uqmWoDAg.js";import{al as Sa,am as Ta,an as ka,a as Oa,$ as ja,p as Ce,c as K,z as we,ao as Da,V as Fa,e as Va,ap as Aa,aq as Ea,a6 as Pa,j as Q,O as Ma,A as La,k as ge,ar as Ba,as as va,at as Ya}from"./index-Bh_fLBtD.js";import"./mui-DlnMF8jT.js";import Ua from"./NotFoundScreen-aNGbN_zE.js";import{F as xa}from"./FeaturePreviewScreen-BObKMLAH.js";import{a as u}from"./sentry-BFx1l1Aw.js";import{u as za}from"./useInitialThreadRequest-DlNol2qu.js";import{t as fe,a as be,b as Ga}from"./routePaths-Cc8-vBzD.js";import{t as me}from"./reportTimeframe-BU3vOF4Q.js";import{M as Ha}from"./MobileAppDrawer-DosePlrQ.js";import"./recharts-eszpIgqD.js";import"./analytics-LExiZ3ZJ.js";import"./plaid-Cml2d2AI.js";import"./dnd-kzApZ30A.js";import"./stripe-cKAAJElX.js";import"./lottie-BTborGkK.js";import"./lexical-CfpKXz7n.js";import"./pdf-CkEJTjrf.js";import"./utils-DTvrFNdP.js";import"./InboxNotificationsProvider-D3zL6WrJ.js";import"./useTaskManagerAccess-D4gSk69T.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]="ff1e1143-08ca-47e8-908b-76ec3582ea52",e._sentryDebugIdIdentifier="sentry-dbid-ff1e1143-08ca-47e8-908b-76ec3582ea52")}catch{}})();const Na=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(Z({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(W({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0}))},Wa=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=J(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=Ne(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:Q,isZeniUser:We(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(P(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(P(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(E());break;case"balance_sheet_by_projects":e(P(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(A());break;case"cash_flow":e(D(r,!0,a,s));break;case"cash_flow_by_classes":e(D(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(D(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?Ga(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:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Z({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(W({scrollPosition:s}));break;case"balance_sheet_by_classes":e(N({scrollPosition:s}));break;case"balance_sheet_by_projects":e(H({scrollPosition:s}));break;case"cash_flow_by_classes":e(G({scrollPosition:s}));break;case"cash_flow_by_projects":e(z({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(Z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(z({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",j(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(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(Ke({projectsToFilterOut:a})):R(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):e(Je({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?E():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?A():U())},onUpdateDisplayOrder:a=>{e(Ze(a))},onUpdateReportFormat:a=>{Wa(e),e(qe(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):A(!0):E(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=ja(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(K.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(K.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=>J(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=za(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>Ge(l))),{areTenantIdsInSync:y}=Da(),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)),je=_((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(P(C.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":g&&s(A());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(D(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Fa(),De=ee?.loggedInUserRole!=null&&He(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Ae=Va(),Ee=Aa();return(function(l){const{isDataReady:Pe}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Pe),Be=u.useMemo((()=>se?Na:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Ea({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Pa,{analytics:Q,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ha,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:je,selectedReportID:B,analytics:Q,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:De,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ee&&Ae&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const j=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=>J(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(K.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(ze,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-DQb3Em37.js";import{z as j,a6 as N,j as u,O as S,e6 as I,p as k,c as C}from"./index-BaogokNB.js";import"./mui-D2HFTrjh.js";import g from"./NotFoundScreen-hP5G-uHy.js";import{a as c}from"./sentry-bn66aQBn.js";import{u as D,j as h,h as F,g as L,l as _,n as T,o as d,N as y}from"./core-C1WlT0Gj.js";import{fI as U,a2Z as w,a2_ as p,Ei as P,q3 as V,a2$ as q,Eg as z}from"./zeni-epic-state-VpP2uC41.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.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]="55debf4f-7914-49ca-a7d6-da526a1dacee",e._sentryDebugIdIdentifier="sentry-dbid-55debf4f-7914-49ca-a7d6-da526a1dacee")}catch{}})();const G=_((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),O=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),x=L(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),b=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:x,currentTenant:r,companyName:E,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-DIQuw_Y9.js";import{z as j,a6 as N,j as u,O as S,e6 as I,p as k,c as C}from"./index-Bh_fLBtD.js";import"./mui-DlnMF8jT.js";import g from"./NotFoundScreen-aNGbN_zE.js";import{a as c}from"./sentry-BFx1l1Aw.js";import{u as D,j as h,h as F,g as L,l as _,n as T,o as d,N as y}from"./core-8RY6xs4-.js";import{fI as U,a2Z as w,a2_ as p,Ei as P,q3 as V,a2$ as q,Eg as z}from"./zeni-epic-state-uqmWoDAg.js";import"./recharts-eszpIgqD.js";import"./analytics-LExiZ3ZJ.js";import"./plaid-Cml2d2AI.js";import"./dnd-kzApZ30A.js";import"./stripe-cKAAJElX.js";import"./lottie-BTborGkK.js";import"./lexical-CfpKXz7n.js";import"./pdf-CkEJTjrf.js";import"./utils-DTvrFNdP.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]="55debf4f-7914-49ca-a7d6-da526a1dacee",e._sentryDebugIdIdentifier="sentry-dbid-55debf4f-7914-49ca-a7d6-da526a1dacee")}catch{}})();const G=_((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(I),O=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),x=L(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),b=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:x,currentTenant:r,companyName:E,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as E}from"./liveblocks-DQb3Em37.js";import{a as v}from"./sentry-bn66aQBn.js";import{i as M,u as H,h as Q,g as ee,j as r,l as te}from"./core-C1WlT0Gj.js";import{Xw as Fe,Xx as Ge,m3 as ae,sB as Ve,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xy as Ye,fI as K,Wv as pe,Xz as Se,h2 as ne,cD as se,cE as le,FJ as ve,XA as Ce,FN as Xe,gS as ce,sE as ze,td as qe,dF as Ze,dE as We,TS as fe,FH as He,FB as Qe,XB as De,Ft as et,Fs as tt,Fn as at,Fy as nt,FO as st,XC as Y,XD as ge,Fu as lt,Ww as oe,G2 as Ae,FX as Ie,XE as xe,sH as Te,FR as Be,FP as Le,XF as we,G9 as Je,G6 as je,FS as be,G8 as Ne}from"./zeni-epic-state-VpP2uC41.js";import{a2 as de,aW as ie,aX as ct,z as ot,h as dt,a5 as it,a6 as ue,j as _,at as ut,aY as rt,k as G,G as ye,s as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-BaogokNB.js";import{n as re}from"./mui-D2HFTrjh.js";import{p as St}from"./pathToGoBack-Djr4VFL1.js";import{u as ft}from"./useActualMatchingMatchDetail-DC73Os7S.js";import W from"./NotFoundScreen-hP5G-uHy.js";import{c as V}from"./routePaths-B56KGAwY.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]="86aadb4e-9f9e-437d-8b37-cd3671408f8e",e._sentryDebugIdIdentifier="sentry-dbid-86aadb4e-9f9e-437d-8b37-cd3671408f8e")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Fe(u,l??""))),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((()=>{l!=null&&d==null&&h.fetchState==="Not-Started"&&n(Ve(l))}),[l,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(W,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(Dt,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n(Re(l,u,f))},onSkip:(u,f)=>{n($e(l,u,f))}})})}const Dt=re.div`
1
+ import{j as E}from"./liveblocks-DIQuw_Y9.js";import{a as v}from"./sentry-BFx1l1Aw.js";import{i as M,u as H,h as Q,g as ee,j as r,l as te}from"./core-8RY6xs4-.js";import{Xw as Fe,Xx as Ge,m3 as ae,sB as Ve,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xy as Ye,fI as K,Wv as pe,Xz as Se,h2 as ne,cD as se,cE as le,FJ as ve,XA as Ce,FN as Xe,gS as ce,sE as ze,td as qe,dF as Ze,dE as We,TS as fe,FH as He,FB as Qe,XB as De,Ft as et,Fs as tt,Fn as at,Fy as nt,FO as st,XC as Y,XD as ge,Fu as lt,Ww as oe,G2 as Ae,FX as Ie,XE as xe,sH as Te,FR as Be,FP as Le,XF as we,G9 as Je,G6 as je,FS as be,G8 as Ne}from"./zeni-epic-state-uqmWoDAg.js";import{a2 as de,aW as ie,aX as ct,z as ot,h as dt,a5 as it,a6 as ue,j as _,at as ut,aY as rt,k as G,G as ye,s as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-Bh_fLBtD.js";import{n as re}from"./mui-DlnMF8jT.js";import{p as St}from"./pathToGoBack-BQTQkAq4.js";import{u as ft}from"./useActualMatchingMatchDetail-CprHhbVG.js";import W from"./NotFoundScreen-aNGbN_zE.js";import{c as V}from"./routePaths-Cc8-vBzD.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]="86aadb4e-9f9e-437d-8b37-cd3671408f8e",e._sentryDebugIdIdentifier="sentry-dbid-86aadb4e-9f9e-437d-8b37-cd3671408f8e")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=M(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Fe(u,l??""))),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((()=>{l!=null&&d==null&&h.fetchState==="Not-Started"&&n(Ve(l))}),[l,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(W,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(Dt,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n(Re(l,u,f))},onSkip:(u,f)=>{n($e(l,u,f))}})})}const Dt=re.div`
2
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-hP5G-uHy.js","assets/sentry-bn66aQBn.js","assets/core-C1WlT0Gj.js","assets/zeni-epic-state-VpP2uC41.js","assets/index-BaogokNB.js","assets/mui-D2HFTrjh.js","assets/analytics-Cfs2G4_3.js","assets/utils-C55XrdHj.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-B7G0hGYD.js","assets/withTransactionSidePanel-LJitfor3.js","assets/useAskAiCfoHostNavButtonProps-GW3aOOUV.js","assets/TransactionDetailScreen-DKDiKxK4.js","assets/decodeURIComponentSafe-7TTqX1My.js","assets/useInitialThreadRequest-rwXc-zR2.js","assets/routePaths-B56KGAwY.js","assets/expenseAutomationHelper-DNfzvs5h.js","assets/stripSplatSuffix-Bc1c61un.js","assets/reportTimeframe-C4q_PyKL.js","assets/analyticsHelper-USl63sKg.js","assets/CompanyPassportScreen-DzTS_PxV.js","assets/MobileAppDrawer-DYOb_3zl.js","assets/InboxNotificationsProvider-CzZNeGt1.js","assets/useTaskManagerAccess-Bq4KBSvW.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Cj21wv_W.js","assets/FeaturePreviewScreen-CZZbV-Lj.js","assets/BillPayRoutes-D7EPBDh7.js","assets/AddressScreen-DIx8pAlP.js","assets/DomesticWireDetailScreen-BNWRfTvg.js","assets/BusinessVerificationPageScreen-DMccZcIL.js","assets/DrawerScreen-DEMkXBuJ.js","assets/SetupPagesScreen-D-sIYsOb.js","assets/BillPayApprovalRoutes-nVb6rKwz.js","assets/useEnsureVendorListLoaded-DT9MJB3G.js","assets/ReimbursementApprovalRuleDetailScreen-BVAueb7P.js","assets/getLocaleForTenant-GRoZrOtf.js","assets/ReimbursementRoutes-B8-BBslS.js","assets/ReimbursementApprovalRoutes-BikedZ_D.js","assets/TransactionListRoutes-dt9sGf6m.js","assets/ZeniAccountStatementScreen-qY5rQsAd.js","assets/SettingsRoutes-D1KLQYfe.js","assets/AccountMappingScreen-BVoif-LS.js","assets/QBOConnectionScreen-BJEzxzvn.js","assets/empty-CY_o0w8p.js","assets/index-BXFluF17.js","assets/url-alEaciYB.js","assets/index-C7OizTrs.js","assets/accountMappingHelper-BV1cQq3A.js","assets/useEmailConnectResultRefresh-BL7F1fI2.js","assets/ReportsRoutes-BLQeDL9q.js","assets/ChargeCardRoutes-rF3I93wy.js","assets/useChargeCardPusherEvents-BkaiNEUC.js","assets/PeopleRoutes-BWw5-zAe.js","assets/ExpenseAutomationRoutes-DcYDpqvS.js","assets/useActualMatchingMatchDetail-DC73Os7S.js","assets/ScheduleDetailsPrepaidExpensesScreen-BTeNJoD-.js","assets/pathToGoBack-Djr4VFL1.js","assets/TreasuryRoutes-CuCdm5Gl.js","assets/VendorsRoutes--pMAMDSH.js","assets/ZeniAccountRoutes-CWyEeR9A.js","assets/AddressRoutes-CTdswws_.js","assets/PandLWithForecastRoutes-77IqlyFS.js","assets/CustomerOnboardingRoutes-DyQugrQS.js","assets/TransactionDetailRoutes-CPgOmOJv.js","assets/EntityDetailRoutes-DlCSk6Xj.js","assets/InvoicingRoutes-BZEd2Xd_.js","assets/NotificationRoutes-DdgV7jbI.js","assets/PerformanceRoutes-DMlk1Yfb.js","assets/ActualMatchingMatchDetailScreen-37ukErZ3.js","assets/RewardsRoutes-BeComSZ4.js","assets/TaskRoutes-gD6fXeIa.js","assets/TaskListScreen-3oMHbvzs.js","assets/useTaskManagerPusherEvents-DiYOmCQ4.js","assets/AiCfoScreen-bkTvdFWM.js","assets/CardsAiCfoScreen-Cys2hC2x.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bo as gs,dk as Rs,ca as Is,gM as js,gc as Ts,dh as pe,cI as As,gq as bs,cA as fs,bG as Ds,br as ys,UX as Cs,v as vs,U_ as Os,bq as Ps,U$ as Us,bM as ws,bL as Fs,bu as Ls,cw as Vs,V0 as ks,V1 as Hs,dc as Bs,df as Ss,de as Ns,cH as Ms,cO as Zs,pW as xe,gl as ge,h0 as $s,gn as Re,gO as Ie,gP as je,go as Gs}from"./zeni-epic-state-VpP2uC41.js";import{j as e}from"./liveblocks-DQb3Em37.js";import{a as U}from"./sentry-bn66aQBn.js";import{N as u,u as zs,h as qs,i as Ws,g as Ys,j as $,q as Te,n as Xs,o as n}from"./core-C1WlT0Gj.js";import{I as l,u as Ks,z as y,p as Js,e as Qs,r as et,c as S,g as st,K as tt,V as nt,L as F,G as Ae,t as _,P as at,M as ot,j as ne}from"./index-BaogokNB.js";import{u as rt}from"./mui-D2HFTrjh.js";import{f as be}from"./analyticsHelper-USl63sKg.js";import{t as it}from"./getLocaleForTenant-GRoZrOtf.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="447949b4-2c90-42fe-9579-d87fb1859693",o._sentryDebugIdIdentifier="sentry-dbid-447949b4-2c90-42fe-9579-d87fb1859693")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-hP5G-uHy.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(fe,{tenantEmailDomain:v});if(O)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(fe,{tenantEmailDomain:v}):O?e.jsx(ye,{tenantEmailDomain:v}):f?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-B7G0hGYD.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-D7EPBDh7.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-B8-BBslS.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-dt9sGf6m.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-D1KLQYfe.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-BLQeDL9q.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-rF3I93wy.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-BWw5-zAe.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-DcYDpqvS.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-CuCdm5Gl.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--pMAMDSH.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-CWyEeR9A.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]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-BLQeDL9q.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),ht=l((()=>s((()=>import("./AddressRoutes-CTdswws_.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-BWw5-zAe.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-77IqlyFS.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-DyQugrQS.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),gt=l((()=>s((()=>import("./VendorsRoutes--pMAMDSH.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])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-CPgOmOJv.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-DlCSk6Xj.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-B7G0hGYD.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])))),ve=l((()=>s((()=>import("./BillPayRoutes-D7EPBDh7.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])))),jt=l((()=>s((()=>import("./SettingsRoutes-D1KLQYfe.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])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-BZEd2Xd_.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-B8-BBslS.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])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-CWyEeR9A.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])))),bt=l((()=>s((()=>import("./TreasuryRoutes-CuCdm5Gl.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-dt9sGf6m.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),Dt=l((()=>s((()=>import("./ChargeCardRoutes-rF3I93wy.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-DdgV7jbI.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-DMlk1Yfb.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-DcYDpqvS.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])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-37ukErZ3.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Pt=l((()=>s((()=>import("./RewardsRoutes-BeComSZ4.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),Ut=l((()=>s((()=>import("./TaskRoutes-gD6fXeIa.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-bkTvdFWM.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-Cys2hC2x.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-hP5G-uHy.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-3oMHbvzs.js").then((o=>o.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=zs(),N=qs(),{tenantEmailDomain:i}=Ws(),V=rt().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Ks(),D=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),X=hs(j),G=Ys(),[L,we]=U.useState(!1),r=$((a=>Es(a))),{useFeatureGate:H}=Js(),M=Qs(),K=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,J=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,ke=st(r,Ve,oe),{isCardsHidden:He}=tt(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=$((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,V)}const Z={tenantId:D,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ge=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=Ds(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?f(Cs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),U.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,f,y]),U.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,f,qe))}),[D]),U.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){B(Re(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(Gs(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,j,O,f))}),[D,p]),U.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&be(j,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(v(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=U.useRef(!1);U.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const P=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:We}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=H(S.isAccrualEnabled),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Be&&!P,Je=Us(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!P,ss=Le&&!P,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Vs(E?.loggedInUserRoleMap),os=ks(E?.loggedInUserRoleMap),rs=Hs(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),g=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&g,R=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ge===!0||Je===!0||os===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(j!=null&&T!=="In-Progress"&&f(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||X&&!ee)&&es&&Qe!==!0&&h===!1&&J===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||X?!L||te!==!1||ee||X?L&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Xs,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Xe||Ke?e.jsx(Rt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(ft,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ut,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&P===!1?e.jsx(vt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&P===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(gt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Pt,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,$t as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-aNGbN_zE.js","assets/sentry-BFx1l1Aw.js","assets/core-8RY6xs4-.js","assets/zeni-epic-state-uqmWoDAg.js","assets/index-Bh_fLBtD.js","assets/mui-DlnMF8jT.js","assets/analytics-LExiZ3ZJ.js","assets/utils-DTvrFNdP.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-DTuwgG58.js","assets/withTransactionSidePanel-Du9j39QN.js","assets/useAskAiCfoHostNavButtonProps-D0weyruJ.js","assets/TransactionDetailScreen-2sQ-Mt7I.js","assets/decodeURIComponentSafe-EETpxpfb.js","assets/useInitialThreadRequest-DlNol2qu.js","assets/routePaths-Cc8-vBzD.js","assets/expenseAutomationHelper-jyZ4R3Ja.js","assets/stripSplatSuffix-ogsvQMku.js","assets/reportTimeframe-BU3vOF4Q.js","assets/analyticsHelper-D5rI-ENk.js","assets/CompanyPassportScreen-hEm4apSc.js","assets/MobileAppDrawer-DosePlrQ.js","assets/InboxNotificationsProvider-D3zL6WrJ.js","assets/useTaskManagerAccess-D4gSk69T.js","assets/useAiCfoDashboardSuggestedQuestionsChips-ByRfEwhA.js","assets/FeaturePreviewScreen-BObKMLAH.js","assets/BillPayRoutes-BuBG1IC0.js","assets/AddressScreen-DeDeG-XR.js","assets/DomesticWireDetailScreen-BNS_qk21.js","assets/BusinessVerificationPageScreen-89ePZPDL.js","assets/DrawerScreen-C0qnwAy6.js","assets/SetupPagesScreen-DJoEUyNN.js","assets/BillPayApprovalRoutes-TRXWH-VY.js","assets/useEnsureVendorListLoaded-BrBoOaNm.js","assets/ReimbursementApprovalRuleDetailScreen-BpQcXp03.js","assets/getLocaleForTenant-D6WnKMyI.js","assets/ReimbursementRoutes-CkP2voMl.js","assets/ReimbursementApprovalRoutes-CAcLiboU.js","assets/TransactionListRoutes-XEXTkljY.js","assets/ZeniAccountStatementScreen-CpeKlroP.js","assets/SettingsRoutes-90A2f0TW.js","assets/AccountMappingScreen-DgVWUa5y.js","assets/QBOConnectionScreen-CYlwll2k.js","assets/empty-CHwSQ8Uo.js","assets/index-Dper9bLO.js","assets/url-DaHSLsIc.js","assets/index-pySAvyZk.js","assets/accountMappingHelper-BwNhMocq.js","assets/useEmailConnectResultRefresh-DxZYJWI7.js","assets/ReportsRoutes-B4N1RhcC.js","assets/ChargeCardRoutes-BmRjwPqQ.js","assets/useChargeCardPusherEvents-CuGZv5rZ.js","assets/PeopleRoutes-GpfmZrhl.js","assets/ExpenseAutomationRoutes-CLHRK7OQ.js","assets/useActualMatchingMatchDetail-CprHhbVG.js","assets/ScheduleDetailsPrepaidExpensesScreen-BV2oCu5B.js","assets/pathToGoBack-BQTQkAq4.js","assets/TreasuryRoutes-DmOGKdEC.js","assets/VendorsRoutes-BMO8xM6w.js","assets/ZeniAccountRoutes-BKpndSn1.js","assets/AddressRoutes-B9C6RRJ_.js","assets/PandLWithForecastRoutes-ByzBxefz.js","assets/CustomerOnboardingRoutes-B0e21wY_.js","assets/TransactionDetailRoutes-DFsMqUzD.js","assets/EntityDetailRoutes-BqtBHlH-.js","assets/InvoicingRoutes-QtaDX-CT.js","assets/NotificationRoutes-0YyWjFjS.js","assets/PerformanceRoutes-hCnsbHyb.js","assets/ActualMatchingMatchDetailScreen-DvQ9M9-A.js","assets/RewardsRoutes-CPMf7r7a.js","assets/TaskRoutes-Pc6Ssunb.js","assets/TaskListScreen-RmY47KcA.js","assets/useTaskManagerPusherEvents-Bi0TYVNl.js","assets/AiCfoScreen-DrbIK8x6.js","assets/CardsAiCfoScreen-DX5vDEdF.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bo as gs,dk as Rs,ca as Is,gM as js,gc as Ts,dh as pe,cI as As,gq as bs,cA as fs,bG as Ds,br as ys,UX as Cs,v as vs,U_ as Os,bq as Ps,U$ as Us,bM as ws,bL as Fs,bu as Ls,cw as Vs,V0 as ks,V1 as Hs,dc as Bs,df as Ss,de as Ns,cH as Ms,cO as Zs,pW as xe,gl as ge,h0 as $s,gn as Re,gO as Ie,gP as je,go as Gs}from"./zeni-epic-state-uqmWoDAg.js";import{j as e}from"./liveblocks-DIQuw_Y9.js";import{a as U}from"./sentry-BFx1l1Aw.js";import{N as u,u as zs,h as qs,i as Ws,g as Ys,j as $,q as Te,n as Xs,o as n}from"./core-8RY6xs4-.js";import{I as l,u as Ks,z as y,p as Js,e as Qs,r as et,c as S,g as st,K as tt,V as nt,L as F,G as Ae,t as _,P as at,M as ot,j as ne}from"./index-Bh_fLBtD.js";import{u as rt}from"./mui-DlnMF8jT.js";import{f as be}from"./analyticsHelper-D5rI-ENk.js";import{t as it}from"./getLocaleForTenant-D6WnKMyI.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="447949b4-2c90-42fe-9579-d87fb1859693",o._sentryDebugIdIdentifier="sentry-dbid-447949b4-2c90-42fe-9579-d87fb1859693")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-aNGbN_zE.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(fe,{tenantEmailDomain:v});if(O)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(fe,{tenantEmailDomain:v}):O?e.jsx(ye,{tenantEmailDomain:v}):f?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-DTuwgG58.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-BuBG1IC0.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-CkP2voMl.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-XEXTkljY.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-90A2f0TW.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-B4N1RhcC.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-BmRjwPqQ.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-GpfmZrhl.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CLHRK7OQ.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-DmOGKdEC.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-BMO8xM6w.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-BKpndSn1.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]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-B4N1RhcC.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),ht=l((()=>s((()=>import("./AddressRoutes-B9C6RRJ_.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-GpfmZrhl.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-ByzBxefz.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-B0e21wY_.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-BMO8xM6w.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])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-DFsMqUzD.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-BqtBHlH-.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-DTuwgG58.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])))),ve=l((()=>s((()=>import("./BillPayRoutes-BuBG1IC0.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])))),jt=l((()=>s((()=>import("./SettingsRoutes-90A2f0TW.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])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-QtaDX-CT.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-CkP2voMl.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])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-BKpndSn1.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])))),bt=l((()=>s((()=>import("./TreasuryRoutes-DmOGKdEC.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-XEXTkljY.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),Dt=l((()=>s((()=>import("./ChargeCardRoutes-BmRjwPqQ.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-0YyWjFjS.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-hCnsbHyb.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-CLHRK7OQ.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])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-DvQ9M9-A.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Pt=l((()=>s((()=>import("./RewardsRoutes-CPMf7r7a.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),Ut=l((()=>s((()=>import("./TaskRoutes-Pc6Ssunb.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-DrbIK8x6.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-DX5vDEdF.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-aNGbN_zE.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-RmY47KcA.js").then((o=>o.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=zs(),N=qs(),{tenantEmailDomain:i}=Ws(),V=rt().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Ks(),D=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),X=hs(j),G=Ys(),[L,we]=U.useState(!1),r=$((a=>Es(a))),{useFeatureGate:H}=Js(),M=Qs(),K=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,J=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,ke=st(r,Ve,oe),{isCardsHidden:He}=tt(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=$((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,V)}const Z={tenantId:D,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ge=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=Ds(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?f(Cs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),U.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,f,y]),U.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,f,qe))}),[D]),U.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){B(Re(t));const Y=y.getSignedInUserTenantWithId(t);Y?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const Y=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(Gs(d.userId,t,d.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,j,O,f))}),[D,p]),U.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&be(j,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(v(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=U.useRef(!1);U.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const P=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:We}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:Ye}=H(S.isAccrualEnabled),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Be&&!P,Je=Us(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!P,ss=Le&&!P,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Vs(E?.loggedInUserRoleMap),os=ks(E?.loggedInUserRoleMap),rs=Hs(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),g=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&g,R=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ge===!0||Je===!0||os===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(j!=null&&T!=="In-Progress"&&f(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||X&&!ee)&&es&&Qe!==!0&&h===!1&&J===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||X?!L||te!==!1||ee||X?L&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Xs,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Xe||Ke?e.jsx(Rt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(ft,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ut,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&P===!1?e.jsx(vt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&P===!1&&Ye===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(gt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Pt,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,$t as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DQb3Em37.js";import{a as d}from"./sentry-bn66aQBn.js";import{h as O,g as K,u as U,i as L,j as C,l as H,n as J,o as k}from"./core-C1WlT0Gj.js";import{fI as v,_o as je,Oa as Pe,ZX as ve,_4 as we,ca as X,cV as Ae,cW as De,bq as Ue,dg as Re,Gs as Te,_p as Me,PD as Be,N1 as Ve,MU as de,MR as Ne,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Fe,ly as $,lB as me,_q as Oe,mL as Le,GN as Ge,Wp as Ze,Wq as $e,lw as Ke,_r as He,lz as We,uL as qe,Wk as ze,Wl as Je,uP as Qe,hZ as Xe,Vi as z,hR as ae,hO as Ye,hW as en,Vj as nn,GK as tn,_s as an,_t as on,Ni as sn,m3 as rn,e0 as fe,e1 as he,_u as ln,gF as cn,Vy as dn,GJ as oe,gK as se,gJ as un,GI as pn,gI as gn,gH as mn,_v as fn,UK as Ce,_w as hn,_x as Cn,_y as yn,_z as Sn,_A as bn,_B as In,GQ as xn,_C as En,GH as ie,GB as Z,_D as kn,_E as _n,_F as re,_G as jn,dV as Pn,_H as vn,_I as wn,_J as An,UW as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_K as Bn,c6 as Vn,c5 as Nn,c7 as Fn,c4 as On}from"./zeni-epic-state-VpP2uC41.js";import{bU as Ln,z as P,V as G,a5 as ne,c4 as Gn,j as W,p as te,c as N,g as ye,K as Se,c5 as Zn,h as $n,W as be,c6 as Kn,ag as Hn,c7 as Wn,c8 as qn,ao as zn,c9 as Jn,k as Qn,d as Ie,ca as Xn}from"./index-BaogokNB.js";import{n as B}from"./mui-D2HFTrjh.js";import{u as xe}from"./useTaskManagerAccess-Bq4KBSvW.js";import{U as Yn}from"./AccountMappingScreen-BVoif-LS.js";import{t as et,A as nt}from"./AddressScreen-DIx8pAlP.js";import F from"./NotFoundScreen-hP5G-uHy.js";import{g as tt}from"./analyticsHelper-USl63sKg.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DMccZcIL.js";import{C as st}from"./CompanyPassportScreen-DzTS_PxV.js";import{M as T}from"./MobileAppDrawer-DYOb_3zl.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-BL7F1fI2.js";import{q as le}from"./QBOConnectionScreen-BJEzxzvn.js";import{B as lt}from"./BillPayApprovalRoutes-nVb6rKwz.js";import{R as ct}from"./ReimbursementApprovalRoutes-BikedZ_D.js";import"./recharts-Cqzw8WNA.js";import"./analytics-Cfs2G4_3.js";import"./plaid-D36sgvQh.js";import"./dnd-B-4X27-9.js";import"./stripe-cKAAJElX.js";import"./lottie-B_xwqN2A.js";import"./lexical-Dmnf9NSK.js";import"./pdf-DDFs-jyU.js";import"./utils-C55XrdHj.js";import"./accountMappingHelper-BV1cQq3A.js";import"./routePaths-B56KGAwY.js";import"./InboxNotificationsProvider-CzZNeGt1.js";import"./empty-CY_o0w8p.js";import"./pdf-lib-uEuVq1x5.js";import"./index-BXFluF17.js";import"./url-alEaciYB.js";import"./index-C7OizTrs.js";import"./decodeURIComponentSafe-7TTqX1My.js";import"./useEnsureVendorListLoaded-DT9MJB3G.js";import"./ReimbursementApprovalRuleDetailScreen-BVAueb7P.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]="4535dd77-041b-4934-9589-153673e37b63",e._sentryDebugIdIdentifier="sentry-dbid-4535dd77-041b-4934-9589-153673e37b63")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-DIQuw_Y9.js";import{a as d}from"./sentry-BFx1l1Aw.js";import{h as O,g as K,u as U,i as L,j as C,l as H,n as J,o as k}from"./core-8RY6xs4-.js";import{fI as v,_o as je,Oa as Pe,ZX as ve,_4 as we,ca as X,cV as Ae,cW as De,bq as Ue,dg as Re,Gs as Te,_p as Me,PD as Be,N1 as Ve,MU as de,MR as Ne,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Fe,ly as $,lB as me,_q as Oe,mL as Le,GN as Ge,Wp as Ze,Wq as $e,lw as Ke,_r as He,lz as We,uL as qe,Wk as ze,Wl as Je,uP as Qe,hZ as Xe,Vi as z,hR as ae,hO as Ye,hW as en,Vj as nn,GK as tn,_s as an,_t as on,Ni as sn,m3 as rn,e0 as fe,e1 as he,_u as ln,gF as cn,Vy as dn,GJ as oe,gK as se,gJ as un,GI as pn,gI as gn,gH as mn,_v as fn,UK as Ce,_w as hn,_x as Cn,_y as yn,_z as Sn,_A as bn,_B as In,GQ as xn,_C as En,GH as ie,GB as Z,_D as kn,_E as _n,_F as re,_G as jn,dV as Pn,_H as vn,_I as wn,_J as An,UW as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_K as Bn,c6 as Vn,c5 as Nn,c7 as Fn,c4 as On}from"./zeni-epic-state-uqmWoDAg.js";import{bU as Ln,z as P,V as G,a5 as ne,c4 as Gn,j as W,p as te,c as N,g as ye,K as Se,c5 as Zn,h as $n,W as be,c6 as Kn,ag as Hn,c7 as Wn,c8 as qn,ao as zn,c9 as Jn,k as Qn,d as Ie,ca as Xn}from"./index-Bh_fLBtD.js";import{n as B}from"./mui-DlnMF8jT.js";import{u as xe}from"./useTaskManagerAccess-D4gSk69T.js";import{U as Yn}from"./AccountMappingScreen-DgVWUa5y.js";import{t as et,A as nt}from"./AddressScreen-DeDeG-XR.js";import F from"./NotFoundScreen-aNGbN_zE.js";import{g as tt}from"./analyticsHelper-D5rI-ENk.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-89ePZPDL.js";import{C as st}from"./CompanyPassportScreen-hEm4apSc.js";import{M as T}from"./MobileAppDrawer-DosePlrQ.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DxZYJWI7.js";import{q as le}from"./QBOConnectionScreen-CYlwll2k.js";import{B as lt}from"./BillPayApprovalRoutes-TRXWH-VY.js";import{R as ct}from"./ReimbursementApprovalRoutes-CAcLiboU.js";import"./recharts-eszpIgqD.js";import"./analytics-LExiZ3ZJ.js";import"./plaid-Cml2d2AI.js";import"./dnd-kzApZ30A.js";import"./stripe-cKAAJElX.js";import"./lottie-BTborGkK.js";import"./lexical-CfpKXz7n.js";import"./pdf-CkEJTjrf.js";import"./utils-DTvrFNdP.js";import"./accountMappingHelper-BwNhMocq.js";import"./routePaths-Cc8-vBzD.js";import"./InboxNotificationsProvider-D3zL6WrJ.js";import"./empty-CHwSQ8Uo.js";import"./pdf-lib-BnMOX36_.js";import"./index-Dper9bLO.js";import"./url-DaHSLsIc.js";import"./index-pySAvyZk.js";import"./decodeURIComponentSafe-EETpxpfb.js";import"./useEnsureVendorListLoaded-BrBoOaNm.js";import"./ReimbursementApprovalRuleDetailScreen-BpQcXp03.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]="4535dd77-041b-4934-9589-153673e37b63",e._sentryDebugIdIdentifier="sentry-dbid-4535dd77-041b-4934-9589-153673e37b63")}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-DQb3Em37.js";import{h as Y,g as Q,u as ee,i as W,j as k,N as R,l as G,t as en}from"./core-C1WlT0Gj.js";import{bL as nn,fI as V,cI as tn,Ik as q,ZX as an,Z_ as sn,v2 as ne,uS as te,mD as ae,C6 as N,_0 as be,gJ as Ge,gI as He,gH as Ke,_1 as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as X,MX as Ae,M_ as _e,N4 as ke,CA as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,_2 as yn,Lw as fe,M8 as fn,_3 as gn,bM as Sn,Om as ge,Oa as bn,_4 as Cn,_5 as hn,Oq as In,Ou as An,_6 as je,B$ as _n,T3 as kn,_7 as vn,_8 as Pn,_9 as Tn,_a as Je,_b as En,_c as Dn,W8 as Un,Zc as On,Wn as wn,_d as qe,MI as Fn,MA as Vn,Wo as xn,ME as Bn,_e as Oe,Pa as Xe,mL as jn,uV as Ye,C8 as Rn,bG as Re,Ck as Le,cG as Ln,_f as Qe,P0 as we,OJ as Nn,OK as Mn,OO as zn,_g as Zn,P3 as Ne,_h as $n,_i as Wn,_j as Gn,PR as Se,_k as Hn,gZ as Kn,JF as Jn,_l as qn,JK as Xn,JJ as Yn}from"./zeni-epic-state-VpP2uC41.js";import{ag as Pe,V as ie,p as de,c as J,z as E,a6 as se,j as D,a5 as Te,O as $,bR as Qn,ac as oe,bS as x,bj as Ve,bT as et,bU as nt,bV as tt,o as Be,bW as at,k as Me,aE as ze,$ as it,a9 as st,bX as ot,bY as ct,bZ as rt,w as ut}from"./index-BaogokNB.js";import{a as h}from"./sentry-bn66aQBn.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-D2HFTrjh.js";import{u as pt,d as Ze,B as Ue}from"./BusinessVerificationPageScreen-DMccZcIL.js";import{M as le}from"./MobileAppDrawer-DYOb_3zl.js";import L from"./NotFoundScreen-hP5G-uHy.js";import{a as $e}from"./analyticsHelper-USl63sKg.js";import{d as We}from"./routePaths-B56KGAwY.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]="def18639-b007-4bec-9488-a568a0fced50",e._sentryDebugIdIdentifier="sentry-dbid-def18639-b007-4bec-9488-a568a0fced50")}catch{}})();const mt=xe.div`
1
+ import{j as u}from"./liveblocks-DIQuw_Y9.js";import{h as Y,g as Q,u as ee,i as W,j as k,N as R,l as G,t as en}from"./core-8RY6xs4-.js";import{bL as nn,fI as V,cI as tn,Ik as q,ZX as an,Z_ as sn,v2 as ne,uS as te,mD as ae,C6 as N,_0 as be,gJ as Ge,gI as He,gH as Ke,_1 as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as X,MX as Ae,M_ as _e,N4 as ke,CA as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,_2 as yn,Lw as fe,M8 as fn,_3 as gn,bM as Sn,Om as ge,Oa as bn,_4 as Cn,_5 as hn,Oq as In,Ou as An,_6 as je,B$ as _n,T3 as kn,_7 as vn,_8 as Pn,_9 as Tn,_a as Je,_b as En,_c as Dn,W8 as Un,Zc as On,Wn as wn,_d as qe,MI as Fn,MA as Vn,Wo as xn,ME as Bn,_e as Oe,Pa as Xe,mL as jn,uV as Ye,C8 as Rn,bG as Re,Ck as Le,cG as Ln,_f as Qe,P0 as we,OJ as Nn,OK as Mn,OO as zn,_g as Zn,P3 as Ne,_h as $n,_i as Wn,_j as Gn,PR as Se,_k as Hn,gZ as Kn,JF as Jn,_l as qn,JK as Xn,JJ as Yn}from"./zeni-epic-state-uqmWoDAg.js";import{ag as Pe,V as ie,p as de,c as J,z as E,a6 as se,j as D,a5 as Te,O as $,bR as Qn,ac as oe,bS as x,bj as Ve,bT as et,bU as nt,bV as tt,o as Be,bW as at,k as Me,aE as ze,$ as it,a9 as st,bX as ot,bY as ct,bZ as rt,w as ut}from"./index-Bh_fLBtD.js";import{a as h}from"./sentry-BFx1l1Aw.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-DlnMF8jT.js";import{u as pt,d as Ze,B as Ue}from"./BusinessVerificationPageScreen-89ePZPDL.js";import{M as le}from"./MobileAppDrawer-DosePlrQ.js";import L from"./NotFoundScreen-aNGbN_zE.js";import{a as $e}from"./analyticsHelper-D5rI-ENk.js";import{d as We}from"./routePaths-Cc8-vBzD.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]="def18639-b007-4bec-9488-a568a0fced50",e._sentryDebugIdIdentifier="sentry-dbid-def18639-b007-4bec-9488-a568a0fced50")}catch{}})();const mt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;