@zeniai/web-app-ui 5.0.78-prod → 5.0.79-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/assets/AddressRoutes-VNiW4zFt.js +1 -0
  2. package/dist/assets/AddressScreen-zAEAr0cm.js +9 -0
  3. package/dist/assets/{AiCfoScreen-A8Awkqi8.js → AiCfoScreen-CEp0H39c.js} +3 -3
  4. package/dist/assets/BillPayApprovalRoutes-DdepEMNI.js +1 -0
  5. package/dist/assets/{BillPayRoutes-Dq3yQ57P.js → BillPayRoutes-BFjD0YEd.js} +26 -26
  6. package/dist/assets/BusinessVerificationPageScreen-C2DktOhf.js +9 -0
  7. package/dist/assets/{ChargeCardRoutes-DP2t_uhH.js → ChargeCardRoutes-DzXM12p0.js} +9 -9
  8. package/dist/assets/CompanyPassportScreen-2RC9cNYm.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-Cz8BO1Qy.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-C11rmqMq.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-Dz9NWWrJ.js +23 -0
  12. package/dist/assets/{DashboardRoutes-CAQmzY7M.js → DashboardRoutes-AodiBc0C.js} +4 -4
  13. package/dist/assets/{DefaultTenantHome-BuA42TgC.js → DefaultTenantHome-VZ9caScB.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-D3cRlBJq.js +18 -0
  15. package/dist/assets/DrawerScreen-DrA0_hQo.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-Htc-mXG5.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-Ctsyj1qb.js → ExpenseAutomationRoutes-hDXdzNbj.js} +5 -5
  18. package/dist/assets/FeaturePreviewScreen-9JeQ0IeJ.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-rCTFotPG.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-c-ICkHeA.js → MagicLinkRoutes-Bk573e_F.js} +8 -8
  21. package/dist/assets/MagicLinkSignInScreen-C8DIoYNk.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-DSgPRxOv.js → MobileAppDrawer-DDKkJ918.js} +1 -1
  23. package/dist/assets/NotFoundScreen-vkDXbz0R.js +1 -0
  24. package/dist/assets/NotificationRoutes-BCGxlZOG.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-CL6akwVK.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-Br2Ee7zc.js +1 -0
  27. package/dist/assets/PeopleRoutes-g3ceR6fI.js +22 -0
  28. package/dist/assets/PerformanceRoutes-BX5shptQ.js +1 -0
  29. package/dist/assets/{Preview-CzTmVH5B.js → Preview-x7C1SnY9.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DVWXlQxR.js → QBOConnectionScreen-C0EWfqqq.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-Dk4OhEOh.js → ReferralListScreen-DtKoNKFt.js} +2 -2
  32. package/dist/assets/ReimbursementApprovalRoutes-DfPsMGzz.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CvAjyFdG.js → ReimbursementApprovalRuleDetailScreen-CQFzG62_.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-LJv5ZEhb.js → ReimbursementRoutes-49Rieggp.js} +7 -7
  35. package/dist/assets/ReportsRoutes-BScMXjBF.js +1 -0
  36. package/dist/assets/RewardsRoutes-DN1QCtTK.js +1 -0
  37. package/dist/assets/ScreenRoutes-u3IHYIz2.js +2 -0
  38. package/dist/assets/{SettingsRoutes-CN1RB2Kk.js → SettingsRoutes-D6YwI1A0.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-B1u5XXT5.js → SetupPagesScreen-HxvWGUNa.js} +5 -5
  40. package/dist/assets/SignInScreen-CQSFtM1Y.js +1 -0
  41. package/dist/assets/SignOutScreen-Cje6a06U.js +9 -0
  42. package/dist/assets/TaskListScreen-B_GnE7cK.js +9 -0
  43. package/dist/assets/TaskRoutes-B384KfDT.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-BKgQg9gp.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-CVJIejMp.js → TransactionDetailScreen-BkrtxHZ2.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-nDA_htng.js → TransactionListRoutes-DhFIr0h0.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-BNUkMK5W.js → TreasuryRoutes-D0IWSqF8.js} +6 -6
  48. package/dist/assets/{VendorsRoutes-CpWLxCM4.js → VendorsRoutes-KHi82m-_.js} +22 -22
  49. package/dist/assets/WiseConfirmationScreen-ZNfVKLHA.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-Db8jzNqV.js → ZeniAccountRoutes-wwixhMEJ.js} +12 -12
  51. package/dist/assets/ZeniAccountStatementScreen-Bk1Pha4F.js +9 -0
  52. package/dist/assets/{accountMappingHelper-CT28maj0.js → accountMappingHelper-Ce_vl0gX.js} +1 -1
  53. package/dist/assets/{analytics-Br8sYi51.js → analytics-CYNkDTSy.js} +1 -1
  54. package/dist/assets/{analyticsHelper-CUa_2Hxt.js → analyticsHelper-Db94ox0D.js} +1 -1
  55. package/dist/assets/{core-BUa4y4mL.js → core-DS-Czzkv.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-CRJGdpaG.js → decodeURIComponentSafe-BUgIzLPe.js} +1 -1
  57. package/dist/assets/{dnd-Dl4N7fBZ.js → dnd-B781yOiO.js} +1 -1
  58. package/dist/assets/{empty-B90Uv9-T.js → empty-BVRicoJe.js} +1 -1
  59. package/dist/assets/{empty-BR4JY50t.js → empty-BW6MrnJi.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-tnCNovqO.js → emptyVideoElement-qUB1PF8Z.js} +1 -1
  61. package/dist/assets/epic-BNsqfRJa.js +2 -0
  62. package/dist/assets/getLocaleForTenant-bt_-bwkg.js +1 -0
  63. package/dist/assets/{index-CHewEF_r.js → index-BIUN5C-2.js} +1 -1
  64. package/dist/assets/{index-2Xf81mMP.js → index-BnFuYygs.js} +1 -1
  65. package/dist/assets/{index-BChjK39b.js → index-CW8nCWyD.js} +2 -2
  66. package/dist/assets/{index-BphHrMlb.js → index-D3TculOd.js} +1 -1
  67. package/dist/assets/{index-BlE_QRZ7.js → index-DZw5cZyY.js} +1 -1
  68. package/dist/assets/{index-BqVUPrfN.js → index-KYBDOcEA.js} +12744 -12716
  69. package/dist/assets/{index-xcm_ApEH.js → index-P6artprw.js} +1 -1
  70. package/dist/assets/{index-B46Qh1vA.js → index-_F7gR_zT.js} +1 -1
  71. package/dist/assets/{lexical-gklPXKki.js → lexical-DZ3pAnkc.js} +1 -1
  72. package/dist/assets/{liveblocks-JFc2ySVL.js → liveblocks-BLWCZxXF.js} +1 -1
  73. package/dist/assets/{lottie-tfFSHGOM.js → lottie-DuFs7GNB.js} +1 -1
  74. package/dist/assets/{mui-RJ5XtWIj.js → mui-DeKIqdeR.js} +1 -1
  75. package/dist/assets/{pathToGoBack-UH0xKv_w.js → pathToGoBack-BXYS_je9.js} +1 -1
  76. package/dist/assets/{pdf-DyXQZDfv.js → pdf-Co6rX9Tl.js} +3 -3
  77. package/dist/assets/{pdf-lib-DQ75GOuH.js → pdf-lib-CqpoMVUd.js} +1 -1
  78. package/dist/assets/{plaid-M6xkDuEc.js → plaid-Dyu1hAU2.js} +1 -1
  79. package/dist/assets/{pusher-9Pzhq4pa.js → pusher-OyTTrvJD.js} +1 -1
  80. package/dist/assets/{react-DtBTgNL_.js → react-BSux8eVn.js} +1 -1
  81. package/dist/assets/{react-tmTSBFJN.js → react-BaqI5eTn.js} +1 -1
  82. package/dist/assets/{react-B-lMEwuQ.js → react-BiQHsRc-.js} +1 -1
  83. package/dist/assets/{react-CbK-iBIw.js → react-BoFCiaud.js} +1 -1
  84. package/dist/assets/{react-Dm8DL33B.js → react-BqBM4ptm.js} +1 -1
  85. package/dist/assets/{react-Cy7gL0rm.js → react-BrEHhFCn.js} +1 -1
  86. package/dist/assets/{recharts-CPOd-6nk.js → recharts-BV8xDSZo.js} +1 -1
  87. package/dist/assets/{routePaths-FsWFCrEG.js → routePaths-BgR0bMMr.js} +1 -1
  88. package/dist/assets/{sentry-DbhlVCDx.js → sentry-BweJUVSU.js} +1 -1
  89. package/dist/assets/{url-BVyZWqxl.js → url-B26fnakI.js} +1 -1
  90. package/dist/assets/{url-BdgRfFdn.js → url-CluwUD6c.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-eM31eQ25.js +1 -0
  92. package/dist/assets/{useDeviceId-BqTcE7B1.js → useDeviceId-eKf2uZLe.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-HdAnpaOw.js → useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-BwBVCvna.js → useInitialThreadRequest-GwPuAy0h.js} +1 -1
  95. package/dist/assets/{utils-jfneV6S1.js → utils-D7Uun_Ak.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-_HCg7dnz.js → withTransactionSidePanel-BxEYZshS.js} +2 -2
  97. package/dist/assets/{zeni-epic-state-CGaNHYyd.js → zeni-epic-state-CH3oUd_o.js} +5 -5
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -4
  100. package/dist/assets/AddressRoutes-D1tOHYbp.js +0 -1
  101. package/dist/assets/AddressScreen-YA46n52j.js +0 -9
  102. package/dist/assets/BillPayApprovalRoutes-NVMWEPu0.js +0 -1
  103. package/dist/assets/BusinessVerificationPageScreen-CgOqYGYR.js +0 -9
  104. package/dist/assets/CompanyPassportScreen-CJkXrH5j.js +0 -1
  105. package/dist/assets/ConnectionAuthScreen-DkkZ1Fif.js +0 -11
  106. package/dist/assets/CustomerOnboardingAuthScreen-CaRVOe5Q.js +0 -1
  107. package/dist/assets/CustomerOnboardingRoutes-BOQ5oKh7.js +0 -23
  108. package/dist/assets/DomesticWireDetailScreen-2MNzySFr.js +0 -18
  109. package/dist/assets/DrawerScreen-uJ_3Dk8M.js +0 -1
  110. package/dist/assets/EntityDetailRoutes-DAqHSgtY.js +0 -1
  111. package/dist/assets/FeaturePreviewScreen-BGV0ZXxB.js +0 -1
  112. package/dist/assets/HubSpotOAuthCallbackScreen-DceAiXdK.js +0 -1
  113. package/dist/assets/MagicLinkSignInScreen-BCvwxuHv.js +0 -12
  114. package/dist/assets/NotFoundScreen-B9fIdZtZ.js +0 -1
  115. package/dist/assets/NotificationRoutes-CtZRU3jC.js +0 -1
  116. package/dist/assets/OAuthConsentScreen-BfiVtm7S.js +0 -1
  117. package/dist/assets/PandLWithForecastRoutes-Bco3KBub.js +0 -1
  118. package/dist/assets/PeopleRoutes-CpJmRoUV.js +0 -22
  119. package/dist/assets/PerformanceRoutes-BJ4hq_vo.js +0 -1
  120. package/dist/assets/ReimbursementApprovalRoutes-SuUGS_MC.js +0 -1
  121. package/dist/assets/ReportsRoutes-DWgChqq3.js +0 -1
  122. package/dist/assets/RewardsRoutes-IbwzyTA0.js +0 -1
  123. package/dist/assets/ScreenRoutes-Bzr1Pddu.js +0 -2
  124. package/dist/assets/SignInScreen-DLqX9QIL.js +0 -1
  125. package/dist/assets/SignOutScreen-pxwuoR_l.js +0 -9
  126. package/dist/assets/TaskListScreen-DTiPtOdu.js +0 -9
  127. package/dist/assets/TaskRoutes-Bnccp3rk.js +0 -9
  128. package/dist/assets/TransactionDetailRoutes-DEPQW9cF.js +0 -1
  129. package/dist/assets/WiseConfirmationScreen-2PZ32Ekb.js +0 -12
  130. package/dist/assets/ZeniAccountStatementScreen-BudCs1Qh.js +0 -9
  131. package/dist/assets/epic-BsQGAan2.js +0 -2
  132. package/dist/assets/getLocaleForTenant-Crr4jHK_.js +0 -1
  133. package/dist/assets/useAskAiCfoHostNavButtonProps-CzbTY4Ry.js +0 -1
@@ -1,5 +1,5 @@
1
- import{j as s}from"./liveblocks-JFc2ySVL.js";import{a as o}from"./sentry-DbhlVCDx.js";import{g as f,j as H,h as L,u as M,k as _}from"./core-BUa4y4mL.js";import{m as F,Z as N,z as R,b3 as W,G as U,V as $,A as z,c as l,e as G,a3 as Y,b4 as Q}from"./index-BqVUPrfN.js";import{eY as Z,eO as q,Ma as I,Mb as J,tI as K,ty as g,e_ as X,bN as ee,tD as re,Mc as ae}from"./zeni-epic-state-CGaNHYyd.js";import{D as ne,e as te,n as se,S as oe}from"./mui-RJ5XtWIj.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-CzbTY4Ry.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-HdAnpaOw.js";import{M as de}from"./MobileAppDrawer-DSgPRxOv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e0f17ef8-d3b9-4255-b287-196bc988da6b",e._sentryDebugIdIdentifier="sentry-dbid-e0f17ef8-d3b9-4255-b287-196bc988da6b")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=N();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>Z(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
1
+ import{j as s}from"./liveblocks-BLWCZxXF.js";import{a as o}from"./sentry-BweJUVSU.js";import{g as f,j as F,h as _,u as H,k as M}from"./core-DS-Czzkv.js";import{m as V,Z as W,z as R,b3 as U,F as N,U as $,A as z,e as l,g as K,a3 as Q,b4 as Z}from"./index-KYBDOcEA.js";import{e_ as q,eQ as G,Mc as P,Md as J,tK as X,tA as g,f0 as Y,bO as ee,tF as re,Me as ae}from"./zeni-epic-state-CH3oUd_o.js";import{D as ne,e as te,n as se,S as oe}from"./mui-DeKIqdeR.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import{M as de}from"./MobileAppDrawer-DDKkJ918.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="f65240db-b59c-4436-be8e-5373be5d0629",e._sentryDebugIdIdentifier="sentry-dbid-f65240db-b59c-4436-be8e-5373be5d0629")}catch{}})();const ce={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=V(),n=W();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>q(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,P="refer-and-earn-status-update",pe=_(function(e){const r=I(e),a=e.referralViewState.rewardsPlanFetchState,n=ee([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ae({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(Y(Q));function Se({isReferralDrawerOpen:e}){const r=H(),a=L(),n=M(),[i,u]=o.useState(!1),[d,D]=o.useState(!1),[x,E]=o.useState(!1),[k,b]=o.useState(!1),p=R.getSignedInUser(),m=f(t=>q(t)),C=f(t=>I(t)),h=C.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([C,w]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{m?.rewardsLastViewedTime==null&&x===!1&&(a(K()),E(!0))},[]),o.useEffect(()=>{!i&&h==="Not-Started"&&c&&(u(!0),a(g(!0)))},[h,a,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(D(!0),a(X(!0)))},[w,a,c]),o.useEffect(()=>{b(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),v=t=>{A(t)},{isAiCfoAccessEnabled:T,onAskAiCfoClick:O}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const V={events:p?.userId!=null?[`private-encrypted-${p.userId}.${P}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(G.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{b(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:r,currentTenant:m,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:O,...V})]})}export{Se as R};
5
+ `,I="refer-and-earn-status-update",pe=M(function(e){const r=P(e),a=e.referralViewState.rewardsPlanFetchState,n=ee([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ae({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(Q(Z));function Se({isReferralDrawerOpen:e}){const r=F(),a=_(),n=H(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,b]=o.useState(!1),p=R.getSignedInUser(),m=f(t=>G(t)),C=f(t=>P(t)),h=C.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([C,w]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{m?.rewardsLastViewedTime==null&&D===!1&&(a(X()),E(!0))},[]),o.useEffect(()=>{!i&&h==="Not-Started"&&c&&(u(!0),a(g(!0)))},[h,a,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),a(Y(!0)))},[w,a,c]),o.useEffect(()=>{b(e!=null&&e===!0)},[e]);const[A,j]=o.useState(!1),v=t=>{j(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:L}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const T={events:p?.userId!=null?[`private-encrypted-${p.userId}.${I}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(K.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:A,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{b(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:r,currentTenant:m,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:L,...T})]})}export{Se as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-BLWCZxXF.js";import R from"./NotFoundScreen-vkDXbz0R.js";import{a as p}from"./sentry-BweJUVSU.js";import{j as C,u as I,h as A,g as l,N as E,k,n as D,o as u}from"./core-DS-Czzkv.js";import{eQ as N,N6 as g,Nm as S,CH as T,BQ as V,CG as m,Cx as U,NC as _}from"./zeni-epic-state-CH3oUd_o.js";import{m as $,z as B,x as O,a3 as Q,bJ as W,ac as z}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-CQFzG62_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="5b634807-731f-4412-9c63-c94fca0d0cbc",e._sentryDebugIdIdentifier="sentry-dbid-5b634807-731f-4412-9c63-c94fca0d0cbc")}catch{}})();const d="reimbursement-approval-rule-update",G=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:c}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(d)&&e(_(!1))},onBackClick:()=>{z(c)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})(Q(W)),H=()=>{const e=C(),r=I(),a=A(),[c,s]=p.useState(!1),[f,y]=p.useState(!1),b=l(n=>n.remiSetupApproverViewState.fetchState),o=l(n=>N(n)),w=$(),i=l(n=>g(n)),h=l(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{c||b!=="Not-Started"||(s(!0),a(V(!0)))},[c,b,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(m())),e("./new"))},[f,i,a]);const x={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${d}`]:[],eventCallback:(n,J,j)=>{n.endsWith(d)&&j.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(O,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(G,{currentTenant:o,location:r,navigate:e,...x})};function Z(){return t.jsxs(D,{children:[t.jsx(u,{path:"/",element:t.jsx(H,{})}),t.jsx(u,{path:"/new",element:t.jsx(v,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(u,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-JFc2ySVL.js";import{a as y}from"./sentry-DbhlVCDx.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-BUa4y4mL.js";import{Nk as R,N4 as E,Cy as x,CH as _,CF as S,CG as h,Nl as k}from"./zeni-epic-state-CGaNHYyd.js";import{z as B,m as N,B as V,bA as F,ac as j}from"./index-BqVUPrfN.js";import"./mui-RJ5XtWIj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="76e88467-3709-4dc1-be22-b5e708f7928c",e._sentryDebugIdIdentifier="sentry-dbid-76e88467-3709-4dc1-be22-b5e708f7928c")}catch{}})();function O(e){return k(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function J(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
1
+ import{j as g}from"./liveblocks-BLWCZxXF.js";import{a as y}from"./sentry-BweJUVSU.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-DS-Czzkv.js";import{Nm as R,N6 as E,CA as x,CJ as _,CH as S,CI as h,Nn as k}from"./zeni-epic-state-CH3oUd_o.js";import{z as B,m as N,x as V,bA as j,ac as F}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="6212639a-fc28-4d90-b500-c41ea2b0c885",e._sentryDebugIdIdentifier="sentry-dbid-6212639a-fc28-4d90-b500-c41ea2b0c885")}catch{}})();function O(e){return k(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=F(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const m=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),v=D.concat(I);m.push({action:u.stepType.selectedOption,actors:v,operator:v.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function G(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,O as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-JFc2ySVL.js";import{j as J,h as re,u as Z,l as X,g as E,N as $,k as K,i as mt,n as ct,o as C}from"./core-BUa4y4mL.js";import{eO as V,NB as le,c1 as me,BJ as xe,jL as dt,BW as ne,BV as ae,NC as ut,bn as ce,fI as Te,ND as pt,JY as bt,jA as De,JZ as fe,J_ as gt,iv as ht,MS as St,iK as ft,Bx as It,sm as yt,iC as Rt,Ch as je,NE as Fe,NF as At,NG as kt,NH as vt,NI as Ct,NJ as Et,C1 as Ie,iQ as wt,M$ as Bt,BX as xt,BH as Tt,NK as Dt,BG as jt,NL as Ft,BP as ye,C5 as Ut,C4 as Lt,C0 as Nt,NM as Ue,H6 as Pt,bo as Mt,BS as $t,Cz as _t,NN as Ot,NO as zt,Cd as Gt,Ca as Re,Ml as Ht,BE as Zt,NP as Le,CY as Ae,D4 as Vt,NQ as Wt,NR as G,NS as Jt,NT as Ne,NU as Kt,NV as Pe,NW as Me,Cp as se,bt as qt,bF as de,cB as ue,eU as $e,eS as _e,NX as Yt,gM as Xt,My as Qt,NY as en,NZ as Oe,MC as tn,Nk as nn,N_ as an,NA as sn,D1 as ke,D0 as on,N$ as rn,O0 as ln,O1 as mn,O2 as cn,O3 as dn,N5 as un,CT as pn,CX as bn,bv as gn,bE as hn,cw as Sn,ck as fn,bs as In,IS as yn,cM as Rn,cO as An,cN as kn,cv as vn}from"./zeni-epic-state-CGaNHYyd.js";import{w as ze,Z as Ge,y as Q,S as k,z as P,bK as He,A as ee,c as v,aE as ve,o as j,aq as Y,I as Cn,D as Ze,bL as En,r as H,bM as wn,k as te,bN as Bn,V as xn,G as Tn,B as pe,e as Ve,a3 as Dn,bb as jn,Y as Fn,m as We,bO as Un,a6 as Ln}from"./index-BqVUPrfN.js";import{n as _,S as Nn}from"./mui-RJ5XtWIj.js";import ie from"./NotFoundScreen-B9fIdZtZ.js";import{S as Ce}from"./SetupPagesScreen-B1u5XXT5.js";import{F as Je}from"./FeaturePreviewScreen-BGV0ZXxB.js";import{a as S}from"./sentry-DbhlVCDx.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-CzbTY4Ry.js";import{u as Ke}from"./useInitialThreadRequest-BwBVCvna.js";import{c as qe}from"./useFetchSuggestedQuestionsWhenReady-HdAnpaOw.js";import{D as Pn}from"./DrawerScreen-uJ_3Dk8M.js";import{M as Ye}from"./MobileAppDrawer-DSgPRxOv.js";import{R as Mn}from"./ReimbursementApprovalRoutes-SuUGS_MC.js";import{FallBackRoute as $n}from"./ScreenRoutes-Bzr1Pddu.js";import"./recharts-CPOd-6nk.js";import"./analytics-Br8sYi51.js";import"./plaid-M6xkDuEc.js";import"./dnd-Dl4N7fBZ.js";import"./stripe-DMRn4zHo.js";import"./lottie-tfFSHGOM.js";import"./lexical-gklPXKki.js";import"./pdf-DyXQZDfv.js";import"./utils-jfneV6S1.js";import"./analyticsHelper-CUa_2Hxt.js";import"./routePaths-FsWFCrEG.js";import"./BusinessVerificationPageScreen-CgOqYGYR.js";import"./ReimbursementApprovalRuleDetailScreen-CvAjyFdG.js";import"./getLocaleForTenant-Crr4jHK_.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]="75c23160-89a4-4328-a585-41ee00437eca",e._sentryDebugIdIdentifier="sentry-dbid-75c23160-89a4-4328-a585-41ee00437eca")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Xe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(ft(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(fe("common"))},onCancelAutoComplete:()=>{e(fe("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=X(),d=ze(),c=Ge(),[m,o]=S.useState(r==null),[a,i]=S.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,B]=S.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Ke(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);S.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
1
+ import{j as s}from"./liveblocks-BLWCZxXF.js";import{j as J,h as re,u as H,l as Q,g as E,N as M,k as K,i as mt,n as ct,o as k}from"./core-DS-Czzkv.js";import{eQ as V,ND as le,c2 as me,BL as Be,jN as dt,BY as ne,BX as ae,NE as ut,bn as ce,fK as Te,NF as pt,J_ as bt,jC as De,J$ as Se,K0 as gt,ix as ht,MU as ft,iM as St,Bz as It,so as yt,iE as Rt,Cj as je,NG as Fe,NH as At,NI as Ct,NJ as vt,NK as kt,NL as Et,C3 as Ie,iS as wt,N1 as xt,BZ as Bt,BJ as Tt,NM as Dt,BI as jt,NN as Ft,BR as ye,C7 as Ut,C6 as Lt,C2 as Nt,NO as Ue,H8 as Pt,bo as $t,BU as Mt,CB as _t,NP as Ot,NQ as zt,Cf as Gt,Cc as Re,Mn as Zt,BG as Ht,NR as Le,C_ as Ae,D6 as Vt,NS as Wt,NT as G,NU as Jt,NV as Ne,NW as Kt,NX as Pe,NY as $e,Cr as se,bt as qt,bG as de,cC as ue,eW as Me,eU as _e,NZ as Xt,gO as Qt,MA as Yt,N_ as en,N$ as Oe,ME as tn,Nm as nn,O0 as an,NC as sn,D3 as Ce,D2 as on,O1 as rn,O2 as ln,O3 as mn,O4 as cn,O5 as dn,N7 as un,CV as pn,CZ as bn,bv as gn,bF as hn,cx as fn,cl as Sn,bs as In,IU as yn,cN as Rn,cP as An,cO as Cn,cw as vn}from"./zeni-epic-state-CH3oUd_o.js";import{v as ze,Z as Ge,y as Y,S as C,z as P,bK as Ze,A as ee,e as v,aE as ve,o as j,aq as X,I as kn,D as He,bL as En,r as Z,bM as wn,d as te,bN as xn,U as Bn,F as Tn,x as pe,g as Ve,a3 as Dn,bb as jn,X as Fn,m as We,bO as Un,a6 as Ln}from"./index-KYBDOcEA.js";import{n as _,S as Nn}from"./mui-DeKIqdeR.js";import ie from"./NotFoundScreen-vkDXbz0R.js";import{S as ke}from"./SetupPagesScreen-HxvWGUNa.js";import{F as Je}from"./FeaturePreviewScreen-9JeQ0IeJ.js";import{a as f}from"./sentry-BweJUVSU.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import{u as Ke}from"./useInitialThreadRequest-GwPuAy0h.js";import{c as qe}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import{D as Pn}from"./DrawerScreen-DrA0_hQo.js";import{M as Xe}from"./MobileAppDrawer-DDKkJ918.js";import{R as $n}from"./ReimbursementApprovalRoutes-DfPsMGzz.js";import{FallBackRoute as Mn}from"./ScreenRoutes-u3IHYIz2.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";import"./analyticsHelper-Db94ox0D.js";import"./routePaths-BgR0bMMr.js";import"./BusinessVerificationPageScreen-C2DktOhf.js";import"./ReimbursementApprovalRuleDetailScreen-CQFzG62_.js";import"./getLocaleForTenant-bt_-bwkg.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]="b365c7cc-9473-4f79-8835-7bea9d6ec7c2",e._sentryDebugIdIdentifier="sentry-dbid-b365c7cc-9473-4f79-8835-7bea9d6ec7c2")}catch{}})();const Qe=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Ct({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Qe(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=H(),{reimbursementId:r}=Q(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(C.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(C.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Ke(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ze,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Zn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -10,9 +10,9 @@ import{j as s}from"./liveblocks-JFc2ySVL.js";import{j as J,h as re,u as Z,l as X
10
10
  left: 0;
11
11
  right: 0;
12
12
  bottom: 0;
13
- background-color: ${Cn.overlayBackgroundBlack};
13
+ background-color: ${kn.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,Hn=_.div`
15
+ `,Zn=_.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-JFc2ySVL.js";import{j as J,h as re,u as Z,l as X
22
22
  display: flex;
23
23
  background-color: transparent;
24
24
  overflow: hidden;
25
- `,Zn=_.div`
25
+ `,Hn=_.div`
26
26
  position: fixed;
27
27
  top: 0;
28
28
  left: 0;
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-JFc2ySVL.js";import{j as J,h as re,u as Z,l as X
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Jn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Xe(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=J(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=X(),m=P.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Ke(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Q(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,w]=S.useState(!1),[D,A]=S.useState(!1),[F,B]=S.useState(!1),{isFeatureEnabled:x}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),N=Pt(o),U=Mt(o.userRole),M=a.fetchState;if(S.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t($t(c,!1,I)))},[u,c,t,M]),S.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&N===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,N,m]),S.useEffect(()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(xe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:x,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const qn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(Bn);function Yn(){const e=J(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return S.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const z=tn(),Qe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:we}=Ze.getLocalizedStrings(),Be=Xn.reimbursement.bulkActions,Qn=_.div`
56
+ `,Jn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Qe(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Ht(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=J(),t=re(),n=H(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=Q(),m=P.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Ke(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(C.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[D,A]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(C.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(C.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),N=Pt(o),U=$t(o.userRole),$=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(Mt(c,!1,I)))},[u,c,t,$]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&N===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,N,m]),f.useEffect(()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Ze,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const qn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(xn);function Xn(){const e=J(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const z=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Qn,common:we}=He.getLocalizedStrings(),xe=Qn.reimbursement.bulkActions,Yn=_.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-JFc2ySVL.js";import{j as J,h as re,u as Z,l as X
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ea=K(function(e,t){const n=Me(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Ne(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Qe&&e(an())}}})(Dn(jn));function ta(){const e=J(),t=re(),n=Z(),r=n.state,d=Ge(),[c,m]=S.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;S.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Jt(r.tab.toString());f!=null?t(Ne(f)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Pe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Q(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=E(f=>V(f)),[w,D]=S.useState(!1),[A,F]=S.useState(!1),B=te(),x=B?.loggedInUserRole?.includes("admin")===!0,I=E(f=>Me(f,z,h)),{areTenantIdsInSync:g}=xn(),N=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:N==="Completed"}),S.useEffect(()=>{!A&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&qt(u),p=de(B?.loggedInUserRoleMap),W=ue(B?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(f=>Te(f.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=f=>{D(f)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=$e(it,u),rt=_e(u),{remisProcessed:q,remisProcessing:he}=E(f=>Yt(f));S.useEffect(()=>{q===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?Be.reports:Be.report},{variableName:"_has_",variableValue:q>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Qt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Qe}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(f,O,Se)=>{f.endsWith(oe)?Se.onReimbursementApprovalRulesEventReceived?.(f):O.entity_type==="reimbursement"&&(m(O.operation_type),Se.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Je,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[N==="Completed"?s.jsx(ee,{analytics:v,onLoad:f=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(f)}):null,s.jsx(Ye,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Qn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:f=>f.stopPropagation(),children:s.jsx(Yn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:x,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:M,...lt})]})]}):nt&&p?s.jsx($,{to:"../setup"}):B!=null&&Oe(u,B.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Nn)`
64
+ `,ea=K(function(e,t){const n=$e(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Ne(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(Ce("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Ce("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(Dn(jn));function ta(){const e=J(),t=re(),n=H(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Jt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Pe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(C.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(C.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(C.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(C.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=E(S=>V(S)),[w,D]=f.useState(!1),[A,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>$e(S,z,h)),{areTenantIdsInSync:g}=Bn(),N=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:$}=be({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:N==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&qt(u),p=de(x?.loggedInUserRoleMap),W=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{D(S)},{isFeatureEnabled:it}=a(C.isDebitCardFeatureEnabled),ot=Me(it,u),rt=_e(u),{remisProcessed:q,remisProcessing:he}=E(S=>Xt(S));f.useEffect(()=>{q===he&&c!=null&&(t(Qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?xe.reports:xe.report},{variableName:"_has_",variableValue:q>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,O,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Je,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[N==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Xe,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:$,...lt})]})]}):nt&&p?s.jsx(M,{to:"../setup"}):x!=null&&Oe(u,x.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Nn)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=J(),t=Z(),{tenantEmailDomain:n}=X(),r=We(),[d,c]=S.useState(!1),m=E(A=>V(A)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx($,{to:"../../../reimbursements"}):w&&R?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Ye,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Q(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:D}=m(k.isDepositAccountsFeatureEnabled),A=D&&!b&&fn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),B=yn(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),N=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=X(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:B,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:B,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:w?s.jsx(Mn,{}):s.jsx($n,{isUserHasZeniAccountsAccess:x,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:M??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
68
+ `,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=J(),t=H(),{tenantEmailDomain:n}=Q(),r=We(),[d,c]=f.useState(!1),m=E(A=>V(A)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(M,{to:"../../../reimbursements"}):w&&R?s.jsx(M,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Xe,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(C.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(C.isDebitCardFeatureEnabled),i=Me(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:D}=m(C.isDepositAccountsFeatureEnabled),A=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=Cn(t?.loggedInUserRoleMap),N=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=Q(),y=H(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(k,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(k,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(k,{path:"promo",element:s.jsx(oa,{})}),s.jsx(k,{path:"approval-rules/*",element:w?s.jsx($n,{}):s.jsx(Mn,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:$??""})}),p&&s.jsx(k,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(k,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(k,{path:"*",element:s.jsx(M,{to:"../promo"})}),d&&u&&s.jsx(k,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(k,{path:"new",element:s.jsx(Ee,{})}),s.jsx(k,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(k,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(k,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(k,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(k,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
@@ -0,0 +1 @@
1
+ import{j as p}from"./liveblocks-BLWCZxXF.js";import{u as z,j as ye,h as ge,l as Ce,g as d,k as we,n as Se,o as G}from"./core-DS-Czzkv.js";import{eQ as L,fa as w,Jl as Ie,jC as W,Jm as X,pU as F,jq as Te,iu as Re,to as K,pZ as Ae,bv as Fe,Jn as Oe,bn as ke,un as De,Jo as Ee,Jp as je,tg as Pe,Jq as Y,Jr as Le,Js as Me,Jt as Be,Ju as Je,Jv as S,Jw as O,Jx as k,Jy as H,Jz as D,JA as E,dE as Ue,u3 as ve,tT as N,tU as q,u9 as Ve,tY as $,uf as xe,JB as ze,JC as Ge,JD as Ye,JE as He,JF as Ne,eW as qe,eU as $e}from"./zeni-epic-state-CH3oUd_o.js";import{R as Ze,T as Qe,Z as We,y as ee,S as j,z as ae,U as Xe,d as Ke,a as ea,A as aa,e as P,g as sa,r as se,V as ta,W as oa,X as na}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import ra from"./NotFoundScreen-vkDXbz0R.js";import{F as ia}from"./FeaturePreviewScreen-9JeQ0IeJ.js";import{a as _}from"./sentry-BweJUVSU.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import{u as fa}from"./useInitialThreadRequest-GwPuAy0h.js";import{t as Z,a as Q}from"./routePaths-BgR0bMMr.js";import{M as ma}from"./MobileAppDrawer-DDKkJ918.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.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]="912c9068-2e7c-42f8-b32d-85d43f32810d",e._sentryDebugIdIdentifier="sentry-dbid-912c9068-2e7c-42f8-b32d-85d43f32810d")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(Ye()),e(He()),e(Ne())},ha=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Oe(u);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,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:W(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ve({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(O({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(O({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(S("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{_a(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=We(),u=oa(f),a=ye(),s=ge(),t=z(),{tenantEmailDomain:r}=Ce(),{useFeatureGate:c}=ee(),{isFeatureEnabled:m}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,g]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=fa(B?J?.companyId:void 0),C=d(n=>w(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),T=d(n=>n.financeStatementState.selectedReportId),U=d(n=>W(n)),R=d(n=>X(n)),ie=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),A=d(n=>w(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&C==="Completed"&&h&&(s(F(l.userId,!1,!0,!1)),te(!0))},[i,M,C,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(T){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":R&&s(K());break;case"balance_sheet":s(Re(b.timeframe));break;case"cash_flow":s(Te(b.timeframe))}},[i,T,A,h,U,R]);const v=Ke(),ce=v?.loggedInUserRole!=null&&Fe(v?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},fe=ea(),me=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=Ze(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:C==="Completed"}),pa({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(ma,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:le,selectedReportID:T,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:R,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:me&&fe&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function va(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=qe(f,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{va as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-BLWCZxXF.js";import{y as w,z as j,aK as y,A as E,e as p,g as F,cF as P,S as L}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import l from"./NotFoundScreen-vkDXbz0R.js";import{a as u}from"./sentry-BweJUVSU.js";import{h as A,g as b,j as T,u as V,k as R,n as U,o as d}from"./core-DS-Czzkv.js";import{eQ as z,PY as C,MN as Y,PZ as _,tK as K,f0 as G,P_ as M,tI as O}from"./zeni-epic-state-CH3oUd_o.js";import{R as x}from"./ReferralListScreen-DtKoNKFt.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";import"./useAskAiCfoHostNavButtonProps-eM31eQ25.js";import"./useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js";import"./MobileAppDrawer-DDKkJ918.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]="cd130b35-c97e-4573-92ba-5ac437d5a45e",e._sentryDebugIdIdentifier="sentry-dbid-cd130b35-c97e-4573-92ba-5ac437d5a45e")}catch{}})();const Q=R(function(e,t){const n=C(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(_()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(M({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),Z=()=>{const e=A(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=T(),k=V(),{useDynamicConfig:g}=w(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),v=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),S=Y(D);u.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(K()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(Q,{navigate:c,location:k,currentTenant:r,companyName:I,userName:v,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:S.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(Z,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-AodiBc0C.js","assets/sentry-BweJUVSU.js","assets/core-DS-Czzkv.js","assets/zeni-epic-state-CH3oUd_o.js","assets/index-KYBDOcEA.js","assets/mui-DeKIqdeR.js","assets/analytics-CYNkDTSy.js","assets/utils-D7Uun_Ak.js","assets/withTransactionSidePanel-BxEYZshS.js","assets/useAskAiCfoHostNavButtonProps-eM31eQ25.js","assets/useFetchSuggestedQuestionsWhenReady-DMkfTLZU.js","assets/TransactionDetailScreen-BkrtxHZ2.js","assets/decodeURIComponentSafe-BUgIzLPe.js","assets/routePaths-BgR0bMMr.js","assets/NotFoundScreen-vkDXbz0R.js","assets/analyticsHelper-Db94ox0D.js","assets/CompanyPassportScreen-2RC9cNYm.js","assets/MobileAppDrawer-DDKkJ918.js","assets/FeaturePreviewScreen-9JeQ0IeJ.js","assets/ReferralListScreen-DtKoNKFt.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-BFjD0YEd.js","assets/AddressScreen-zAEAr0cm.js","assets/DomesticWireDetailScreen-D3cRlBJq.js","assets/useInitialThreadRequest-GwPuAy0h.js","assets/DrawerScreen-DrA0_hQo.js","assets/SetupPagesScreen-HxvWGUNa.js","assets/BusinessVerificationPageScreen-C2DktOhf.js","assets/BillPayApprovalRoutes-DdepEMNI.js","assets/ReimbursementApprovalRuleDetailScreen-CQFzG62_.js","assets/getLocaleForTenant-bt_-bwkg.js","assets/ReimbursementRoutes-49Rieggp.js","assets/ReimbursementApprovalRoutes-DfPsMGzz.js","assets/TransactionListRoutes-DhFIr0h0.js","assets/ZeniAccountStatementScreen-Bk1Pha4F.js","assets/SettingsRoutes-D6YwI1A0.js","assets/accountMappingHelper-Ce_vl0gX.js","assets/QBOConnectionScreen-C0EWfqqq.js","assets/empty-BW6MrnJi.js","assets/index-DZw5cZyY.js","assets/url-CluwUD6c.js","assets/index-BIUN5C-2.js","assets/ReportsRoutes-BScMXjBF.js","assets/ChargeCardRoutes-DzXM12p0.js","assets/PeopleRoutes-g3ceR6fI.js","assets/ExpenseAutomationRoutes-hDXdzNbj.js","assets/TreasuryRoutes-D0IWSqF8.js","assets/VendorsRoutes-KHi82m-_.js","assets/pathToGoBack-BXYS_je9.js","assets/ZeniAccountRoutes-wwixhMEJ.js","assets/AddressRoutes-VNiW4zFt.js","assets/PandLWithForecastRoutes-Br2Ee7zc.js","assets/CustomerOnboardingRoutes-Dz9NWWrJ.js","assets/TransactionDetailRoutes-BKgQg9gp.js","assets/EntityDetailRoutes-Htc-mXG5.js","assets/NotificationRoutes-BCGxlZOG.js","assets/PerformanceRoutes-BX5shptQ.js","assets/RewardsRoutes-DN1QCtTK.js","assets/TaskRoutes-B384KfDT.js","assets/TaskListScreen-B_GnE7cK.js","assets/AiCfoScreen-CEp0H39c.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eQ as ls,eW as cs,eU as ds,eV as ms,fF as us,eS as _s,cQ as Ee,cx as Es,fb as As,cp as ps,bE as Is,bq as xs,fg as gs,v as Ts,IT as hs,bv as js,IU as Us,bG as bs,fd as Hs,bF as Rs,bs as Ds,cl as ys,IV as fs,IW as Cs,cN as vs,cP as Os,cO as Ps,cw as Fs,cC as Ls,mx as Ae,eR as pe,fP as Bs,fk as Ie,fM as xe,fN as ge,fl as ks}from"./zeni-epic-state-CH3oUd_o.js";import{j as e}from"./liveblocks-BLWCZxXF.js";import{a as v}from"./sentry-BweJUVSU.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as G,i as Te,N as c,n as Zs,o as t}from"./core-DS-Czzkv.js";import{m as ws,u as Gs,z as H,y as zs,a as $s,c as Ws,S as L,d as Ys,L as B,D as he,t as _,P as qs,e as X,l}from"./index-KYBDOcEA.js";import"./mui-DeKIqdeR.js";import{f as je}from"./analyticsHelper-Db94ox0D.js";import{t as Qs}from"./getLocaleForTenant-bt_-bwkg.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="164a8179-d1f8-440b-9b0d-a8f4fd09d6d5",i._sentryDebugIdIdentifier="sentry-dbid-164a8179-d1f8-440b-9b0d-a8f4fd09d6d5")}catch{}})();const Js={dashboard:()=>n(()=>import("./DashboardRoutes-AodiBc0C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-BFjD0YEd.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-49Rieggp.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-DhFIr0h0.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-D6YwI1A0.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-BScMXjBF.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DzXM12p0.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-g3ceR6fI.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-hDXdzNbj.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-D0IWSqF8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-KHi82m-_.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-wwixhMEJ.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Ks=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-BScMXjBF.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-VNiW4zFt.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-g3ceR6fI.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-Br2Ee7zc.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-Dz9NWWrJ.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-KHi82m-_.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-BKgQg9gp.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-Htc-mXG5.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-AodiBc0C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),be=l(()=>n(()=>import("./BillPayRoutes-BFjD0YEd.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-D6YwI1A0.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),He=l(()=>n(()=>import("./ReimbursementRoutes-49Rieggp.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-wwixhMEJ.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-D0IWSqF8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-DhFIr0h0.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-DzXM12p0.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-BCGxlZOG.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),En=l(()=>n(()=>import("./PerformanceRoutes-BX5shptQ.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-hDXdzNbj.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-DN1QCtTK.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-B384KfDT.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),xn=l(()=>n(()=>import("./AiCfoScreen-CEp0H39c.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-vkDXbz0R.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),gn=l(()=>n(()=>import("./TaskListScreen-B_GnE7cK.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),D=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),Q=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),J=$s(),ye=Ws(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&Q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),W=G(a=>us(a));if(o!=null){const a=H.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Ys(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,K=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&D!=null){const a=K.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=xs();m.isAfter(M,"month")===!1?U(gs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,D]),v.useEffect(()=>{N||(De(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=H.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Qs(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(Ie(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(q?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)));if(Y){X.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,D,h,f,U))},[D,A]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,W.tenantsBaseInOrder))},[W,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):A==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Ks,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Js[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(E?.loggedInUserRoleMap),me=Oe&&!C,We=r.company!=null&&Hs(r.company),Ye=Pe&&We===!0&&!C,qe=re&&Rs(E?.loggedInUserRoleMap),Qe=oe&&Ds(E?.loggedInUserRoleMap),Je=me&&ys(E?.loggedInUserRoleMap),Ke=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),I=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&g,_e=ce&&T,es=me&&p,ss=Ye&&I,ns=oe&&x,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Ke===!0||Xe===!0;return H.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||Q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||Q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(gn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:qe||de||Je||Qe?e.jsx(en,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:J?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:J?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:J?e.jsx(xn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(bn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Hn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wn as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-JFc2ySVL.js";import{a as p}from"./sentry-DbhlVCDx.js";import{j as _,u as B,h as k,g as h,k as R,l as F,n as X,o as C}from"./core-BUa4y4mL.js";import{bn as xe,eO as j,gG as de,KX as Ee,Jk as Ae,jA as ue,lT as we,gI as je,KZ as ve,KY as ke,Nm as Pe,xj as De,BO as Ue,MX as Me,N4 as _e,c1 as W,cG as Te,cH as Be,J1 as Re,Nn as Fe,J2 as Ve,vL as Ne,No as Oe,E2 as Le,Bu as $e,Bl as pe,Bi as Je,vP as ge,Bo as me,Br as fe,Bx as ee,sm as ne,vO as ze,jc as Q,jf as he,Np as Ge,kg as Ke,w2 as Ze,JS as He,JT as qe,ja as Xe,Nq as Qe,jd as Ye,qM as We,Nr as en,Ns as nn,qQ as tn,gi as an,Ja as se,gp as sn,Jb as on,v$ as cn,Nt as rn,Nu as ln,BL as dn,eS as be,eU as Se,Nv as un,fw as pn,Jl as gn,v_ as oe,fB as ie,fA as mn,vZ as fn,fz as hn,fy as bn,Nw as Sn,eX as ye,Nx as yn,Ny as In,w5 as Cn,vY as ce,Nz as xn,fd as En,vV as An,bU as wn,c0 as jn,b$ as vn,bV as kn,bZ as Pn,bY as Dn,bX as Un,b_ as Mn,bW as _n}from"./zeni-epic-state-CGaNHYyd.js";import{y as te,S as U,z as x,ac as Ie,bB as Tn,c as J,e as Bn,k as V,B as ae,bC as Rn,bD as Fn,an as Vn,f as Ce,bE as Nn,bF as On,bG as Ln,a6 as $n,V as Jn,bH as zn,r as Gn,bI as Kn}from"./index-BqVUPrfN.js";import{n as M}from"./mui-RJ5XtWIj.js";import{M as P}from"./MobileAppDrawer-DSgPRxOv.js";import{a as L,g as $,m as Zn}from"./accountMappingHelper-CT28maj0.js";import{t as Hn,A as qn}from"./AddressScreen-YA46n52j.js";import T from"./NotFoundScreen-B9fIdZtZ.js";import{g as Xn}from"./analyticsHelper-CUa_2Hxt.js";import{B as Qn}from"./BusinessVerificationPageScreen-CgOqYGYR.js";import{C as Yn}from"./CompanyPassportScreen-CJkXrH5j.js";import{q as re}from"./QBOConnectionScreen-DVWXlQxR.js";import{B as Wn}from"./BillPayApprovalRoutes-NVMWEPu0.js";import{R as et}from"./ReimbursementApprovalRoutes-SuUGS_MC.js";import"./recharts-CPOd-6nk.js";import"./analytics-Br8sYi51.js";import"./plaid-M6xkDuEc.js";import"./dnd-Dl4N7fBZ.js";import"./stripe-DMRn4zHo.js";import"./lottie-tfFSHGOM.js";import"./lexical-gklPXKki.js";import"./pdf-DyXQZDfv.js";import"./utils-jfneV6S1.js";import"./routePaths-FsWFCrEG.js";import"./empty-BR4JY50t.js";import"./pdf-lib-DQ75GOuH.js";import"./index-BlE_QRZ7.js";import"./url-BdgRfFdn.js";import"./index-CHewEF_r.js";import"./decodeURIComponentSafe-CRJGdpaG.js";import"./ReimbursementApprovalRuleDetailScreen-CvAjyFdG.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]="141754f2-c264-4b87-ac68-41723230eb79",e._sentryDebugIdIdentifier="sentry-dbid-141754f2-c264-4b87-ac68-41723230eb79")}catch{}})();const nt=M.div`
1
+ import{j as a}from"./liveblocks-BLWCZxXF.js";import{a as p}from"./sentry-BweJUVSU.js";import{j as _,u as R,h as v,g as h,k as T,l as F,n as Q,o as C}from"./core-DS-Czzkv.js";import{bn as xe,eQ as j,gI as de,KZ as Ee,Jm as Ae,jC as ue,lV as we,gK as je,K$ as ke,K_ as ve,No as Pe,xl as De,BQ as Ue,MZ as Me,N6 as _e,c2 as Y,cH as Be,cI as Re,J3 as Te,Np as Fe,J4 as Ne,vN as Ve,Nq as Oe,E4 as Le,Bw as $e,Bn as pe,Bk as Je,vR as ge,Bq as me,Bt as fe,Bz as ee,so as ne,vQ as Ke,je as W,jh as he,Nr as ze,ki as Ze,w4 as Ge,JU as He,JV as qe,jc as Qe,Ns as We,jf as Xe,qO as Ye,Nt as en,Nu as nn,qS as tn,gk as an,Jc as se,gr as sn,Jd as on,w1 as cn,Nv as rn,Nw as ln,BN as dn,eU as be,eW as Se,Nx as un,fy as pn,Jn as gn,w0 as oe,fD as ie,fC as mn,v$ as fn,fB as hn,fA as bn,Ny as Sn,eZ as ye,Nz as yn,NA as In,w7 as Cn,v_ as ce,NB as xn,ff as En,vX as An,bV as wn,c1 as jn,c0 as kn,bW as vn,b_ as Pn,bZ as Dn,bY as Un,b$ as Mn,bX as _n}from"./zeni-epic-state-CH3oUd_o.js";import{y as te,S as U,z as x,ac as Ie,bB as Bn,e as J,g as Rn,d as N,x as ae,bC as Tn,bD as Fn,an as Nn,j as Ce,bE as Vn,bF as On,bG as Ln,a6 as $n,U as Jn,bH as Kn,r as zn,bI as Zn}from"./index-KYBDOcEA.js";import{n as M}from"./mui-DeKIqdeR.js";import{M as P}from"./MobileAppDrawer-DDKkJ918.js";import{a as L,g as $,m as Gn}from"./accountMappingHelper-Ce_vl0gX.js";import{t as Hn,A as qn}from"./AddressScreen-zAEAr0cm.js";import B from"./NotFoundScreen-vkDXbz0R.js";import{g as Qn}from"./analyticsHelper-Db94ox0D.js";import{B as Wn}from"./BusinessVerificationPageScreen-C2DktOhf.js";import{C as Xn}from"./CompanyPassportScreen-2RC9cNYm.js";import{q as re}from"./QBOConnectionScreen-C0EWfqqq.js";import{B as Yn}from"./BillPayApprovalRoutes-DdepEMNI.js";import{R as et}from"./ReimbursementApprovalRoutes-DfPsMGzz.js";import"./recharts-BV8xDSZo.js";import"./analytics-CYNkDTSy.js";import"./plaid-Dyu1hAU2.js";import"./dnd-B781yOiO.js";import"./stripe-DMRn4zHo.js";import"./lottie-DuFs7GNB.js";import"./lexical-DZ3pAnkc.js";import"./pdf-Co6rX9Tl.js";import"./utils-D7Uun_Ak.js";import"./routePaths-BgR0bMMr.js";import"./empty-BW6MrnJi.js";import"./pdf-lib-CqpoMVUd.js";import"./index-DZw5cZyY.js";import"./url-CluwUD6c.js";import"./index-BIUN5C-2.js";import"./decodeURIComponentSafe-BUgIzLPe.js";import"./ReimbursementApprovalRuleDetailScreen-CQFzG62_.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]="236ab51c-af4f-4f9c-ab3b-81ceb93bfb7d",e._sentryDebugIdIdentifier="sentry-dbid-236ab51c-af4f-4f9c-ab3b-81ceb93bfb7d")}catch{}})();const nt=M.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-JFc2ySVL.js";import{a as p}from"./sentry-DbhlVCD
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,tt=R(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:y,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:N}=g,A=L(s.accountMappingView.incomeAccountList,f.selectedOption),z=L(s.accountMappingView.expenseAccountList,m.selectedOption),G=L(s.accountMappingView.billPayAccountList,l.selectedOption),K=L(s.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(s.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(s.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=Zn(s.accountMappingView.expenseAccounts1099FilingAccountList,N),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:K?.accountId,selectedPrepaidExpensesAccountIds:O.map(v=>v.accountId),selectedFixedAssetsAccountIds:b.map(v=>v.accountId),selectedAccruedExpensesAccountIds:D.map(v=>v.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(v=>v.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:q}))},onBackClick:()=>{Ie(c)===!1?(o("../../dashboard"),e(ve())):e(de())},onSaveClick:()=>{e(je()),i&&J.track(Bn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),at=()=>{const e=_(),s=B(),o=k(),{useFeatureGate:c}=te(),{isFeatureEnabled:i}=c(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(U.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(y=>j(y)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const l=h(y=>Ee(y)),E=y=>{m(y)};return a.jsxs(nt,{children:[a.jsx(P,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:Ie(s),onClickMenuIcon:()=>E(!0)})]})},st=M.div`
9
+ `,tt=T(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:y,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:V}=g,A=L(s.accountMappingView.incomeAccountList,f.selectedOption),K=L(s.accountMappingView.expenseAccountList,m.selectedOption),z=L(s.accountMappingView.billPayAccountList,l.selectedOption),Z=L(s.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(s.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),G=$(s.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=Gn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:Z?.accountId,selectedPrepaidExpensesAccountIds:O.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:G.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ve({data:q}))},onBackClick:()=>{Ie(c)===!1?(o("../../dashboard"),e(ke())):e(de())},onSaveClick:()=>{e(je()),i&&J.track(Rn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Bn),at=()=>{const e=_(),s=R(),o=v(),{useFeatureGate:c}=te(),{isFeatureEnabled:i}=c(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(U.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(y=>j(y)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const l=h(y=>Ee(y)),E=y=>{m(y)};return a.jsxs(nt,{children:[a.jsx(P,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:Ie(s),onClickMenuIcon:()=>E(!0)})]})},st=M.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-JFc2ySVL.js";import{a as p}from"./sentry-DbhlVCD
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,ot=R(function(e,s){const o=j(e),c=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:J}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Rn),it=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Pe(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return y?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(ae,{fetchState:l.fetchState})},ct=M.div`
17
+ `,ot=T(function(e,s){const o=j(e),c=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(Y(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:J}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Tn),it=()=>{const e=_(),s=R(),o=v(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Pe(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=N();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return y?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(ae,{fetchState:l.fetchState})},ct=M.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-JFc2ySVL.js";import{a as p}from"./sentry-DbhlVCD
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,rt=R(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Oe(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ne(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(ee(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Je(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),lt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),i=V(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(I=>j(I)),g=h(I=>I.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Be(d,i?.loggedInUserRoleMap),l=Re(d,i?.loggedInUserRoleMap),E=Fe(d,i?.loggedInUserRoleMap),y=Ve(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ne(!1)))},[r,o,g]);const S=I=>{t(I)};return f||l||m||y?a.jsxs(ct,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},dt=M.div`
25
+ `,rt=T(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Oe(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ne(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(ee(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Je(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),lt=()=>{const e=_(),s=R(),o=v(),{tenantEmailDomain:c}=F(),i=N(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(I=>j(I)),g=h(I=>I.settingsViewState.bankConnection.fetchState),f=Be(d,i?.loggedInUserRoleMap),m=Re(d,i?.loggedInUserRoleMap),l=Te(d,i?.loggedInUserRoleMap),E=Fe(d,i?.loggedInUserRoleMap),y=Ne(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ve(!1)))},[r,o,g]);const S=I=>{t(I)};return f||l||m||y?a.jsxs(ct,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(B,{})},dt=M.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as a}from"./liveblocks-JFc2ySVL.js";import{a as p}from"./sentry-DbhlVCD
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,ut=R(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=Ge(e,o),{uiState:t}=n,r=(W(c?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ne("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ee(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Ye(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(Xe(n,t,r))},handleFetchPaymentSources:()=>{e(Q())},resetCardPaymentViewState:()=>{e(qe())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Nn),pt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(I=>j(I)),f=h(I=>I.cardPaymentViewState),m=h(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Vn(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,y=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=V();p.useEffect(()=>{y!=null&&o(ze(y,!1))},[y,o]),p.useEffect(()=>{t||(r(!0),o(Q()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(Q())},[l,E]);const S=I=>{n(I)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:y,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(ae,{fetchState:m})},Y="external_integrations",gt=R(function(e){const s=nn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,se("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,se(u)))},onNotifyMe:r=>{e(tn(Y,r,i))}}})(On),mt=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=V(),g=W(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(We(Y))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(P,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(ae,{fetchState:n})},ft=M.div`
33
+ `,ut=T(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=ze(e,o),{uiState:t}=n,r=(Y(c?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ne("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ee(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Xe(n))},updateCardPaymentModalState:n=>{e(We({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(Qe(n,t,r))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(qe())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ze({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Vn),pt=()=>{const e=_(),s=R(),o=v(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(I=>j(I)),f=h(I=>I.cardPaymentViewState),m=h(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Nn(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,y=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=N();p.useEffect(()=>{y!=null&&o(Ke(y,!1))},[y,o]),p.useEffect(()=>{t||(r(!0),o(W()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(W())},[l,E]);const S=I=>{n(I)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:y,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(ae,{fetchState:m})},X="external_integrations",gt=T(function(e){const s=nn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,se("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,se(u)))},onNotifyMe:r=>{e(tn(X,r,i))}}})(On),mt=()=>{const e=_(),s=v(),{tenantEmailDomain:o}=F(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=N(),g=Y(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Ye(X))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(P,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(ae,{fetchState:n})},ft=M.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as a}from"./liveblocks-JFc2ySVL.js";import{a as p}from"./sentry-DbhlVCD
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,bt=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ne("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ee(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(P,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(Ln,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=M.div`
49
+ `,bt=()=>{const e=v(),{tenantEmailDomain:s}=F(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ne("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ee(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(P,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(Ln,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=M.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as a}from"./liveblocks-JFc2ySVL.js";import{a as p}from"./sentry-DbhlVCD
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,le=({appContent:e})=>{const s=k(),o=_(),c=B(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=te(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(U.isTreasuryEnabled),E=h(b=>ue(b)),y=be(t),w=Se(m,t),S=!w&&E,I=$n(t,f,m),{areTenantIdsInSync:N}=Jn();p.useEffect(()=>{N&&s(un(u,S))},[u,s,S,N]);const A=h(b=>pn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,G=gn(t),K=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:K===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{O(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:y,onAddressClick:b=>{const D=function(H,q){let v=`/${H}/settings/my_profile`;return v=v.concat(`/new/${q}`),v}(r,b),Z=Gn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=k(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>ye(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(yn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Kn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>ye(l)),i=h(l=>j(l)),n=V(),t=x.getSignedInUser(),r=k(),{useFeatureGate:u}=te(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(X,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),vn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),kn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),Pn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(Qn,{productType:f?"zeni_accounts":m?"charge_cards":Xn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Yn,{})}),Mn(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(qn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]}):a.jsx(X,{children:a.jsx(C,{path:"*",element:a.jsx(T,{})})}):null}function It(e){return a.jsxs(X,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Wn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(T,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]})}export{ea as default};
57
+ `,le=({appContent:e})=>{const s=v(),o=_(),c=R(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=te(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(U.isTreasuryEnabled),E=h(b=>ue(b)),y=be(t),w=Se(m,t),S=!w&&E,I=$n(t,f,m),{areTenantIdsInSync:V}=Jn();p.useEffect(()=>{V&&s(un(u,S))},[u,s,S,V]);const A=h(b=>pn(b,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,z=gn(t),Z=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Kn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:w,isCardsOnlyTenant:y,onAddressClick:b=>{const D=function(H,q){let k=`/${H}/settings/my_profile`;return k=k.concat(`/new/${q}`),k}(r,b),G=zn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:G}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=v(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>ye(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(yn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Zn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>ye(l)),i=h(l=>j(l)),n=N(),t=x.getSignedInUser(),r=v(),{useFeatureGate:u}=te(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(Q,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),kn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),vn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),Pn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(Wn,{productType:f?"zeni_accounts":m?"charge_cards":Qn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Xn,{})}),Mn(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(qn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(C,{path:"*",element:a.jsx(B,{})})]}):a.jsx(Q,{children:a.jsx(C,{path:"*",element:a.jsx(B,{})})}):null}function It(e){return a.jsxs(Q,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Yn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(B,{})}),a.jsx(C,{path:"*",element:a.jsx(B,{})})]})}export{ea as default};