@zeniai/web-app-ui 5.0.78-next → 5.0.78-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/assets/AddressRoutes-BTXAYebf.js +1 -0
  2. package/dist/assets/{AddressScreen-DLY0B5X2.js → AddressScreen-eTY0sZvp.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-BrFGp0Rw.js → AiCfoScreen-Bkyb6Zx1.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DGTEW0Ts.js → BillPayApprovalRoutes-BI_Y1b8l.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-B4DyZg9q.js → BillPayRoutes-oC-NzmtU.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CJhDGXDa.js → BusinessVerificationPageScreen-CiVtyVMD.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-ouivBCgA.js → ChargeCardRoutes-DjxijFKo.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-Cv1RmmZ2.js → CompanyPassportScreen-DhxtS0hb.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-BGLgRykg.js → ConnectionAuthScreen-zri-JRoW.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CCTHlQM4.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CCJ8rzxG.js → CustomerOnboardingRoutes-B7NKLiFW.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DpMwQkOO.js → DashboardRoutes-D3SHWcHr.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BjKn1NRZ.js → DefaultTenantHome-D8JSlgld.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-Da3AjbNa.js → DomesticWireDetailScreen-7xR18qFa.js} +1 -1
  15. package/dist/assets/{DrawerScreen-BtlXa6K0.js → DrawerScreen-Bfal1rIA.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-DwRVDUuS.js → EntityDetailRoutes-BfgUmjkv.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-UwZsuZMU.js → ExpenseAutomationRoutes-0hG_n7Gy.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-CUAIKz1i.js → FeaturePreviewScreen-BTGMWD-c.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-vr1PQzA9.js → HubSpotOAuthCallbackScreen-CUvlNWTg.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-pq1cqXvR.js → MagicLinkRoutes-D69UoMIO.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-CJZyHulf.js → MagicLinkSignInScreen-Bjtynlh1.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-DSdJwfd5.js → MobileAppDrawer-uxmqh_ak.js} +1 -1
  23. package/dist/assets/NotFoundScreen-Bgm7QovY.js +1 -0
  24. package/dist/assets/{NotificationRoutes-BpqbcrT3.js → NotificationRoutes-BWClZ6R9.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-Cr5NZApw.js → OAuthConsentScreen-DISHSUDY.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-CrHHjUmh.js → PandLWithForecastRoutes-WDlNQdop.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-DjAv-Cbm.js → PeopleRoutes-BzQYmD9S.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-ap8B_-S5.js → PerformanceRoutes-DeQxYgB5.js} +1 -1
  29. package/dist/assets/{Preview-BlbTJX4y.js → Preview-DZV44_GA.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-gihlHabK.js → QBOConnectionScreen---6d_O2t.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-DiGYqmEw.js → ReferralListScreen-V548TPRB.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-Dkrm7ab1.js → ReimbursementApprovalRoutes-7WHxbekg.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B-jeaK-0.js → ReimbursementApprovalRuleDetailScreen-CEN6ZBSv.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-Df1rene3.js → ReimbursementRoutes-WCYzbqkO.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-01ZBxNzi.js → ReportsRoutes-DKzteMEe.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-C_RjM3wM.js → RewardsRoutes-BdJWc-Yf.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-XUGVTlJU.js → ScreenRoutes-CG_Gnubt.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-DgDaKTnp.js → SettingsRoutes-DtQSWV43.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-DFNkJSDZ.js → SetupPagesScreen-CNq2NGTh.js} +1 -1
  40. package/dist/assets/{SignInScreen-4QpxmPGm.js → SignInScreen-C3Yd4KAx.js} +1 -1
  41. package/dist/assets/{SignOutScreen-B8MdXYvN.js → SignOutScreen-tjwxOeb2.js} +1 -1
  42. package/dist/assets/{TaskListScreen-BDFYRBL0.js → TaskListScreen-BA5nkXWU.js} +1 -1
  43. package/dist/assets/{TaskRoutes-DT2WLVpc.js → TaskRoutes-C2JkPxm6.js} +1 -1
  44. package/dist/assets/TransactionDetailRoutes-V4nSypXh.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-Ci4ZELq0.js → TransactionDetailScreen-Dufv1-Zd.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-BvA_L1Bn.js → TransactionListRoutes-BIHPwXds.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-CCwpqIb0.js → TreasuryRoutes-tO1rZI1W.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-CEucFn4v.js → VendorsRoutes-f7hlersr.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-74LRyISH.js → WiseConfirmationScreen-BGxHbRg3.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-C_yIwLbb.js → ZeniAccountRoutes-BWCKIQtd.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-C7x2WOwU.js → ZeniAccountStatementScreen-fRWwWarV.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-dm9IDhd5.js → accountMappingHelper-BkNWBFnf.js} +1 -1
  53. package/dist/assets/{analytics-LRXDxB9U.js → analytics-CYMgeTT5.js} +1 -1
  54. package/dist/assets/{analyticsHelper-CM7-DzIH.js → analyticsHelper-kA_46WRt.js} +1 -1
  55. package/dist/assets/{core-DrFqYlht.js → core-B2Hxdfie.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-BIE62qI8.js → decodeURIComponentSafe-BcAs3k9x.js} +1 -1
  57. package/dist/assets/{dnd-DjCTgA16.js → dnd-ChJsuxMK.js} +1 -1
  58. package/dist/assets/{empty-B_1j7UZd.js → empty-CYXfR6Pz.js} +1 -1
  59. package/dist/assets/{empty-Btqpa3Dn.js → empty-DJcdURMB.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-DUjVh48Y.js → emptyVideoElement-DLkg1CzQ.js} +1 -1
  61. package/dist/assets/{epic-DUdYUOqK.js → epic-C0Eo73Oo.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-CtOQ1QSt.js → getLocaleForTenant-BC4keiZu.js} +1 -1
  63. package/dist/assets/{index-g9hTOOdd.js → index-0xo6Gnn6.js} +1 -1
  64. package/dist/assets/{index-B7-w4njp.js → index-BGx8Cqw2.js} +1 -1
  65. package/dist/assets/{index-gIHwUZJz.js → index-BsI-BcOG.js} +7 -7
  66. package/dist/assets/{index-BUJjaTE7.js → index-COkZQ6VK.js} +2 -2
  67. package/dist/assets/{index-vvusuUAb.js → index-CXaTyYPI.js} +1 -1
  68. package/dist/assets/{index-BIdZz-Lu.js → index-CsMY6Obb.js} +1 -1
  69. package/dist/assets/{index-BxB1wE84.js → index-eJRNQy-q.js} +1 -1
  70. package/dist/assets/{index-CuGjO8q5.js → index-m_9cQfeA.js} +1 -1
  71. package/dist/assets/{lexical-BvSd63VE.js → lexical-WK6PZ_Fc.js} +1 -1
  72. package/dist/assets/{liveblocks-C6NDyiJv.js → liveblocks-C_VE9Mu9.js} +1 -1
  73. package/dist/assets/{lottie-CRrBZj94.js → lottie-DL0TkQBF.js} +1 -1
  74. package/dist/assets/{mui-BfKuxuES.js → mui-tg9Pwou2.js} +1 -1
  75. package/dist/assets/{pathToGoBack-CUljzXbA.js → pathToGoBack-8wBiRMg4.js} +1 -1
  76. package/dist/assets/{pdf-WyHfBZP8.js → pdf-DJRvlcHv.js} +3 -3
  77. package/dist/assets/{pdf-lib-Ni58cQtF.js → pdf-lib-BAv_DefF.js} +1 -1
  78. package/dist/assets/{plaid-BfLcb-Mu.js → plaid-B_jGdYrM.js} +1 -1
  79. package/dist/assets/{pusher-BetHGDvL.js → pusher-DYar66K5.js} +1 -1
  80. package/dist/assets/{react-CdUYyNlS.js → react-BmsK-Z5g.js} +1 -1
  81. package/dist/assets/{react-CKFyZHqR.js → react-C72jUlOf.js} +1 -1
  82. package/dist/assets/{react-BWdafFx3.js → react-CL3atXxv.js} +1 -1
  83. package/dist/assets/{react-D7NpAKPT.js → react-Ce2HDnkF.js} +1 -1
  84. package/dist/assets/{react-DPXh3mWt.js → react-Dz065-ys.js} +1 -1
  85. package/dist/assets/{react-CZxiptYj.js → react-vGzgrc8s.js} +1 -1
  86. package/dist/assets/{recharts-DzFRpM3n.js → recharts-Ep8XanlT.js} +1 -1
  87. package/dist/assets/{routePaths-DwqXZ9IC.js → routePaths-BtZYDC_i.js} +1 -1
  88. package/dist/assets/{sentry-DorFMwQU.js → sentry-Byikl8iY.js} +1 -1
  89. package/dist/assets/{url-CkJQeQOD.js → url-CsuiCVcH.js} +1 -1
  90. package/dist/assets/{url-yU2RR5Y5.js → url-pgCCDGVL.js} +1 -1
  91. package/dist/assets/{useAskAiCfoHostNavButtonProps-SdJdV09H.js → useAskAiCfoHostNavButtonProps-kK55rQTy.js} +1 -1
  92. package/dist/assets/{useDeviceId-B51M4N2b.js → useDeviceId-rn2ep5ML.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js → useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-C8hN7EcF.js → useInitialThreadRequest-TLWHLSZh.js} +1 -1
  95. package/dist/assets/{utils-BiDInqYy.js → utils-KJcQ4RjB.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-51Ock1rJ.js → withTransactionSidePanel-CxundvVG.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-vpQnS6PI.js → zeni-epic-state-BZK5iHMQ.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +1 -1
  100. package/dist/assets/AddressRoutes-Bs0ffT2X.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-xT3UtszS.js +0 -1
  102. package/dist/assets/NotFoundScreen-Du1hgJnA.js +0 -1
  103. package/dist/assets/TransactionDetailRoutes-Buw31_AN.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-C6NDyiJv.js";import{a as g}from"./sentry-DorFMwQU.js";import{h as O,u as _,j as w,q as P,g as l,N as T}from"./core-DrFqYlht.js";import{z as r,m as M,D as V,d as A,c as N,e as R,h as W,i as $,g as q}from"./index-gIHwUZJz.js";import{eO as H,IQ as J,I_ as Q,IR as B,eP as G,fi as K,IW as X,fH as Y,cT as Z,I$ as ee,J0 as te}from"./zeni-epic-state-vpQnS6PI.js";import{n as ne}from"./mui-BfKuxuES.js";import{u as se}from"./useDeviceId-B51M4N2b.js";import{f as ae}from"./analyticsHelper-CM7-DzIH.js";import{t as ie}from"./getLocaleForTenant-CtOQ1QSt.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="b2a57564-5a74-475b-b65f-64b43d24c73f",t._sentryDebugIdIdentifier="sentry-dbid-b2a57564-5a74-475b-b65f-64b43d24c73f")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=P(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>H(e)),b=l(e=>J(e)),E=r.getSignedInUser(),v=M().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Q(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(b.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=q();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx($,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-C_VE9Mu9.js";import{a as g}from"./sentry-Byikl8iY.js";import{h as O,u as _,j as w,q as P,g as l,N as T}from"./core-B2Hxdfie.js";import{z as r,m as M,D as V,d as A,c as N,e as R,h as W,i as $,g as q}from"./index-BsI-BcOG.js";import{eO as H,IQ as J,I_ as Q,IR as B,eP as G,fi as K,IW as X,fH as Y,cT as Z,I$ as ee,J0 as te}from"./zeni-epic-state-BZK5iHMQ.js";import{n as ne}from"./mui-tg9Pwou2.js";import{u as se}from"./useDeviceId-rn2ep5ML.js";import{f as ae}from"./analyticsHelper-kA_46WRt.js";import{t as ie}from"./getLocaleForTenant-BC4keiZu.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="b2a57564-5a74-475b-b65f-64b43d24c73f",t._sentryDebugIdIdentifier="sentry-dbid-b2a57564-5a74-475b-b65f-64b43d24c73f")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=P(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>H(e)),b=l(e=>J(e)),E=r.getSignedInUser(),v=M().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Q(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(b.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=q();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx($,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1 +1 @@
1
- import{j as G}from"./liveblocks-C6NDyiJv.js";import{a as c}from"./sentry-DorFMwQU.js";import{h as be,g as s,l as Je,u as Ke,j as ea,i as P}from"./core-DrFqYlht.js";import{eO as he,eV as aa,eW as Se,eQ as ta,bn as na,f3 as sa,eX as oa,eY as ia,e_ as ra,f1 as da,fb as la,f2 as g,f5 as ca,f6 as ue,f9 as ua,f7 as fa,f8 as ma,fa as pa,cI as ba,fd as ha,cO as Sa,bv as ga,eN as Ea,fi as ka,fj as Ca,fh as ya}from"./zeni-epic-state-vpQnS6PI.js";import{a3 as Ia,a4 as Ta,w as _a,y as wa,z as k,Z as Aa,a5 as Fa,U as Da,x as va,u as $a,S as r,a6 as Ba,a7 as xa,k as Ma,a as Pa,a8 as Ra,_ as Na,a9 as Ga,aa as Ua,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,c as R,r as w,X as ja,af as N,ag as La}from"./index-gIHwUZJz.js";import{D as za}from"./mui-BfKuxuES.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="1001afa4-8e93-4a79-94c8-202fc6d34790",m._sentryDebugIdIdentifier="sentry-dbid-1001afa4-8e93-4a79-94c8-202fc6d34790")}catch{}})();const Ya=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Je(),t=Ke(),C=_a(),o=ea(),U=ta(),p=be(),{useFeatureGate:i}=wa(),V=k.getSignedInUser(),A=na(V),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),O=s(e=>sa(e)),j=O.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:_e}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),Q=X||W&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:xe}=i(r.isTreasuryEnabled),{isFeatureEnabled:Me}=i(r.isTaskManagerCustomerUserAccessEnabled),Pe=A||!A&&Me,Re=n.company!=null&&la(n.company),_=xe&&Re,Ne=s(e=>g(e).totalUnreadCount),Ge=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=xa();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&U.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Ge,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const je=Ma(),oe=s(e=>fa(e,S,h,X,W,_).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",ze=c.useMemo(()=>pa(n.userRole),[n.userRole]),Ye=ba(ze),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Pa(),We=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=c.useCallback(()=>_&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[_,de,le,t.pathname,a]),[Xe,ce]=c.useState(x);c.useEffect(()=>{ce(x())},[x]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Ga(Qe);return G.jsx(za,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:G.jsx(Ua,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:_e,isVendorsTabVisible:Ye,isZeniAccountEnabled:Y,isChargeCardEnabled:Te,isTreasuryEnabled:_,treasuryYieldPercentage:qe,isTreasuryPopupVisible:Xe,isNotificationsTabVisible:He,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:Q&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=w(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=w(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=w(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const M=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Pe,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),Ja=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return G.jsx(Ya,{...m,...t})};export{Ja as M};
1
+ import{j as G}from"./liveblocks-C_VE9Mu9.js";import{a as c}from"./sentry-Byikl8iY.js";import{h as be,g as s,l as Je,u as Ke,j as ea,i as P}from"./core-B2Hxdfie.js";import{eO as he,eV as aa,eW as Se,eQ as ta,bn as na,f3 as sa,eX as oa,eY as ia,e_ as ra,f1 as da,fb as la,f2 as g,f5 as ca,f6 as ue,f9 as ua,f7 as fa,f8 as ma,fa as pa,cI as ba,fd as ha,cO as Sa,bv as ga,eN as Ea,fi as ka,fj as Ca,fh as ya}from"./zeni-epic-state-BZK5iHMQ.js";import{a3 as Ia,a4 as Ta,w as _a,y as wa,z as k,Z as Aa,a5 as Fa,U as Da,x as va,u as $a,S as r,a6 as Ba,a7 as xa,k as Ma,a as Pa,a8 as Ra,_ as Na,a9 as Ga,aa as Ua,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,c as R,r as w,X as ja,af as N,ag as La}from"./index-BsI-BcOG.js";import{D as za}from"./mui-tg9Pwou2.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="1001afa4-8e93-4a79-94c8-202fc6d34790",m._sentryDebugIdIdentifier="sentry-dbid-1001afa4-8e93-4a79-94c8-202fc6d34790")}catch{}})();const Ya=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Je(),t=Ke(),C=_a(),o=ea(),U=ta(),p=be(),{useFeatureGate:i}=wa(),V=k.getSignedInUser(),A=na(V),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),O=s(e=>sa(e)),j=O.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:_e}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),Q=X||W&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:xe}=i(r.isTreasuryEnabled),{isFeatureEnabled:Me}=i(r.isTaskManagerCustomerUserAccessEnabled),Pe=A||!A&&Me,Re=n.company!=null&&la(n.company),_=xe&&Re,Ne=s(e=>g(e).totalUnreadCount),Ge=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=xa();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&U.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Ge,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const je=Ma(),oe=s(e=>fa(e,S,h,X,W,_).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",ze=c.useMemo(()=>pa(n.userRole),[n.userRole]),Ye=ba(ze),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Pa(),We=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=c.useCallback(()=>_&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[_,de,le,t.pathname,a]),[Xe,ce]=c.useState(x);c.useEffect(()=>{ce(x())},[x]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Ga(Qe);return G.jsx(za,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:G.jsx(Ua,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:_e,isVendorsTabVisible:Ye,isZeniAccountEnabled:Y,isChargeCardEnabled:Te,isTreasuryEnabled:_,treasuryYieldPercentage:qe,isTreasuryPopupVisible:Xe,isNotificationsTabVisible:He,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:Q&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=w(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=w(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=w(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const M=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Pe,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),Ja=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return G.jsx(Ya,{...m,...t})};export{Ja as M};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-C_VE9Mu9.js";import{j as i,k as n}from"./core-B2Hxdfie.js";import{Q as e}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import"./sentry-Byikl8iY.js";import"./zeni-epic-state-BZK5iHMQ.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="38433470-5748-45c8-9d22-f3cba6aaf7d5",o._sentryDebugIdIdentifier="sentry-dbid-38433470-5748-45c8-9d22-f3cba6aaf7d5")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(e);function h(){const o=i();return r.jsx(a,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-C6NDyiJv.js";import lt from"./NotFoundScreen-Du1hgJnA.js";import{a as k}from"./sentry-DorFMwQU.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-DrFqYlht.js";import{cq as St,eX as Q,eO as H,fa as bt,f2 as b,Pj as K,f6 as d,eW as y,qA as $,vV as It,Pk as Ct,eV as Tt,fd as yt,qF as At,Pl as F,bq as M,gM as w,qJ as O,Pm as Et,cB as _t,cv as Nt}from"./zeni-epic-state-vpQnS6PI.js";import{V as Bt,z as xt,y as wt,S as Pt,ct as vt,r as N,a3 as Rt,cu as Dt,a4 as Ut,q as Gt}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as Mt}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="a6923adf-a87f-4136-824e-ee3d47ca64dc",t._sentryDebugIdIdentifier="sentry-dbid-a6923adf-a87f-4136-824e-ee3d47ca64dc")}catch{}})();const $t=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(O("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),$t(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Rt(Dt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Mt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),v=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:J,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{U&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&x!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(J||L===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,J,C,L,W,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];v==="all"?E.push("read","unread"):v!=="mentions"&&E.push(v),s($("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
1
+ import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-C_VE9Mu9.js";import lt from"./NotFoundScreen-Bgm7QovY.js";import{a as k}from"./sentry-Byikl8iY.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-B2Hxdfie.js";import{cq as St,eX as Q,eO as H,fa as bt,f2 as b,Pj as K,f6 as d,eW as y,qA as $,vV as It,Pk as Ct,eV as Tt,fd as yt,qF as At,Pl as F,bq as M,gM as w,qJ as O,Pm as Et,cB as _t,cv as Nt}from"./zeni-epic-state-BZK5iHMQ.js";import{V as Bt,z as xt,y as wt,S as Pt,ct as vt,r as N,a3 as Rt,cu as Dt,a4 as Ut,q as Gt}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-kK55rQTy.js";import{c as Mt}from"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="a6923adf-a87f-4136-824e-ee3d47ca64dc",t._sentryDebugIdIdentifier="sentry-dbid-a6923adf-a87f-4136-824e-ee3d47ca64dc")}catch{}})();const $t=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(O("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),$t(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Rt(Dt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Mt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),v=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:J,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{U&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&x!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(J||L===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,J,C,L,W,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];v==="all"?E.push("read","unread"):v!=="mentions"&&E.push(v),s($("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-C6NDyiJv.js";import{a as r}from"./sentry-DorFMwQU.js";import{h as A,u as C,g as o,N as J}from"./core-DrFqYlht.js";import{Jd as P,eO as j,f1 as x,Je as z,Jf as D,Jg as M,Jh as R,mv as k,I9 as L}from"./zeni-epic-state-vpQnS6PI.js";import{z as h,K as I}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="93d9e189-d114-4351-a497-7cdbbe6cf3b0",n._sentryDebugIdIdentifier="sentry-dbid-93d9e189-d114-4351-a497-7cdbbe6cf3b0")}catch{}})();function ee(){const n=A(),s=C(),{params:t,error:i}=r.useMemo(()=>P(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o(e=>j(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),b=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(J,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-C_VE9Mu9.js";import{a as r}from"./sentry-Byikl8iY.js";import{h as A,u as C,g as o,N as J}from"./core-B2Hxdfie.js";import{Jd as P,eO as j,f1 as x,Je as z,Jf as D,Jg as M,Jh as R,mv as k,I9 as L}from"./zeni-epic-state-BZK5iHMQ.js";import{z as h,K as I}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="93d9e189-d114-4351-a497-7cdbbe6cf3b0",n._sentryDebugIdIdentifier="sentry-dbid-93d9e189-d114-4351-a497-7cdbbe6cf3b0")}catch{}})();function ee(){const n=A(),s=C(),{params:t,error:i}=r.useMemo(()=>P(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o(e=>j(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),b=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(J,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-C6NDyiJv.js";import{j as V,h as z,u as Z,l as H,g as d,k as K,n as Q,o as I}from"./core-DrFqYlht.js";import{eO as R,qo as U,pY as X,JM as v,pT as C,bv as ee,bn as ae,bS as te,pU as se,JN as oe,Jy as S,dC as re,tS as ne,JO as ie,ud as ce,eU as le,eS as de}from"./zeni-epic-state-vpQnS6PI.js";import{z as me,V as fe,k as pe,y as M,S as w,A as ue,c as $,al as he,r as ge}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import Fe from"./NotFoundScreen-Du1hgJnA.js";import{F as be}from"./FeaturePreviewScreen-CUAIKz1i.js";import{a as g}from"./sentry-DorFMwQU.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{u as Ce}from"./useInitialThreadRequest-C8hN7EcF.js";import{t as ye}from"./routePaths-DwqXZ9IC.js";import{M as Te}from"./MobileAppDrawer-DSdJwfd5.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="938486c2-3e02-4aa4-8299-b9f418694158",s._sentryDebugIdIdentifier="sentry-dbid-938486c2-3e02-4aa4-8299-b9f418694158")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(C(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=ye(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function P(){const s=V(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),T=d(t=>R(t)),N=T.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Se({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,O)=>L!=null?f.forecasts.findIndex(b=>b.id===L):O!=null?f.forecasts.findIndex(b=>b.id===O):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(c.forecasts[t].id,t)),y(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&y(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&F&&e(C(c.forecasts[t].id))}},[i,p,e,l,c,m,u,U,C,F]);const D=pe(),W=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:Y}=M(),{isFeatureEnabled:j}=Y(w.isReportsCommentingEnabled),_=Ce(j?T?.companyId:void 0,{clearParams:l&&m}),[G,J]=g.useState(!1),E=t=>{J(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:G,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:q,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:_,onClickMenuIcon:()=>{E(!0)}})]})}function Ve(){const s=d(i=>R(i)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
1
+ import{j as n}from"./liveblocks-C_VE9Mu9.js";import{j as V,h as z,u as Z,l as H,g as d,k as K,n as Q,o as I}from"./core-B2Hxdfie.js";import{eO as R,qo as U,pY as X,JM as v,pT as C,bv as ee,bn as ae,bS as te,pU as se,JN as oe,Jy as S,dC as re,tS as ne,JO as ie,ud as ce,eU as le,eS as de}from"./zeni-epic-state-BZK5iHMQ.js";import{z as me,V as fe,k as pe,y as M,S as w,A as ue,c as $,al as he,r as ge}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import Fe from"./NotFoundScreen-Bgm7QovY.js";import{F as be}from"./FeaturePreviewScreen-BTGMWD-c.js";import{a as g}from"./sentry-Byikl8iY.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-kK55rQTy.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import{u as Ce}from"./useInitialThreadRequest-TLWHLSZh.js";import{t as ye}from"./routePaths-BtZYDC_i.js";import{M as Te}from"./MobileAppDrawer-uxmqh_ak.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="938486c2-3e02-4aa4-8299-b9f418694158",s._sentryDebugIdIdentifier="sentry-dbid-938486c2-3e02-4aa4-8299-b9f418694158")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(C(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=ye(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function P(){const s=V(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),T=d(t=>R(t)),N=T.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Se({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,O)=>L!=null?f.forecasts.findIndex(b=>b.id===L):O!=null?f.forecasts.findIndex(b=>b.id===O):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(c.forecasts[t].id,t)),y(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&y(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&F&&e(C(c.forecasts[t].id))}},[i,p,e,l,c,m,u,U,C,F]);const D=pe(),W=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:Y}=M(),{isFeatureEnabled:j}=Y(w.isReportsCommentingEnabled),_=Ce(j?T?.companyId:void 0,{clearParams:l&&m}),[G,J]=g.useState(!1),E=t=>{J(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:G,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:q,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:_,onClickMenuIcon:()=>{E(!0)}})]})}function Ve(){const s=d(i=>R(i)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C6NDyiJv.js";import{JH as te,eO as Y,jA as G,eU as q,eS as ne,H6 as N,Jl as oe,s_ as Ee,JI as X,sO as ke,t7 as Ie,t1 as ie,sS as re,t5 as Pe,t2 as je,JJ as le,uE as Le,JK as Te,fx as ve,JL as J,sX as de,sV as ce,ta as Fe,c1 as Ae}from"./zeni-epic-state-vpQnS6PI.js";import{Z as pe,y as Q,S as E,z as H,a6 as ue,I as me,ah as ge,ai as Oe,G as he,o as O,J as fe,D as Ce,aj as Re,V as Ve,A as Ue,c as be,e as Ze,r as Be,ak as $e,k as Je}from"./index-gIHwUZJz.js";import{D as ye,n as W,S as Se}from"./mui-BfKuxuES.js";import ae from"./NotFoundScreen-Du1hgJnA.js";import{a as r}from"./sentry-DorFMwQU.js";import{h as ee,l as _e,g as m,j as ze,u as Ge,k as He,n as se,o as $}from"./core-DrFqYlht.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{M as Me}from"./MobileAppDrawer-DSdJwfd5.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6fe53476-954b-41b6-92c6-0c2f3aeef133",a._sentryDebugIdIdentifier="sentry-dbid-6fe53476-954b-41b6-92c6-0c2f3aeef133")}catch{}})();const Xe={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>G(e)),{useFeatureGate:f}=Q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=N(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(X()),y()},F=()=>{R===!0?S(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=W(Se)`
1
+ import{j as s}from"./liveblocks-C_VE9Mu9.js";import{JH as te,eO as Y,jA as G,eU as q,eS as ne,H6 as N,Jl as oe,s_ as Ee,JI as X,sO as ke,t7 as Ie,t1 as ie,sS as re,t5 as Pe,t2 as je,JJ as le,uE as Le,JK as Te,fx as ve,JL as J,sX as de,sV as ce,ta as Fe,c1 as Ae}from"./zeni-epic-state-BZK5iHMQ.js";import{Z as pe,y as Q,S as E,z as H,a6 as ue,I as me,ah as ge,ai as Oe,G as he,o as O,J as fe,D as Ce,aj as Re,V as Ve,A as Ue,c as be,e as Ze,r as Be,ak as $e,k as Je}from"./index-BsI-BcOG.js";import{D as ye,n as W,S as Se}from"./mui-tg9Pwou2.js";import ae from"./NotFoundScreen-Bgm7QovY.js";import{a as r}from"./sentry-Byikl8iY.js";import{h as ee,l as _e,g as m,j as ze,u as Ge,k as He,n as se,o as $}from"./core-B2Hxdfie.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-kK55rQTy.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import{M as Me}from"./MobileAppDrawer-uxmqh_ak.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6fe53476-954b-41b6-92c6-0c2f3aeef133",a._sentryDebugIdIdentifier="sentry-dbid-6fe53476-954b-41b6-92c6-0c2f3aeef133")}catch{}})();const Xe={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>G(e)),{useFeatureGate:f}=Q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=N(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(X()),y()},F=()=>{R===!0?S(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=W(Se)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-C6NDyiJv.js";import E from"./NotFoundScreen-Du1hgJnA.js";import{a as r}from"./sentry-DorFMwQU.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-DrFqYlht.js";import{eO as B,Pn as b,bo as F,bn as N,hg as V,gM as $}from"./zeni-epic-state-vpQnS6PI.js";import{w as q,z as I,cv as G}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as J}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{M as K}from"./MobileAppDrawer-DSdJwfd5.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.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]="9124148e-a571-47bf-9507-5c1b791e80bd",e._sentryDebugIdIdentifier="sentry-dbid-9124148e-a571-47bf-9507-5c1b791e80bd")}catch{}})();const L=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),Q=()=>{const e=_(),t=v(),c=q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:u}=M(),f=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{f(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:u,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${u}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
1
+ import{j as s}from"./liveblocks-C_VE9Mu9.js";import E from"./NotFoundScreen-Bgm7QovY.js";import{a as r}from"./sentry-Byikl8iY.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-B2Hxdfie.js";import{eO as B,Pn as b,bo as F,bn as N,hg as V,gM as $}from"./zeni-epic-state-BZK5iHMQ.js";import{w as q,z as I,cv as G}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-kK55rQTy.js";import{c as J}from"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import{M as K}from"./MobileAppDrawer-uxmqh_ak.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.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]="9124148e-a571-47bf-9507-5c1b791e80bd",e._sentryDebugIdIdentifier="sentry-dbid-9124148e-a571-47bf-9507-5c1b791e80bd")}catch{}})();const L=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),Q=()=>{const e=_(),t=v(),c=q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:u}=M(),f=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{f(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:u,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${u}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-DorFMwQU.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-Byikl8iY.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-C6NDyiJv.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DorFMwQU.js";import{L as dt,bS as Tc,eO as Ac,IQ as Rc,Ji as kl,c1 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-vpQnS6PI.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-BiDInqYy.js";import{r as un}from"./empty-Btqpa3Dn.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Ni58cQtF.js";import{r as Gl}from"./index-CuGjO8q5.js";import{r as zl}from"./index-BIdZz-Lu.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DrFqYlht.js";import{u as Kl,z as Pc,L as Wl,M as Jl,O as Xl,f as Ql,c as tf}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import{d as Pe}from"./decodeURIComponentSafe-BIE62qI8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="fadc171b-6792-4f49-86ab-6741f3ac973e",t._sentryDebugIdIdentifier="sentry-dbid-fadc171b-6792-4f49-86ab-6741f3ac973e")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-C_VE9Mu9.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-Byikl8iY.js";import{L as dt,bS as Tc,eO as Ac,IQ as Rc,Ji as kl,c1 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-BZK5iHMQ.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-KJcQ4RjB.js";import{r as un}from"./empty-DJcdURMB.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-BAv_DefF.js";import{r as Gl}from"./index-m_9cQfeA.js";import{r as zl}from"./index-CsMY6Obb.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-B2Hxdfie.js";import{u as Kl,z as Pc,L as Wl,M as Jl,O as Xl,f as Ql,c as tf}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import{d as Pe}from"./decodeURIComponentSafe-BcAs3k9x.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="fadc171b-6792-4f49-86ab-6741f3ac973e",t._sentryDebugIdIdentifier="sentry-dbid-fadc171b-6792-4f49-86ab-6741f3ac973e")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C6NDyiJv.js";import{a as o}from"./sentry-DorFMwQU.js";import{g as f,j as H,h as L,u as M,k as _}from"./core-DrFqYlht.js";import{m as F,Z as N,z as R,b3 as W,G as U,V as $,A as z,c as l,e as G,a3 as Y,b4 as Q}from"./index-gIHwUZJz.js";import{eY as Z,eO as q,Ma as I,Mb as J,tI as K,ty as g,e_ as X,bN as ee,tD as re,Mc as ae}from"./zeni-epic-state-vpQnS6PI.js";import{D as ne,e as te,n as se,S as oe}from"./mui-BfKuxuES.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{M as de}from"./MobileAppDrawer-DSdJwfd5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e0f17ef8-d3b9-4255-b287-196bc988da6b",e._sentryDebugIdIdentifier="sentry-dbid-e0f17ef8-d3b9-4255-b287-196bc988da6b")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=N();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>Z(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
1
+ import{j as s}from"./liveblocks-C_VE9Mu9.js";import{a as o}from"./sentry-Byikl8iY.js";import{g as f,j as H,h as L,u as M,k as _}from"./core-B2Hxdfie.js";import{m as F,Z as N,z as R,b3 as W,G as U,V as $,A as z,c as l,e as G,a3 as Y,b4 as Q}from"./index-BsI-BcOG.js";import{eY as Z,eO as q,Ma as I,Mb as J,tI as K,ty as g,e_ as X,bN as ee,tD as re,Mc as ae}from"./zeni-epic-state-BZK5iHMQ.js";import{D as ne,e as te,n as se,S as oe}from"./mui-tg9Pwou2.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-kK55rQTy.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import{M as de}from"./MobileAppDrawer-uxmqh_ak.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e0f17ef8-d3b9-4255-b287-196bc988da6b",e._sentryDebugIdIdentifier="sentry-dbid-e0f17ef8-d3b9-4255-b287-196bc988da6b")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=N();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>Z(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-C6NDyiJv.js";import x from"./NotFoundScreen-Du1hgJnA.js";import{a as p}from"./sentry-DorFMwQU.js";import{j as C,u as I,h as A,g as c,N as E,k,n as D,o as d}from"./core-DrFqYlht.js";import{eO as N,N4 as b,Nk as S,CF as T,BO as V,CE as u,Cv as O,NA as U}from"./zeni-epic-state-vpQnS6PI.js";import{m as _,z as B,B as $,a3 as W,bJ as z,ac as F}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import{R as g}from"./ReimbursementApprovalRuleDetailScreen-B-jeaK-0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="01cee2ea-de3f-47a5-ad56-dcd474496007",e._sentryDebugIdIdentifier="sentry-dbid-01cee2ea-de3f-47a5-ad56-dcd474496007")}catch{}})();const m="reimbursement-approval-rule-update",J=k(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(U(!1))},onBackClick:()=>{F(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(O(s))},onEditRuleClick:s=>{s!=null?(e(u(s)),a(`./${s}/edit`)):(e(u()),a("./new"))}}})(W(z)),P=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),v=c(n=>n.remiSetupApproverViewState.fetchState),o=c(n=>N(n)),w=_(),i=c(n=>b(n)),h=c(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||v!=="Not-Started"||(s(!0),a(V(!0)))},[l,v,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(u())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(d,{path:"/",element:t.jsx(P,{})}),t.jsx(d,{path:"/new",element:t.jsx(g,{})}),t.jsx(d,{path:"/:approvalRuleId/edit",element:t.jsx(g,{})}),t.jsx(d,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
1
+ import{j as t}from"./liveblocks-C_VE9Mu9.js";import x from"./NotFoundScreen-Bgm7QovY.js";import{a as p}from"./sentry-Byikl8iY.js";import{j as C,u as I,h as A,g as c,N as E,k,n as D,o as d}from"./core-B2Hxdfie.js";import{eO as N,N4 as b,Nk as S,CF as T,BO as V,CE as u,Cv as O,NA as U}from"./zeni-epic-state-BZK5iHMQ.js";import{m as _,z as B,B as $,a3 as W,bJ as z,ac as F}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import{R as g}from"./ReimbursementApprovalRuleDetailScreen-CEN6ZBSv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="01cee2ea-de3f-47a5-ad56-dcd474496007",e._sentryDebugIdIdentifier="sentry-dbid-01cee2ea-de3f-47a5-ad56-dcd474496007")}catch{}})();const m="reimbursement-approval-rule-update",J=k(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(U(!1))},onBackClick:()=>{F(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(O(s))},onEditRuleClick:s=>{s!=null?(e(u(s)),a(`./${s}/edit`)):(e(u()),a("./new"))}}})(W(z)),P=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),v=c(n=>n.remiSetupApproverViewState.fetchState),o=c(n=>N(n)),w=_(),i=c(n=>b(n)),h=c(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||v!=="Not-Started"||(s(!0),a(V(!0)))},[l,v,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(u())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(d,{path:"/",element:t.jsx(P,{})}),t.jsx(d,{path:"/new",element:t.jsx(g,{})}),t.jsx(d,{path:"/:approvalRuleId/edit",element:t.jsx(g,{})}),t.jsx(d,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-C6NDyiJv.js";import{a as y}from"./sentry-DorFMwQU.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-DrFqYlht.js";import{Nk as R,N4 as E,Cy as x,CH as _,CF as S,CG as h,Nl as k}from"./zeni-epic-state-vpQnS6PI.js";import{z as B,m as N,B as V,bA as F,ac as j}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="76e88467-3709-4dc1-be22-b5e708f7928c",e._sentryDebugIdIdentifier="sentry-dbid-76e88467-3709-4dc1-be22-b5e708f7928c")}catch{}})();function O(e){return k(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function J(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
1
+ import{j as g}from"./liveblocks-C_VE9Mu9.js";import{a as y}from"./sentry-Byikl8iY.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-B2Hxdfie.js";import{Nk as R,N4 as E,Cy as x,CH as _,CF as S,CG as h,Nl as k}from"./zeni-epic-state-BZK5iHMQ.js";import{z as B,m as N,B as V,bA as F,ac as j}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="76e88467-3709-4dc1-be22-b5e708f7928c",e._sentryDebugIdIdentifier="sentry-dbid-76e88467-3709-4dc1-be22-b5e708f7928c")}catch{}})();function O(e){return k(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function J(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C6NDyiJv.js";import{j as J,h as re,u as Z,l as X,g as E,N as $,k as K,i as mt,n as ct,o as C}from"./core-DrFqYlht.js";import{eO as V,NB as le,c1 as me,BJ as xe,jL as dt,BW as ne,BV as ae,NC as ut,bn as ce,fI as Te,ND as pt,JY as bt,jA as De,JZ as fe,J_ as gt,iv as ht,MS as St,iK as ft,Bx as It,sm as yt,iC as Rt,Ch as je,NE as Fe,NF as At,NG as kt,NH as vt,NI as Ct,NJ as Et,C1 as Ie,iQ as wt,M$ as Bt,BX as xt,BH as Tt,NK as Dt,BG as jt,NL as Ft,BP as ye,C5 as Ut,C4 as Lt,C0 as Nt,NM as Ue,H6 as Pt,bo as Mt,BS as $t,Cz as _t,NN as Ot,NO as zt,Cd as Gt,Ca as Re,Ml as Ht,BE as Zt,NP as Le,CY as Ae,D4 as Vt,NQ as Wt,NR as G,NS as Jt,NT as Ne,NU as Kt,NV as Pe,NW as Me,Cp as se,bt as qt,bF as de,cB as ue,eU as $e,eS as _e,NX as Yt,gM as Xt,My as Qt,NY as en,NZ as Oe,MC as tn,Nk as nn,N_ as an,NA as sn,D1 as ke,D0 as on,N$ as rn,O0 as ln,O1 as mn,O2 as cn,O3 as dn,N5 as un,CT as pn,CX as bn,bv as gn,bE as hn,cw as Sn,ck as fn,bs as In,IS as yn,cM as Rn,cO as An,cN as kn,cv as vn}from"./zeni-epic-state-vpQnS6PI.js";import{w as ze,Z as Ge,y as Q,S as k,z as P,bK as He,A as ee,c as v,aE as ve,o as j,aq as Y,I as Cn,D as Ze,bL as En,r as H,bM as wn,k as te,bN as Bn,V as xn,G as Tn,B as pe,e as Ve,a3 as Dn,bb as jn,Y as Fn,m as We,bO as Un,a6 as Ln}from"./index-gIHwUZJz.js";import{n as _,S as Nn}from"./mui-BfKuxuES.js";import ie from"./NotFoundScreen-Du1hgJnA.js";import{S as Ce}from"./SetupPagesScreen-DFNkJSDZ.js";import{F as Je}from"./FeaturePreviewScreen-CUAIKz1i.js";import{a as S}from"./sentry-DorFMwQU.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import{u as Ke}from"./useInitialThreadRequest-C8hN7EcF.js";import{c as qe}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{D as Pn}from"./DrawerScreen-BtlXa6K0.js";import{M as Ye}from"./MobileAppDrawer-DSdJwfd5.js";import{R as Mn}from"./ReimbursementApprovalRoutes-Dkrm7ab1.js";import{FallBackRoute as $n}from"./ScreenRoutes-XUGVTlJU.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";import"./analyticsHelper-CM7-DzIH.js";import"./routePaths-DwqXZ9IC.js";import"./BusinessVerificationPageScreen-CJhDGXDa.js";import"./ReimbursementApprovalRuleDetailScreen-B-jeaK-0.js";import"./getLocaleForTenant-CtOQ1QSt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75c23160-89a4-4328-a585-41ee00437eca",e._sentryDebugIdIdentifier="sentry-dbid-75c23160-89a4-4328-a585-41ee00437eca")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Xe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(ft(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(fe("common"))},onCancelAutoComplete:()=>{e(fe("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=X(),d=ze(),c=Ge(),[m,o]=S.useState(r==null),[a,i]=S.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,B]=S.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Ke(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);S.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
1
+ import{j as s}from"./liveblocks-C_VE9Mu9.js";import{j as J,h as re,u as Z,l as X,g as E,N as $,k as K,i as mt,n as ct,o as C}from"./core-B2Hxdfie.js";import{eO as V,NB as le,c1 as me,BJ as xe,jL as dt,BW as ne,BV as ae,NC as ut,bn as ce,fI as Te,ND as pt,JY as bt,jA as De,JZ as fe,J_ as gt,iv as ht,MS as St,iK as ft,Bx as It,sm as yt,iC as Rt,Ch as je,NE as Fe,NF as At,NG as kt,NH as vt,NI as Ct,NJ as Et,C1 as Ie,iQ as wt,M$ as Bt,BX as xt,BH as Tt,NK as Dt,BG as jt,NL as Ft,BP as ye,C5 as Ut,C4 as Lt,C0 as Nt,NM as Ue,H6 as Pt,bo as Mt,BS as $t,Cz as _t,NN as Ot,NO as zt,Cd as Gt,Ca as Re,Ml as Ht,BE as Zt,NP as Le,CY as Ae,D4 as Vt,NQ as Wt,NR as G,NS as Jt,NT as Ne,NU as Kt,NV as Pe,NW as Me,Cp as se,bt as qt,bF as de,cB as ue,eU as $e,eS as _e,NX as Yt,gM as Xt,My as Qt,NY as en,NZ as Oe,MC as tn,Nk as nn,N_ as an,NA as sn,D1 as ke,D0 as on,N$ as rn,O0 as ln,O1 as mn,O2 as cn,O3 as dn,N5 as un,CT as pn,CX as bn,bv as gn,bE as hn,cw as Sn,ck as fn,bs as In,IS as yn,cM as Rn,cO as An,cN as kn,cv as vn}from"./zeni-epic-state-BZK5iHMQ.js";import{w as ze,Z as Ge,y as Q,S as k,z as P,bK as He,A as ee,c as v,aE as ve,o as j,aq as Y,I as Cn,D as Ze,bL as En,r as H,bM as wn,k as te,bN as Bn,V as xn,G as Tn,B as pe,e as Ve,a3 as Dn,bb as jn,Y as Fn,m as We,bO as Un,a6 as Ln}from"./index-BsI-BcOG.js";import{n as _,S as Nn}from"./mui-tg9Pwou2.js";import ie from"./NotFoundScreen-Bgm7QovY.js";import{S as Ce}from"./SetupPagesScreen-CNq2NGTh.js";import{F as Je}from"./FeaturePreviewScreen-BTGMWD-c.js";import{a as S}from"./sentry-Byikl8iY.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-kK55rQTy.js";import{u as Ke}from"./useInitialThreadRequest-TLWHLSZh.js";import{c as qe}from"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import{D as Pn}from"./DrawerScreen-Bfal1rIA.js";import{M as Ye}from"./MobileAppDrawer-uxmqh_ak.js";import{R as Mn}from"./ReimbursementApprovalRoutes-7WHxbekg.js";import{FallBackRoute as $n}from"./ScreenRoutes-CG_Gnubt.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";import"./analyticsHelper-kA_46WRt.js";import"./routePaths-BtZYDC_i.js";import"./BusinessVerificationPageScreen-CiVtyVMD.js";import"./ReimbursementApprovalRuleDetailScreen-CEN6ZBSv.js";import"./getLocaleForTenant-BC4keiZu.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75c23160-89a4-4328-a585-41ee00437eca",e._sentryDebugIdIdentifier="sentry-dbid-75c23160-89a4-4328-a585-41ee00437eca")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Xe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(ft(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(fe("common"))},onCancelAutoComplete:()=>{e(fe("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=X(),d=ze(),c=Ge(),[m,o]=S.useState(r==null),[a,i]=S.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,B]=S.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Ke(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);S.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-C6NDyiJv.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-DrFqYlht.js";import{eO as L,f8 as S,Jj as Ie,jA as Q,Jk as X,pS as O,jo as Re,is as Te,tm as K,pX as Ae,bv as Oe,Jl as ke,bn as Fe,ul as De,Jm as je,Jn as Ee,te as Pe,Jo as Y,Jp as Le,Jq as Me,Jr as Be,Js as Je,Jt as w,Ju as k,Jv as F,Jw as H,Jx as D,Jy as j,dC as ve,u1 as Ue,tR as N,tS as q,u7 as Ve,tW as $,ud as xe,Jz as ze,JA as Ge,JB as Ye,JC as He,JD as Ne,eU as qe,eS as $e}from"./zeni-epic-state-vpQnS6PI.js";import{R as We,U as Ze,Z as Qe,y as ee,S as E,z as ae,V as Xe,k as Ke,a as ea,A as aa,c as P,e as sa,r as se,W as ta,X as oa,Y as na}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import ra from"./NotFoundScreen-Du1hgJnA.js";import{F as ia}from"./FeaturePreviewScreen-CUAIKz1i.js";import{a as _}from"./sentry-DorFMwQU.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import{u as ma}from"./useInitialThreadRequest-C8hN7EcF.js";import{t as W,a as Z}from"./routePaths-DwqXZ9IC.js";import{M as fa}from"./MobileAppDrawer-DSdJwfd5.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.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]="eaaae7a2-c68a-4d72-9e9f-27ed524dd209",e._sentryDebugIdIdentifier="sentry-dbid-eaaae7a2-c68a-4d72-9e9f-27ed524dd209")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(Ye()),e(He()),e(Ne())},ha=Se(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},t=S(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:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),f.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return W(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(F({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({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:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ze(),m=Qe(),u=oa(m),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:f}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=ma(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>Q(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),A=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,M,g,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":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,v,T]);const U=Ke(),ce=U?.loggedInUserRole!=null&&Oe(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},me=ea(),fe=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=We(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(fa,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:fe&&me&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(E.isDebitCardFeatureEnabled),u=qe(m,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
1
+ import{j as p}from"./liveblocks-C_VE9Mu9.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-B2Hxdfie.js";import{eO as L,f8 as S,Jj as Ie,jA as Q,Jk as X,pS as O,jo as Re,is as Te,tm as K,pX as Ae,bv as Oe,Jl as ke,bn as Fe,ul as De,Jm as je,Jn as Ee,te as Pe,Jo as Y,Jp as Le,Jq as Me,Jr as Be,Js as Je,Jt as w,Ju as k,Jv as F,Jw as H,Jx as D,Jy as j,dC as ve,u1 as Ue,tR as N,tS as q,u7 as Ve,tW as $,ud as xe,Jz as ze,JA as Ge,JB as Ye,JC as He,JD as Ne,eU as qe,eS as $e}from"./zeni-epic-state-BZK5iHMQ.js";import{R as We,U as Ze,Z as Qe,y as ee,S as E,z as ae,V as Xe,k as Ke,a as ea,A as aa,c as P,e as sa,r as se,W as ta,X as oa,Y as na}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import ra from"./NotFoundScreen-Bgm7QovY.js";import{F as ia}from"./FeaturePreviewScreen-BTGMWD-c.js";import{a as _}from"./sentry-Byikl8iY.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import{u as ma}from"./useInitialThreadRequest-TLWHLSZh.js";import{t as W,a as Z}from"./routePaths-BtZYDC_i.js";import{M as fa}from"./MobileAppDrawer-uxmqh_ak.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.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]="eaaae7a2-c68a-4d72-9e9f-27ed524dd209",e._sentryDebugIdIdentifier="sentry-dbid-eaaae7a2-c68a-4d72-9e9f-27ed524dd209")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(Ye()),e(He()),e(Ne())},ha=Se(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},t=S(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:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),f.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return W(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(F({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({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:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ze(),m=Qe(),u=oa(m),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:f}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=ma(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>Q(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),A=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,M,g,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":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,v,T]);const U=Ke(),ce=U?.loggedInUserRole!=null&&Oe(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},me=ea(),fe=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=We(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(fa,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:fe&&me&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(E.isDebitCardFeatureEnabled),u=qe(m,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-C6NDyiJv.js";import{y as w,z as j,aK as y,A as E,c as p,e as F,cF as P,S as L}from"./index-gIHwUZJz.js";import"./mui-BfKuxuES.js";import l from"./NotFoundScreen-Du1hgJnA.js";import{a as u}from"./sentry-DorFMwQU.js";import{h as A,g as b,j as T,u as V,k as R,n as U,o as d}from"./core-DrFqYlht.js";import{eO as z,PW as C,ML as Y,PX as _,tI as G,e_ as O,PY as K,tG as M}from"./zeni-epic-state-vpQnS6PI.js";import{R as x}from"./ReferralListScreen-DiGYqmEw.js";import"./recharts-DzFRpM3n.js";import"./analytics-LRXDxB9U.js";import"./plaid-BfLcb-Mu.js";import"./dnd-DjCTgA16.js";import"./stripe-DMRn4zHo.js";import"./lottie-CRrBZj94.js";import"./lexical-BvSd63VE.js";import"./pdf-WyHfBZP8.js";import"./utils-BiDInqYy.js";import"./useAskAiCfoHostNavButtonProps-SdJdV09H.js";import"./useFetchSuggestedQuestionsWhenReady-1RkvixCJ.js";import"./MobileAppDrawer-DSdJwfd5.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]="398a84b3-50c2-4821-ab67-0a75e0948568",e._sentryDebugIdIdentifier="sentry-dbid-398a84b3-50c2-4821-ab67-0a75e0948568")}catch{}})();const W=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(_()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(M())},onUpdateInviteFormLocalData:s=>{e(K({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),X=()=>{const e=A(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=T(),k=V(),{useDynamicConfig:g}=w(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),D=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),v=Y(S);u.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(O(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:k,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(X,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
1
+ import{j as a}from"./liveblocks-C_VE9Mu9.js";import{y as w,z as j,aK as y,A as E,c as p,e as F,cF as P,S as L}from"./index-BsI-BcOG.js";import"./mui-tg9Pwou2.js";import l from"./NotFoundScreen-Bgm7QovY.js";import{a as u}from"./sentry-Byikl8iY.js";import{h as A,g as b,j as T,u as V,k as R,n as U,o as d}from"./core-B2Hxdfie.js";import{eO as z,PW as C,ML as Y,PX as _,tI as G,e_ as O,PY as K,tG as M}from"./zeni-epic-state-BZK5iHMQ.js";import{R as x}from"./ReferralListScreen-V548TPRB.js";import"./recharts-Ep8XanlT.js";import"./analytics-CYMgeTT5.js";import"./plaid-B_jGdYrM.js";import"./dnd-ChJsuxMK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL0TkQBF.js";import"./lexical-WK6PZ_Fc.js";import"./pdf-DJRvlcHv.js";import"./utils-KJcQ4RjB.js";import"./useAskAiCfoHostNavButtonProps-kK55rQTy.js";import"./useFetchSuggestedQuestionsWhenReady-D_ChcTLo.js";import"./MobileAppDrawer-uxmqh_ak.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]="398a84b3-50c2-4821-ab67-0a75e0948568",e._sentryDebugIdIdentifier="sentry-dbid-398a84b3-50c2-4821-ab67-0a75e0948568")}catch{}})();const W=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(_()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(M())},onUpdateInviteFormLocalData:s=>{e(K({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),X=()=>{const e=A(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=T(),k=V(),{useDynamicConfig:g}=w(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),D=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),v=Y(S);u.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(O(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:k,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(X,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};