@zeniai/web-app-ui 5.1.73-qa → 5.1.75-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 (161) hide show
  1. package/dist/assets/AddressRoutes-BqX5wkCR.js +1 -0
  2. package/dist/assets/AddressScreen-ScWWmTbP.js +9 -0
  3. package/dist/assets/AiCfoScreen-quWQqhzX.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-CQmYX8YN.js +1 -0
  5. package/dist/assets/BillPayRoutes-jZS0wJcj.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-DFgVqXvI.js +9 -0
  7. package/dist/assets/CardsAiCfoScreen-BbBCL2AM.js +14 -0
  8. package/dist/assets/ChargeCardRoutes-BPGek5pB.js +71 -0
  9. package/dist/assets/{CompanyPassportScreen-C6ugmGBs.js → CompanyPassportScreen-DavSJynu.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-BbANlW5J.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-kiJ2IeW7.js +1 -0
  12. package/dist/assets/CustomerOnboardingRoutes-6ipmFo_1.js +30 -0
  13. package/dist/assets/DashboardRoutes-Brg8B8gk.js +20 -0
  14. package/dist/assets/DefaultTenantHome-B6se2qjz.js +1 -0
  15. package/dist/assets/DomesticWireDetailScreen-jS6brB2p.js +18 -0
  16. package/dist/assets/DrawerScreen-D0g6PABS.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-qim0q068.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-D3rXxAM_.js +25 -0
  19. package/dist/assets/FeaturePreviewScreen-Y7t6ABdh.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-BUpxwCNc.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-5wgvqx65.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-CelaLjKf.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-Djrnxmnv.js → MobileAppDrawer-Sx7ydj7A.js} +1 -1
  24. package/dist/assets/NotFoundScreen-BDl5tn8o.js +1 -0
  25. package/dist/assets/NotificationRoutes-Cdcu8PTz.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-C5pyboC-.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-DjwWiUAb.js +1 -0
  28. package/dist/assets/PeopleRoutes-x62_g_WP.js +22 -0
  29. package/dist/assets/PerformanceRoutes-DQciMsYC.js +1 -0
  30. package/dist/assets/{Preview-9K4X8cjD.js → Preview-DIWTyMQY.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-DrwgecUL.js → QBOConnectionScreen-DXq_HXCX.js} +1 -1
  32. package/dist/assets/ReferralListScreen-DNdLnut4.js +5 -0
  33. package/dist/assets/ReimbursementApprovalRoutes-BazeprVG.js +1 -0
  34. package/dist/assets/ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js +1 -0
  35. package/dist/assets/ReimbursementRoutes-Bb9JPi0m.js +68 -0
  36. package/dist/assets/ReportsRoutes-DB2v4EPm.js +1 -0
  37. package/dist/assets/RewardsRoutes-ChJyJSHY.js +1 -0
  38. package/dist/assets/ScreenRoutes-8R8Dd2d9.js +2 -0
  39. package/dist/assets/SettingsRoutes-oK_kou4I.js +57 -0
  40. package/dist/assets/SetupPagesScreen-CVKPKeC9.js +29 -0
  41. package/dist/assets/SignInScreen-C7vB3Bra.js +1 -0
  42. package/dist/assets/SignOutScreen-CQYa9Dvp.js +9 -0
  43. package/dist/assets/TaskListScreen-WRcn05lO.js +9 -0
  44. package/dist/assets/TaskRoutes-DoWinBID.js +9 -0
  45. package/dist/assets/TransactionDetailRoutes-B4ryZwp2.js +1 -0
  46. package/dist/assets/TransactionDetailScreen-DB5lxQrk.js +5 -0
  47. package/dist/assets/TransactionListRoutes-6SM8gNlu.js +1 -0
  48. package/dist/assets/TreasuryRoutes-DHuVCY9q.js +37 -0
  49. package/dist/assets/{VendorsRoutes-CXgYXHLy.js → VendorsRoutes-CwYVQ8VQ.js} +20 -20
  50. package/dist/assets/WiseConfirmationScreen-DLnf9dkP.js +12 -0
  51. package/dist/assets/ZeniAccountRoutes-u96OM2YN.js +73 -0
  52. package/dist/assets/ZeniAccountStatementScreen-D9UEHLLF.js +9 -0
  53. package/dist/assets/{accountMappingHelper-1n6-L3ip.js → accountMappingHelper-s2xO6MjH.js} +1 -1
  54. package/dist/assets/{analytics-B5_QbYyf.js → analytics-Ba6zmRos.js} +1 -1
  55. package/dist/assets/{analyticsHelper-llu9ZY3e.js → analyticsHelper-Cq2pq-lr.js} +1 -1
  56. package/dist/assets/{core-C5uCD0QC.js → core-D6ttr5iw.js} +2 -2
  57. package/dist/assets/{decodeURIComponentSafe-WSnueMtI.js → decodeURIComponentSafe-D0vQ4d1Q.js} +1 -1
  58. package/dist/assets/dnd-C751Xq24.js +6 -0
  59. package/dist/assets/{index-WNZaIyi6.js → empty-0_eSm854.js} +1 -1
  60. package/dist/assets/{empty-D1KuG6Gh.js → empty-B81gHGCB.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-B_-dVSa6.js → emptyVideoElement-DNxKi3mL.js} +1 -1
  62. package/dist/assets/epic-BpVO28im.js +2 -0
  63. package/dist/assets/getLocaleForTenant-O3Y2pcaQ.js +1 -0
  64. package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
  65. package/dist/assets/{index-DxRIv8ho.js → index-CETE-7wR.js} +1 -1
  66. package/dist/assets/{index-mGu5aIQO.js → index-DK3W-xXd.js} +2 -2
  67. package/dist/assets/{index-DiaEA_nH.js → index-DL-oj321.js} +1 -1
  68. package/dist/assets/{index-5jMBO2WT.js → index-DyaqeLYa.js} +1 -1
  69. package/dist/assets/{index-CXNJX-KR.js → index-ilZtTEZn.js} +33335 -27881
  70. package/dist/assets/index-lXh6fiHl.js +1 -0
  71. package/dist/assets/{index-hHuZx5_w.js → index-pFVjg2n3.js} +1 -1
  72. package/dist/assets/index-xNwL9wH4.js +1 -0
  73. package/dist/assets/{lexical-hLnHAypU.js → lexical-T2nlwAPk.js} +1 -1
  74. package/dist/assets/{liveblocks-2V3XhuUi.js → liveblocks-CS0rfBBF.js} +1 -1
  75. package/dist/assets/{lottie-DTk6h7CK.js → lottie-CZmubsAo.js} +1 -1
  76. package/dist/assets/{mui-Dpp2C1dL.js → mui-vLo47rlo.js} +1 -1
  77. package/dist/assets/{pathToGoBack-spodqoPj.js → pathToGoBack-CkJN8BOO.js} +1 -1
  78. package/dist/assets/{pdf-BNUWc0Kr.js → pdf-CdoB_huE.js} +3 -3
  79. package/dist/assets/{pdf-lib-clv_iGdC.js → pdf-lib-RRzqb1kw.js} +1 -1
  80. package/dist/assets/{plaid-BYfDj3kT.js → plaid-IKw4XOsd.js} +1 -1
  81. package/dist/assets/{pusher-Kk7s6P3d.js → pusher-Cj6_igRe.js} +1 -1
  82. package/dist/assets/{react-Dt710hEm.js → react-BDJBiih3.js} +1 -1
  83. package/dist/assets/{react-D3szvoI3.js → react-BbjDrfEs.js} +1 -1
  84. package/dist/assets/{react-Dzi-2YSW.js → react-BkKsXl-3.js} +1 -1
  85. package/dist/assets/{react-M3dO3ysp.js → react-CCfELnN3.js} +1 -1
  86. package/dist/assets/{react-D_RXy40V.js → react-CppN-oCz.js} +1 -1
  87. package/dist/assets/{react-DSH7yy9o.js → react-D95yXzXQ.js} +1 -1
  88. package/dist/assets/{recharts-CrS5Kd38.js → recharts-BDyAk4nR.js} +3 -3
  89. package/dist/assets/routePaths-C1rKvS5o.js +1 -0
  90. package/dist/assets/{sentry-Bjq7jLMy.js → sentry-CEfOando.js} +1 -1
  91. package/dist/assets/{url-RMDL_YV7.js → url-BQNo9gT5.js} +1 -1
  92. package/dist/assets/{url-Dtn96jHv.js → url-C9_bAZjF.js} +1 -1
  93. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js +1 -0
  94. package/dist/assets/useAskAiCfoHostNavButtonProps-33WX5dhg.js +1 -0
  95. package/dist/assets/useCashManagementBanner-CBJfpbK7.js +1 -0
  96. package/dist/assets/useChargeCardPusherEvents-Cvnaf2Z-.js +1 -0
  97. package/dist/assets/{useDeviceId-C2SjyoZO.js → useDeviceId-DISstVTH.js} +1 -1
  98. package/dist/assets/useEmailConnectResultRefresh-BzWsu8a4.js +1 -0
  99. package/dist/assets/useInitialThreadRequest-Bx57kb_d.js +1 -0
  100. package/dist/assets/{utils-Y3UWLN-V.js → utils-DKj7mVPA.js} +2 -2
  101. package/dist/assets/withTransactionSidePanel-DeW-W6do.js +21 -0
  102. package/dist/assets/zeni-epic-state-Cl3jFj7z.js +13 -0
  103. package/dist/index.html +1 -1
  104. package/package.json +4 -4
  105. package/dist/assets/AddressRoutes-D0pPyHh_.js +0 -1
  106. package/dist/assets/AddressScreen-DJKsJ10Z.js +0 -9
  107. package/dist/assets/AiCfoScreen-D72rCutj.js +0 -22
  108. package/dist/assets/BillPayApprovalRoutes-B-2S4SNn.js +0 -1
  109. package/dist/assets/BillPayRoutes-4uZ7joLO.js +0 -119
  110. package/dist/assets/BusinessVerificationPageScreen-g2faFJJh.js +0 -9
  111. package/dist/assets/ChargeCardRoutes-DpCZ_jyS.js +0 -71
  112. package/dist/assets/ConnectionAuthScreen-ByAXPikh.js +0 -11
  113. package/dist/assets/CustomerOnboardingAuthScreen-D3CEJKzV.js +0 -1
  114. package/dist/assets/CustomerOnboardingRoutes-DR9dynHR.js +0 -23
  115. package/dist/assets/DashboardRoutes-DOnDhlUi.js +0 -20
  116. package/dist/assets/DefaultTenantHome-B2PohhkN.js +0 -1
  117. package/dist/assets/DomesticWireDetailScreen-lJID4K8i.js +0 -18
  118. package/dist/assets/DrawerScreen-drwDX_t8.js +0 -1
  119. package/dist/assets/EntityDetailRoutes-ORWd6K8g.js +0 -1
  120. package/dist/assets/ExpenseAutomationRoutes-CLYPTfXE.js +0 -25
  121. package/dist/assets/FeaturePreviewScreen-2lGXkGnT.js +0 -1
  122. package/dist/assets/HubSpotOAuthCallbackScreen-DWy-9hg1.js +0 -1
  123. package/dist/assets/MagicLinkRoutes-BGVALfKT.js +0 -72
  124. package/dist/assets/MagicLinkSignInScreen-D0cBpIHO.js +0 -12
  125. package/dist/assets/NotFoundScreen-C6fP8ezZ.js +0 -1
  126. package/dist/assets/NotificationRoutes-BKEZI2NF.js +0 -1
  127. package/dist/assets/OAuthConsentScreen-CKsmYMlV.js +0 -1
  128. package/dist/assets/PandLWithForecastRoutes-97f0lT8j.js +0 -1
  129. package/dist/assets/PeopleRoutes-gwhry3Ow.js +0 -22
  130. package/dist/assets/PerformanceRoutes-BNgmYjW8.js +0 -1
  131. package/dist/assets/ReferralListScreen-7zacnt57.js +0 -5
  132. package/dist/assets/ReimbursementApprovalRoutes-yt8YQciv.js +0 -1
  133. package/dist/assets/ReimbursementApprovalRuleDetailScreen-CN_fVdI4.js +0 -1
  134. package/dist/assets/ReimbursementRoutes-BBYA68YB.js +0 -68
  135. package/dist/assets/ReportsRoutes-BYiPKbc6.js +0 -1
  136. package/dist/assets/RewardsRoutes-D631WDFb.js +0 -1
  137. package/dist/assets/ScreenRoutes-CandKxww.js +0 -2
  138. package/dist/assets/SettingsRoutes-Cb24ieWi.js +0 -57
  139. package/dist/assets/SetupPagesScreen-cvYJWiZ-.js +0 -29
  140. package/dist/assets/SignInScreen-UxDhgwJf.js +0 -1
  141. package/dist/assets/SignOutScreen-pyZ6yW6l.js +0 -9
  142. package/dist/assets/TaskListScreen-D3jwxPFn.js +0 -9
  143. package/dist/assets/TaskRoutes-BqQas_t-.js +0 -9
  144. package/dist/assets/TransactionDetailRoutes-zmbZfCAF.js +0 -1
  145. package/dist/assets/TransactionDetailScreen-C_-nFgWB.js +0 -5
  146. package/dist/assets/TransactionListRoutes-8BMGQlvq.js +0 -1
  147. package/dist/assets/TreasuryRoutes-aI9AzHq8.js +0 -37
  148. package/dist/assets/WiseConfirmationScreen-CO23H5IW.js +0 -12
  149. package/dist/assets/ZeniAccountRoutes-C1u_CJhb.js +0 -57
  150. package/dist/assets/ZeniAccountStatementScreen-Byji_IxT.js +0 -9
  151. package/dist/assets/dnd-CtoEWKvO.js +0 -6
  152. package/dist/assets/empty-CNiNdD6H.js +0 -1
  153. package/dist/assets/epic-GX18T2Rd.js +0 -2
  154. package/dist/assets/getLocaleForTenant-CSnj06iQ.js +0 -1
  155. package/dist/assets/index-BXJxTGtH.js +0 -1
  156. package/dist/assets/routePaths-DDv-R3QG.js +0 -1
  157. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-wNyzo2Lm.js +0 -1
  158. package/dist/assets/useAskAiCfoHostNavButtonProps-B-Hj-PQt.js +0 -1
  159. package/dist/assets/useInitialThreadRequest-07AtACng.js +0 -1
  160. package/dist/assets/withTransactionSidePanel-BMgKJwSH.js +0 -21
  161. package/dist/assets/zeni-epic-state-lec4Lm2t.js +0 -13
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-CS0rfBBF.js";import{h as z,u as K,g as Q,i as J,j as d,n as X,o as Z,p as I}from"./core-D6ttr5iw.js";import{eX as O,sd as M,rN as H,MQ as U,rI as S,bs as ee,bn as ae,bY as te,rJ as se,MR as oe,MD as C,dK as re,vS as ne,MS as ce,wd as ie,fE as le,fC as de}from"./zeni-epic-state-Cl3jFj7z.js";import{z as me,Y as fe,$ as pe,I as ue,Q as v,d as $,K as he,e as w,ao as be,s as ge}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import Fe from"./NotFoundScreen-BDl5tn8o.js";import{F as Ie}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as b}from"./sentry-CEfOando.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{u as Se}from"./useInitialThreadRequest-Bx57kb_d.js";import{t as Te}from"./routePaths-C1rKvS5o.js";import{M as ye}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52",s._sentryDebugIdIdentifier="sentry-dbid-0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=X(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(U(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(be);function P(){const s=z(),e=K(),a=Q(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),N=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>M(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:W}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(H());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex(F=>F.id===L):R!=null?f.forecasts.findIndex(F=>F.id===R):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(U(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&g&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,m,u,M,S,g]);const x=ue(),Y=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=v(),{isFeatureEnabled:E}=_($.isReportsCommentingEnabled),q=Se(E?y?.companyId:void 0,{clearParams:l&&m}),[G,V]=b.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:B,onAskAiCfoClick:W,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:q,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>O(c)),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Z,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{MM as te,eX as Y,ky as z,fE as q,fC as ne,Ke as Q,Mq as oe,uP as Ee,MN as N,uE as ke,uZ as Ie,uT as ie,uI as re,uX as Pe,uU as je,MO as le,wE as Le,fo as Te,gf as ve,MP as M,uM as de,uL as ce,v0 as Fe,c6 as Ae}from"./zeni-epic-state-Cl3jFj7z.js";import{Z as pe,Q as J,d as E,z as G,i as ue,D as me,ak as ge,al as Oe,A as he,o as O,G as fe,a as Ce,am as Re,Y as Ve,$ as Ue,K as Ze,e as be,g as Be,s as $e,an as Me,I as Ke}from"./index-ilZtTEZn.js";import{D as ye,n as H,S as we}from"./mui-vLo47rlo.js";import ae from"./NotFoundScreen-BDl5tn8o.js";import{a as r}from"./sentry-CEfOando.js";import{u as ee,i as _e,j as m,h as ze,g as Ge,n as He,o as se,p as $}from"./core-D6ttr5iw.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as Xe}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="d618ae18-9dec-4b80-8081-905200718551",a._sentryDebugIdIdentifier="sentry-dbid-d618ae18-9dec-4b80-8081-905200718551")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},K=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>z(e)),{useFeatureGate:f}=J(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=Q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{R===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=H(we)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,Se=H(fe.H6Regular)`
6
+ margin-top: ${O.sp7};
7
+ padding-left: ${O.sp8};
8
+ padding-right: ${O.sp8};
9
+ color: ${a=>a.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,De=H(fe.LargeRegularSp)`
12
+ color: ${a=>a.theme.colors.hero};
13
+ padding-left: ${O.sp8};
14
+ padding-right: ${O.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${O.sp4};
17
+ white-space: pre-line;
18
+ `,Qe={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>Y(i)),u=m(i=>z(i)),{useFeatureGate:D}=J(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=q(f,d),P=ne(d),T=Q(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,Z=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{R===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},B=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),L=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:T,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:Z};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:F}):null,s.jsx(Re,{...b})]})})},ea=H(we)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,aa=He(function(a,t){const l=le(a),n=G.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:z(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(M({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(M({searchText:o}))}}}})(Me);function X({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=Ge(),{areTenantIdsInSync:o}=Ve(),y=G.getSignedInUser(),h=m(e=>Y(e)),{useFeatureGate:p}=J(),{isFeatureEnabled:R}=p(E.isDebitCardFeatureEnabled),V=m(e=>z(e)),I=!q(R,h)&&V,w=Q(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,T]=r.useState(!1),[v,U]=r.useState("off"),[Z,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:B}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>Le(e.classState,e.classListState)),L=m(e=>Te(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(M({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),T(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(M({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),T(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Ze,{analytics:be,onLoad:e=>e.trackPageLoaded(Be.Event.members)}):null,f===!0?s.jsx(Je,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Ye,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Xe,{isAppContentDrawerOpen:Z,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:L,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(M({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:B})]})}function wa(){const a=Ke();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(X,{})}),s.jsx($,{path:"new",element:s.jsx(X,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(X,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import E from"./NotFoundScreen-BDl5tn8o.js";import{a as r}from"./sentry-CEfOando.js";import{h as _,g as v,j as p,i as M,u as U,N as z,n as P,o as $,p as h}from"./core-D6ttr5iw.js";import{eX as B,S$ as b,bq as F,bn as N,ig as O,fz as V}from"./zeni-epic-state-Cl3jFj7z.js";import{S as q,z as I,$ as X,cY as Y}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as H}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="fe2800c8-046d-4d7e-9bcb-fe976171a445",e._sentryDebugIdIdentifier="sentry-dbid-fe2800c8-046d-4d7e-9bcb-fe976171a445")}catch{}})();const J=P(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(Y),K=()=>{const e=_(),t=v(),c=q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback((a,i,T)=>{u(O({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(V({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return X({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs($,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-Bjq7jLMy.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-CEfOando.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-2V3XhuUi.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-Bjq7jLMy.js";import{L as dt,bT as Tc,eR as Ac,JY as Rc,Kq as kl,c1 as Tl,fp as Al,fq as Rl}from"./zeni-epic-state-lec4Lm2t.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-Y3UWLN-V.js";import{r as un}from"./empty-D1KuG6Gh.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-clv_iGdC.js";import{r as Gl}from"./index-hHuZx5_w.js";import{r as zl}from"./index-BXJxTGtH.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-C5uCD0QC.js";import{u as Kl,z as Pc,L as Wl,K as Jl,M as Xl,h as Ql,d as tf}from"./index-CXNJX-KR.js";import"./mui-Dpp2C1dL.js";import{d as Pe}from"./decodeURIComponentSafe-WSnueMtI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="f8d2d602-d542-48e8-9398-6f8704d35c4d",t._sentryDebugIdIdentifier="sentry-dbid-f8d2d602-d542-48e8-9398-6f8704d35c4d")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-CS0rfBBF.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CEfOando.js";import{L as dt,bY as Tc,eX as Ac,LW as Rc,Mo as kl,c6 as Tl,g1 as Al,g2 as Rl}from"./zeni-epic-state-Cl3jFj7z.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-DKj7mVPA.js";import{r as un}from"./empty-B81gHGCB.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-RRzqb1kw.js";import{r as Gl}from"./index-pFVjg2n3.js";import{r as zl}from"./index-lXh6fiHl.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-D6ttr5iw.js";import{u as Kl,z as Pc,L as Wl,J as Jl,M as Xl,k as Ql,e as tf}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{d as Pe}from"./decodeURIComponentSafe-D0vQ4d1Q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="e1c5219e-5947-41e6-9e5b-95361986cb11",t._sentryDebugIdIdentifier="sentry-dbid-e1c5219e-5947-41e6-9e5b-95361986cb11")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as o}from"./sentry-CEfOando.js";import{j as f,h as V,u as H,g as F,n as N}from"./core-D6ttr5iw.js";import{m as W,Z as _,z as P,bf as $,A as K,Y as M,$ as U,K as z,e as l,g as X,a8 as Y,bg as Z}from"./index-ilZtTEZn.js";import{fI as q,eX as G,Pm as R,Pn as J,vI as Q,vy as g,fK as ee,bS as ae,vD as re,Po as ne}from"./zeni-epic-state-Cl3jFj7z.js";import{D as te,e as se,n as oe,S as ie}from"./mui-vLo47rlo.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as ce}from"./MobileAppDrawer-Sx7ydj7A.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]="a02f8d6e-5e83-4f22-a0f0-5bc54c95432c",e._sentryDebugIdIdentifier="sentry-dbid-a02f8d6e-5e83-4f22-a0f0-5bc54c95432c")}catch{}})();const de={overlayWidth:new K(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=W(),n=_();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx($,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,I="refer-and-earn-status-update",we=N(function(e){const a=R(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(Y(Z));function Se({isReferralDrawerOpen:e}){const a=V(),r=H(),n=F(),[i,u]=o.useState(!1),[c,D]=o.useState(!1),[x,E]=o.useState(!1),[k,C]=o.useState(!1),w=P.getSignedInUser(),h=f(t=>G(t)),m=f(t=>R(t)),v=m.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([m,p]),{areTenantIdsInSync:d}=M();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&x===!1&&(r(Q()),E(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&d&&(u(!0),r(g(!0)))},[v,r,d]),o.useEffect(()=>{!c&&p.fetchState==="Not-Started"&&d&&(D(!0),r(ee(!0)))},[p,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),S=t=>{A(t)},{isAiCfoAccessEnabled:B,onAskAiCfoClick:O}=le({mobileExploreReferrer:"Rewards"});U({isDataReady:y===!0});const T={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,b,L)=>{L.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(z,{analytics:l,onLoad:t=>(b=>{w!=null&&b.trackPageLoaded(X.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:S}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:B,onAskAiCfoClick:O,...T})]})}export{Se as R};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-CS0rfBBF.js";import _ from"./NotFoundScreen-BDl5tn8o.js";import{a as p}from"./sentry-CEfOando.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as O,p as b}from"./core-D6ttr5iw.js";import{eX as I,Qg as g,Qw as S,FD as V,EM as U,FC as d,Ft as $,QK as B,FF as W}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,a8 as L,b_ as Q,af as T,bD as K,b$ as z}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as M,R as A}from"./ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.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]="f2e90a39-cb30-4858-8382-0bbe66f676d6",e._sentryDebugIdIdentifier="sentry-dbid-f2e90a39-cb30-4858-8382-0bbe66f676d6")}catch{}})();const y="reimbursement-approval-rule-update",X=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(L(Q)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,F,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=k(function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}})(L(z)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a));M();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,F,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
@@ -0,0 +1 @@
1
+ import{j as h}from"./liveblocks-CS0rfBBF.js";import{a as f}from"./sentry-CEfOando.js";import{u as T,j as y,h as _,g as O,i as k,n as F}from"./core-D6ttr5iw.js";import{k_ as L,Qw as E,Qg as x,Fw as V,FI as B,FD as A,FE as w,Qx as j,eX as z,FC as K}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,m as P,w as Q,bQ as W,af as $,bD as X,bR as G}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.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]="7769a24f-1b33-4b45-a314-f08c889a339a",e._sentryDebugIdIdentifier="sentry-dbid-7769a24f-1b33-4b45-a314-f08c889a339a")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=y(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=y(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const J=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const b=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const g=(S=m.value,j(S)==null);var S;return{type:g?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),c=I.concat(R);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),b},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(W);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(g=>{const S=g.actorKind?.selectedOption,C=g.selectedRole?.selectedOption;let D=[];S==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const U=g.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=b?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=y(t=>z(t)),{isApprovalRulesV3Enabled:s}=X(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(M,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{h as W,u as me,g as H,i as J,j as w,N as _,n as K,l as mt,o as ct,p as E}from"./core-D6ttr5iw.js";import{eX as V,QL as ce,c6 as de,EH as je,kJ as dt,EU as se,ET as ie,QM as ut,bn as ue,gq as Fe,QN as pt,N8 as bt,ky as De,N9 as Re,Na as gt,jt as ht,Q2 as ft,jI as St,Ev as It,uc as Rt,jA as yt,Ff as Ue,QO as Le,QP as At,QQ as kt,QR as vt,QS as Ct,QT as Et,E$ as ye,jO as wt,Qb as xt,EV as Bt,EF as Tt,QU as jt,EE as Ft,QV as Dt,EN as Ae,F3 as Ut,F2 as Lt,E_ as Pt,QW as Pe,Ke as $t,bq as Mt,EQ as _t,Fx as Nt,QX as Ot,QY as Qt,Fb as zt,F8 as ke,Px as Gt,EC as Zt,QZ as $e,FZ as ve,G5 as Ht,Q_ as Vt,Q$ as G,R0 as Wt,R1 as Me,R2 as Kt,R3 as _e,R4 as Ne,Fn as oe,bu as qt,bK as pe,cG as be,fE as Oe,fC as Qe,R5 as Yt,fz as Jt,PK as Xt,R6 as en,R7 as ze,PO as tn,Qw as nn,R8 as an,QK as sn,G2 as Ce,G1 as on,R9 as rn,Ra as ln,Rb as mn,Rc as cn,Rd as dn,Qh as un,FU as pn,FY as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LY as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-Cl3jFj7z.js";import{S as Ge,Z as Ze,Q as X,d as k,z as M,c0 as He,K as ee,e as v,aL as Ee,o as F,at as Y,D as Cn,a as Ve,c1 as En,s as Z,$ as We,c2 as wn,I as te,c3 as xn,Y as Bn,A as Tn,w as ge,g as Ke,a8 as jn,bo as Fn,a3 as Dn,m as qe,c4 as Un,i as Ln}from"./index-ilZtTEZn.js";import{n as N,S as Pn}from"./mui-vLo47rlo.js";import re from"./NotFoundScreen-BDl5tn8o.js";import{S as we}from"./SetupPagesScreen-CVKPKeC9.js";import{F as Ye}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as f}from"./sentry-CEfOando.js";import{u as he}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{u as Je}from"./useInitialThreadRequest-Bx57kb_d.js";import{D as $n}from"./DrawerScreen-D0g6PABS.js";import{M as Xe}from"./MobileAppDrawer-Sx7ydj7A.js";import{R as Mn}from"./ReimbursementApprovalRoutes-BazeprVG.js";import{FallBackRoute as _n}from"./ScreenRoutes-8R8Dd2d9.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./analyticsHelper-Cq2pq-lr.js";import"./routePaths-C1rKvS5o.js";import"./BusinessVerificationPageScreen-DFgVqXvI.js";import"./ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js";import"./getLocaleForTenant-O3Y2pcaQ.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]="10b4bdab-40a8-4c90-a298-9a324ce9a9eb",e._sentryDebugIdIdentifier="sentry-dbid-10b4bdab-40a8-4c90-a298-9a324ce9a9eb")}catch{}})();const et=e=>`/${e}/reimbursements`,Nn=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:U}}}=Ve.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ue(d),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ce(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${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:y,isUserAdmin:de(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=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ie(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(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(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({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(ye(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ye("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(se({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(Le()),e(At());const i=et(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Ue(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("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(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}})(En);function xe(){const e=W(),t=me(),n=H(),{reimbursementId:r}=J(),d=Ge(),c=Ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=he({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),C=M.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ce(p,r)),L=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=de(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(je(!1,b,y,r)))});const $=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(C==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(z=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&z.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??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 Qn=N.div`
2
+ display: flex;
3
+ position: relative;
4
+ height: 100vh;
5
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,zn=N.div`
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ background-color: ${Cn.overlayBackgroundBlack};
14
+ z-index: 5;
15
+ `,Gn=N.div`
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 42%;
20
+ height: 100%;
21
+ z-index: 6;
22
+ display: flex;
23
+ background-color: transparent;
24
+ overflow: hidden;
25
+ `,Zn=N.div`
26
+ position: fixed;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ z-index: 11;
32
+ display: flex;
33
+ flex-direction: column;
34
+ overflow-y: auto;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ `,Hn=N.button`
37
+ align-self: flex-end;
38
+ background: none;
39
+ border: none;
40
+ cursor: pointer;
41
+ padding: ${F.sp2} ${F.sp3};
42
+ line-height: 1;
43
+ color: ${e=>e.theme.colors.hero};
44
+ &:hover {
45
+ color: ${e=>e.theme.colors.primary};
46
+ }
47
+ svg {
48
+ width: ${F.sp4};
49
+ height: ${F.sp4};
50
+ }
51
+ `,Vn=N.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,Wn=K(function(e,t){const n=Pe(e,t.reimbursementId),r=M.getSignedInUser(),d=ue(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,Qt(t.currentTenant),r));const i=de(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(Le());const a=et(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(ke(n,a.type,"")):e(ke(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(Ue(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=W(),t=me(),n=H(),r=n.hash.substring(1),d=Ge(),{reimbursementId:c}=J(),m=M.getSignedInUser(),o=w(R=>V(R)),a=w(R=>Pe(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Je(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=he({mobileExploreReferrer:"Reimbursement Details"});We({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=X(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,A]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:C}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=w(R=>ce(R,c??"")),L=$t(o),P=Mt(o.userRole),$=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(_t(c,!1,I)))},[u,c,t,$]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(P||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,P,o.isZeni,L,m]),f.useEffect(()=>{j||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(je(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[j,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:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:C,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=K(function(e,t){return{remisReviewView:$e(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(ve("approved",r??""));break;case"reject":e(ve("rejected",r??""))}}}})(xn);function Yn(){const e=W(),t=w(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(c=>$e(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 Q=tn(),tt="bulk-operation-update",le="reimbursement-approval-rule-update",{spendManagement:Jn,common:Be}=Ve.getLocalizedStrings(),Te=Jn.reimbursement.bulkActions,Xn=N.div`
57
+ display: flex;
58
+ min-height: 100%;
59
+ width: 100%;
60
+ flex: 1 1 auto;
61
+ flex-direction: column;
62
+ align-items: center;
63
+ background-color: ${e=>e.theme.colors.grey4};
64
+ `,ea=K(function(e,t){const n=Ne(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=M.getSignedInUser(),c=ue(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,y=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:Q,spendManagementEndPoint:`${Dn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Me(o))},onSubtabChange:o=>{e(G()),e(_e(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(oe(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(le)&&e(sn(!1))},onEventReceived:o=>{o===tt&&e(an())}}})(jn(Fn));function ta(){const e=W(),t=me(),n=H(),r=n.state,d=Ze(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Me(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(_e(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=X(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),T=M.getSignedInUser(),u=w(S=>V(S)),[x,j]=f.useState(!1),[A,D]=f.useState(!1),B=te(),C=B?.loggedInUserRole?.includes("admin")===!0,I=w(S=>Ne(S,Q,h)),{areTenantIdsInSync:g}=Bn(),L=I.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:$}=he({mobileExploreReferrer:"Reimbursement List"});if(We({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(D(!0),t(oe(Q,!0,l,!1,!0)))},[A,Q,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=pe(B?.loggedInUserRoleMap),z=be(B?.loggedInUserRoleMap),ne=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,ae=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=w(S=>Fe(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,fe=S=>{j(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=Oe(it,u),rt=Qe(u),{remisProcessed:q,remisProcessing:Se}=w(S=>Yt(S));f.useEffect(()=>{q===Se&&c!=null&&(t(Jt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?Te.reports:Te.report},{variableName:"_has_",variableValue:q>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:Xt(c)}]})),t(en()),setTimeout(()=>{t(oe(Q,!0,l,!1,!0,!0))},3e3),m(null))},[q,Se]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${tt}`,`private-encrypted-${u.companyId}.${le}`]:[],eventCallback:(S,O,Ie)=>{S.endsWith(le)?Ie.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),Ie.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ye,{}):ae&&(!R||p)||z&&ne?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Ke.Event.reimbursementHome))(S)}):null,s.jsx(Xe,{isAppContentDrawerOpen:x,handleDrawerToggle:fe}),s.jsxs(Xn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Yn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Q,isAdmin:C,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{fe(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:P,onAskAiCfoClick:$,...lt})]})]}):nt&&p?s.jsx(_,{to:"../setup"}):B!=null&&ze(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(ge,{fetchState:"In-Progress"}):s.jsx(re,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
65
+ display: flex;
66
+ min-height: 100%;
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=W(),t=H(),{tenantEmailDomain:n}=J(),r=qe(),[d,c]=f.useState(!1),m=w(A=>V(A)),o=M.getSignedInUserTenant(n)?.companyId??m.companyId,a=M.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),y=pe(b?.loggedInUserRoleMap),h=be(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=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"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(D=>D.trackPageLoaded(Ke.Event.reimbursementPromoPage))(A)}),s.jsx(Xe,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(ge,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=w(ae=>V(ae)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=qe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=X(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=Oe(a,e),l=Qe(e),b=e?.userRole!=null&&gn(e?.userRole),y=(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=pe(t?.loggedInUserRoleMap),x=T&&u,{isFeatureEnabled:j}=m(k.isDepositAccountsFeatureEnabled),A=j&&!b&&Sn(t?.loggedInUserRoleMap),D=Ln(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),C=Rn(t?.loggedInUserRoleMap),I=yn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=kn(t?.loggedInUserRoleMap),P=vn(t?.loggedInUserRoleMap),$=be(t?.loggedInUserRoleMap),R=D&&L,{tenantEmailDomain:p}=J(),z=H(),ne=n===!0&&(u||$&&c);return s.jsxs(ct,{children:[z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"verification",element:s.jsx(we,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:C,productType:"reimbursement",type:"verification"})}),s.jsx(E,{path:"setup",element:s.jsx(we,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:C,productType:"reimbursement",type:"setup"})}),s.jsx(E,{path:"promo",element:s.jsx(oa,{})}),s.jsx(E,{path:"approval-rules/*",element:x?s.jsx(Mn,{}):s.jsx(_n,{isUserHasZeniAccountsAccess:I,isUserHasBillPayAccess:P,isUserHasReimbursementAccess:$,isUserHasTreasuryAccess:g,isTenantBankingOnly:i,showChargeCardRoute:R,tenantEmailDomain:p??""})}),ne&&s.jsx(E,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(E,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&ze(e,t?.loggedInUserRoleMap)&&s.jsx(E,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(E,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"new",element:s.jsx(xe,{})}),s.jsx(E,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(E,{path:":reimbursementId/edit",element:s.jsx(xe,{})}),s.jsx(E,{path:"*",element:s.jsx(re,{})})]}):s.jsx(E,{path:"*",element:s.jsx(ge,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(E,{path:"*",element:s.jsx(re,{})})]})}export{Pa as default};
@@ -0,0 +1 @@
1
+ import{j as p}from"./liveblocks-CS0rfBBF.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as H}from"./core-D6ttr5iw.js";import{eX as v,fT as w,Mp as Te,ky as Z,qS as X,rH as A,km as Re,jq as Me,vc as J,rM as Oe,bs as Ae,Mq as Fe,bn as ke,wl as De,Mr as Ee,Ms as je,v4 as Pe,Mt as Y,Mu as ve,Mv as Le,Mw as Be,Mx as Ve,My as I,Mz as F,MA as k,MB as q,MC as D,MD as E,dK as Ue,w1 as xe,vR as N,vS as $,w7 as ze,vW as K,wd as Ge,ME as He,MF as Ye,MG as qe,MH as Ne,MI as $e,fE as Ke,fC as Qe}from"./zeni-epic-state-Cl3jFj7z.js";import{R as We,V as Ze,W as Xe,X as Je,Z as ea,Q as ee,d as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,K as ra,e as P,g as ia,a0 as la,s as se,a1 as ca,a2 as da,a3 as pa}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import fa from"./NotFoundScreen-BDl5tn8o.js";import{F as ma}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as _}from"./sentry-CEfOando.js";import{u as ua}from"./useInitialThreadRequest-Bx57kb_d.js";import{t as Q,a as W,b as _a}from"./routePaths-C1rKvS5o.js";import{M as ha}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="06403b31-f3c5-49d7-8d66-1419e33f2214",e._sentryDebugIdIdentifier="sentry-dbid-06403b31-f3c5-49d7-8d66-1419e33f2214")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(qe()),e(Ne()),e($e())},ga=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(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:Z(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;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,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({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(K(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(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($(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(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(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(q({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({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(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({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(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Z(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Ze(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=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 za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-CS0rfBBF.js";import{Q as j,z as w,aR as y,K as E,e as p,g as F,d7 as P,d as T}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import m from"./NotFoundScreen-BDl5tn8o.js";import{a as f}from"./sentry-CEfOando.js";import{u as L,j as b,h as R,g as V,n as A,o as U,p as u}from"./core-D6ttr5iw.js";import{eX as z,TD as C,PX as G,TE as v,vI as K,fK as X,TF as Y,vG as O}from"./zeni-epic-state-Cl3jFj7z.js";import{R as x}from"./ReferralListScreen-DNdLnut4.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./MobileAppDrawer-Sx7ydj7A.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6192166c-9a62-4d32-b2f1-8af86b346738",a._sentryDebugIdIdentifier="sentry-dbid-6192166c-9a62-4d32-b2f1-8af86b346738")}catch{}})();const Q=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),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)}a(O())},onUpdateInviteFormLocalData:s=>{a(Y({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const a=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=R(),D=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),I=G(k);f.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(K()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(X(!0)))},[l.fetchState,a]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(Q,{navigate:c,location:D,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(u,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(q,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Brg8B8gk.js","assets/sentry-CEfOando.js","assets/core-D6ttr5iw.js","assets/zeni-epic-state-Cl3jFj7z.js","assets/index-ilZtTEZn.js","assets/mui-vLo47rlo.js","assets/analytics-Ba6zmRos.js","assets/utils-DKj7mVPA.js","assets/withTransactionSidePanel-DeW-W6do.js","assets/useAskAiCfoHostNavButtonProps-33WX5dhg.js","assets/TransactionDetailScreen-DB5lxQrk.js","assets/decodeURIComponentSafe-D0vQ4d1Q.js","assets/routePaths-C1rKvS5o.js","assets/NotFoundScreen-BDl5tn8o.js","assets/useInitialThreadRequest-Bx57kb_d.js","assets/analyticsHelper-Cq2pq-lr.js","assets/CompanyPassportScreen-DavSJynu.js","assets/MobileAppDrawer-Sx7ydj7A.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js","assets/FeaturePreviewScreen-Y7t6ABdh.js","assets/ReferralListScreen-DNdLnut4.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-jZS0wJcj.js","assets/AddressScreen-ScWWmTbP.js","assets/DomesticWireDetailScreen-jS6brB2p.js","assets/DrawerScreen-D0g6PABS.js","assets/SetupPagesScreen-CVKPKeC9.js","assets/BusinessVerificationPageScreen-DFgVqXvI.js","assets/BillPayApprovalRoutes-CQmYX8YN.js","assets/ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js","assets/getLocaleForTenant-O3Y2pcaQ.js","assets/ReimbursementRoutes-Bb9JPi0m.js","assets/ReimbursementApprovalRoutes-BazeprVG.js","assets/TransactionListRoutes-6SM8gNlu.js","assets/ZeniAccountStatementScreen-D9UEHLLF.js","assets/SettingsRoutes-oK_kou4I.js","assets/accountMappingHelper-s2xO6MjH.js","assets/useEmailConnectResultRefresh-BzWsu8a4.js","assets/QBOConnectionScreen-DXq_HXCX.js","assets/empty-B81gHGCB.js","assets/index-pFVjg2n3.js","assets/url-BQNo9gT5.js","assets/index-lXh6fiHl.js","assets/ReportsRoutes-DB2v4EPm.js","assets/ChargeCardRoutes-BPGek5pB.js","assets/useChargeCardPusherEvents-Cvnaf2Z-.js","assets/PeopleRoutes-x62_g_WP.js","assets/ExpenseAutomationRoutes-D3rXxAM_.js","assets/TreasuryRoutes-DHuVCY9q.js","assets/useCashManagementBanner-CBJfpbK7.js","assets/VendorsRoutes-CwYVQ8VQ.js","assets/pathToGoBack-CkJN8BOO.js","assets/ZeniAccountRoutes-u96OM2YN.js","assets/AddressRoutes-BqX5wkCR.js","assets/PandLWithForecastRoutes-DjwWiUAb.js","assets/CustomerOnboardingRoutes-6ipmFo_1.js","assets/TransactionDetailRoutes-B4ryZwp2.js","assets/EntityDetailRoutes-qim0q068.js","assets/NotificationRoutes-Cdcu8PTz.js","assets/PerformanceRoutes-DQciMsYC.js","assets/RewardsRoutes-ChJyJSHY.js","assets/TaskRoutes-DoWinBID.js","assets/TaskListScreen-WRcn05lO.js","assets/AiCfoScreen-quWQqhzX.js","assets/CardsAiCfoScreen-BbBCL2AM.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as as,eX as rs,fE as is,fC as os,gl as ls,fr as cs,cU as Ae,cA as ds,fU as us,cs as ms,bE as _s,bo as Es,fZ as ps,v as As,LX as hs,bs as gs,LY as xs,bK as Is,fW as Ts,bJ as js,bt as Rs,co as Us,LZ as Ds,L_ as bs,cQ as ys,cT as fs,cS as Cs,cz as Hs,cG as vs,oa as he,fA as ge,gv as Os,g1 as xe,gs as Ie,gt as Te,g2 as Ps}from"./zeni-epic-state-Cl3jFj7z.js";import{j as e}from"./liveblocks-CS0rfBBF.js";import{a as v}from"./sentry-CEfOando.js";import{u as Fs,h as Ls,i as ks,g as Bs,j as G,l as je,N as c,o as Vs,p as a}from"./core-D6ttr5iw.js";import{m as Ss,u as Ns,z as D,Q as ws,c as Zs,T as Ms,d as B,i as zs,I as Gs,L as F,a as Re,t as _,P as $s,e as K,l}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{f as Ue}from"./analyticsHelper-Cq2pq-lr.js";import{t as Ys}from"./getLocaleForTenant-O3Y2pcaQ.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new r.Error().stack;j&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[j]="f82ecb94-1a4f-4a10-a990-a5703ddf5add",r._sentryDebugIdIdentifier="sentry-dbid-f82ecb94-1a4f-4a10-a990-a5703ddf5add")}catch{}})();const Ws={dashboard:()=>n(()=>import("./DashboardRoutes-Brg8B8gk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-jZS0wJcj.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-Bb9JPi0m.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-6SM8gNlu.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-oK_kou4I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-DB2v4EPm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-BPGek5pB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>n(()=>import("./PeopleRoutes-x62_g_WP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-D3rXxAM_.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-DHuVCY9q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-CwYVQ8VQ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-u96OM2YN.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=r=>{"requestIdleCallback"in window?requestIdleCallback(r):setTimeout(r,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-DB2v4EPm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Xs=l(()=>n(()=>import("./AddressRoutes-BqX5wkCR.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Js=l(()=>n(()=>import("./PeopleRoutes-x62_g_WP.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),Ks=l(()=>n(()=>import("./PandLWithForecastRoutes-DjwWiUAb.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-6ipmFo_1.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-CwYVQ8VQ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-B4ryZwp2.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>n(()=>import("./EntityDetailRoutes-qim0q068.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),tn=l(()=>n(()=>import("./DashboardRoutes-Brg8B8gk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),be=l(()=>n(()=>import("./BillPayRoutes-jZS0wJcj.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),an=l(()=>n(()=>import("./SettingsRoutes-oK_kou4I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>n(()=>import("./ReimbursementRoutes-Bb9JPi0m.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-u96OM2YN.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-DHuVCY9q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-6SM8gNlu.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-BPGek5pB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-Cdcu8PTz.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),un=l(()=>n(()=>import("./PerformanceRoutes-DQciMsYC.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mn=l(()=>n(()=>import("./ExpenseAutomationRoutes-D3rXxAM_.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-ChJyJSHY.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),En=l(()=>n(()=>import("./TaskRoutes-DoWinBID.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-quWQqhzX.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>n(()=>import("./CardsAiCfoScreen-BbBCL2AM.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>n(()=>import("./NotFoundScreen-BDl5tn8o.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),An=l(()=>n(()=>import("./TaskListScreen-WRcn05lO.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:r}){const j=Fs(),V=Ls(),{tenantEmailDomain:o}=ks(),S=Ss().mode,{setLoading:C,clearAllLoading:O,clearLoading:N}=Ns(),f=D.getSignedInUserTenant(o)?.tenantId,I=D.getSignedInUser(),se=as(I),$=Bs(),[w,He]=v.useState(!1),i=G(t=>rs(t)),{useFeatureGate:L}=ws(),M=Zs(),ne=Ms(),{isFeatureEnabled:ve}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Oe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Pe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),R=G(t=>t.tenantState.fetchState),T=G(t=>t.tenantState.activeTenantFetchState.fetchState),E=T==="Completed"||R==="Completed"?is(te,i):void 0,Q=T==="Completed"||R==="Completed"?os(i):void 0,Fe=zs(i,Pe,te),{isFeatureEnabled:Le}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=L(B.isAiCfoFileUploadEnabled),Y=G(t=>ls(t));if(o!=null){const t=D.getSignedInUserTenant(o);I!=null&&t!=null&&Ue(I,i,S)}const z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ae=cs(),p=Gs(),ke=i.company==null||p?.loggedInUserRoleMap!=null&&Ae(p.loggedInUserRole),Be=ds(p?.loggedInUserRoleMap),re=v.useRef(!0),ie=je("/:tenantEmailDomain/onboarding/*")!==null,J=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(t=>z.tenantId!=null?us(t,z.tenantId):void 0);v.useEffect(()=>{C(F.TENANT_FETCHING),r(o)},[o]),v.useEffect(()=>{if(J!=null&&f!=null){const t=J.params.selectedPeriod;if(t!=null){const U=t.split("-");if(U.length===2){const d=ms(Number(U[0])),s=Number(U[1]),u=_s(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();u.isAfter(Z,"month")===!1?j(ps(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,f]),v.useEffect(()=>{w||(He(!0),C(F.TENANT_FETCHING)),re.current?re.current=!1:!As(ae,z)&&D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s){if(ge(U?.userId,U?.zeniSessionId,t.tenantId),d(Os(!0)),d(xe(t.tenantId)),t.tenantId!=null&&_.clearTenant(t.tenantId),t.tenantId!=null){const u=D.getSignedInUserTenantWithId(t.tenantId);s&&Re.updateAppLocaleID(Ys(s)),u?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(u?.tenantEmailDomain)}t.userId!=null?K.identify(t.userId,{tenant_id:t.tenantId}):K.resetUserIdentity()}(z,I,j,Ve))},[z,ae,I,j,D]),v.useEffect(()=>{D.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s,u,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&u?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(W&&ss){k(xe(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(u?.userId,u?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)))}else W&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),W&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)));if(W){K.identify(u.userId,{tenant_id:s});const q=s==null||s!=null&&(U==="Completed"||U==="Error");t==="Completed"||U!=="Not-Started"&&U!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ps(u.userId,s,u.zeniSessionId))),q&&(t==="Not-Started"||t==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(he(u.userId,u.zeniSessionId)))}}(R,T,i,f,I,C,j))},[f,T]),v.useEffect(()=>{D.isSignedIn()&&R==="Completed"&&Y.tenantsBaseInOrder.length>0&&(N(F.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),I!=null&&Ue(I,i,S,void 0,Y.tenantsBaseInOrder))},[Y,R,i,I]),v.useEffect(()=>{T==="In-Progress"&&C(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):T==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),N(F.TENANT_FETCHING),N(F.TENANT_SWITCHING))),R!=="Completed"&&R!=="Error"||(R==="Completed"?_.markAllTenantsFetchCompleted():R==="Error"&&_.markAllTenantsFetchFailed())},[T,R,f,w]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&T==="Completed"&&w&&(oe.current=!0,function(t=qs,U=3e3){setTimeout(()=>{const d=s=>{if(s>=t.length)return;const u=t[s],Z=Ws[u];Z!=null?Z().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},U)}())},[T,w]);const H=i?.userRole!=null&&gs(i?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ne=i?.userRole!=null&&i.userRole.includes("charge_card_user"),we=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&Ae(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!H,ce=Fe&&!H,Ze=xs(p?.loggedInUserRoleMap),Me=i.externalConnections?.accounting[0]?.isValid,de=i.company?.companyOnboardingInfo.isOnboardingCompleted,ue=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!H,me=ue&&Is(p?.loggedInUserRoleMap),_e=ve&&!H,ze=i.company!=null&&Ts(i.company),Ge=Oe&&ze===!0&&!H,$e=le&&js(p?.loggedInUserRoleMap),Ye=ce&&Rs(p?.loggedInUserRoleMap),We=_e&&Us(p?.loggedInUserRoleMap),qe=Ds(p?.loggedInUserRoleMap),Qe=bs(p?.loggedInUserRoleMap),A=ys(p?.loggedInUserRoleMap),h=fs(p?.loggedInUserRoleMap),Xe=Cs(p?.loggedInUserRoleMap),g=Hs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),Ee=le&&g,pe=ue&&x,Je=_e&&A,Ke=Ge&&h,m=ce&&Xe,es=i.excludedResources?.resources?.find(t=>t.resource==="/invites")!=null||Be===!0||Ze===!0||qe===!0||Qe===!0;return D.isSignedIn()?f==null?R==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&R!=="In-Progress"&&j(he(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||R==="Completed"?(de===!0||se&&!ie)&&Me===!1&&E===!1&&Q===!1?(r(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!w||de!==!1||ie||se?w&&i?.userRole&&E!=null&&Q!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx($s,{}),children:[e.jsx(a,{path:"/",element:e.jsx(hn,{isDashboardAccess:P,isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(tn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Qs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"people/*",element:es||P?e.jsx(Js,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(a,{path:"transaction/*",element:P&&H===!1||Ne||we?e.jsx(nn,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"transactions/*",element:P&&H===!1?e.jsx(ln,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"customer/*",element:P&&H===!1?e.jsx(De,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,isUserHasTreasuryAccess:h,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"vendor/*",element:P&&H===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"tasks",element:e.jsx(An,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(En,{})}),e.jsx(a,{path:"address/*",element:$e||me||We||Ye?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"checking/*",element:Je?e.jsx(rn,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:Ke?e.jsx(on,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:ne===!0?e.jsx(un,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:ne===!0&&H===!1?e.jsx(mn,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(a,{path:"vendors/*",element:ke?e.jsx(sn,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(be,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"settings/*",element:Le?e.jsx(an,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(pn,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(r(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),r(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const hn=({isDashboardAccess:r,isUserHasZeniAccountsAccess:j,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:C,isTenantCardsOnly:O,showChargeCardRoute:N})=>C===!0&&j?e.jsx(c,{to:"checking"}):O===!0&&N?e.jsx(c,{to:"cards"}):r?e.jsx(c,{to:"dashboard"}):j?e.jsx(c,{to:"checking"}):S?e.jsx(c,{to:"treasury"}):N?e.jsx(c,{to:"cards"}):V?e.jsx(c,{to:"bills"}):o?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:r,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:o,isTenantBankingOnly:S,showChargeCardRoute:C,tenantEmailDomain:O})=>S===!0||r?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(In,{tenantEmailDomain:O}):C?e.jsx(jn,{tenantEmailDomain:O}):j?e.jsx(xn,{tenantEmailDomain:O}):V?e.jsx(gn,{tenantEmailDomain:O}):e.jsx(y,{}),gn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/reimbursements`}),xn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/bills`}),In=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/treasury`}),Tn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/checking`}),jn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/cards`}),Ce=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/dashboard`});export{b as FallBackRoute,Nn as default};
@@ -0,0 +1,57 @@
1
+ import{j as o}from"./liveblocks-CS0rfBBF.js";import{a as d}from"./sentry-CEfOando.js";import{h as z,g as Q,u as O,j as b,s as ce,n as $,i as G,o as W,p as w}from"./core-D6ttr5iw.js";import{bn as Pe,eX as D,gq as De,n0 as le,Og as Me,hG as he,O7 as Ue,qS as Te,ky as fe,mY as _e,hI as Fe,O9 as Oe,O8 as Re,Qy as Be,zj as Ve,EM as ze,Q7 as Le,Qg as Ne,c6 as ne,cL as Qe,cM as $e,M7 as Ge,Qz as He,M8 as Ze,xL as Ke,QA as qe,Hb as Ye,Es as Je,Ej as be,Eg as Xe,xP as Se,Em as ye,Ep as Ce,Ev as te,uc as ae,xO as We,ka as q,kd as Ie,QB as en,le as nn,y2 as tn,M$ as an,N0 as on,k8 as sn,QC as cn,kb as ln,rk as rn,MW as dn,MX as un,ro as pn,hr as gn,Mg as X,hj as re,hg as mn,ho as hn,Mh as fn,x$ as bn,QD as Sn,QE as yn,EJ as Cn,fC as Ee,fE as xe,QF as In,ge as En,Mq as xn,x_ as de,gj as ue,gi as An,xZ as vn,gh as wn,gg as kn,QG as jn,fH as Ae,QH as Pn,QI as Dn,y5 as Mn,xY as pe,QJ as Un,fY as Tn,xV as _n,bZ as Fn,c5 as On,c4 as Rn,b_ as Bn,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as Y,d as F,z as P,af as ve,bS as $n,e as J,g as Gn,bD as Hn,I as H,w as oe,bT as Zn,i as we,bU as Kn,aq as qn,k as ke,bV as Yn,bW as Jn,bX as Xn,Y as Wn,bY as et,s as nt,bZ as tt}from"./index-ilZtTEZn.js";import{n as B}from"./mui-vLo47rlo.js";import{M as R}from"./MobileAppDrawer-Sx7ydj7A.js";import{a as Z,g as K,m as at}from"./accountMappingHelper-s2xO6MjH.js";import{t as ot,A as st}from"./AddressScreen-ScWWmTbP.js";import N from"./NotFoundScreen-BDl5tn8o.js";import{g as it}from"./analyticsHelper-Cq2pq-lr.js";import{B as ct}from"./BusinessVerificationPageScreen-DFgVqXvI.js";import{C as lt}from"./CompanyPassportScreen-DavSJynu.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-BzWsu8a4.js";import{q as ge}from"./QBOConnectionScreen-DXq_HXCX.js";import{B as ut}from"./BillPayApprovalRoutes-CQmYX8YN.js";import{R as pt}from"./ReimbursementApprovalRoutes-BazeprVG.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./routePaths-C1rKvS5o.js";import"./empty-B81gHGCB.js";import"./pdf-lib-RRzqb1kw.js";import"./index-pFVjg2n3.js";import"./url-BQNo9gT5.js";import"./index-lXh6fiHl.js";import"./decodeURIComponentSafe-D0vQ4d1Q.js";import"./ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.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]="ed38793f-dc64-407e-b8e1-4df9f58ccbbb",e._sentryDebugIdIdentifier="sentry-dbid-ed38793f-dc64-407e-b8e1-4df9f58ccbbb")}catch{}})();const gt=B.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,mt=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:fe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Te(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:l,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:p,filing1099Section:m}=n,{incomeAccount:y,expenseAccount:g}=a,{billPayAccount:r}=c,{reimbursementsAccount:f}=u,{prepaidExpensesAccount:E,fixedAssetsAccount:k,accruedExpensesAccount:v}=p,{bankAccount:h,expenseCategory1099:I}=m,x=Z(t.accountMappingView.incomeAccountList,y.selectedOption),T=Z(t.accountMappingView.expenseAccountList,g.selectedOption),M=Z(t.accountMappingView.billPayAccountList,r.selectedOption),L=Z(t.accountMappingView.reimbursementsAccountList,f.selectedOption),V=K(t.accountMappingView.prepaidExpensesAccountList,E.selectedOptions),S=K(t.accountMappingView.fixedAssetsAccountList,k.selectedOptions),U=K(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),C=K(t.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),A=at(t.accountMappingView.expenseAccounts1099FilingAccountList,I),_={selectedIncomeAccountId:x?.accountId,selectedExpenseAccountId:T?.accountId,selectedBillPayAccountId:M?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:V.map(j=>j.accountId),selectedFixedAssetsAccountIds:S.map(j=>j.accountId),selectedAccruedExpensesAccountIds:U.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:C.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:A};e(Re({data:_}))},onBackClick:()=>{ve(l)===!1?(s("../../dashboard"),e(Oe())):e(he())},onSaveClick:()=>{e(Fe()),i&&J.track(Gn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(_e(t.currentTenant.companyId,n))}}})($n),ht=()=>{const e=z(),t=Q(),s=O(),{useFeatureGate:l,useDynamicConfig:i}=Y(),{isFeatureEnabled:n}=l(F.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=l(F.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),p=!u&&c?.capitalization_enabled===!0,m=P.getSignedInUser(),y=Pe(m),g=b(C=>D(C)),{capitalizableAccounts:r,capitalizableAccountOverrides:f,isCapitalizationThresholdSaving:E,currencySymbol:k}=b(C=>{const A=C.tenantState.currentTenantId,_=A!=null?C.tenantState.tenantsById[A]:void 0,j=De(C.companyState,g.companyId);return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizableAccountOverrides:_?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:C.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=d.useCallback((C,A)=>{s(le(g.companyId,C,A))},[s,g.companyId]),h=d.useCallback(C=>{const A={...f??{}},_=Object.entries(C);for(const[se,ie]of _)ie===null?delete A[se]:A[se]=ie;const[j,je]=_[0]??[];j!=null&&s(le(g.companyId,j,je,void 0,Object.keys(A).length>0?A:null))},[s,g.companyId,f]),I=b(C=>Me(C.accountState),ce),x=d.useMemo(()=>{const C={};for(const A of I)A.accountId!=null&&A.accountName!=null&&(C[A.accountId]=A.accountName);return C},[I]),[T,M]=d.useState(!1),[L,V]=d.useState(!1);d.useEffect(()=>{T===!1&&(s(he()),M(!0))},[T]);const S=b(C=>Ue(C)),U=C=>{V(C)};return o.jsxs(gt,{children:[o.jsx(R,{isAppContentDrawerOpen:L,handleDrawerToggle:U}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:S,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:p,capitalizableAccounts:r,accountNamesById:x,capitalizableAccountOverrides:f,currencySymbol:k,isCapitalizationThresholdSaving:E,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:h,location:t,isSettings:ve(t),onClickMenuIcon:()=>U(!0)})]})},ft=B.div`
10
+ display: flex;
11
+ height: 100%;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,bt=$(function(e,t){const s=D(e),l=Le(e),i=Ne(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ne(s?.userRole??[])||n)&&"readonly",billpayApprovalView:l,remiApproverView:i,analytics:J}},function(e,t){const{navigate:s,currentTenant:l}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Zn),St=()=>{const e=z(),t=Q(),s=O(),{tenantEmailDomain:l}=G(),[i,n]=d.useState(!1),[a,c]=d.useState(!1),[u,p]=d.useState(!1),m=b(I=>D(I)),y=b(I=>I.billPaySetupApproverViewState.fetchState),g=b(I=>I.remiSetupApproverViewState.fetchState),r=b(I=>Be(I)),{isApprovalRulesV3Enabled:f,isLoading:E}=Hn(m?.tenantId),k=m.companyId??P.getSignedInUserTenant(l)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=H();d.useEffect(()=>{u||y!=="Not-Started"||E||(p(!0),s(Ve(!0,!0,f)))},[u,y,E,f,s]),d.useEffect(()=>{a||g!=="Not-Started"||E||(c(!0),s(ze(!0,!1,!1,f)))},[a,g,E,f,s]);const h=I=>{n(I)};return v?.loggedInUserRoleMap!=null?o.jsxs(ft,{children:[o.jsx(R,{isAppContentDrawerOpen:i,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:t,companyId:k,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(oe,{fetchState:r.fetchState})},yt=B.div`
18
+ display: flex;
19
+ height: 100%;
20
+ width: 100%;
21
+ flex: 1 1 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,Ct=$(function(e,t){const{companyId:s,isZeniAccountEnabled:l,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=D(e);return{bankSetupView:qe(e,s,n,a,l,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,t){const{navigate:s,currentTenant:l,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(ae(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(te(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,p)=>{e(Ce(n,a,p,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(ye(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(Se(a,n))},onUpdateAccountClick:(n,a,c,u,p)=>{e(p==="paymentAccount"?be(n,a,c,u):Xe(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(Je(i,a,n,c))},onRemoveConnection:n=>{e(Ye(n))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),It=()=>{const e=z(),t=Q(),s=O(),{tenantEmailDomain:l}=G(),i=H(),{useFeatureGate:n}=Y(),{isFeatureEnabled:a}=n(F.isChargeCardFeatureEnabled),{isFeatureEnabled:c}=n(F.isDebitCardFeatureEnabled),[u,p]=d.useState(!1),[m,y]=d.useState(!1),g=b(M=>D(M)),r=b(M=>M.settingsViewState.bankConnection.fetchState),f=Qe(g,i?.loggedInUserRoleMap),E=$e(g,i?.loggedInUserRoleMap),k=Ge(g,i?.loggedInUserRoleMap),v=He(g,i?.loggedInUserRoleMap),h=we(g,a,c),I=Ze(g,i?.loggedInUserRoleMap)&&h,x=g.companyId??P.getSignedInUserTenant(l)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect(()=>{m||r==="Completed"||(y(!0),s(Ke(!1)))},[m,s,r]);const T=M=>{p(M)};return f||k||E||I?o.jsxs(yt,{children:[o.jsx(R,{isAppContentDrawerOpen:u,handleDrawerToggle:T}),o.jsx(Ct,{navigate:e,location:t,companyId:x,currentTenant:g,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:E,isZeniAccountEnabled:k,isChargeCardEnabled:I,isTreasuryEnabled:v,onClickMenuIcon:()=>{T(!0)}})]}):o.jsx(N,{})},Et=B.div`
26
+ display: flex;
27
+ height: 100%;
28
+ width: 100%;
29
+ flex: 1 1 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,xt=$(function(e,t){const{companyId:s}=t,l=D(e),i=t.roleMap.bill_pay_admin,n=en(e,s),{uiState:a}=n,c=(ne(l?.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:a,stripeKey:ke.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:l.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:J}},function(e,t){const{navigate:s,currentTenant:l,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(ae("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(te(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(Ce(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(ye(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(be(n,a,"billing","billing_setup"))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ie(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(sn(n,a,c))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const a=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Yn),At=()=>{const e=z(),t=Q(),s=O(),{tenantEmailDomain:l}=G(),[i,n]=d.useState(!1),[a,c]=d.useState(!1),[u,p]=d.useState(!1),m=b(h=>D(h)),y=b(h=>h.cardPaymentViewState),g=b(h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=qn(y.addCardPaymentSourceStatus.fetchState),f=y.addCardPaymentSourceStatus.fetchState,E=m.companyId??P.getSignedInUserTenant(l)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=H();d.useEffect(()=>{E!=null&&s(We(E,!1))},[E,s]),d.useEffect(()=>{a||(c(!0),s(q()))},[a,s]),d.useEffect(()=>{u||(Ie(["card"]),p(!0))},[u]),d.useEffect(()=>{r==="In-Progress"&&f==="Completed"&&s(q())},[r,f]);const v=h=>{n(h)};return k?.loggedInUserRoleMap!=null?o.jsxs(Et,{children:[o.jsx(R,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(xt,{navigate:e,location:t,companyId:E,currentTenant:m,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:ke.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},ee="external_integrations",vt=$(function(e){const t=un(e,ee);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:l,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{ge.init("/connection/auth",n),ge.handleClick()},onRefreshClick:()=>{l.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(c,u)=>{const p=l.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;p!=null&&e(hn(a,p,X("revenue"),fn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const p=l.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(p!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:p,redirect_uri:m,tenant_id:a}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(mn(a,c,X(u)))},onConnectGmail:()=>{e(re(a,"gmail",window.location.href))},onConnectOutlook:()=>{e(re(a,"outlook",window.location.href))},onSaveConnectorCredentials:c=>{e(gn(a,X("payments"),c))},onNotifyMe:c=>{e(pn(ee,c,i))}}})(Jn),wt=()=>{const e=z(),t=O(),{tenantEmailDomain:s}=G();rt();const[l,i]=d.useState(!1),n=b(h=>h.tenantState.fetchState),a=b(h=>D(h)),c=a.companyId??P.getSignedInUserTenant(s)?.companyId,u=P.getSignedInUser(),p=H(),m=ne(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");d.useEffect(()=>{t(rn(ee))},[t]);const[y,g]=d.useState(!1);d.useEffect(()=>{y||(g(!0),t(q()))},[y,t]);const r=h=>{i(h)},f=b(h=>dn(h,c)),E=b(h=>h.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:k,onAddPlaidAccount:v}=dt({companyId:c??a.companyId});return p?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:m,integrationsView:f,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:f.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:f.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:f.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:f.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:f.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(f.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([h,I])=>[h,I?.message])),deleteConnectionState:f.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:f.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:k,onAddPlaidAccount:v,plaidConnectionDetails:E})]}):o.jsx(oe,{fetchState:n})},kt=B.div`
34
+ display: flex;
35
+ height: 100%;
36
+ width: 100%;
37
+ flex: 1 1 auto;
38
+ flex-direction: column;
39
+ align-items: center;
40
+ background-color: ${e=>e.theme.colors.grey4};
41
+ `,jt=B.div`
42
+ display: flex;
43
+ height: 100%;
44
+ width: 100%;
45
+ flex: 1 1 auto;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ background-color: ${e=>e.theme.colors.grey4};
49
+ `,Pt=()=>{const e=O(),{tenantEmailDomain:t}=G(),[s,l]=d.useState(!1),i=b(r=>D(r)).companyId??P.getSignedInUserTenant(t)?.companyId,n=P.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=b(r=>Sn(r,n.userId)),c=b(r=>yn(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,p=r=>{l(r)},m=d.useCallback(r=>{e(ae("user_reimbursement_account",r))},[]),y=d.useCallback(r=>{e(te(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);d.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(Cn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:p}),o.jsx(Xn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:y,onClickMenuIcon:()=>{p(!0)}})]})},Dt=B.div`
50
+ display: flex;
51
+ height: 100%;
52
+ width: 100%;
53
+ flex: 1 1 auto;
54
+ flex-direction: column;
55
+ align-items: center;
56
+ background-color: ${e=>e.theme.colors.grey4};
57
+ `,me=({appContent:e})=>{const t=O(),s=z(),l=Q(),[i,n]=d.useState(!1),a=b(S=>D(S)),{tenantEmailDomain:c}=a,u=a.companyId??P.getSignedInUserTenant(c)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(F.isDepositAccountsFeatureEnabled),{isFeatureEnabled:y}=p(F.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=p(F.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=p(F.isTreasuryEnabled),f=b(S=>fe(S)),E=Ee(a),k=xe(g,a),v=!k&&f,h=we(a,y,g),{areTenantIdsInSync:I}=Wn();d.useEffect(()=>{I&&t(In(u,v))},[u,t,v,I]);const x=b(S=>En(S,v)),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||u==null,M=xn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,V=S=>{n(S)};return o.jsxs(Dt,{children:[o.jsx(R,{isAppContentDrawerOpen:i,handleDrawerToggle:V}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:f,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:h===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:M===!1,onClickMenuIcon:()=>{V(!0)},isLoading:T,isBankingOnlyTenant:k,isCardsOnlyTenant:E,onAddressClick:S=>{const U=function(A,_){let j=`/${A}/settings/my_profile`;return j=j.concat(`/new/${_}`),j}(c,S),C=nt(l.state?.pathnameStackToGoBack,l.pathname);s(U,{state:{pathnameStackToGoBack:C}})},onGetOtp:S=>{const U={...x.myProfileLocalData,phone:S};t(de({localData:U})),t(kn(S,"MyProfile"))},onResendOtp:S=>{t(wn(S,"MyProfile"))},onCancelClick:()=>{t(vn())},onSaveClick:()=>{t(ue("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(S,U)=>{t(An(S,U,"MyProfile"))},onVerifyOtpSuccess:S=>{S!=null&&P.saveZeniOtpToken(S),t(ue("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:S=>{t(de({localData:S}))}})]})};function Mt(){const e=O(),t=b(r=>D(r)).companyId,s=b(r=>jn(r)),l=b(r=>Ae(r)),i=P.getSignedInUser(),[n,a]=d.useState(!1),c=d.useCallback(r=>{a(r)},[]),u=d.useCallback(r=>{e(Pn(r))},[]),p=d.useCallback(()=>{i?.userEmail!=null&&e(Dn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=d.useCallback(()=>{e(Mn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const y=d.useCallback(()=>{const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,t))},[t,l.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=d.useCallback(()=>{e(Un())},[]);return d.useEffect(()=>{if(l.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,t))}},[s.fetchState,t,l.notificationSettings.monthEndInsightsNotificationSettings.enabled,l.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:u,onCancel:p,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[t,s]=d.useState(!1),l=b(r=>Ae(r)),i=b(r=>D(r)),n=H(),a=P.getSignedInUser(),c=O(),{useFeatureGate:u}=Y(),{isFeatureEnabled:p}=u(F.isDebitCardFeatureEnabled),m=a?.userEmail==null||l.fetchState!=="Completed"||Tn(l.notificationSettings,a.userEmail,p,i);d.useEffect(()=>{l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&t===!1&&(s(!0),c(_n()))},[l.fetchState,t]);const y=xe(p,i),g=Ee(i);return l.fetchState!=="In-Progress"&&l.fetchState!=="Not-Started"||m!==!0?Fn(i)?o.jsxs(W,{children:[On(n?.loggedInUserRole??[],p,i,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"accounting/*",element:o.jsx(ht,{})}),Rn(n?.loggedInUserRole??[],p,i,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"approval_rules/*",element:o.jsx(Ut,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Bn(i,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(i,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"bank_connections",element:o.jsx(It,{})}),zn(i,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(i,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],i)&&o.jsx(w,{path:"billing",element:o.jsx(At,{})}),Qn(n?.loggedInUserRole??[],p,i)&&o.jsx(w,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(w,{path:"my_profile/new/:addressType",element:o.jsx(me,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(w,{path:"my_profile",element:o.jsx(me,{})}),m&&o.jsx(w,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(w,{path:"*",element:o.jsx(N,{})})]}):o.jsx(W,{children:o.jsx(w,{path:"*",element:o.jsx(N,{})})}):null}function Ut(e){return o.jsxs(W,{children:[o.jsx(w,{path:"/",element:o.jsx(St,{})}),o.jsx(w,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(w,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx(N,{})}),o.jsx(w,{path:"*",element:o.jsx(N,{})})]})}export{ga as default};