@zeniai/web-app-ui 5.1.23-dev → 5.1.24-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 (129) hide show
  1. package/dist/assets/AddressRoutes-DocR07FY.js +1 -0
  2. package/dist/assets/AddressScreen-Csre8zO2.js +9 -0
  3. package/dist/assets/{AiCfoScreen-DDKQqune.js → AiCfoScreen-C5oCZlS4.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-DHZpT3No.js → BillPayApprovalRoutes-DcGG_cef.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-C3kWZhA-.js → BillPayRoutes-DjcCRuED.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-Gu3xfWkO.js → BusinessVerificationPageScreen-e2XdUw9z.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-Jy5HjNAq.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-WdmqXh3-.js → CompanyPassportScreen-D8V0b6yZ.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-B37X59g8.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-C_QbqgZM.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-CmcaDbTa.js +23 -0
  12. package/dist/assets/{DashboardRoutes-Cr_qaBQm.js → DashboardRoutes-Crdrh0ru.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-CVoVD99-.js → DefaultTenantHome-CrS-vGpL.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-DuxbN0zG.js +18 -0
  15. package/dist/assets/DrawerScreen-k4ejNFVF.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-Cz3bqJps.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-DUQvgVgE.js +25 -0
  18. package/dist/assets/{FeaturePreviewScreen-CFCMNKBU.js → FeaturePreviewScreen-DX8d8ftd.js} +1 -1
  19. package/dist/assets/HubSpotOAuthCallbackScreen-xn6NQAqC.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-B1WpGs_j.js → MagicLinkRoutes-DQ4uoRpD.js} +9 -9
  21. package/dist/assets/MagicLinkSignInScreen-DrGW2O8V.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-BSk7YHeH.js → MobileAppDrawer-ztL55BFc.js} +1 -1
  23. package/dist/assets/NotFoundScreen-CbugOr9O.js +1 -0
  24. package/dist/assets/{NotificationRoutes-BY3IG0y5.js → NotificationRoutes-CKq0wqeI.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-CEU5OZgL.js +1 -0
  26. package/dist/assets/{PandLWithForecastRoutes-cWGNCcqf.js → PandLWithForecastRoutes-B-40q3h2.js} +1 -1
  27. package/dist/assets/PeopleRoutes-CLPVeXV_.js +22 -0
  28. package/dist/assets/PerformanceRoutes-BRxTGeZG.js +1 -0
  29. package/dist/assets/{Preview-DJmqkFOo.js → Preview-DvwNtgYT.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-Dain4XtO.js → QBOConnectionScreen-B4aVoacL.js} +1 -1
  31. package/dist/assets/ReferralListScreen-wo-BFaOS.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-CwwWIVRR.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BKQV6Gey.js → ReimbursementApprovalRuleDetailScreen-B6hhKpnv.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-Cv7-Cyp4.js → ReimbursementRoutes-DqOur3Qw.js} +10 -10
  35. package/dist/assets/{ReportsRoutes-DEUxYcXP.js → ReportsRoutes-DhxXl2sZ.js} +1 -1
  36. package/dist/assets/RewardsRoutes-U6P7PAVH.js +1 -0
  37. package/dist/assets/{ScreenRoutes-Cd2ZKjlA.js → ScreenRoutes-_YOcQOAn.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-NK-zqL44.js → SettingsRoutes-Txvmet51.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-NvSqWgzr.js → SetupPagesScreen-CW4TDHQ1.js} +5 -5
  40. package/dist/assets/SignInScreen-LFx-lhED.js +1 -0
  41. package/dist/assets/SignOutScreen-Cj8XXvng.js +9 -0
  42. package/dist/assets/{TaskListScreen-DYz0lfQ9.js → TaskListScreen-gDLwnqUy.js} +2 -2
  43. package/dist/assets/{TaskRoutes-D53-F9Tz.js → TaskRoutes-DSsGgBGN.js} +2 -2
  44. package/dist/assets/{TransactionDetailRoutes-NB5jTxua.js → TransactionDetailRoutes-3fJlcVH_.js} +1 -1
  45. package/dist/assets/TransactionDetailScreen-C05AQBgs.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-aQZ7jhPa.js → TransactionListRoutes-B7M8rc9_.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-DRGM_rOp.js +37 -0
  48. package/dist/assets/{VendorsRoutes-Dw3rLW5P.js → VendorsRoutes-C3bYBpA7.js} +22 -22
  49. package/dist/assets/WiseConfirmationScreen-CCLyRCEQ.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-Q8kxFpOw.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-CeoDjC-C.js +9 -0
  52. package/dist/assets/{accountMappingHelper-BprfT0GK.js → accountMappingHelper-BeLxsEhj.js} +1 -1
  53. package/dist/assets/{analytics-i3QajGlB.js → analytics-Dcb_7Yrn.js} +1 -1
  54. package/dist/assets/analyticsHelper-Bgdq7lAB.js +1 -0
  55. package/dist/assets/{core-mrC-JzGi.js → core-B01_r_a6.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-D7hgbcm6.js → decodeURIComponentSafe-BOkChgPc.js} +1 -1
  57. package/dist/assets/{dnd-DZwpImxe.js → dnd-aIvu8cuo.js} +1 -1
  58. package/dist/assets/{empty-p7zsbAY4.js → empty-DLWGhBLz.js} +1 -1
  59. package/dist/assets/{empty-DncJ1CJr.js → empty-DP7Qtv_6.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-nmkuasXW.js → emptyVideoElement-mC3LqJrg.js} +1 -1
  61. package/dist/assets/epic-U_1X8d7m.js +2 -0
  62. package/dist/assets/getLocaleForTenant-BIDDVgBq.js +1 -0
  63. package/dist/assets/{index-D9amQzUe.js → index-B9Boa_Td.js} +2 -2
  64. package/dist/assets/{index-W27fWxOr.js → index-BAIA3LT3.js} +1 -1
  65. package/dist/assets/{index-C9iPRurj.js → index-C7ZZYs3m.js} +1 -1
  66. package/dist/assets/{index-T0lbkIBD.js → index-CKvoU8sU.js} +1 -1
  67. package/dist/assets/{index-CsClpzPd.js → index-DEwFeJzq.js} +1 -1
  68. package/dist/assets/{index-B75Ozwz_.js → index-HFOJdDTm.js} +1 -1
  69. package/dist/assets/{index-HYe9zsmh.js → index-b9cGMwNO.js} +12632 -12576
  70. package/dist/assets/{index-BqRCJPTQ.js → index-fiqC8vZO.js} +1 -1
  71. package/dist/assets/{lexical-9U8kXGr5.js → lexical-CSRsdQQS.js} +1 -1
  72. package/dist/assets/{liveblocks-D8betOTZ.js → liveblocks-CnWjJuBt.js} +1 -1
  73. package/dist/assets/{lottie-CT5flDGi.js → lottie-DUONjUug.js} +1 -1
  74. package/dist/assets/{mui-CtKcfboe.js → mui-DRaG-BlK.js} +1 -1
  75. package/dist/assets/{pathToGoBack-CynAiod2.js → pathToGoBack-3jAhRKQN.js} +1 -1
  76. package/dist/assets/{pdf-CUvE2RE-.js → pdf-UaypZdKm.js} +3 -3
  77. package/dist/assets/{pdf-lib-CClLSROc.js → pdf-lib-t9AAxY-T.js} +1 -1
  78. package/dist/assets/{plaid-DVya51Ew.js → plaid-VN7yDnB4.js} +1 -1
  79. package/dist/assets/{pusher-DSqgf_ao.js → pusher-UqFP2KpO.js} +1 -1
  80. package/dist/assets/{react-BaFQVmTf.js → react-B_Uab5TB.js} +1 -1
  81. package/dist/assets/{react-CozBWqvn.js → react-CFhlJXGh.js} +1 -1
  82. package/dist/assets/{react-B9ErTbNF.js → react-CqO-0SNq.js} +1 -1
  83. package/dist/assets/{react-Klu4yn0H.js → react-DNgryaI2.js} +1 -1
  84. package/dist/assets/{react-BBWa0hDB.js → react-YISROtP4.js} +1 -1
  85. package/dist/assets/{react-Siz_fpzj.js → react-r8LsJVdm.js} +1 -1
  86. package/dist/assets/{recharts-Q6vC6hsk.js → recharts-q0doAU-l.js} +1 -1
  87. package/dist/assets/{routePaths-REpeZ6R0.js → routePaths-Sv0e7DY5.js} +1 -1
  88. package/dist/assets/{sentry-BHRgRpRB.js → sentry-1cGDtjwd.js} +1 -1
  89. package/dist/assets/{url-Cx4mpMZX.js → url-C9c3hZCp.js} +1 -1
  90. package/dist/assets/{url-sKaroM18.js → url-C_w1-pX_.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D-YoPaLt.js → useAiCfoDashboardSuggestedQuestionsChips-BtVPWNXS.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-C1fOlGC9.js +1 -0
  93. package/dist/assets/{useDeviceId-Csejqjvv.js → useDeviceId-DJ_jocMS.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-BO39So_q.js → useInitialThreadRequest-C9kyf2mS.js} +1 -1
  95. package/dist/assets/{utils-B2v0z9lS.js → utils-Y2cylN27.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-BDlHvnIn.js → withTransactionSidePanel-Oei_yMio.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-Beqj4-lt.js → zeni-epic-state-BFnJgXOA.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +11 -6
  100. package/dist/assets/AddressRoutes-iiutr8Jz.js +0 -1
  101. package/dist/assets/AddressScreen-tFmdakWA.js +0 -9
  102. package/dist/assets/ChargeCardRoutes-CDBK5Rsn.js +0 -71
  103. package/dist/assets/ConnectionAuthScreen-CYdP4C61.js +0 -11
  104. package/dist/assets/CustomerOnboardingAuthScreen-B6G9r_f7.js +0 -1
  105. package/dist/assets/CustomerOnboardingRoutes-Do7A7jXR.js +0 -23
  106. package/dist/assets/DomesticWireDetailScreen-D-kY5B9y.js +0 -18
  107. package/dist/assets/DrawerScreen-Dy-FhaRy.js +0 -1
  108. package/dist/assets/EntityDetailRoutes-CXuD_yIT.js +0 -1
  109. package/dist/assets/ExpenseAutomationRoutes-BqOROAyt.js +0 -25
  110. package/dist/assets/HubSpotOAuthCallbackScreen-BZL3fMbo.js +0 -1
  111. package/dist/assets/MagicLinkSignInScreen-BmHDtX_Y.js +0 -12
  112. package/dist/assets/NotFoundScreen-BEFHW4G3.js +0 -1
  113. package/dist/assets/OAuthConsentScreen-C2xZczK4.js +0 -1
  114. package/dist/assets/PeopleRoutes-vbCcQ3ee.js +0 -22
  115. package/dist/assets/PerformanceRoutes-CBUJyIHv.js +0 -1
  116. package/dist/assets/ReferralListScreen-sgTEbSbs.js +0 -5
  117. package/dist/assets/ReimbursementApprovalRoutes-D4DIZDe_.js +0 -1
  118. package/dist/assets/RewardsRoutes-BTu3LH6D.js +0 -1
  119. package/dist/assets/SignInScreen-BB4yXngc.js +0 -1
  120. package/dist/assets/SignOutScreen-C24Lu_iD.js +0 -9
  121. package/dist/assets/TransactionDetailScreen-C-nbZGJm.js +0 -5
  122. package/dist/assets/TreasuryRoutes-DDQ8gehh.js +0 -37
  123. package/dist/assets/WiseConfirmationScreen-CNibKVby.js +0 -12
  124. package/dist/assets/ZeniAccountRoutes-BrBJNwAv.js +0 -57
  125. package/dist/assets/ZeniAccountStatementScreen-DpqB7dh6.js +0 -9
  126. package/dist/assets/analyticsHelper-PpRvwE56.js +0 -1
  127. package/dist/assets/epic-BkgBKn6e.js +0 -2
  128. package/dist/assets/getLocaleForTenant-DlHE4SFU.js +0 -1
  129. package/dist/assets/useAskAiCfoHostNavButtonProps-O_OQACkG.js +0 -1
@@ -1,18 +1,18 @@
1
- import{j as s}from"./liveblocks-D8betOTZ.js";import{h as q,u as re,g as Z,i as X,j as E,N as M,n as K,l as mt,o as ct,p as k}from"./core-mrC-JzGi.js";import{eP as V,O8 as le,c2 as me,Cc as Be,jR as dt,Cp as ne,Co as ae,O9 as ut,bn as ce,fM as Te,Oa as pt,Kv as bt,jG as De,Kw as Se,Kx as gt,iB as ht,Np as ft,iQ as St,C0 as It,sP as yt,iI as Rt,CM as je,Ob as Fe,Oc as Ct,Od as vt,Oe as At,Of as kt,Og as Et,Cw as Ie,iW as wt,Ny as xt,Cq as Bt,Ca as Tt,Oh as Dt,C9 as jt,Oi as Ft,Ci as ye,CA as Ut,Cz as Lt,Cv as Ot,Oj as Ue,HG as Pt,bo as $t,Cl as Mt,D2 as _t,Ok as Nt,Ol as zt,CI as Gt,CF as Re,MU as Ht,C7 as Zt,Om as Le,Dr as Ce,Dz as Vt,On as Wt,Oo as G,Op as qt,Oq as Oe,Or as Kt,Os as Pe,Ot as $e,CU as se,bu as Jt,bG as de,cC as ue,e_ as Me,eY as _e,Ou as Qt,gT as Xt,N5 as Yt,Ov as en,Ow as Ne,N9 as tn,NT as nn,Ox as an,O7 as sn,Dw as ve,Dv as on,Oy as rn,Oz as ln,OA as mn,OB as cn,OC as dn,NE as un,Dm as pn,Dq as bn,bt as gn,bF as hn,cx as fn,cl as Sn,bs as In,Jq as yn,cM as Rn,cO as Cn,cN as vn,cw as An}from"./zeni-epic-state-Beqj4-lt.js";import{F as ze,n as Ge,v as Y,T as v,z as P,bR as He,Z as ee,c as A,aH as Ae,o as j,at as Q,x as kn,D as Ze,bS as En,q as H,_ as Ve,bT as wn,k as te,bU as xn,X as Bn,w as Tn,B as pe,e as We,a7 as Dn,bi as jn,a2 as Fn,h as qe,bV as Un,a9 as Ln}from"./index-HYe9zsmh.js";import{n as _,S as On}from"./mui-CtKcfboe.js";import ie from"./NotFoundScreen-BEFHW4G3.js";import{S as ke}from"./SetupPagesScreen-NvSqWgzr.js";import{F as Ke}from"./FeaturePreviewScreen-CFCMNKBU.js";import{a as f}from"./sentry-BHRgRpRB.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-O_OQACkG.js";import{u as Je}from"./useInitialThreadRequest-BO39So_q.js";import{D as Pn}from"./DrawerScreen-Dy-FhaRy.js";import{M as Qe}from"./MobileAppDrawer-BSk7YHeH.js";import{R as $n}from"./ReimbursementApprovalRoutes-D4DIZDe_.js";import{FallBackRoute as Mn}from"./ScreenRoutes-Cd2ZKjlA.js";import"./recharts-Q6vC6hsk.js";import"./analytics-i3QajGlB.js";import"./plaid-DVya51Ew.js";import"./dnd-DZwpImxe.js";import"./stripe-DMRn4zHo.js";import"./lottie-CT5flDGi.js";import"./lexical-9U8kXGr5.js";import"./pdf-CUvE2RE-.js";import"./utils-B2v0z9lS.js";import"./analyticsHelper-PpRvwE56.js";import"./routePaths-REpeZ6R0.js";import"./BusinessVerificationPageScreen-Gu3xfWkO.js";import"./ReimbursementApprovalRuleDetailScreen-BKQV6Gey.js";import"./getLocaleForTenant-DlHE4SFU.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]="00380fd2-426a-47a7-b773-e8a567eb76d9",e._sentryDebugIdIdentifier="sentry-dbid-00380fd2-426a-47a7-b773-e8a567eb76d9")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Nn=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ot(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(Ct());const i=Xe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=q(),t=re(),n=Z(),{reimbursementId:r}=X(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(v.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),C=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),O=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(C&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:A,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(Ae,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Ae,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:O??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
1
+ import{j as s}from"./liveblocks-CnWjJuBt.js";import{h as K,u as re,g as Z,i as Y,j as E,N as M,n as q,l as mt,o as ct,p as v}from"./core-B01_r_a6.js";import{eP as V,Oa as le,c2 as me,Ce as Be,jR as dt,Cr as ne,Cq as ae,Ob as ut,bn as ce,fM as Te,Oc as pt,Kx as bt,jG as De,Ky as Se,Kz as gt,iB as ht,Nr as ft,iQ as St,C2 as It,sR as yt,iI as Rt,CO as je,Od as Fe,Oe as Ct,Of as At,Og as kt,Oh as vt,Oi as Et,Cy as Ie,iW as wt,NA as xt,Cs as Bt,Cc as Tt,Oj as Dt,Cb as jt,Ok as Ft,Ck as ye,CC as Ut,CB as Lt,Cx as Ot,Ol as Ue,HI as Pt,bo as $t,Cn as Mt,D4 as Nt,Om as _t,On as zt,CK as Gt,CH as Re,MW as Ht,C9 as Zt,Oo as Le,Dt as Ce,DB as Vt,Op as Wt,Oq as G,Or as Kt,Os as Oe,Ot as qt,Ou as Pe,Ov as $e,CW as se,bu as Jt,bG as de,cC as ue,e_ as Me,eY as Ne,Ow as Qt,gT as Yt,N7 as Xt,Ox as en,Oy as _e,Nb as tn,NV as nn,Oz as an,O9 as sn,Dy as Ae,Dx as on,OA as rn,OB as ln,OC as mn,OD as cn,OE as dn,NG as un,Do as pn,Ds as bn,bt as gn,bF as hn,cx as fn,cl as Sn,bs as In,Js as yn,cM as Rn,cO as Cn,cN as An,cw as kn}from"./zeni-epic-state-BFnJgXOA.js";import{K as ze,J as Ge,S as X,c as A,z as P,bR as He,w as ee,d as k,aH as ke,o as j,at as Q,F as vn,D as Ze,bS as En,r as H,Z as Ve,bT as wn,k as te,bU as xn,V as Bn,A as Tn,B as pe,f as We,a7 as Dn,bi as jn,a2 as Fn,h as Ke,bV as Un,a9 as Ln}from"./index-b9cGMwNO.js";import{n as N,S as On}from"./mui-DRaG-BlK.js";import ie from"./NotFoundScreen-CbugOr9O.js";import{S as ve}from"./SetupPagesScreen-CW4TDHQ1.js";import{F as qe}from"./FeaturePreviewScreen-DX8d8ftd.js";import{a as f}from"./sentry-1cGDtjwd.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-C1fOlGC9.js";import{u as Je}from"./useInitialThreadRequest-C9kyf2mS.js";import{D as Pn}from"./DrawerScreen-k4ejNFVF.js";import{M as Qe}from"./MobileAppDrawer-ztL55BFc.js";import{R as $n}from"./ReimbursementApprovalRoutes-CwwWIVRR.js";import{FallBackRoute as Mn}from"./ScreenRoutes-_YOcQOAn.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.js";import"./analyticsHelper-Bgdq7lAB.js";import"./routePaths-Sv0e7DY5.js";import"./BusinessVerificationPageScreen-e2XdUw9z.js";import"./ReimbursementApprovalRuleDetailScreen-B6hhKpnv.js";import"./getLocaleForTenant-BIDDVgBq.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]="3925e0b3-5b7b-4029-b429-8faecb33cc8b",e._sentryDebugIdIdentifier="sentry-dbid-3925e0b3-5b7b-4029-b429-8faecb33cc8b")}catch{}})();const Ye=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:L}}}=Ze.getLocalizedStrings(),_n=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ot(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(vt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(Ct());const i=Ye(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=K(),t=re(),n=Z(),{reimbursementId:r}=Y(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(A.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(A.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(A.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),C=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),O=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(C&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:k,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(_n,{initialOpenThreadRequest:O??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
5
5
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,Gn=_.div`
7
+ `,Gn=N.div`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
11
11
  right: 0;
12
12
  bottom: 0;
13
- background-color: ${kn.overlayBackgroundBlack};
13
+ background-color: ${vn.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,Hn=_.div`
15
+ `,Hn=N.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-D8betOTZ.js";import{h as q,u as re,g as Z,i as X
22
22
  display: flex;
23
23
  background-color: transparent;
24
24
  overflow: hidden;
25
- `,Zn=_.div`
25
+ `,Zn=N.div`
26
26
  position: fixed;
27
27
  top: 0;
28
28
  left: 0;
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-D8betOTZ.js";import{h as q,u as re,g as Z,i as X
33
33
  flex-direction: column;
34
34
  overflow-y: auto;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- `,Vn=_.button`
36
+ `,Vn=N.button`
37
37
  align-self: flex-end;
38
38
  background: none;
39
39
  border: none;
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-D8betOTZ.js";import{h as q,u as re,g as Z,i as X
48
48
  width: ${j.sp4};
49
49
  height: ${j.sp4};
50
50
  }
51
- `,Wn=_.div`
51
+ `,Wn=N.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Nt(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Xe(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{A.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?A.trackReimbursementCancelAndDeleteReimbursement(n):A.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=q(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=X(),m=P.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Je(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Ve({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(v.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[D,C]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(v.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(v.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),O=Pt(o),U=$t(o.userRole),$=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(Mt(c,!1,I)))},[u,c,t,$]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&O===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,O,m]),f.useEffect(()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(C(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:A,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Jn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ce("approved",r??""));break;case"reject":e(Ce("rejected",r??""))}}}})(xn);function Qn(){const e=q(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Jn,{navigate:e,analytics:A,isAdmin:d})}const z=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:we}=Ze.getLocalizedStrings(),xe=Xn.reimbursement.bulkActions,Yn=_.div`
56
+ `,Kn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=_t(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Ye(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function qn(){const e=K(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=Y(),m=P.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Je(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Ve({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=X(),{isFeatureEnabled:T}=h(A.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[D,C]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(A.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(A.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),O=Pt(o),U=$t(o.userRole),$=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(Mt(c,!1,I)))},[u,c,t,$]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&O===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,O,m]),f.useEffect(()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(C(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[D,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Kn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Jn=q(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ce("approved",r??""));break;case"reject":e(Ce("rejected",r??""))}}}})(xn);function Qn(){const e=K(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Jn,{navigate:e,analytics:k,isAdmin:d})}const z=tn(),Xe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Yn,common:we}=Ze.getLocalizedStrings(),xe=Yn.reimbursement.bulkActions,Xn=N.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-D8betOTZ.js";import{h as q,u as re,g as Z,i as X
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ea=K(function(e,t){const n=$e(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:A,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Oe(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;A?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&A.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&A.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ve("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ve("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(Dn(jn));function ta(){const e=q(),t=re(),n=Z(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(Oe(S)):console.log("Warning:Not a valid remiListTab");const N=Kt(r.subTab.toString());N!=null?t(Pe(N)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(v.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(v.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(v.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=E(S=>V(S)),[w,D]=f.useState(!1),[C,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>$e(S,z,h)),{areTenantIdsInSync:g}=Bn(),O=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:$}=be({mobileExploreReferrer:"Reimbursement List"});if(Ve({isDataReady:O==="Completed"}),f.useEffect(()=>{!C&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[C,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Jt(u),p=de(x?.loggedInUserRoleMap),W=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{D(S)},{isFeatureEnabled:it}=a(v.isDebitCardFeatureEnabled),ot=Me(it,u),rt=_e(u),{remisProcessed:J,remisProcessing:he}=E(S=>Qt(S));f.useEffect(()=>{J===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?xe.reports:xe.report},{variableName:"_has_",variableValue:J>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[J,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,N,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):N.entity_type==="reimbursement"&&(m(N.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ke,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[O==="Completed"?s.jsx(ee,{analytics:A,onLoad:S=>(N=>N.trackPageLoaded(We.Event.reimbursementHome))(S)}):null,s.jsx(Qe,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Qn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:$,...lt})]})]}):nt&&p?s.jsx(M,{to:"../setup"}):x!=null&&Ne(u,x.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(On)`
64
+ `,ea=q(function(e,t){const n=$e(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Oe(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(Ae("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Ae("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Xe&&e(an())}}})(Dn(jn));function ta(){const e=K(),t=re(),n=Z(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Kt(r.tab.toString());S!=null?t(Oe(S)):console.log("Warning:Not a valid remiListTab");const _=qt(r.subTab.toString());_!=null?t(Pe(_)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=X(),{isFeatureEnabled:i}=a(A.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(A.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(A.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(A.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(A.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=E(S=>V(S)),[w,D]=f.useState(!1),[C,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>$e(S,z,h)),{areTenantIdsInSync:g}=Bn(),O=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:$}=be({mobileExploreReferrer:"Reimbursement List"});if(Ve({isDataReady:O==="Completed"}),f.useEffect(()=>{!C&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[C,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Jt(u),p=de(x?.loggedInUserRoleMap),W=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{D(S)},{isFeatureEnabled:it}=a(A.isDebitCardFeatureEnabled),ot=Me(it,u),rt=Ne(u),{remisProcessed:J,remisProcessing:he}=E(S=>Qt(S));f.useEffect(()=>{J===he&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?xe.reports:xe.report},{variableName:"_has_",variableValue:J>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Xt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[J,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Xe}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,_,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):_.entity_type==="reimbursement"&&(m(_.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(qe,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[O==="Completed"?s.jsx(ee,{analytics:k,onLoad:S=>(_=>_.trackPageLoaded(We.Event.reimbursementHome))(S)}):null,s.jsx(Qe,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Xn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Qn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:$,...lt})]})]}):nt&&p?s.jsx(M,{to:"../setup"}):x!=null&&_e(u,x.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(On)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:A,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=q(),t=Z(),{tenantEmailDomain:n}=X(),r=qe(),[d,c]=f.useState(!1),m=E(C=>V(C)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=C=>{c(C)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(M,{to:"../../../reimbursements"}):w&&R?s.jsx(M,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:A,onLoad:C=>(F=>F.trackPageLoaded(We.Event.reimbursementPromoPage))(C)}),s.jsx(Qe,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Oa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=qe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=Me(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:D}=m(v.isDepositAccountsFeatureEnabled),C=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),O=An(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=X(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(k,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(k,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(k,{path:"promo",element:s.jsx(oa,{})}),s.jsx(k,{path:"approval-rules/*",element:w?s.jsx($n,{}):s.jsx(Mn,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:O,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:$??""})}),p&&s.jsx(k,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(k,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&Ne(e,t?.loggedInUserRoleMap)&&s.jsx(k,{path:"*",element:s.jsx(M,{to:"../promo"})}),d&&u&&s.jsx(k,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(k,{path:"new",element:s.jsx(Ee,{})}),s.jsx(k,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(k,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(k,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(k,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(k,{path:"*",element:s.jsx(ie,{})})]})}export{Oa as default};
68
+ `,ia=q(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:k,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=K(),t=Z(),{tenantEmailDomain:n}=Y(),r=Ke(),[d,c]=f.useState(!1),m=E(C=>V(C)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=C=>{c(C)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(M,{to:"../../../reimbursements"}):w&&R?s.jsx(M,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:C=>(F=>F.trackPageLoaded(We.Event.reimbursementPromoPage))(C)}),s.jsx(Qe,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Oa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ke(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=X(),{isFeatureEnabled:o}=m(A.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(A.isDebitCardFeatureEnabled),i=Me(a,e),l=Ne(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:D}=m(A.isDepositAccountsFeatureEnabled),C=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),O=kn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=Y(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(v,{path:"verification",element:s.jsx(ve,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(v,{path:"setup",element:s.jsx(ve,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(v,{path:"promo",element:s.jsx(oa,{})}),s.jsx(v,{path:"approval-rules/*",element:w?s.jsx($n,{}):s.jsx(Mn,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:O,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:$??""})}),p&&s.jsx(v,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(v,{path:"/*",element:s.jsx(qe,{})}),t!=null&&_e(e,t?.loggedInUserRoleMap)&&s.jsx(v,{path:"*",element:s.jsx(M,{to:"../promo"})}),d&&u&&s.jsx(v,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(v,{path:"new",element:s.jsx(Ee,{})}),s.jsx(v,{path:":reimbursementId",element:s.jsx(qn,{})}),s.jsx(v,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(v,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(v,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(v,{path:"*",element:s.jsx(ie,{})})]})}export{Oa as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-D8betOTZ.js";import{g as Y,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-mrC-JzGi.js";import{eP as L,fd as I,JT as Te,jG as Q,pB as X,qj as k,ju as Re,iy as Oe,tP as W,qo as Ae,bt as ke,JU as Fe,bn as De,uQ as je,JV as Pe,JW as Ee,tH as Me,JX as K,JY as Le,JZ as Be,J_ as ve,J$ as Ue,K0 as w,K1 as F,K2 as D,K3 as H,K4 as j,K5 as P,dE as Ve,uw as xe,uk as J,ul as q,uC as ze,up as N,uI as Ye,K6 as Ge,K7 as Ke,K8 as He,K9 as Je,Ka as qe,e_ as Ne,eY as $e}from"./zeni-epic-state-Beqj4-lt.js";import{M as Ze,O as Qe,Q as Xe,U as We,n as ea,v as ee,T as E,z as ae,X as aa,k as sa,a as ta,Y as oa,_ as na,Z as ra,c as M,e as ia,$ as la,q as se,a0 as ca,a1 as da,a2 as pa}from"./index-HYe9zsmh.js";import"./mui-CtKcfboe.js";import fa from"./NotFoundScreen-BEFHW4G3.js";import{F as ma}from"./FeaturePreviewScreen-CFCMNKBU.js";import{a as _}from"./sentry-BHRgRpRB.js";import{u as ua}from"./useInitialThreadRequest-BO39So_q.js";import{t as $,a as Z,b as _a}from"./routePaths-REpeZ6R0.js";import{M as ha}from"./MobileAppDrawer-BSk7YHeH.js";import"./recharts-Q6vC6hsk.js";import"./analytics-i3QajGlB.js";import"./plaid-DVya51Ew.js";import"./dnd-DZwpImxe.js";import"./stripe-DMRn4zHo.js";import"./lottie-CT5flDGi.js";import"./lexical-9U8kXGr5.js";import"./pdf-CUvE2RE-.js";import"./utils-B2v0z9lS.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]="d2c9721d-f675-4e6f-9c29-ab45858a4151",e._sentryDebugIdIdentifier="sentry-dbid-d2c9721d-f675-4e6f-9c29-ab45858a4151")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(P({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ke()),e(He()),e(Je()),e(qe())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(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:M,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(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(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ye(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(J(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(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(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(N(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(J(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(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=Ve(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 $(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(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?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?$(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(P({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(D({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(P({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({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(ve({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(K({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Me()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(Pe(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=ge(),s=Ce(),t=Y(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),U=d(n=>Q(n)),O=d(n=>X(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),A=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(k(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!B&&C==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))},[i,B,C,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(W());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,U,O]);const V=sa(),de=V?.loggedInUserRole!=null&&ke(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=Y(),z=Ze(he??"")==="reports",be=Qe(_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:M,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:M,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,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:v,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=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ne(f,e),a=$e(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-CnWjJuBt.js";import{g as z,h as ge,u as Ce,i as Ie,j as d,n as Se,o as we,p as G}from"./core-B01_r_a6.js";import{eP as M,fd as I,JV as Te,jG as Q,pD as W,qs as F,ju as Re,iy as Oe,tR as X,qx as Ae,bt as Fe,JW as ke,bn as De,uS as je,JX as Ee,JY as Pe,tJ as Le,JZ as Y,J_ as Me,J$ as Be,K0 as Ve,K1 as ve,K2 as S,K3 as k,K4 as D,K5 as H,K6 as j,K7 as E,dE as Ue,uy as xe,um as J,un as N,uE as Ke,ur as $,uK as ze,K8 as Ge,K9 as Ye,Ka as He,Kb as Je,Kc as Ne,e_ as $e,eY as qe}from"./zeni-epic-state-BFnJgXOA.js";import{N as Ze,O as Qe,Q as We,T as Xe,J as ea,S as ee,c as P,z as ae,V as aa,k as sa,a as ta,W as oa,Z as na,w as ra,d as L,f as ia,$ as la,r as se,a0 as ca,a1 as da,a2 as pa}from"./index-b9cGMwNO.js";import"./mui-DRaG-BlK.js";import fa from"./NotFoundScreen-CbugOr9O.js";import{F as ma}from"./FeaturePreviewScreen-DX8d8ftd.js";import{a as _}from"./sentry-1cGDtjwd.js";import{u as ua}from"./useInitialThreadRequest-C9kyf2mS.js";import{t as q,a as Z,b as _a}from"./routePaths-Sv0e7DY5.js";import{M as ha}from"./MobileAppDrawer-ztL55BFc.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.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]="8c998e0c-4df7-41ed-a81c-4cf234f81935",e._sentryDebugIdIdentifier="sentry-dbid-8c998e0c-4df7-41ed-a81c-4cf234f81935")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(He()),e(Je()),e(Ne())},ga=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=M(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(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:L,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:W(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(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(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(J(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(N(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(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ke(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(J(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(N(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 Z(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?Z(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:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(k({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Ve({viewMode:a})),e(ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Le()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:V}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>M(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(V?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>Q(n)),O=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),A=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(F(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!B&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,B,C,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(X());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,v,O]);const U=sa(),de=U?.loggedInUserRole!=null&&Fe(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=z(),K=Ze(he??"")==="reports",be=Qe(_e),ye=_.useMemo(()=>K?ba:void 0,[K]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:L,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:L,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,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:V,initialOpenThreadRequest:re})]})}const w=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 Ka(){const e=d(s=>M(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=$e(f,e),a=qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{Ka as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-CnWjJuBt.js";import{S as w,z as x,aN as y,w as E,d as p,f as F,cN as P,c as L}from"./index-b9cGMwNO.js";import"./mui-DRaG-BlK.js";import l from"./NotFoundScreen-CbugOr9O.js";import{a as f}from"./sentry-1cGDtjwd.js";import{u as T,j as b,h as V,g as A,n as R,o as U,p as d}from"./core-B01_r_a6.js";import{eP as z,QG as C,Nk as Q,QH as N,ud as G,f4 as Y,QI as H,ub as O}from"./zeni-epic-state-BFnJgXOA.js";import{R as j}from"./ReferralListScreen-wo-BFaOS.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.js";import"./useAskAiCfoHostNavButtonProps-C1fOlGC9.js";import"./MobileAppDrawer-ztL55BFc.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]="c9ff566d-f839-44b7-924d-3ec13ff7c891",e._sentryDebugIdIdentifier="sentry-dbid-c9ff566d-f839-44b7-924d-3ec13ff7c891")}catch{}})();const q=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=x.getSignedInUser();return{onDismissClick:()=>{e(N()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=w(),u=x.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),k=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),v=Q(S);f.useEffect(()=>{e(N()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),f.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))},[m.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(I=>I.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(q,{navigate:c,location:_,currentTenant:r,companyName:D,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:t?a.jsx(j,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Cr_qaBQm.js","assets/sentry-BHRgRpRB.js","assets/core-mrC-JzGi.js","assets/zeni-epic-state-Beqj4-lt.js","assets/index-HYe9zsmh.js","assets/mui-CtKcfboe.js","assets/analytics-i3QajGlB.js","assets/utils-B2v0z9lS.js","assets/withTransactionSidePanel-BDlHvnIn.js","assets/useAskAiCfoHostNavButtonProps-O_OQACkG.js","assets/TransactionDetailScreen-C-nbZGJm.js","assets/decodeURIComponentSafe-D7hgbcm6.js","assets/routePaths-REpeZ6R0.js","assets/NotFoundScreen-BEFHW4G3.js","assets/useInitialThreadRequest-BO39So_q.js","assets/analyticsHelper-PpRvwE56.js","assets/CompanyPassportScreen-WdmqXh3-.js","assets/MobileAppDrawer-BSk7YHeH.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D-YoPaLt.js","assets/FeaturePreviewScreen-CFCMNKBU.js","assets/ReferralListScreen-sgTEbSbs.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-C3kWZhA-.js","assets/AddressScreen-tFmdakWA.js","assets/DomesticWireDetailScreen-D-kY5B9y.js","assets/DrawerScreen-Dy-FhaRy.js","assets/SetupPagesScreen-NvSqWgzr.js","assets/BusinessVerificationPageScreen-Gu3xfWkO.js","assets/BillPayApprovalRoutes-DHZpT3No.js","assets/ReimbursementApprovalRuleDetailScreen-BKQV6Gey.js","assets/getLocaleForTenant-DlHE4SFU.js","assets/ReimbursementRoutes-Cv7-Cyp4.js","assets/ReimbursementApprovalRoutes-D4DIZDe_.js","assets/TransactionListRoutes-aQZ7jhPa.js","assets/ZeniAccountStatementScreen-DpqB7dh6.js","assets/SettingsRoutes-NK-zqL44.js","assets/accountMappingHelper-BprfT0GK.js","assets/QBOConnectionScreen-Dain4XtO.js","assets/empty-DncJ1CJr.js","assets/index-B75Ozwz_.js","assets/url-sKaroM18.js","assets/index-T0lbkIBD.js","assets/ReportsRoutes-DEUxYcXP.js","assets/ChargeCardRoutes-CDBK5Rsn.js","assets/PeopleRoutes-vbCcQ3ee.js","assets/ExpenseAutomationRoutes-BqOROAyt.js","assets/TreasuryRoutes-DDQ8gehh.js","assets/VendorsRoutes-Dw3rLW5P.js","assets/pathToGoBack-CynAiod2.js","assets/ZeniAccountRoutes-BrBJNwAv.js","assets/AddressRoutes-iiutr8Jz.js","assets/PandLWithForecastRoutes-cWGNCcqf.js","assets/CustomerOnboardingRoutes-Do7A7jXR.js","assets/TransactionDetailRoutes-NB5jTxua.js","assets/EntityDetailRoutes-CXuD_yIT.js","assets/NotificationRoutes-BY3IG0y5.js","assets/PerformanceRoutes-CBUJyIHv.js","assets/RewardsRoutes-BTu3LH6D.js","assets/TaskRoutes-D53-F9Tz.js","assets/TaskListScreen-DYz0lfQ9.js","assets/AiCfoScreen-DDKQqune.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eP as ls,e_ as cs,eY as ds,eZ as ms,fH as us,eT as _s,cP as Ee,cx as Es,fe as As,cp as ps,bE as gs,bq as xs,fj as Is,v as Ts,Jp as hs,bt as js,Jq as Us,bG as Hs,fg as Rs,bF as Ds,bs,cl as ys,Jr as fs,Js as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,mW as Ae,eW as pe,fR as Bs,fn as ge,fO as xe,fP as Ie,fo as ks}from"./zeni-epic-state-Beqj4-lt.js";import{j as e}from"./liveblocks-D8betOTZ.js";import{a as v}from"./sentry-BHRgRpRB.js";import{u as Vs,h as Ss,i as Ns,g as Ms,j as G,l as Te,N as c,o as Zs,p as t}from"./core-mrC-JzGi.js";import{h as ws,u as Gs,z as R,v as zs,a as $s,J as Js,T as L,k as Ws,L as B,D as he,t as _,P as Ys,c as X,l}from"./index-HYe9zsmh.js";import"./mui-CtKcfboe.js";import{f as je}from"./analyticsHelper-PpRvwE56.js";import{t as qs}from"./getLocaleForTenant-DlHE4SFU.js";import"./recharts-Q6vC6hsk.js";import"./analytics-i3QajGlB.js";import"./plaid-DVya51Ew.js";import"./dnd-DZwpImxe.js";import"./stripe-DMRn4zHo.js";import"./lottie-CT5flDGi.js";import"./lexical-9U8kXGr5.js";import"./pdf-CUvE2RE-.js";import"./utils-B2v0z9lS.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="450e195e-3fc4-4dd4-aa6d-79e541a3293d",i._sentryDebugIdIdentifier="sentry-dbid-450e195e-3fc4-4dd4-aa6d-79e541a3293d")}catch{}})();const Ks={dashboard:()=>n(()=>import("./DashboardRoutes-Cr_qaBQm.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-C3kWZhA-.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-Cv7-Cyp4.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-aQZ7jhPa.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-NK-zqL44.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-DEUxYcXP.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-CDBK5Rsn.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-vbCcQ3ee.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-BqOROAyt.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-DDQ8gehh.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-Dw3rLW5P.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-BrBJNwAv.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-DEUxYcXP.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-iiutr8Jz.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-vbCcQ3ee.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-cWGNCcqf.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-Do7A7jXR.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-Dw3rLW5P.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-NB5jTxua.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-CXuD_yIT.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-Cr_qaBQm.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]))),He=l(()=>n(()=>import("./BillPayRoutes-C3kWZhA-.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]))),ln=l(()=>n(()=>import("./SettingsRoutes-NK-zqL44.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),Re=l(()=>n(()=>import("./ReimbursementRoutes-Cv7-Cyp4.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]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-BrBJNwAv.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-DDQ8gehh.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-aQZ7jhPa.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-CDBK5Rsn.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-BY3IG0y5.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),En=l(()=>n(()=>import("./PerformanceRoutes-CBUJyIHv.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-BqOROAyt.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-BTu3LH6D.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),gn=l(()=>n(()=>import("./TaskRoutes-D53-F9Tz.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),xn=l(()=>n(()=>import("./AiCfoScreen-DDKQqune.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-BEFHW4G3.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),In=l(()=>n(()=>import("./TaskListScreen-DYz0lfQ9.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),b=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),q=os(h),z=Ms(),[N,be]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),K=$s(),ye=Js(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),J=G(a=>us(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Ws(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&b!=null){const a=Q.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=xs();m.isAfter(M,"month")===!1?U(Is(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,b]),v.useEffect(()=>{N||(be(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(qs(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(W&&ts){k(ge(s));const Y=R.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)))}else W&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),W&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)));if(W){X.identify(m.userId,{tenant_id:s});const Y=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,b,h,f,U))},[b,A]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&J.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(J.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,J.tenantsBaseInOrder))},[J,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):A==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Qs,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(E?.loggedInUserRoleMap),me=Oe&&!C,Je=r.company!=null&&Rs(r.company),We=Pe&&Je===!0&&!C,Ye=re&&Ds(E?.loggedInUserRoleMap),qe=oe&&bs(E?.loggedInUserRoleMap),Ke=me&&ys(E?.loggedInUserRoleMap),Qe=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),g=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),I=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&I,_e=ce&&T,es=me&&p,ss=We&&g,ns=oe&&x,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Qe===!0||Xe===!0;return R.isSignedIn()?b==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ys,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(In,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(gn,{})}),e.jsx(t,{path:"address/*",element:Ye||de||Ke||qe?e.jsx(en,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(xn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Rn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Rn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),De=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,wn as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Crdrh0ru.js","assets/sentry-1cGDtjwd.js","assets/core-B01_r_a6.js","assets/zeni-epic-state-BFnJgXOA.js","assets/index-b9cGMwNO.js","assets/mui-DRaG-BlK.js","assets/analytics-Dcb_7Yrn.js","assets/utils-Y2cylN27.js","assets/withTransactionSidePanel-Oei_yMio.js","assets/useAskAiCfoHostNavButtonProps-C1fOlGC9.js","assets/TransactionDetailScreen-C05AQBgs.js","assets/decodeURIComponentSafe-BOkChgPc.js","assets/routePaths-Sv0e7DY5.js","assets/NotFoundScreen-CbugOr9O.js","assets/useInitialThreadRequest-C9kyf2mS.js","assets/analyticsHelper-Bgdq7lAB.js","assets/CompanyPassportScreen-D8V0b6yZ.js","assets/MobileAppDrawer-ztL55BFc.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BtVPWNXS.js","assets/FeaturePreviewScreen-DX8d8ftd.js","assets/ReferralListScreen-wo-BFaOS.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-DjcCRuED.js","assets/AddressScreen-Csre8zO2.js","assets/DomesticWireDetailScreen-DuxbN0zG.js","assets/DrawerScreen-k4ejNFVF.js","assets/SetupPagesScreen-CW4TDHQ1.js","assets/BusinessVerificationPageScreen-e2XdUw9z.js","assets/BillPayApprovalRoutes-DcGG_cef.js","assets/ReimbursementApprovalRuleDetailScreen-B6hhKpnv.js","assets/getLocaleForTenant-BIDDVgBq.js","assets/ReimbursementRoutes-DqOur3Qw.js","assets/ReimbursementApprovalRoutes-CwwWIVRR.js","assets/TransactionListRoutes-B7M8rc9_.js","assets/ZeniAccountStatementScreen-CeoDjC-C.js","assets/SettingsRoutes-Txvmet51.js","assets/accountMappingHelper-BeLxsEhj.js","assets/QBOConnectionScreen-B4aVoacL.js","assets/empty-DP7Qtv_6.js","assets/index-HFOJdDTm.js","assets/url-C_w1-pX_.js","assets/index-CKvoU8sU.js","assets/ReportsRoutes-DhxXl2sZ.js","assets/ChargeCardRoutes-Jy5HjNAq.js","assets/PeopleRoutes-CLPVeXV_.js","assets/ExpenseAutomationRoutes-DUQvgVgE.js","assets/TreasuryRoutes-DRGM_rOp.js","assets/VendorsRoutes-C3bYBpA7.js","assets/pathToGoBack-3jAhRKQN.js","assets/ZeniAccountRoutes-Q8kxFpOw.js","assets/AddressRoutes-DocR07FY.js","assets/PandLWithForecastRoutes-B-40q3h2.js","assets/CustomerOnboardingRoutes-CmcaDbTa.js","assets/TransactionDetailRoutes-3fJlcVH_.js","assets/EntityDetailRoutes-Cz3bqJps.js","assets/NotificationRoutes-CKq0wqeI.js","assets/PerformanceRoutes-BRxTGeZG.js","assets/RewardsRoutes-U6P7PAVH.js","assets/TaskRoutes-DSsGgBGN.js","assets/TaskListScreen-gDLwnqUy.js","assets/AiCfoScreen-C5oCZlS4.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eP as ls,e_ as cs,eY as ds,eZ as ms,fH as us,eT as _s,cP as Ee,cx as Es,fe as As,cp as ps,bE as gs,bq as xs,fj as Is,v as Ts,Jr as hs,bt as js,Js as Us,bG as Hs,fg as Rs,bF as Ds,bs,cl as ys,Jt as fs,Ju as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,mW as Ae,eW as pe,fR as Bs,fn as ge,fO as xe,fP as Ie,fo as ks}from"./zeni-epic-state-BFnJgXOA.js";import{j as e}from"./liveblocks-CnWjJuBt.js";import{a as v}from"./sentry-1cGDtjwd.js";import{u as Vs,h as Ss,i as Ns,g as Ms,j as G,l as Te,N as c,o as Zs,p as t}from"./core-B01_r_a6.js";import{h as ws,u as Gs,z as R,S as zs,a as $s,C as Ws,c as L,k as Ys,L as B,D as he,t as _,P as Js,d as X,l}from"./index-b9cGMwNO.js";import"./mui-DRaG-BlK.js";import{f as je}from"./analyticsHelper-Bgdq7lAB.js";import{t as qs}from"./getLocaleForTenant-BIDDVgBq.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="6722c6fd-88f2-421d-a74d-31a11576dc3e",i._sentryDebugIdIdentifier="sentry-dbid-6722c6fd-88f2-421d-a74d-31a11576dc3e")}catch{}})();const Ks={dashboard:()=>n(()=>import("./DashboardRoutes-Crdrh0ru.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-DjcCRuED.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-DqOur3Qw.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-B7M8rc9_.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-Txvmet51.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-DhxXl2sZ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-Jy5HjNAq.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-CLPVeXV_.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-DUQvgVgE.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-DRGM_rOp.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-C3bYBpA7.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-Q8kxFpOw.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-DhxXl2sZ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-DocR07FY.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-CLPVeXV_.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-B-40q3h2.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-CmcaDbTa.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-C3bYBpA7.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-3fJlcVH_.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-Cz3bqJps.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-Crdrh0ru.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]))),He=l(()=>n(()=>import("./BillPayRoutes-DjcCRuED.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]))),ln=l(()=>n(()=>import("./SettingsRoutes-Txvmet51.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),Re=l(()=>n(()=>import("./ReimbursementRoutes-DqOur3Qw.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]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-Q8kxFpOw.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-DRGM_rOp.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-B7M8rc9_.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-Jy5HjNAq.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-CKq0wqeI.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),En=l(()=>n(()=>import("./PerformanceRoutes-BRxTGeZG.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-DUQvgVgE.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-U6P7PAVH.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),gn=l(()=>n(()=>import("./TaskRoutes-DSsGgBGN.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),xn=l(()=>n(()=>import("./AiCfoScreen-C5oCZlS4.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-CbugOr9O.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),In=l(()=>n(()=>import("./TaskListScreen-gDLwnqUy.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),b=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),q=os(h),z=Ms(),[N,be]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),K=$s(),ye=Ws(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),W=G(a=>us(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Ys(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&b!=null){const a=Q.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=xs();m.isAfter(M,"month")===!1?U(Is(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,b]),v.useEffect(()=>{N||(be(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(qs(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(ge(s));const J=R.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(J?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)));if(Y){X.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,b,h,f,U))},[b,A]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,W.tenantsBaseInOrder))},[W,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):A==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Qs,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(E?.loggedInUserRoleMap),me=Oe&&!C,We=r.company!=null&&Rs(r.company),Ye=Pe&&We===!0&&!C,Je=re&&Ds(E?.loggedInUserRoleMap),qe=oe&&bs(E?.loggedInUserRoleMap),Ke=me&&ys(E?.loggedInUserRoleMap),Qe=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),g=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),I=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&I,_e=ce&&T,es=me&&p,ss=Ye&&g,ns=oe&&x,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Qe===!0||Xe===!0;return R.isSignedIn()?b==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Js,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(In,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(gn,{})}),e.jsx(t,{path:"address/*",element:Je||de||Ke||qe?e.jsx(en,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(xn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Rn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Rn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),De=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,wn as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpRB.js";import{h as _,g as B,u as k,j as h,n as R,i as F,o as W,p as I}from"./core-mrC-JzGi.js";import{bn as xe,eP as j,gN as de,Lu as Ee,pB as Ae,jG as ue,lZ as we,gP as je,Lw as Pe,Lv as ke,NV as ve,xO as De,Ch as Ue,Nu as Me,ND as _e,c2 as ee,cH as Te,cI as Be,JB as Re,NW as Fe,JC as Oe,we as Ve,NX as Le,Ex as Ne,BZ as $e,BQ as pe,BN as Ke,wi as ge,BT as me,BW as fe,C0 as ne,sP as te,wh as Je,ji as X,jl as he,NY as Ze,km as Ge,wx as ze,Kp as He,Kq as qe,jg as Qe,NZ as We,jj as Xe,rd as Ye,N_ as en,N$ as nn,rh as tn,gx as an,JK as Q,gm as sn,gt as on,JL as cn,wu as rn,O0 as ln,O1 as dn,Ce as un,eY as be,e_ as Se,O2 as pn,fA as gn,JU as mn,wt as oe,fF as ie,fE as fn,ws as hn,fD as bn,fC as Sn,O3 as Cn,f1 as Ce,O4 as yn,O5 as In,wA as xn,wr as ce,O6 as En,fi as An,wo as wn,bV as jn,c1 as Pn,c0 as kn,bW as vn,b_ as Dn,bZ as Un,bY as Mn,b$ as _n,bX as Tn}from"./zeni-epic-state-Beqj4-lt.js";import{v as ae,T as U,z as E,af as ye,bI as Bn,c as K,e as Rn,k as O,B as se,bJ as Fn,bK as On,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,X as Jn,bO as Zn,q as Gn,bP as zn}from"./index-HYe9zsmh.js";import{n as M}from"./mui-CtKcfboe.js";import{M as v}from"./MobileAppDrawer-BSk7YHeH.js";import{a as N,g as $,m as Hn}from"./accountMappingHelper-BprfT0GK.js";import{t as qn,A as Qn}from"./AddressScreen-tFmdakWA.js";import T from"./NotFoundScreen-BEFHW4G3.js";import{g as Wn}from"./analyticsHelper-PpRvwE56.js";import{B as Xn}from"./BusinessVerificationPageScreen-Gu3xfWkO.js";import{C as Yn}from"./CompanyPassportScreen-WdmqXh3-.js";import{q as re}from"./QBOConnectionScreen-Dain4XtO.js";import{B as et}from"./BillPayApprovalRoutes-DHZpT3No.js";import{R as nt}from"./ReimbursementApprovalRoutes-D4DIZDe_.js";import"./recharts-Q6vC6hsk.js";import"./analytics-i3QajGlB.js";import"./plaid-DVya51Ew.js";import"./dnd-DZwpImxe.js";import"./stripe-DMRn4zHo.js";import"./lottie-CT5flDGi.js";import"./lexical-9U8kXGr5.js";import"./pdf-CUvE2RE-.js";import"./utils-B2v0z9lS.js";import"./routePaths-REpeZ6R0.js";import"./empty-DncJ1CJr.js";import"./pdf-lib-CClLSROc.js";import"./index-B75Ozwz_.js";import"./url-sKaroM18.js";import"./index-T0lbkIBD.js";import"./decodeURIComponentSafe-D7hgbcm6.js";import"./ReimbursementApprovalRuleDetailScreen-BKQV6Gey.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]="5889f91a-3b4b-430f-a530-e6b819668ede",e._sentryDebugIdIdentifier="sentry-dbid-5889f91a-3b4b-430f-a530-e6b819668ede")}catch{}})();const tt=M.div`
1
+ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjwd.js";import{h as _,g as T,u as k,j as h,n as B,i as F,o as Q,p as I}from"./core-B01_r_a6.js";import{bn as xe,eP as j,gN as de,Lw as Ee,pD as Ae,jG as ue,lZ as we,gP as je,Ly as Pe,Lx as ke,NX as ve,xQ as De,Cj as Me,Nw as Ue,NF as _e,c2 as ee,cH as Re,cI as Te,JD as Be,NY as Fe,JE as Oe,wg as Ve,NZ as Le,Ez as Ne,B$ as $e,BS as pe,BP as Ke,wk as ge,BV as me,BY as fe,C2 as ne,sR as te,wj as ze,ji as W,jl as he,N_ as Je,km as Ge,wz as Ze,Kr as qe,Ks as He,jg as Ye,N$ as Qe,jj as We,q5 as Xe,O0 as en,O1 as nn,q9 as tn,gx as an,JM as Y,gm as sn,gt as on,JN as cn,ww as rn,O2 as ln,O3 as dn,Cg as un,eY as be,e_ as Se,O4 as pn,fA as gn,JW as mn,wv as oe,fF as ie,fE as fn,wu as hn,fD as bn,fC as Sn,O5 as Cn,f1 as Ce,O6 as yn,O7 as In,wC as xn,wt as ce,O8 as En,fi as An,wq as wn,bV as jn,c1 as Pn,c0 as kn,bW as vn,b_ as Dn,bZ as Mn,bY as Un,b$ as _n,bX as Rn}from"./zeni-epic-state-BFnJgXOA.js";import{S as ae,c as M,z as E,af as ye,bI as Tn,d as K,f as Bn,k as O,B as se,bJ as Fn,bK as On,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,V as zn,bO as Jn,r as Gn,bP as Zn}from"./index-b9cGMwNO.js";import{n as U}from"./mui-DRaG-BlK.js";import{M as v}from"./MobileAppDrawer-ztL55BFc.js";import{a as N,g as $,m as qn}from"./accountMappingHelper-BeLxsEhj.js";import{t as Hn,A as Yn}from"./AddressScreen-Csre8zO2.js";import R from"./NotFoundScreen-CbugOr9O.js";import{g as Qn}from"./analyticsHelper-Bgdq7lAB.js";import{B as Wn}from"./BusinessVerificationPageScreen-e2XdUw9z.js";import{C as Xn}from"./CompanyPassportScreen-D8V0b6yZ.js";import{q as re}from"./QBOConnectionScreen-B4aVoacL.js";import{B as et}from"./BillPayApprovalRoutes-DcGG_cef.js";import{R as nt}from"./ReimbursementApprovalRoutes-CwwWIVRR.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.js";import"./routePaths-Sv0e7DY5.js";import"./empty-DP7Qtv_6.js";import"./pdf-lib-t9AAxY-T.js";import"./index-HFOJdDTm.js";import"./url-C_w1-pX_.js";import"./index-CKvoU8sU.js";import"./decodeURIComponentSafe-BOkChgPc.js";import"./ReimbursementApprovalRuleDetailScreen-B6hhKpnv.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]="234b4c36-6986-4131-8a9b-82ff7c115715",e._sentryDebugIdIdentifier="sentry-dbid-234b4c36-6986-4131-8a9b-82ff7c115715")}catch{}})();const tt=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpR
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,at=R(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:l,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:r}=c,{reimbursementsAccount:x}=u,{prepaidExpensesAccount:C,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:V}=g,A=N(s.accountMappingView.incomeAccountList,f.selectedOption),J=N(s.accountMappingView.expenseAccountList,m.selectedOption),Z=N(s.accountMappingView.billPayAccountList,r.selectedOption),G=N(s.accountMappingView.reimbursementsAccountList,x.selectedOption),L=$(s.accountMappingView.prepaidExpensesAccountList,C.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),z=$(s.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),H=Hn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:J?.accountId,selectedBillPayAccountId:Z?.accountId,selectedReimbursementsAccountId:G?.accountId,selectedPrepaidExpensesAccountIds:L.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:D.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:z.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:q}))},onBackClick:()=>{ye(l)===!1?(o("../../dashboard"),e(Pe())):e(de())},onSaveClick:()=>{e(je()),i&&K.track(Rn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Bn),st=()=>{const e=_(),s=B(),o=k(),{useFeatureGate:l}=ae(),{isFeatureEnabled:i}=l(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=l(U.isScheduledJEAccruedExpensesFeatureEnabled),t=E.getSignedInUser(),c=xe(t),u=h(C=>j(C)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const r=h(C=>Ee(C)),x=C=>{m(C)};return a.jsxs(tt,{children:[a.jsx(v,{isAppContentDrawerOpen:f,handleDrawerToggle:x}),a.jsx(at,{currentTenant:u,navigate:e,accountMappingView:r,isFiling1099FeatureEnabled:i&&c,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:ye(s),onClickMenuIcon:()=>x(!0)})]})},ot=M.div`
9
+ `,at=B(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:l,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:r}=c,{reimbursementsAccount:x}=u,{prepaidExpensesAccount:C,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:V}=g,A=N(s.accountMappingView.incomeAccountList,f.selectedOption),z=N(s.accountMappingView.expenseAccountList,m.selectedOption),J=N(s.accountMappingView.billPayAccountList,r.selectedOption),G=N(s.accountMappingView.reimbursementsAccountList,x.selectedOption),L=$(s.accountMappingView.prepaidExpensesAccountList,C.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(s.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),q=qn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),H={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:J?.accountId,selectedReimbursementsAccountId:G?.accountId,selectedPrepaidExpensesAccountIds:L.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:D.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:q};e(ke({data:H}))},onBackClick:()=>{ye(l)===!1?(o("../../dashboard"),e(Pe())):e(de())},onSaveClick:()=>{e(je()),i&&K.track(Bn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),st=()=>{const e=_(),s=T(),o=k(),{useFeatureGate:l}=ae(),{isFeatureEnabled:i}=l(M.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=l(M.isScheduledJEAccruedExpensesFeatureEnabled),t=E.getSignedInUser(),c=xe(t),u=h(C=>j(C)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const r=h(C=>Ee(C)),x=C=>{m(C)};return a.jsxs(tt,{children:[a.jsx(v,{isAppContentDrawerOpen:f,handleDrawerToggle:x}),a.jsx(at,{currentTenant:u,navigate:e,accountMappingView:r,isFiling1099FeatureEnabled:i&&c,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:ye(s),onClickMenuIcon:()=>x(!0)})]})},ot=U.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpR
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,it=R(function(e,s){const o=j(e),l=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(ee(o?.userRole??[])||n)&&"readonly",billpayApprovalView:l,remiApproverView:i,analytics:K}},function(e,s){const{navigate:o,currentTenant:l}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),ct=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:l}=F(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),r=h(S=>ve(S)),x=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const C=O();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(c(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return C?.loggedInUserRoleMap!=null?a.jsxs(ot,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(it,{navigate:e,location:s,companyId:x,currentTenant:g,roleMap:C.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(se,{fetchState:r.fetchState})},rt=M.div`
17
+ `,it=B(function(e,s){const o=j(e),l=Ue(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(ee(o?.userRole??[])||n)&&"readonly",billpayApprovalView:l,remiApproverView:i,analytics:K}},function(e,s){const{navigate:o,currentTenant:l}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),ct=()=>{const e=_(),s=T(),o=k(),{tenantEmailDomain:l}=F(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),r=h(S=>ve(S)),x=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const C=O();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(c(!0),o(Me(!0)))},[t,m,o]);const w=S=>{n(S)};return C?.loggedInUserRoleMap!=null?a.jsxs(ot,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(it,{navigate:e,location:s,companyId:x,currentTenant:g,roleMap:C.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(se,{fetchState:r.fetchState})},rt=U.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpR
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,lt=R(function(e,s){const{companyId:o,isZeniAccountEnabled:l,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:c}=s,u=j(e);return{bankSetupView:Le(e,o,n,t,l,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,c)=>{e(te(t,n,c))},onEstablishConnectionClick:(n,t,c)=>{e(ne(n,i,t,c))},onUpdatePaymentAccountStatus:(n,t,c,u,d)=>{e(fe(n,t,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,t,c,u)=>{e(me(!1,n,u,c,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,c,u,d)=>{e(d==="paymentAccount"?pe(n,t,c,u):Ke(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,c)=>{e($e(i,t,n,c))},onRemoveConnection:n=>{e(Ne(n))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(On),dt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:l}=F(),i=O(),[n,t]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>j(y)),g=h(y=>y.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Be(d,i?.loggedInUserRoleMap),r=Re(d,i?.loggedInUserRoleMap),x=Fe(d,i?.loggedInUserRoleMap),C=Oe(d,i?.loggedInUserRoleMap),w=d.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||g==="Completed"||(u(!0),o(Ve(!1)))},[c,o,g]);const S=y=>{t(y)};return f||r||m||C?a.jsxs(rt,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(lt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:r,isChargeCardEnabled:C,isTreasuryEnabled:x,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},ut=M.div`
25
+ `,lt=B(function(e,s){const{companyId:o,isZeniAccountEnabled:l,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:c}=s,u=j(e);return{bankSetupView:Le(e,o,n,t,l,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,c)=>{e(te(t,n,c))},onEstablishConnectionClick:(n,t,c)=>{e(ne(n,i,t,c))},onUpdatePaymentAccountStatus:(n,t,c,u,d)=>{e(fe(n,t,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,t,c,u)=>{e(me(!1,n,u,c,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,c,u,d)=>{e(d==="paymentAccount"?pe(n,t,c,u):Ke(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,c)=>{e($e(i,t,n,c))},onRemoveConnection:n=>{e(Ne(n))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(On),dt=()=>{const e=_(),s=T(),o=k(),{tenantEmailDomain:l}=F(),i=O(),[n,t]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>j(y)),g=h(y=>y.settingsViewState.bankConnection.fetchState),f=Re(d,i?.loggedInUserRoleMap),m=Te(d,i?.loggedInUserRoleMap),r=Be(d,i?.loggedInUserRoleMap),x=Fe(d,i?.loggedInUserRoleMap),C=Oe(d,i?.loggedInUserRoleMap),w=d.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||g==="Completed"||(u(!0),o(Ve(!1)))},[c,o,g]);const S=y=>{t(y)};return f||r||m||C?a.jsxs(rt,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(lt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:r,isChargeCardEnabled:C,isTreasuryEnabled:x,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(R,{})},ut=U.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpR
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,pt=R(function(e,s){const{companyId:o}=s,l=j(e),i=s.roleMap.bill_pay_admin,n=Ze(e,o),{uiState:t}=n,c=(ee(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:t,stripeKey:Ie.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:l.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(te("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,c)=>{e(fe(n,t,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Xe(n))},updateCardPaymentModalState:n=>{e(We({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,c)=>{e(Qe(n,t,c))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(qe())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=qn(n);e(Ge({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Ln),gt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:l}=F(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(y=>j(y)),f=h(y=>y.cardPaymentViewState),m=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Vn(f.addCardPaymentSourceStatus.fetchState),x=f.addCardPaymentSourceStatus.fetchState,C=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=O();p.useEffect(()=>{C!=null&&o(Je(C,!1))},[C,o]),p.useEffect(()=>{t||(c(!0),o(X()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{r==="In-Progress"&&x==="Completed"&&o(X())},[r,x]);const S=y=>{n(y)};return w?.loggedInUserRoleMap!=null?a.jsxs(ut,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(pt,{navigate:e,location:s,companyId:C,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ie.googleMapsAPIKey})]}):a.jsx(se,{fetchState:m})},Y="external_integrations",mt=R(function(e){const s=nn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:l,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{l.integrations.refreshQBO.fetchState!=="In-Progress"&&e(rn())},onSaveChargeBeeCredentials:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(on(t,d,Q("revenue"),cn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(c,u)=>{e(sn(t,c,Q(u)))},onSaveConnectorCredentials:c=>{e(an(t,Q("payments"),c))},onNotifyMe:c=>{e(tn(Y,c,i))}}})(Nn),ft=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[l,i]=p.useState(!1),n=h(r=>r.tenantState.fetchState),t=h(r=>j(r)),c=t.companyId??E.getSignedInUserTenant(o)?.companyId,u=E.getSignedInUser(),d=O(),g=ee(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Ye(Y))},[s]);const f=r=>{i(r)},m=h(r=>en(r,c));return d?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(v,{isAppContentDrawerOpen:l,handleDrawerToggle:f}),a.jsx(mt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:m.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(m.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([r,x])=>[r,x?.message])),deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(se,{fetchState:n})},ht=M.div`
33
+ `,pt=B(function(e,s){const{companyId:o}=s,l=j(e),i=s.roleMap.bill_pay_admin,n=Je(e,o),{uiState:t}=n,c=(ee(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:t,stripeKey:Ie.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:l.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(te("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,c)=>{e(fe(n,t,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,c)=>{e(Ye(n,t,c))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(He())},handleResetCardPaymentErrorStatuses:()=>{e(qe())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ge({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Ln),gt=()=>{const e=_(),s=T(),o=k(),{tenantEmailDomain:l}=F(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(y=>j(y)),f=h(y=>y.cardPaymentViewState),m=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Vn(f.addCardPaymentSourceStatus.fetchState),x=f.addCardPaymentSourceStatus.fetchState,C=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=O();p.useEffect(()=>{C!=null&&o(ze(C,!1))},[C,o]),p.useEffect(()=>{t||(c(!0),o(W()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{r==="In-Progress"&&x==="Completed"&&o(W())},[r,x]);const S=y=>{n(y)};return w?.loggedInUserRoleMap!=null?a.jsxs(ut,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(pt,{navigate:e,location:s,companyId:C,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ie.googleMapsAPIKey})]}):a.jsx(se,{fetchState:m})},X="external_integrations",mt=B(function(e){const s=nn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:l,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{l.integrations.refreshQBO.fetchState!=="In-Progress"&&e(rn())},onSaveChargeBeeCredentials:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(on(t,d,Y("revenue"),cn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(c,u)=>{e(sn(t,c,Y(u)))},onSaveConnectorCredentials:c=>{e(an(t,Y("payments"),c))},onNotifyMe:c=>{e(tn(X,c,i))}}})(Nn),ft=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[l,i]=p.useState(!1),n=h(r=>r.tenantState.fetchState),t=h(r=>j(r)),c=t.companyId??E.getSignedInUserTenant(o)?.companyId,u=E.getSignedInUser(),d=O(),g=ee(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Xe(X))},[s]);const f=r=>{i(r)},m=h(r=>en(r,c));return d?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(v,{isAppContentDrawerOpen:l,handleDrawerToggle:f}),a.jsx(mt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:m.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(m.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([r,x])=>[r,x?.message])),deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(se,{fetchState:n})},ht=U.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpR
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,bt=M.div`
41
+ `,bt=U.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,7 +46,7 @@ import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpR
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,St=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,l]=p.useState(!1),i=h(r=>j(r)).companyId??E.getSignedInUserTenant(s)?.companyId,n=E.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(r=>ln(r,n.userId)),c=h(r=>dn(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=r=>{l(r)},g=p.useCallback(r=>{e(te("user_reimbursement_account",r))},[]),f=p.useCallback(r=>{e(ne(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(un(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(bt,{children:[a.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx($n,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Ct=M.div`
49
+ `,St=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,l]=p.useState(!1),i=h(r=>j(r)).companyId??E.getSignedInUserTenant(s)?.companyId,n=E.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(r=>ln(r,n.userId)),c=h(r=>dn(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=r=>{l(r)},g=p.useCallback(r=>{e(te("user_reimbursement_account",r))},[]),f=p.useCallback(r=>{e(ne(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(un(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(bt,{children:[a.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx($n,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Ct=U.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as a}from"./liveblocks-D8betOTZ.js";import{a as p}from"./sentry-BHRgRpR
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,le=({appContent:e})=>{const s=k(),o=_(),l=B(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:c}=t,u=t.companyId??E.getSignedInUserTenant(c)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=d(U.isTreasuryEnabled),x=h(b=>ue(b)),C=be(t),w=Se(m,t),S=!w&&x,y=Kn(t,f,m),{areTenantIdsInSync:V}=Jn();p.useEffect(()=>{V&&s(pn(u,S))},[u,s,S,V]);const A=h(b=>gn(b,S)),J=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,Z=mn(t),G=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=b=>{n(b)};return a.jsxs(Ct,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:L}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Zn,{myProfileView:A,isAccountingClassesEnabled:x,isReimbursementDisabled:G===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:Z===!1,onClickMenuIcon:()=>{L(!0)},isLoading:J,isBankingOnlyTenant:w,isCardsOnlyTenant:C,onAddressClick:b=>{const D=function(H,q){let P=`/${H}/settings/my_profile`;return P=P.concat(`/new/${q}`),P}(c,b),z=Gn(l.state?.pathnameStackToGoBack,l.pathname);o(D,{state:{pathnameStackToGoBack:z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(Sn(b,"MyProfile"))},onResendOtp:b=>{s(bn(b,"MyProfile"))},onCancelClick:()=>{s(hn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(fn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&E.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=k(),s=h(r=>j(r)).companyId,o=h(r=>Cn(r)),l=h(r=>Ce(r)),i=E.getSignedInUser(),[n,t]=p.useState(!1),c=p.useCallback(r=>{t(r)},[]),u=p.useCallback(r=>{e(yn(r))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(xn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))},[s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(En())},[]);return p.useEffect(()=>{if(l.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))}},[o.fetchState,s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled,l.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),a.jsx(zn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function na(e){const[s,o]=p.useState(!1),l=h(r=>Ce(r)),i=h(r=>j(r)),n=O(),t=E.getSignedInUser(),c=k(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||l.fetchState!=="Completed"||An(l.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&s===!1&&(o(!0),c(wn()))},[l.fetchState,s]);const f=Se(d,i),m=be(i);return l.fetchState!=="In-Progress"&&l.fetchState!=="Not-Started"||g!==!0?jn(i)?a.jsxs(W,{children:[Pn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"accounting/*",element:a.jsx(st,{})}),kn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),vn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"my_bank_connections",element:a.jsx(St,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"bank_connections",element:a.jsx(dt,{})}),Un(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"business_verification",element:a.jsx(Xn,{productType:f?"zeni_accounts":m?"charge_cards":Wn(i,n?.loggedInUserRoleMap)})}),Mn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"company_details",element:a.jsx(Yn,{})}),_n(n?.loggedInUserRole??[],i)&&a.jsx(I,{path:"billing",element:a.jsx(gt,{})}),Tn(n?.loggedInUserRole??[],d,i)&&a.jsx(I,{path:"integrations",element:a.jsx(ft,{})}),a.jsx(I,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(Qn,{isSubPage:!1})})}),a.jsx(I,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(I,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(I,{path:"*",element:a.jsx(T,{})})]}):a.jsx(W,{children:a.jsx(I,{path:"*",element:a.jsx(T,{})})}):null}function It(e){return a.jsxs(W,{children:[a.jsx(I,{path:"/",element:a.jsx(ct,{})}),a.jsx(I,{path:"bills/approval-rules/*",element:a.jsx(et,{})}),a.jsx(I,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(nt,{}):a.jsx(T,{})}),a.jsx(I,{path:"*",element:a.jsx(T,{})})]})}export{na as default};
57
+ `,le=({appContent:e})=>{const s=k(),o=_(),l=T(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:c}=t,u=t.companyId??E.getSignedInUserTenant(c)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:g}=d(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(M.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(M.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=d(M.isTreasuryEnabled),x=h(b=>ue(b)),C=be(t),w=Se(m,t),S=!w&&x,y=Kn(t,f,m),{areTenantIdsInSync:V}=zn();p.useEffect(()=>{V&&s(pn(u,S))},[u,s,S,V]);const A=h(b=>gn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,J=mn(t),G=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=b=>{n(b)};return a.jsxs(Ct,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:L}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:A,isAccountingClassesEnabled:x,isReimbursementDisabled:G===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:J===!1,onClickMenuIcon:()=>{L(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:C,onAddressClick:b=>{const D=function(q,H){let P=`/${q}/settings/my_profile`;return P=P.concat(`/new/${H}`),P}(c,b),Z=Gn(l.state?.pathnameStackToGoBack,l.pathname);o(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(Sn(b,"MyProfile"))},onResendOtp:b=>{s(bn(b,"MyProfile"))},onCancelClick:()=>{s(hn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(fn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&E.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=k(),s=h(r=>j(r)).companyId,o=h(r=>Cn(r)),l=h(r=>Ce(r)),i=E.getSignedInUser(),[n,t]=p.useState(!1),c=p.useCallback(r=>{t(r)},[]),u=p.useCallback(r=>{e(yn(r))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(xn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))},[s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(En())},[]);return p.useEffect(()=>{if(l.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))}},[o.fetchState,s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled,l.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),a.jsx(Zn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function na(e){const[s,o]=p.useState(!1),l=h(r=>Ce(r)),i=h(r=>j(r)),n=O(),t=E.getSignedInUser(),c=k(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(M.isDebitCardFeatureEnabled),g=t?.userEmail==null||l.fetchState!=="Completed"||An(l.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&s===!1&&(o(!0),c(wn()))},[l.fetchState,s]);const f=Se(d,i),m=be(i);return l.fetchState!=="In-Progress"&&l.fetchState!=="Not-Started"||g!==!0?jn(i)?a.jsxs(Q,{children:[Pn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"accounting/*",element:a.jsx(st,{})}),kn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),vn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"my_bank_connections",element:a.jsx(St,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"bank_connections",element:a.jsx(dt,{})}),Mn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"business_verification",element:a.jsx(Wn,{productType:f?"zeni_accounts":m?"charge_cards":Qn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"company_details",element:a.jsx(Xn,{})}),_n(n?.loggedInUserRole??[],i)&&a.jsx(I,{path:"billing",element:a.jsx(gt,{})}),Rn(n?.loggedInUserRole??[],d,i)&&a.jsx(I,{path:"integrations",element:a.jsx(ft,{})}),a.jsx(I,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(Yn,{isSubPage:!1})})}),a.jsx(I,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(I,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(I,{path:"*",element:a.jsx(R,{})})]}):a.jsx(Q,{children:a.jsx(I,{path:"*",element:a.jsx(R,{})})}):null}function It(e){return a.jsxs(Q,{children:[a.jsx(I,{path:"/",element:a.jsx(ct,{})}),a.jsx(I,{path:"bills/approval-rules/*",element:a.jsx(et,{})}),a.jsx(I,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(nt,{}):a.jsx(R,{})}),a.jsx(I,{path:"*",element:a.jsx(R,{})})]})}export{na as default};