@zeniai/web-app-ui 5.2.12-qa → 5.2.13-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/assets/AddressRoutes-DLYj8iuV.js +1 -0
  2. package/dist/assets/{AddressScreen-C6qRGk6n.js → AddressScreen-B_7cEnKD.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-ChZ4u6nj.js → AiCfoScreen-BUaUMOqh.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-BrG8_bHG.js → BillPayApprovalRoutes-fFL-mX-V.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D_u5WOiF.js → BillPayRoutes-D8lwLTXH.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BShNzAX6.js → BusinessVerificationPageScreen-Dwb9q8Sr.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-BaUv9Tls.js → CardsAiCfoScreen-BnOoZ3-l.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-D85MbIGG.js → ChargeCardRoutes-BX8sKg9j.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-C0IvgrSf.js → CompanyPassportScreen-CA1rNnz6.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-DyZUEreD.js → ConnectionAuthScreen-B-QI6jlM.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-66MImbnX.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BSO96x0H.js → CustomerOnboardingRoutes-BLyR0Odx.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-CCNlEL9t.js → DashboardRoutes-PAZiNp5H.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-Bmj0dyC5.js → DefaultTenantHome-spOtWD3A.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-6lgCq1Oi.js → DomesticWireDetailScreen-C-fj-EK2.js} +1 -1
  16. package/dist/assets/{DrawerScreen-CB78UwSt.js → DrawerScreen-BWiSdsIV.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-ebwnXKfN.js → EntityDetailRoutes-sCRpS1j0.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-BGOEFhQK.js → ExpenseAutomationRoutes-VJVnQQzl.js} +3 -3
  19. package/dist/assets/{FeaturePreviewScreen-BuxbtmPT.js → FeaturePreviewScreen-CUKc27Vx.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-CBdvuvIr.js → HubSpotOAuthCallbackScreen-B-OjwaD5.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-CUrTEYe3.js → MagicLinkRoutes-Bwrv6MrB.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-C1w86A6x.js → MagicLinkSignInScreen-CIkT8Ypk.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-BlUKlkof.js → MobileAppDrawer-DrKscogU.js} +1 -1
  24. package/dist/assets/NotFoundScreen-BGr9LaDQ.js +1 -0
  25. package/dist/assets/{NotificationRoutes-m1zdSxRY.js → NotificationRoutes-DtJ6zv5F.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-0d8SUlgO.js → OAuthConsentScreen-DmxAjF14.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-BGe3SifM.js → PandLWithForecastRoutes-4euaT8sc.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-CI8mZcWj.js → PeopleRoutes-BIY3PU2s.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-DTSVjeVx.js → PerformanceRoutes-BW2KAG3G.js} +1 -1
  30. package/dist/assets/{Preview-Cvkizx6n.js → Preview-Mf-iNnbX.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-BTrTPyqS.js → QBOConnectionScreen-BTDegFyb.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-BpHYGAKS.js → ReimbursementApprovalRoutes-Brpp_tVb.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BBP2YOa7.js → ReimbursementApprovalRuleDetailScreen-BEGmFwZm.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-C5ODHJOv.js → ReimbursementRoutes-Chp3smrm.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-YVt4z7BI.js → ReportsRoutes-JVGYt6D9.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-DsYmuaI2.js → RewardsRoutes-C7gK933e.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-DC80Y7ST.js → ScreenRoutes-B2M2KeTa.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-C0ZTV4cM.js → SettingsRoutes-DMIIn4Bo.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-CzqvTU7Q.js → SetupPagesScreen-ikH1-jvA.js} +1 -1
  40. package/dist/assets/{SignInScreen-B4tkZfBl.js → SignInScreen-Dr1D_Sql.js} +1 -1
  41. package/dist/assets/{SignOutScreen-Clu99CFp.js → SignOutScreen-Bc5DA_PD.js} +1 -1
  42. package/dist/assets/{TaskListScreen-DLCl-j3R.js → TaskListScreen-D9kTMlmb.js} +1 -1
  43. package/dist/assets/{TaskRoutes-BXNOpiYB.js → TaskRoutes-CzorS81R.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-Bkq0V99v.js → TransactionDetailRoutes-C2yXNhQy.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-Bn-xSZGA.js → TransactionDetailScreen-DoAx_dWo.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-uz-zO6BU.js → TransactionListRoutes-DeAjnViL.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-B9RMcSaN.js → TreasuryRoutes-DruSns4N.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-DyDKrnBl.js → VendorsRoutes-CdAuHesx.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-COPTP8wL.js → WiseConfirmationScreen-P1xAIVAG.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-B2-lwzJt.js → ZeniAccountRoutes-CppeCNmZ.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-HS25znBA.js → ZeniAccountStatementScreen-C9WZyVpo.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-BoMcJRmU.js → accountMappingHelper-DPo5_oRM.js} +1 -1
  53. package/dist/assets/{analytics-tnLNAAzo.js → analytics-C3yKGO2p.js} +1 -1
  54. package/dist/assets/{analyticsHelper-BLN8Q7dD.js → analyticsHelper-Bb-clko5.js} +1 -1
  55. package/dist/assets/{core-73g-CRXm.js → core-QBDM2m9E.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-vreX6HdN.js → decodeURIComponentSafe-V0q2i3Mt.js} +1 -1
  57. package/dist/assets/{dnd-CCmj5-_i.js → dnd-DTpdpLY3.js} +1 -1
  58. package/dist/assets/{empty-Dgn5BJ4x.js → empty-CFhDMTFy.js} +1 -1
  59. package/dist/assets/{empty-AoB5TcI1.js → empty-DOkYgcMg.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-BE66TwHH.js → emptyVideoElement--yp8X02p.js} +1 -1
  61. package/dist/assets/{epic-LDMRAHZs.js → epic-DhMQUuQ_.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-Ci7Iyx0p.js → getLocaleForTenant-CZ5OuBaj.js} +1 -1
  63. package/dist/assets/{index-CwCXBsVA.js → index-BD-4IlOh.js} +2 -2
  64. package/dist/assets/{index-B7mOZ36a.js → index-BMXF4zS6.js} +1 -1
  65. package/dist/assets/{index-B2-aA0mm.js → index-BzUA8nAy.js} +14 -14
  66. package/dist/assets/{index-B_4cz_K1.js → index-C-I3RcJQ.js} +1 -1
  67. package/dist/assets/{index-CdShvsd9.js → index-ChYlKp3n.js} +1 -1
  68. package/dist/assets/{index-C9WNu74T.js → index-Dgg3TEkF.js} +1 -1
  69. package/dist/assets/{index-BlFohoS1.js → index-PvNZ50rx.js} +1 -1
  70. package/dist/assets/{index-Bf1SUo7G.js → index-_F7n4D5D.js} +1 -1
  71. package/dist/assets/{lexical-B-MdcDyi.js → lexical-DBGXZJbY.js} +1 -1
  72. package/dist/assets/{liveblocks-ff5jvbRc.js → liveblocks-ufh19lah.js} +1 -1
  73. package/dist/assets/{lottie-DvKGbHR7.js → lottie-Ceg93JYe.js} +1 -1
  74. package/dist/assets/{mui-C6EPTIjM.js → mui-CB8RW45Z.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DB-OtIUd.js → pathToGoBack-Bi5ALgzm.js} +1 -1
  76. package/dist/assets/{pdf-BJ608N2P.js → pdf-DdbTijar.js} +3 -3
  77. package/dist/assets/{pdf-lib-Dhic7kAC.js → pdf-lib-DuOAYy25.js} +1 -1
  78. package/dist/assets/{plaid-BGzMn-Ja.js → plaid-DAwCYgVP.js} +1 -1
  79. package/dist/assets/{pusher-WaTQDWIq.js → pusher-CiZh5qhj.js} +1 -1
  80. package/dist/assets/{react-DxulePqx.js → react-BNUtRbVm.js} +1 -1
  81. package/dist/assets/{react-COsTIbDv.js → react-BQkbVo66.js} +1 -1
  82. package/dist/assets/{react-BUwb_BL7.js → react-C-M5T2pV.js} +1 -1
  83. package/dist/assets/{react-BD0aRB2D.js → react-C4Bd6CfY.js} +1 -1
  84. package/dist/assets/{react-B29GLwIL.js → react-XuQaBloD.js} +1 -1
  85. package/dist/assets/{react-D8hZ-zAO.js → react-b_GUNHoi.js} +1 -1
  86. package/dist/assets/{recharts-CuGywxsn.js → recharts-B8SFxg38.js} +1 -1
  87. package/dist/assets/{routePaths-D9vDZtOv.js → routePaths-GKW140Mx.js} +1 -1
  88. package/dist/assets/{sentry-DRJyi6Lv.js → sentry-Co2H8v0G.js} +1 -1
  89. package/dist/assets/{url-94cOi_su.js → url-BD8IMRo-.js} +1 -1
  90. package/dist/assets/{url-nWZmwppH.js → url-D7tTbw7b.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DvNt2bSq.js → useAiCfoDashboardSuggestedQuestionsChips-UT4ITugD.js} +1 -1
  92. package/dist/assets/{useAskAiCfoHostNavButtonProps-NCLc8anu.js → useAskAiCfoHostNavButtonProps-DRkfNJU3.js} +1 -1
  93. package/dist/assets/{useCashManagementBanner-ChfeBgIX.js → useCashManagementBanner-CDnWdC79.js} +1 -1
  94. package/dist/assets/{useChargeCardPusherEvents-CKUYXOLS.js → useChargeCardPusherEvents-tUZA-Moq.js} +1 -1
  95. package/dist/assets/{useDeviceId-Dn2y2Mec.js → useDeviceId-SWL_t36p.js} +1 -1
  96. package/dist/assets/{useEmailConnectResultRefresh-D_QaL-cQ.js → useEmailConnectResultRefresh-CeyjUEl1.js} +1 -1
  97. package/dist/assets/{useInitialThreadRequest-Dt88hhBW.js → useInitialThreadRequest-y87fsb02.js} +1 -1
  98. package/dist/assets/{utils-DSjwo3lj.js → utils-CWM6Tene.js} +1 -1
  99. package/dist/assets/{withTransactionSidePanel-hWv9TKTy.js → withTransactionSidePanel-Cx7SLti4.js} +1 -1
  100. package/dist/assets/{zeni-epic-state-CVqp5cMc.js → zeni-epic-state-BF09v22i.js} +3 -3
  101. package/dist/index.html +1 -1
  102. package/package.json +3 -3
  103. package/dist/assets/AddressRoutes-BeHuFlKI.js +0 -1
  104. package/dist/assets/CustomerOnboardingAuthScreen-CvcKpx99.js +0 -1
  105. package/dist/assets/NotFoundScreen-wxvtJzir.js +0 -1
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-ff5jvbRc.js";import E from"./NotFoundScreen-wxvtJzir.js";import{a as r}from"./sentry-DRJyi6Lv.js";import{h as _,g as v,j as p,i as M,u as U,N as B,n as P,o as z,p as h}from"./core-73g-CRXm.js";import{eZ as O,Tj as b,bq as F,bn as N,ij as V,fB as q}from"./zeni-epic-state-CVqp5cMc.js";import{B as Y,z as I,a0 as Z,cY as $}from"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-NCLc8anu.js";import{M as H}from"./MobileAppDrawer-BlUKlkof.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.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]="3828ab5c-1061-4de8-83ea-987f3b31e92e",e._sentryDebugIdIdentifier="sentry-dbid-3828ab5c-1061-4de8-83ea-987f3b31e92e")}catch{}})();const J=P((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))($),K=()=>{const e=_(),t=v(),c=Y(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),j=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(d),x=C||j||k,l=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0}),[n?.fetchState,l]),D=r.useCallback(((a,i)=>{l(a,i,!1)}),[l]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=G({mobileExploreReferrer:"Performance"});return Z({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:f,onReload:y,onTimeRangeSelect:D,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(B,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-ufh19lah.js";import E from"./NotFoundScreen-BGr9LaDQ.js";import{a as r}from"./sentry-Co2H8v0G.js";import{h as _,g as v,j as p,i as M,u as U,N as B,n as P,o as z,p as h}from"./core-QBDM2m9E.js";import{eZ as O,Tj as b,bq as F,bn as N,ij as V,fB as q}from"./zeni-epic-state-BF09v22i.js";import{B as Y,z as I,a0 as Z,cY as $}from"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DRkfNJU3.js";import{M as H}from"./MobileAppDrawer-DrKscogU.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="3828ab5c-1061-4de8-83ea-987f3b31e92e",e._sentryDebugIdIdentifier="sentry-dbid-3828ab5c-1061-4de8-83ea-987f3b31e92e")}catch{}})();const J=P((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))($),K=()=>{const e=_(),t=v(),c=Y(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),j=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(d),x=C||j||k,l=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0}),[n?.fetchState,l]),D=r.useCallback(((a,i)=>{l(a,i,!1)}),[l]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=G({mobileExploreReferrer:"Performance"});return Z({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:f,onReload:y,onTimeRangeSelect:D,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(B,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-DRJyi6Lv.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-Co2H8v0G.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-ff5jvbRc.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DRJyi6Lv.js";import{L as dt,bZ as Tc,eZ as Ac,Mh as Rc,ML as kl,c7 as Tl,g2 as Al,g3 as Rl}from"./zeni-epic-state-CVqp5cMc.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-DSjwo3lj.js";import{r as un}from"./empty-AoB5TcI1.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Dhic7kAC.js";import{r as Gl}from"./index-Bf1SUo7G.js";import{r as zl}from"./index-BlFohoS1.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-73g-CRXm.js";import{u as Kl,z as Pc,L as Wl,R as Jl,Q as Xl,m as Ql,f as tf}from"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";import{d as Pe}from"./decodeURIComponentSafe-vreX6HdN.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]="a4df7845-f425-4a98-ad58-7e83d65268e3",t._sentryDebugIdIdentifier="sentry-dbid-a4df7845-f425-4a98-ad58-7e83d65268e3")}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-ufh19lah.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-Co2H8v0G.js";import{L as dt,bZ as Tc,eZ as Ac,Mh as Rc,ML as kl,c7 as Tl,g2 as Al,g3 as Rl}from"./zeni-epic-state-BF09v22i.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-CWM6Tene.js";import{r as un}from"./empty-DOkYgcMg.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DuOAYy25.js";import{r as Gl}from"./index-_F7n4D5D.js";import{r as zl}from"./index-PvNZ50rx.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-QBDM2m9E.js";import{u as Kl,z as Pc,L as Wl,R as Jl,Q as Xl,m as Ql,f as tf}from"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";import{d as Pe}from"./decodeURIComponentSafe-V0q2i3Mt.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]="a4df7845-f425-4a98-ad58-7e83d65268e3",t._sentryDebugIdIdentifier="sentry-dbid-a4df7845-f425-4a98-ad58-7e83d65268e3")}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 +1 @@
1
- import{j as r}from"./liveblocks-ff5jvbRc.js";import F from"./NotFoundScreen-wxvtJzir.js";import{a as p}from"./sentry-DRJyi6Lv.js";import{h as x,g as C,u as E,j as u,N as D,n as k,o as O,p as b}from"./core-73g-CRXm.js";import{eZ as I,QB as g,QR as S,F_ as V,F7 as U,FZ as c,FQ as B,R2 as L,G0 as W}from"./zeni-epic-state-CVqp5cMc.js";import{z as N,a9 as T,bZ as Q,ag as _,bC as Z,b_ as z}from"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";import{u as G,R as A}from"./ReimbursementApprovalRuleDetailScreen-BBP2YOa7.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]="ba488a7b-1f2a-49d3-b755-d1b8d0021a05",e._sentryDebugIdIdentifier="sentry-dbid-ba488a7b-1f2a-49d3-b755-d1b8d0021a05")}catch{}})();const y="reimbursement-approval-rule-update",K=k((function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(L(!1))},onBackClick:()=>{_(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))}}}))(T(Q)),q=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),d=u((a=>g(a))),v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(R(!0),n(c())),o("./new"))}),[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,$,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(K,{currentTenant:l,location:s,navigate:o,...w})},j="reimbursement-approval-rule-update",H=k((function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(L(!1))},onBackClick:()=>{_(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}}))(T(z)),J=()=>{const e=u((n=>I(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=Z(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(q,{isLoading:s})},M=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),d=u((a=>g(a)));G();const v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(R(!0),n(c())),o("./new"))}),[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,$,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(J,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(F,{})})]})}export{oe as R};
1
+ import{j as r}from"./liveblocks-ufh19lah.js";import F from"./NotFoundScreen-BGr9LaDQ.js";import{a as p}from"./sentry-Co2H8v0G.js";import{h as x,g as C,u as E,j as u,N as D,n as k,o as O,p as b}from"./core-QBDM2m9E.js";import{eZ as I,QB as g,QR as S,F_ as V,F7 as U,FZ as c,FQ as B,R2 as L,G0 as W}from"./zeni-epic-state-BF09v22i.js";import{z as N,a9 as T,bZ as Q,ag as _,bC as Z,b_ as z}from"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";import{u as G,R as A}from"./ReimbursementApprovalRuleDetailScreen-BEGmFwZm.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]="ba488a7b-1f2a-49d3-b755-d1b8d0021a05",e._sentryDebugIdIdentifier="sentry-dbid-ba488a7b-1f2a-49d3-b755-d1b8d0021a05")}catch{}})();const y="reimbursement-approval-rule-update",K=k((function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(L(!1))},onBackClick:()=>{_(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))}}}))(T(Q)),q=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),d=u((a=>g(a))),v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(R(!0),n(c())),o("./new"))}),[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,$,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(K,{currentTenant:l,location:s,navigate:o,...w})},j="reimbursement-approval-rule-update",H=k((function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(L(!1))},onBackClick:()=>{_(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}}))(T(z)),J=()=>{const e=u((n=>I(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=Z(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(q,{isLoading:s})},M=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),d=u((a=>g(a)));G();const v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(R(!0),n(c())),o("./new"))}),[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,$,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(J,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(F,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-ff5jvbRc.js";import{a as f}from"./sentry-DRJyi6Lv.js";import{u as w,j as g,h as x,g as O,i as k,n as F}from"./core-73g-CRXm.js";import{l6 as L,QR as T,QB as C,FT as V,G3 as B,F_ as A,F$ as E,QS as j,eZ as Z,FZ as z}from"./zeni-epic-state-CVqp5cMc.js";import{z as P,y as N,E as $,bP as G,ag as Q,bC as K,bQ as W}from"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="1149f0a9-1918-4d94-80f8-25d871ffc2cf",e._sentryDebugIdIdentifier="sentry-dbid-1149f0a9-1918-4d94-80f8-25d871ffc2cf")}catch{}})();function H(){const e=w(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const J=F((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const y=(b=m.value,j(b)==null);var b;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(I);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function M(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const X=F((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];b==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1}))));const _=y.action??"require_approval";m.push({action:_,actors:D,operator:D.length>1?_==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=S?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>Z(t))),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(M,{})}function Y(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as h}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0G.js";import{u as w,j as g,h as x,g as O,i as k,n as F}from"./core-QBDM2m9E.js";import{l6 as L,QR as T,QB as C,FT as V,G3 as B,F_ as A,F$ as E,QS as j,eZ as Z,FZ as z}from"./zeni-epic-state-BF09v22i.js";import{z as P,y as N,E as $,bP as G,ag as Q,bC as K,bQ as W}from"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="1149f0a9-1918-4d94-80f8-25d871ffc2cf",e._sentryDebugIdIdentifier="sentry-dbid-1149f0a9-1918-4d94-80f8-25d871ffc2cf")}catch{}})();function H(){const e=w(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const J=F((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const y=(b=m.value,j(b)==null);var b;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(I);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function M(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const X=F((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];b==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1}))));const _=y.action??"require_approval";m.push({action:_,actors:D,operator:D.length>1?_==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=S?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>Z(t))),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(M,{})}function Y(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-ff5jvbRc.js";import{h as Q,u as de,g as H,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-73g-CRXm.js";import{eZ as V,R3 as ue,c7 as pe,F2 as Ue,kR as ut,Ff as oe,Fe as re,R4 as pt,bn as be,gt as Le,R5 as bt,Nv as gt,kG as Pe,Nw as ve,Nx as ht,jB as ft,Qn as St,jQ as Rt,ES as It,uw as yt,jI as vt,FC as $e,R6 as Me,R7 as kt,R8 as At,R9 as Ct,Ra as Et,Rb as wt,Fm as ke,jW as xt,Qw as Bt,Fg as Tt,F0 as Ft,Rc as jt,E$ as Dt,Rd as Ut,F8 as Ae,Fq as Lt,Fp as Pt,Fl as $t,Re as _e,KB as Mt,bq as _t,Fb as Nt,FU as Gt,Rf as Ot,Rg as zt,Fy as Zt,Fv as Ce,PS as Ht,EZ as Vt,Rh as Ne,Gk as Ee,Gs as Wt,Ri as Qt,Rj as z,Rk as qt,Rl as Ge,Rm as Kt,Rn as Oe,Ro as ze,FK as le,bu as Jt,bK as ge,cI as he,fG as Ze,fE as He,Rp as Xt,fB as Yt,Q3 as en,Rq as tn,Rr as Ve,Q7 as nn,QR as an,Rs as sn,R2 as on,Gp as we,Go as rn,Rt as ln,Ru as mn,Rv as cn,Rw as dn,Rx as un,QC as pn,Gf as bn,Gj as gn,bs as hn,bJ as fn,cC as Sn,cq as Rn,bt as In,Mj as yn,cS as vn,cV as kn,cU as An,cB as Cn}from"./zeni-epic-state-CVqp5cMc.js";import{B as We,J as Qe,A as ee,c as E,z as P,b$ as qe,F as te,f as k,aM as xe,o as j,au as X,K as En,O as Ke,c0 as wn,v as Z,a0 as Je,c1 as xn,e as ne,c2 as Bn,_ as Tn,H as Fn,E as fe,h as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-B2-aA0mm.js";import{n as N,S as $n}from"./mui-C6EPTIjM.js";import me from"./NotFoundScreen-wxvtJzir.js";import{S as Be}from"./SetupPagesScreen-CzqvTU7Q.js";import{F as et}from"./FeaturePreviewScreen-BuxbtmPT.js";import{a as f}from"./sentry-DRJyi6Lv.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-NCLc8anu.js";import{u as tt}from"./useInitialThreadRequest-Dt88hhBW.js";import{D as Mn}from"./DrawerScreen-CB78UwSt.js";import{M as nt}from"./MobileAppDrawer-BlUKlkof.js";import{R as _n}from"./ReimbursementApprovalRoutes-BpHYGAKS.js";import{FallBackRoute as Nn}from"./ScreenRoutes-DC80Y7ST.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.js";import"./analyticsHelper-BLN8Q7dD.js";import"./routePaths-D9vDZtOv.js";import"./BusinessVerificationPageScreen-BShNzAX6.js";import"./ReimbursementApprovalRuleDetailScreen-BBP2YOa7.js";import"./getLocaleForTenant-Ci7Iyx0p.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]="318a6512-ba52-46b3-90d9-45ebd2be5ce7",e._sentryDebugIdIdentifier="sentry-dbid-318a6512-ba52-46b3-90d9-45ebd2be5ce7")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(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(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(kt());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(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(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function Fe(){const e=Q(),t=de(),n=H(),{reimbursementId:r}=Y(),d=We(),c=Qe(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,F=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),A=P.getSignedInUser(),R=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(A==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Qn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
1
+ import{j as s}from"./liveblocks-ufh19lah.js";import{h as Q,u as de,g as H,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-QBDM2m9E.js";import{eZ as V,R3 as ue,c7 as pe,F2 as Ue,kR as ut,Ff as oe,Fe as re,R4 as pt,bn as be,gt as Le,R5 as bt,Nv as gt,kG as Pe,Nw as ve,Nx as ht,jB as ft,Qn as St,jQ as Rt,ES as It,uw as yt,jI as vt,FC as $e,R6 as Me,R7 as kt,R8 as At,R9 as Ct,Ra as Et,Rb as wt,Fm as ke,jW as xt,Qw as Bt,Fg as Tt,F0 as Ft,Rc as jt,E$ as Dt,Rd as Ut,F8 as Ae,Fq as Lt,Fp as Pt,Fl as $t,Re as _e,KB as Mt,bq as _t,Fb as Nt,FU as Gt,Rf as Ot,Rg as zt,Fy as Zt,Fv as Ce,PS as Ht,EZ as Vt,Rh as Ne,Gk as Ee,Gs as Wt,Ri as Qt,Rj as z,Rk as qt,Rl as Ge,Rm as Kt,Rn as Oe,Ro as ze,FK as le,bu as Jt,bK as ge,cI as he,fG as Ze,fE as He,Rp as Xt,fB as Yt,Q3 as en,Rq as tn,Rr as Ve,Q7 as nn,QR as an,Rs as sn,R2 as on,Gp as we,Go as rn,Rt as ln,Ru as mn,Rv as cn,Rw as dn,Rx as un,QC as pn,Gf as bn,Gj as gn,bs as hn,bJ as fn,cC as Sn,cq as Rn,bt as In,Mj as yn,cS as vn,cV as kn,cU as An,cB as Cn}from"./zeni-epic-state-BF09v22i.js";import{B as We,J as Qe,A as ee,c as E,z as P,b$ as qe,F as te,f as k,aM as xe,o as j,au as X,K as En,O as Ke,c0 as wn,v as Z,a0 as Je,c1 as xn,e as ne,c2 as Bn,_ as Tn,H as Fn,E as fe,h as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-BzUA8nAy.js";import{n as N,S as $n}from"./mui-CB8RW45Z.js";import me from"./NotFoundScreen-BGr9LaDQ.js";import{S as Be}from"./SetupPagesScreen-ikH1-jvA.js";import{F as et}from"./FeaturePreviewScreen-CUKc27Vx.js";import{a as f}from"./sentry-Co2H8v0G.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DRkfNJU3.js";import{u as tt}from"./useInitialThreadRequest-y87fsb02.js";import{D as Mn}from"./DrawerScreen-BWiSdsIV.js";import{M as nt}from"./MobileAppDrawer-DrKscogU.js";import{R as _n}from"./ReimbursementApprovalRoutes-Brpp_tVb.js";import{FallBackRoute as Nn}from"./ScreenRoutes-B2M2KeTa.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./analyticsHelper-Bb-clko5.js";import"./routePaths-GKW140Mx.js";import"./BusinessVerificationPageScreen-Dwb9q8Sr.js";import"./ReimbursementApprovalRuleDetailScreen-BEGmFwZm.js";import"./getLocaleForTenant-CZ5OuBaj.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]="318a6512-ba52-46b3-90d9-45ebd2be5ce7",e._sentryDebugIdIdentifier="sentry-dbid-318a6512-ba52-46b3-90d9-45ebd2be5ce7")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(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(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(kt());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(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(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function Fe(){const e=Q(),t=de(),n=H(),{reimbursementId:r}=Y(),d=We(),c=Qe(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,F=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),A=P.getSignedInUser(),R=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(A==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Qn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-ff5jvbRc.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as N}from"./core-73g-CRXm.js";import{eZ as L,fV as w,MM as Te,kG as X,rb as J,s0 as A,ku as Re,jy as Me,vz as K,s5 as Oe,bs as Ae,MN as Fe,bn as ke,wI as De,MO as je,MP as Ee,vr as Pe,MQ as Y,MR as Le,MS as ve,MT as Be,MU as Ve,MV as I,MW as F,MX as k,MY as H,MZ as D,M_ as j,dI as Ue,wo as xe,wc as $,wd as Z,wu as ze,wh as q,wA as Ge,M$ as Ne,N0 as Ye,N1 as He,N2 as $e,N3 as Ze,fG as qe,fE as Qe}from"./zeni-epic-state-CVqp5cMc.js";import{U as We,W as Xe,X as Je,Z as Ke,J as ea,A as ee,c as E,z as ae,_ as aa,e as sa,a as ta,$ as oa,a0 as na,F as ra,f as P,h as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";import fa from"./NotFoundScreen-wxvtJzir.js";import{F as ma}from"./FeaturePreviewScreen-BuxbtmPT.js";import{a as _}from"./sentry-DRJyi6Lv.js";import{u as ua}from"./useInitialThreadRequest-Dt88hhBW.js";import{t as Q,a as W,b as _a}from"./routePaths-D9vDZtOv.js";import{M as ha}from"./MobileAppDrawer-BlUKlkof.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.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]="e47ee269-4a54-48ef-a02e-4f61d8418710",e._sentryDebugIdIdentifier="sentry-dbid-e47ee269-4a54-48ef-a02e-4f61d8418710")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(He()),e($e()),e(Ze())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:X(e),isAccountingProjectsEnabled:J(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ne(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(Z(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({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(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(Z(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(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(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({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=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>X(n))),M=d((n=>J(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!v&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,v,C,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Xe(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=qe(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(N,{path:"/",element:p.jsx(Ca,{})}),p.jsx(N,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-ufh19lah.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as N}from"./core-QBDM2m9E.js";import{eZ as L,fV as w,MM as Te,kG as X,rb as J,s0 as A,ku as Re,jy as Me,vz as K,s5 as Oe,bs as Ae,MN as Fe,bn as ke,wI as De,MO as je,MP as Ee,vr as Pe,MQ as Y,MR as Le,MS as ve,MT as Be,MU as Ve,MV as I,MW as F,MX as k,MY as H,MZ as D,M_ as j,dI as Ue,wo as xe,wc as $,wd as Z,wu as ze,wh as q,wA as Ge,M$ as Ne,N0 as Ye,N1 as He,N2 as $e,N3 as Ze,fG as qe,fE as Qe}from"./zeni-epic-state-BF09v22i.js";import{U as We,W as Xe,X as Je,Z as Ke,J as ea,A as ee,c as E,z as ae,_ as aa,e as sa,a as ta,$ as oa,a0 as na,F as ra,f as P,h as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";import fa from"./NotFoundScreen-BGr9LaDQ.js";import{F as ma}from"./FeaturePreviewScreen-CUKc27Vx.js";import{a as _}from"./sentry-Co2H8v0G.js";import{u as ua}from"./useInitialThreadRequest-y87fsb02.js";import{t as Q,a as W,b as _a}from"./routePaths-GKW140Mx.js";import{M as ha}from"./MobileAppDrawer-DrKscogU.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="e47ee269-4a54-48ef-a02e-4f61d8418710",e._sentryDebugIdIdentifier="sentry-dbid-e47ee269-4a54-48ef-a02e-4f61d8418710")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(He()),e($e()),e(Ze())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:X(e),isAccountingProjectsEnabled:J(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ne(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(Z(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({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(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(Z(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(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(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({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=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>X(n))),M=d((n=>J(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!v&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,v,C,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Xe(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=qe(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(N,{path:"/",element:p.jsx(Ca,{})}),p.jsx(N,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-ff5jvbRc.js";import{z as w,F as S,f as u,h as E,da as k,A as I,c as C}from"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";import g from"./NotFoundScreen-wxvtJzir.js";import{a as l}from"./sentry-DRJyi6Lv.js";import{u as D,j as h,h as F,g as U,n as L,o as T,p as d,N as y}from"./core-73g-CRXm.js";import{eZ as _,U1 as j,U2 as p,w3 as P,fM as V,U3 as z,w1 as A}from"./zeni-epic-state-CVqp5cMc.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.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]="6764d1ab-dda2-4a22-adc7-cecf6d352906",e._sentryDebugIdIdentifier="sentry-dbid-6764d1ab-dda2-4a22-adc7-cecf6d352906")}catch{}})();const G=L((function(e,t){const n=j(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=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(A())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),M=()=>{const e=D(),[t,n]=l.useState(!1),[i,s]=l.useState(!1),r=h((o=>_(o))),c=F(),x=U(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),b=f?.firstName!=null?f.firstName:"User";l.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),l.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:c,location:x,currentTenant:r,companyName:v,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(M,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
1
+ import{j as a}from"./liveblocks-ufh19lah.js";import{z as w,F as S,f as u,h as E,da as k,A as I,c as C}from"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";import g from"./NotFoundScreen-BGr9LaDQ.js";import{a as l}from"./sentry-Co2H8v0G.js";import{u as D,j as h,h as F,g as U,n as L,o as T,p as d,N as y}from"./core-QBDM2m9E.js";import{eZ as _,U1 as j,U2 as p,w3 as P,fM as V,U3 as z,w1 as A}from"./zeni-epic-state-BF09v22i.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="6764d1ab-dda2-4a22-adc7-cecf6d352906",e._sentryDebugIdIdentifier="sentry-dbid-6764d1ab-dda2-4a22-adc7-cecf6d352906")}catch{}})();const G=L((function(e,t){const n=j(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=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(A())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),M=()=>{const e=D(),[t,n]=l.useState(!1),[i,s]=l.useState(!1),r=h((o=>_(o))),c=F(),x=U(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),b=f?.firstName!=null?f.firstName:"User";l.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),l.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:c,location:x,currentTenant:r,companyName:v,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(M,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CCNlEL9t.js","assets/sentry-DRJyi6Lv.js","assets/core-73g-CRXm.js","assets/zeni-epic-state-CVqp5cMc.js","assets/index-B2-aA0mm.js","assets/mui-C6EPTIjM.js","assets/analytics-tnLNAAzo.js","assets/utils-DSjwo3lj.js","assets/withTransactionSidePanel-hWv9TKTy.js","assets/useAskAiCfoHostNavButtonProps-NCLc8anu.js","assets/TransactionDetailScreen-Bn-xSZGA.js","assets/decodeURIComponentSafe-vreX6HdN.js","assets/routePaths-D9vDZtOv.js","assets/NotFoundScreen-wxvtJzir.js","assets/useInitialThreadRequest-Dt88hhBW.js","assets/analyticsHelper-BLN8Q7dD.js","assets/CompanyPassportScreen-C0IvgrSf.js","assets/MobileAppDrawer-BlUKlkof.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DvNt2bSq.js","assets/FeaturePreviewScreen-BuxbtmPT.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-D_u5WOiF.js","assets/AddressScreen-C6qRGk6n.js","assets/DomesticWireDetailScreen-6lgCq1Oi.js","assets/DrawerScreen-CB78UwSt.js","assets/SetupPagesScreen-CzqvTU7Q.js","assets/BusinessVerificationPageScreen-BShNzAX6.js","assets/BillPayApprovalRoutes-BrG8_bHG.js","assets/ReimbursementApprovalRuleDetailScreen-BBP2YOa7.js","assets/getLocaleForTenant-Ci7Iyx0p.js","assets/ReimbursementRoutes-C5ODHJOv.js","assets/ReimbursementApprovalRoutes-BpHYGAKS.js","assets/TransactionListRoutes-uz-zO6BU.js","assets/ZeniAccountStatementScreen-HS25znBA.js","assets/SettingsRoutes-C0ZTV4cM.js","assets/accountMappingHelper-BoMcJRmU.js","assets/useEmailConnectResultRefresh-D_QaL-cQ.js","assets/QBOConnectionScreen-BTrTPyqS.js","assets/empty-AoB5TcI1.js","assets/index-Bf1SUo7G.js","assets/url-nWZmwppH.js","assets/index-BlFohoS1.js","assets/ReportsRoutes-YVt4z7BI.js","assets/ChargeCardRoutes-D85MbIGG.js","assets/useChargeCardPusherEvents-CKUYXOLS.js","assets/PeopleRoutes-CI8mZcWj.js","assets/ExpenseAutomationRoutes-BGOEFhQK.js","assets/TreasuryRoutes-B9RMcSaN.js","assets/useCashManagementBanner-ChfeBgIX.js","assets/VendorsRoutes-DyDKrnBl.js","assets/pathToGoBack-DB-OtIUd.js","assets/ZeniAccountRoutes-B2-lwzJt.js","assets/AddressRoutes-BeHuFlKI.js","assets/PandLWithForecastRoutes-BGe3SifM.js","assets/CustomerOnboardingRoutes-BSO96x0H.js","assets/TransactionDetailRoutes-Bkq0V99v.js","assets/EntityDetailRoutes-ebwnXKfN.js","assets/NotificationRoutes-m1zdSxRY.js","assets/PerformanceRoutes-DTSVjeVx.js","assets/RewardsRoutes-DsYmuaI2.js","assets/TaskRoutes-BXNOpiYB.js","assets/TaskListScreen-DLCl-j3R.js","assets/AiCfoScreen-ChZ4u6nj.js","assets/CardsAiCfoScreen-BaUv9Tls.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,bn as us,eZ as ds,fG as cs,fE as ms,go as _s,ft as hs,cW as pe,cC as Es,fW as ps,cu as Rs,bE as xs,bo as gs,f_ as Is,v as js,Mi as Ts,bs as As,Mj as fs,bK as ys,bJ as Ds,bt as bs,cq as Cs,Mk as vs,Ml as Us,cS as ws,cV as Os,cU as Ps,cB as Fs,cI as Ls,oi as Re,fC as xe,gy as ks,g2 as ge,gv as Ie,gw as je,g3 as Bs}from"./zeni-epic-state-CVqp5cMc.js";import{j as e}from"./liveblocks-ff5jvbRc.js";import{a as O}from"./sentry-DRJyi6Lv.js";import{u as Hs,h as Vs,i as Ss,g as Ns,j as G,l as Te,N as u,o as Ms,p as a}from"./core-73g-CRXm.js";import{y as Zs,u as Gs,z as y,A as zs,a as $s,n as Ws,c as z,i as Ys,d as qs,e as Js,L as F,O as Ae,t as _,P as Ks,f as X,l}from"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";import{f as fe}from"./analyticsHelper-BLN8Q7dD.js";import{t as Qs}from"./getLocaleForTenant-Ci7Iyx0p.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.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]="9c5dc939-e50e-4d82-adf7-2c14b3fce4da",o._sentryDebugIdIdentifier="sentry-dbid-9c5dc939-e50e-4d82-adf7-2c14b3fce4da")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-CCNlEL9t.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-D_u5WOiF.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-C5ODHJOv.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-uz-zO6BU.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-C0ZTV4cM.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-YVt4z7BI.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-D85MbIGG.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-CI8mZcWj.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-BGOEFhQK.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-B9RMcSaN.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-DyDKrnBl.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-B2-lwzJt.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-YVt4z7BI.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-BeHuFlKI.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-CI8mZcWj.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-BGe3SifM.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-BSO96x0H.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-DyDKrnBl.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-Bkq0V99v.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),ye=l((()=>t((()=>import("./EntityDetailRoutes-ebwnXKfN.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-CCNlEL9t.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-D_u5WOiF.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),ut=l((()=>t((()=>import("./SettingsRoutes-C0ZTV4cM.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-C5ODHJOv.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-B2-lwzJt.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-B9RMcSaN.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-uz-zO6BU.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-D85MbIGG.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-m1zdSxRY.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),Et=l((()=>t((()=>import("./PerformanceRoutes-DTSVjeVx.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),pt=l((()=>t((()=>import("./ExpenseAutomationRoutes-BGOEFhQK.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-DsYmuaI2.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-BXNOpiYB.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),gt=l((()=>t((()=>import("./AiCfoScreen-ChZ4u6nj.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-BaUv9Tls.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-wxvtJzir.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),It=l((()=>t((()=>import("./TaskListScreen-DLCl-j3R.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const T=Hs(),H=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Gs(),v=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=us(I),$=Ns(),[V,Pe]=O.useState(!1),r=G((n=>ds(n))),{useFeatureGate:N}=zs(),M=$s(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||A==="Completed"?cs(ne,r):void 0,J=j==="Completed"||A==="Completed"?ms(r):void 0,Be=Ys(r,ke,ne),{isCardsHidden:He}=qs(r?.tenantId),Ve=!Be||!!He,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),W=G((n=>_s(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=hs(),E=Js(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=Es(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=G((n=>Z.tenantId!=null?ps(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=gs();c.isAfter(S,"month")===!1?T(Is(v,{month:d,year:s})):H("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!js(ae,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(ks(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Qs(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Ze))}),[Z,ae,I,T,y]),O.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,B){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(Y&&rs){B(ge(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(c.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Ie(c.userId,s))),Y&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),B(Bs(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(Re(c.userId,c.zeniSessionId)))}})(A,j,r,v,I,U,T))}),[v,j]),O.useEffect((()=>{y.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),O.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[j,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[j,V]);const w=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,We=fs(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,qe=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&ys(E?.loggedInUserRoleMap),_e=Fe&&!w,Je=Le&&!w,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ue&&bs(E?.loggedInUserRoleMap),Xe=_e&&Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),as=Ps(E?.loggedInUserRoleMap),p=Fs(E?.loggedInUserRoleMap),R=Ls(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ts,g=Je&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return y.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&qe&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Ks,{}),children:[e.jsx(a,{path:"/",element:e.jsx(jt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(mt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(ye,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(ye,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(It,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Ke||me||Xe||Qe?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(pt,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(gt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const jt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:H,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):H?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:H,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(At,{tenantEmailDomain:C}):H?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,Nt as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-PAZiNp5H.js","assets/sentry-Co2H8v0G.js","assets/core-QBDM2m9E.js","assets/zeni-epic-state-BF09v22i.js","assets/index-BzUA8nAy.js","assets/mui-CB8RW45Z.js","assets/analytics-C3yKGO2p.js","assets/utils-CWM6Tene.js","assets/withTransactionSidePanel-Cx7SLti4.js","assets/useAskAiCfoHostNavButtonProps-DRkfNJU3.js","assets/TransactionDetailScreen-DoAx_dWo.js","assets/decodeURIComponentSafe-V0q2i3Mt.js","assets/routePaths-GKW140Mx.js","assets/NotFoundScreen-BGr9LaDQ.js","assets/useInitialThreadRequest-y87fsb02.js","assets/analyticsHelper-Bb-clko5.js","assets/CompanyPassportScreen-CA1rNnz6.js","assets/MobileAppDrawer-DrKscogU.js","assets/useAiCfoDashboardSuggestedQuestionsChips-UT4ITugD.js","assets/FeaturePreviewScreen-CUKc27Vx.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-D8lwLTXH.js","assets/AddressScreen-B_7cEnKD.js","assets/DomesticWireDetailScreen-C-fj-EK2.js","assets/DrawerScreen-BWiSdsIV.js","assets/SetupPagesScreen-ikH1-jvA.js","assets/BusinessVerificationPageScreen-Dwb9q8Sr.js","assets/BillPayApprovalRoutes-fFL-mX-V.js","assets/ReimbursementApprovalRuleDetailScreen-BEGmFwZm.js","assets/getLocaleForTenant-CZ5OuBaj.js","assets/ReimbursementRoutes-Chp3smrm.js","assets/ReimbursementApprovalRoutes-Brpp_tVb.js","assets/TransactionListRoutes-DeAjnViL.js","assets/ZeniAccountStatementScreen-C9WZyVpo.js","assets/SettingsRoutes-DMIIn4Bo.js","assets/accountMappingHelper-DPo5_oRM.js","assets/useEmailConnectResultRefresh-CeyjUEl1.js","assets/QBOConnectionScreen-BTDegFyb.js","assets/empty-DOkYgcMg.js","assets/index-_F7n4D5D.js","assets/url-D7tTbw7b.js","assets/index-PvNZ50rx.js","assets/ReportsRoutes-JVGYt6D9.js","assets/ChargeCardRoutes-BX8sKg9j.js","assets/useChargeCardPusherEvents-tUZA-Moq.js","assets/PeopleRoutes-BIY3PU2s.js","assets/ExpenseAutomationRoutes-VJVnQQzl.js","assets/TreasuryRoutes-DruSns4N.js","assets/useCashManagementBanner-CDnWdC79.js","assets/VendorsRoutes-CdAuHesx.js","assets/pathToGoBack-Bi5ALgzm.js","assets/ZeniAccountRoutes-CppeCNmZ.js","assets/AddressRoutes-DLYj8iuV.js","assets/PandLWithForecastRoutes-4euaT8sc.js","assets/CustomerOnboardingRoutes-BLyR0Odx.js","assets/TransactionDetailRoutes-C2yXNhQy.js","assets/EntityDetailRoutes-sCRpS1j0.js","assets/NotificationRoutes-DtJ6zv5F.js","assets/PerformanceRoutes-BW2KAG3G.js","assets/RewardsRoutes-C7gK933e.js","assets/TaskRoutes-CzorS81R.js","assets/TaskListScreen-D9kTMlmb.js","assets/AiCfoScreen-BUaUMOqh.js","assets/CardsAiCfoScreen-BnOoZ3-l.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as us,eZ as ds,fG as cs,fE as ms,go as _s,ft as hs,cW as pe,cC as Es,fW as ps,cu as Rs,bE as xs,bo as gs,f_ as Is,v as js,Mi as Ts,bs as As,Mj as fs,bK as ys,bJ as Ds,bt as bs,cq as Cs,Mk as vs,Ml as Us,cS as ws,cV as Os,cU as Ps,cB as Fs,cI as Ls,oi as Re,fC as xe,gy as ks,g2 as ge,gv as Ie,gw as je,g3 as Bs}from"./zeni-epic-state-BF09v22i.js";import{j as e}from"./liveblocks-ufh19lah.js";import{a as O}from"./sentry-Co2H8v0G.js";import{u as Hs,h as Vs,i as Ss,g as Ns,j as G,l as Te,N as u,o as Ms,p as a}from"./core-QBDM2m9E.js";import{y as Zs,u as Gs,z as y,A as zs,a as $s,n as Ws,c as z,i as Ys,d as qs,e as Js,L as F,O as Ae,t as _,P as Ks,f as X,l}from"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";import{f as fe}from"./analyticsHelper-Bb-clko5.js";import{t as Qs}from"./getLocaleForTenant-CZ5OuBaj.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="9c5dc939-e50e-4d82-adf7-2c14b3fce4da",o._sentryDebugIdIdentifier="sentry-dbid-9c5dc939-e50e-4d82-adf7-2c14b3fce4da")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-PAZiNp5H.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-D8lwLTXH.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-Chp3smrm.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-DeAjnViL.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-DMIIn4Bo.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-JVGYt6D9.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-BX8sKg9j.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-BIY3PU2s.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-VJVnQQzl.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-DruSns4N.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-CdAuHesx.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-CppeCNmZ.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-JVGYt6D9.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-DLYj8iuV.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-BIY3PU2s.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-4euaT8sc.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-BLyR0Odx.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-CdAuHesx.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-C2yXNhQy.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),ye=l((()=>t((()=>import("./EntityDetailRoutes-sCRpS1j0.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-PAZiNp5H.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-D8lwLTXH.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),ut=l((()=>t((()=>import("./SettingsRoutes-DMIIn4Bo.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-Chp3smrm.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-CppeCNmZ.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-DruSns4N.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-DeAjnViL.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-BX8sKg9j.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-DtJ6zv5F.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),Et=l((()=>t((()=>import("./PerformanceRoutes-BW2KAG3G.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),pt=l((()=>t((()=>import("./ExpenseAutomationRoutes-VJVnQQzl.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-C7gK933e.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-CzorS81R.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),gt=l((()=>t((()=>import("./AiCfoScreen-BUaUMOqh.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-BnOoZ3-l.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-BGr9LaDQ.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),It=l((()=>t((()=>import("./TaskListScreen-D9kTMlmb.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const T=Hs(),H=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Gs(),v=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=us(I),$=Ns(),[V,Pe]=O.useState(!1),r=G((n=>ds(n))),{useFeatureGate:N}=zs(),M=$s(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||A==="Completed"?cs(ne,r):void 0,J=j==="Completed"||A==="Completed"?ms(r):void 0,Be=Ys(r,ke,ne),{isCardsHidden:He}=qs(r?.tenantId),Ve=!Be||!!He,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),W=G((n=>_s(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=hs(),E=Js(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=Es(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=G((n=>Z.tenantId!=null?ps(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=gs();c.isAfter(S,"month")===!1?T(Is(v,{month:d,year:s})):H("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!js(ae,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(ks(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Qs(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Ze))}),[Z,ae,I,T,y]),O.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,B){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(Y&&rs){B(ge(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(c.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Ie(c.userId,s))),Y&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),B(Bs(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(Re(c.userId,c.zeniSessionId)))}})(A,j,r,v,I,U,T))}),[v,j]),O.useEffect((()=>{y.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),O.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[j,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[j,V]);const w=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,We=fs(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,qe=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&ys(E?.loggedInUserRoleMap),_e=Fe&&!w,Je=Le&&!w,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ue&&bs(E?.loggedInUserRoleMap),Xe=_e&&Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),as=Ps(E?.loggedInUserRoleMap),p=Fs(E?.loggedInUserRoleMap),R=Ls(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ts,g=Je&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return y.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&qe&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Ks,{}),children:[e.jsx(a,{path:"/",element:e.jsx(jt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(mt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(ye,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(ye,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(It,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Ke||me||Xe||Qe?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(pt,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(gt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const jt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:H,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):H?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:H,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(At,{tenantEmailDomain:C}):H?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,Nt as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-ff5jvbRc.js";import{a as u}from"./sentry-DRJyi6Lv.js";import{h as L,g as Q,u as U,j as y,s as le,n as G,i as Z,o as ne,p as v}from"./core-73g-CRXm.js";import{bn as De,eZ as P,gt as Te,n8 as re,OD as Me,hJ as he,Ou as Ue,rb as _e,kG as be,n4 as Fe,hL as Re,Ow as Be,Ov as Oe,QT as Ve,zG as ze,F7 as Le,Qs as Ne,QB as $e,c7 as ae,cN as Qe,cO as Ge,bs as Ze,Mv as He,y6 as Je,QU as Ke,Hy as We,EP as Xe,EG as ye,ED as Ye,ya as Se,EJ as Ce,EM as Ie,ES as oe,uw as se,y9 as qe,ki as X,kl as Ae,QV as en,lm as nn,yp as tn,Nm as an,Nn as on,kg as sn,QW as cn,kj as ln,rF as rn,Nh as dn,Ni as un,rJ as pn,hu as gn,MD as ee,hm as de,hj as mn,hr as fn,ME as hn,ym as bn,QX as yn,QY as Sn,F4 as Cn,fE as Ee,fG as xe,QZ as In,gh as An,MN as En,yl as ue,gm as pe,gl as xn,yk as vn,gk as wn,gj as kn,Q_ as jn,fJ as ve,Q$ as Pn,R0 as Dn,ys as Tn,yj as ge,R1 as Mn,fZ as Un,yg as _n,b_ as Fn,c6 as Rn,c5 as Bn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-CVqp5cMc.js";import{A as Y,c as O,z as k,ag as we,bR as Qn,f as H,h as Gn,bC as Zn,e as J,E as ie,bS as Hn,i as ke,d as je,bT as Jn,ar as Kn,m as Pe,bU as Wn,bV as Xn,bW as Yn,_ as qn,bX as et,v as nt,bY as tt}from"./index-B2-aA0mm.js";import{n as V}from"./mui-C6EPTIjM.js";import{M as R}from"./MobileAppDrawer-BlUKlkof.js";import{a as K,g as W,m as at}from"./accountMappingHelper-BoMcJRmU.js";import{t as ot,A as st}from"./AddressScreen-C6qRGk6n.js";import $ from"./NotFoundScreen-wxvtJzir.js";import{g as it}from"./analyticsHelper-BLN8Q7dD.js";import{B as ct}from"./BusinessVerificationPageScreen-BShNzAX6.js";import{C as lt}from"./CompanyPassportScreen-C0IvgrSf.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-D_QaL-cQ.js";import{q as me}from"./QBOConnectionScreen-BTrTPyqS.js";import{B as ut}from"./BillPayApprovalRoutes-BrG8_bHG.js";import{R as pt}from"./ReimbursementApprovalRoutes-BpHYGAKS.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.js";import"./routePaths-D9vDZtOv.js";import"./empty-AoB5TcI1.js";import"./pdf-lib-Dhic7kAC.js";import"./index-Bf1SUo7G.js";import"./url-nWZmwppH.js";import"./index-BlFohoS1.js";import"./decodeURIComponentSafe-vreX6HdN.js";import"./ReimbursementApprovalRuleDetailScreen-BBP2YOa7.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]="0c77b21e-dd9d-4d6f-a499-056a1240d09c",e._sentryDebugIdIdentifier="sentry-dbid-0c77b21e-dd9d-4d6f-a499-056a1240d09c")}catch{}})();const gt=V.div`
1
+ import{j as o}from"./liveblocks-ufh19lah.js";import{a as u}from"./sentry-Co2H8v0G.js";import{h as L,g as Q,u as U,j as y,s as le,n as G,i as Z,o as ne,p as v}from"./core-QBDM2m9E.js";import{bn as De,eZ as P,gt as Te,n8 as re,OD as Me,hJ as he,Ou as Ue,rb as _e,kG as be,n4 as Fe,hL as Re,Ow as Be,Ov as Oe,QT as Ve,zG as ze,F7 as Le,Qs as Ne,QB as $e,c7 as ae,cN as Qe,cO as Ge,bs as Ze,Mv as He,y6 as Je,QU as Ke,Hy as We,EP as Xe,EG as ye,ED as Ye,ya as Se,EJ as Ce,EM as Ie,ES as oe,uw as se,y9 as qe,ki as X,kl as Ae,QV as en,lm as nn,yp as tn,Nm as an,Nn as on,kg as sn,QW as cn,kj as ln,rF as rn,Nh as dn,Ni as un,rJ as pn,hu as gn,MD as ee,hm as de,hj as mn,hr as fn,ME as hn,ym as bn,QX as yn,QY as Sn,F4 as Cn,fE as Ee,fG as xe,QZ as In,gh as An,MN as En,yl as ue,gm as pe,gl as xn,yk as vn,gk as wn,gj as kn,Q_ as jn,fJ as ve,Q$ as Pn,R0 as Dn,ys as Tn,yj as ge,R1 as Mn,fZ as Un,yg as _n,b_ as Fn,c6 as Rn,c5 as Bn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-BF09v22i.js";import{A as Y,c as O,z as k,ag as we,bR as Qn,f as H,h as Gn,bC as Zn,e as J,E as ie,bS as Hn,i as ke,d as je,bT as Jn,ar as Kn,m as Pe,bU as Wn,bV as Xn,bW as Yn,_ as qn,bX as et,v as nt,bY as tt}from"./index-BzUA8nAy.js";import{n as V}from"./mui-CB8RW45Z.js";import{M as R}from"./MobileAppDrawer-DrKscogU.js";import{a as K,g as W,m as at}from"./accountMappingHelper-DPo5_oRM.js";import{t as ot,A as st}from"./AddressScreen-B_7cEnKD.js";import $ from"./NotFoundScreen-BGr9LaDQ.js";import{g as it}from"./analyticsHelper-Bb-clko5.js";import{B as ct}from"./BusinessVerificationPageScreen-Dwb9q8Sr.js";import{C as lt}from"./CompanyPassportScreen-CA1rNnz6.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-CeyjUEl1.js";import{q as me}from"./QBOConnectionScreen-BTDegFyb.js";import{B as ut}from"./BillPayApprovalRoutes-fFL-mX-V.js";import{R as pt}from"./ReimbursementApprovalRoutes-Brpp_tVb.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./routePaths-GKW140Mx.js";import"./empty-DOkYgcMg.js";import"./pdf-lib-DuOAYy25.js";import"./index-_F7n4D5D.js";import"./url-D7tTbw7b.js";import"./index-PvNZ50rx.js";import"./decodeURIComponentSafe-V0q2i3Mt.js";import"./ReimbursementApprovalRuleDetailScreen-BEGmFwZm.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]="0c77b21e-dd9d-4d6f-a499-056a1240d09c",e._sentryDebugIdIdentifier="sentry-dbid-0c77b21e-dd9d-4d6f-a499-056a1240d09c")}catch{}})();const gt=V.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-ff5jvbRc.js";import{h as X,g as ee,u as ne,i as $,j as v,N as x,n as H,t as en}from"./core-73g-CRXm.js";import{bJ as nn,cq as Ce,Qg as ye,eZ as V,cC as tn,zW as Q,zG as an,Qs as sn,Qv as on,rY as te,rM as ae,le as ie,u2 as L,Qx as Ie,gl as Ge,gk as $e,gj as He,Qy as cn,A3 as rn,EP as Ae,EG as ke,ED as _e,El as J,EJ as Ee,EM as Pe,ES as ve,uw as Te,gA as un,cx as dn,fG as ln,fE as pn,fF as mn,bt as yn,Qz as fn,Dl as le,DZ as gn,QA as Sn,bK as bn,G6 as pe,F7 as hn,QB as Cn,QC as In,Ga as An,Ge as kn,tX as _n,KE as En,GL as he,HL as me,QD as Pn,QE as vn,QF as Tn,QG as We,QH as wn,N5 as Dn,PI as Un,Nk as On,QI as Ke,Ep as Fn,Nl as Vn,Et as Bn,QJ as Oe,H5 as qe,lm as xn,rP as Je,u4 as jn,bE as Re,ug as Ne,cA as Rn,QK as Ye,fY as Nn,Gt as Ln,Gx as zn,QL as Mn,GO as Le,QM as Zn,QN as Qn,QO as Gn,QP as $n,gt as Hn,Be as Wn,QQ as Kn,Bj as qn,Bi as Jn}from"./zeni-epic-state-CVqp5cMc.js";import{e as se,A as oe,c as q,y as we,aS as Y,bC as Xe,z as U,F as ce,f as O,E as De,h as G,bD as Yn,au as re,bE as B,bF as Xn,bG as et,ag as xe,bH as nt,v as ze,av as Me,J as tt,H as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-B2-aA0mm.js";import{a as h}from"./sentry-DRJyi6Lv.js";import{n as Fe,D as rt,S as ut}from"./mui-C6EPTIjM.js";import{M as fe}from"./MobileAppDrawer-BlUKlkof.js";import N from"./NotFoundScreen-wxvtJzir.js";import{a as Ze}from"./analyticsHelper-BLN8Q7dD.js";import{d as Qe}from"./routePaths-D9vDZtOv.js";import{B as Ue}from"./BusinessVerificationPageScreen-BShNzAX6.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]="517242d2-c88c-4ef7-8da3-57a24fefb65e",e._sentryDebugIdIdentifier="sentry-dbid-517242d2-c88c-4ef7-8da3-57a24fefb65e")}catch{}})();const dt=Fe.div`
1
+ import{j as u}from"./liveblocks-ufh19lah.js";import{h as X,g as ee,u as ne,i as $,j as v,N as x,n as H,t as en}from"./core-QBDM2m9E.js";import{bJ as nn,cq as Ce,Qg as ye,eZ as V,cC as tn,zW as Q,zG as an,Qs as sn,Qv as on,rY as te,rM as ae,le as ie,u2 as L,Qx as Ie,gl as Ge,gk as $e,gj as He,Qy as cn,A3 as rn,EP as Ae,EG as ke,ED as _e,El as J,EJ as Ee,EM as Pe,ES as ve,uw as Te,gA as un,cx as dn,fG as ln,fE as pn,fF as mn,bt as yn,Qz as fn,Dl as le,DZ as gn,QA as Sn,bK as bn,G6 as pe,F7 as hn,QB as Cn,QC as In,Ga as An,Ge as kn,tX as _n,KE as En,GL as he,HL as me,QD as Pn,QE as vn,QF as Tn,QG as We,QH as wn,N5 as Dn,PI as Un,Nk as On,QI as Ke,Ep as Fn,Nl as Vn,Et as Bn,QJ as Oe,H5 as qe,lm as xn,rP as Je,u4 as jn,bE as Re,ug as Ne,cA as Rn,QK as Ye,fY as Nn,Gt as Ln,Gx as zn,QL as Mn,GO as Le,QM as Zn,QN as Qn,QO as Gn,QP as $n,gt as Hn,Be as Wn,QQ as Kn,Bj as qn,Bi as Jn}from"./zeni-epic-state-BF09v22i.js";import{e as se,A as oe,c as q,y as we,aS as Y,bC as Xe,z as U,F as ce,f as O,E as De,h as G,bD as Yn,au as re,bE as B,bF as Xn,bG as et,ag as xe,bH as nt,v as ze,av as Me,J as tt,H as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-BzUA8nAy.js";import{a as h}from"./sentry-Co2H8v0G.js";import{n as Fe,D as rt,S as ut}from"./mui-CB8RW45Z.js";import{M as fe}from"./MobileAppDrawer-DrKscogU.js";import N from"./NotFoundScreen-BGr9LaDQ.js";import{a as Ze}from"./analyticsHelper-Bb-clko5.js";import{d as Qe}from"./routePaths-GKW140Mx.js";import{B as Ue}from"./BusinessVerificationPageScreen-Dwb9q8Sr.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]="517242d2-c88c-4ef7-8da3-57a24fefb65e",e._sentryDebugIdIdentifier="sentry-dbid-517242d2-c88c-4ef7-8da3-57a24fefb65e")}catch{}})();const dt=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-ff5jvbRc.js";import{a as u,b as M,q as T}from"./sentry-DRJyi6Lv.js";import{u as A,h as z,j as c,g as D,N as O,n as j}from"./core-73g-CRXm.js";import{u as P,z as s,y as F,f as E,O as _,g as B,h as N,j as Z,k as q,x as V,m as v}from"./index-B2-aA0mm.js";import{eZ as $,Mh as J,Mi as W,fC as G,g2 as H,Mn as K,gs as Q,cZ as R,Mo as b,Mp as X,Mq as Y,bZ as y}from"./zeni-epic-state-CVqp5cMc.js";import"./mui-C6EPTIjM.js";import{u as ee}from"./useDeviceId-Dn2y2Mec.js";import{f as te}from"./analyticsHelper-BLN8Q7dD.js";import{t as ne}from"./getLocaleForTenant-Ci7Iyx0p.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="7b7fd8ee-d77a-4ce5-8f2d-0b0f6cde9601",t._sentryDebugIdIdentifier="sentry-dbid-7b7fd8ee-d77a-4ce5-8f2d-0b0f6cde9601")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(b())}}}))(V),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),k=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>$(e))),I=c((e=>J(e))),m=D(),w=F().mode,x=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then((()=>{const e=q();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(Z,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-ufh19lah.js";import{a as u,b as M,q as T}from"./sentry-Co2H8v0G.js";import{u as A,h as z,j as c,g as D,N as O,n as j}from"./core-QBDM2m9E.js";import{u as P,z as s,y as F,f as E,O as _,g as B,h as N,j as Z,k as q,x as V,m as v}from"./index-BzUA8nAy.js";import{eZ as $,Mh as J,Mi as W,fC as G,g2 as H,Mn as K,gs as Q,cZ as R,Mo as b,Mp as X,Mq as Y,bZ as y}from"./zeni-epic-state-BF09v22i.js";import"./mui-CB8RW45Z.js";import{u as ee}from"./useDeviceId-SWL_t36p.js";import{f as te}from"./analyticsHelper-Bb-clko5.js";import{t as ne}from"./getLocaleForTenant-CZ5OuBaj.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="7b7fd8ee-d77a-4ce5-8f2d-0b0f6cde9601",t._sentryDebugIdIdentifier="sentry-dbid-7b7fd8ee-d77a-4ce5-8f2d-0b0f6cde9601")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(b())}}}))(V),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),k=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>$(e))),I=c((e=>J(e))),m=D(),w=F().mode,x=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then((()=>{const e=q();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(Z,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-ff5jvbRc.js";import{a as i}from"./sentry-DRJyi6Lv.js";import{u as d,g as c,N as u}from"./core-73g-CRXm.js";import{z as n,f as a,h as m,E as p}from"./index-B2-aA0mm.js";import{gx as g,MF as y}from"./zeni-epic-state-CVqp5cMc.js";import{n as h}from"./mui-C6EPTIjM.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.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]="9ed2578e-f9e9-4377-b294-80a023199235",e._sentryDebugIdIdentifier="sentry-dbid-9ed2578e-f9e9-4377-b294-80a023199235")}catch{}})();function M(){const e=d(),t=c(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(b,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const b=h.div`
1
+ import{j as s}from"./liveblocks-ufh19lah.js";import{a as i}from"./sentry-Co2H8v0G.js";import{u as d,g as c,N as u}from"./core-QBDM2m9E.js";import{z as n,f as a,h as m,E as p}from"./index-BzUA8nAy.js";import{gx as g,MF as y}from"./zeni-epic-state-BF09v22i.js";import{n as h}from"./mui-CB8RW45Z.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="9ed2578e-f9e9-4377-b294-80a023199235",e._sentryDebugIdIdentifier="sentry-dbid-9ed2578e-f9e9-4377-b294-80a023199235")}catch{}})();function M(){const e=d(),t=c(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(b,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const b=h.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-ff5jvbRc.js";import{a as D}from"./sentry-DRJyi6Lv.js";import{h as N,u as v,g as K,j as G,i as _,n as z}from"./core-73g-CRXm.js";import{z as U,A as O,c as p,a0 as W,F as Z,f as q,h as M,dd as V,v as g,r as Q}from"./index-B2-aA0mm.js";import{eZ as H,U8 as F,Jq as y,U9 as R,U4 as X,IO as E,Ua as Y,IW as I,Ig as aa,Jr as S,Ub as B,fB as ea,Jh as ta,Jm as sa,J9 as oa,J7 as w,Jn as na,J4 as ia,Uc as la,Ud as ra,Ue as ka,Uf as ca,Ug as m,ek as da,Uh as ua,Ui as pa}from"./zeni-epic-state-CVqp5cMc.js";import{n as ma}from"./mui-C6EPTIjM.js";import{u as Ta}from"./useAskAiCfoHostNavButtonProps-NCLc8anu.js";import{M as ga}from"./MobileAppDrawer-BlUKlkof.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.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]="67a87f70-7ec1-499b-ac5d-bd29d47831b6",e._sentryDebugIdIdentifier="sentry-dbid-67a87f70-7ec1-499b-ac5d-bd29d47831b6")}catch{}})();const fa=ma.div`
1
+ import{j as u}from"./liveblocks-ufh19lah.js";import{a as D}from"./sentry-Co2H8v0G.js";import{h as N,u as v,g as K,j as G,i as _,n as z}from"./core-QBDM2m9E.js";import{z as U,A as O,c as p,a0 as W,F as Z,f as q,h as M,dd as V,v as g,r as Q}from"./index-BzUA8nAy.js";import{eZ as H,U8 as F,Jq as y,U9 as R,U4 as X,IO as E,Ua as Y,IW as I,Ig as aa,Jr as S,Ub as B,fB as ea,Jh as ta,Jm as sa,J9 as oa,J7 as w,Jn as na,J4 as ia,Uc as la,Ud as ra,Ue as ka,Uf as ca,Ug as m,ek as da,Uh as ua,Ui as pa}from"./zeni-epic-state-BF09v22i.js";import{n as ma}from"./mui-CB8RW45Z.js";import{u as Ta}from"./useAskAiCfoHostNavButtonProps-DRkfNJU3.js";import{M as ga}from"./MobileAppDrawer-DrKscogU.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="67a87f70-7ec1-499b-ac5d-bd29d47831b6",e._sentryDebugIdIdentifier="sentry-dbid-67a87f70-7ec1-499b-ac5d-bd29d47831b6")}catch{}})();const fa=ma.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-ff5jvbRc.js";import se from"./NotFoundScreen-wxvtJzir.js";import{a as c}from"./sentry-DRJyi6Lv.js";import{h as _,u as M,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-73g-CRXm.js";import{It as O,Iw as le,Iq as de,eZ as J,U4 as K,IK as H,In as pe,Je as ue,J7 as ke,U5 as W,U6 as N,Ij as me,Ig as fe,rY as ge,rM as he,le as Ie,IE as Se,U7 as Te,IV as be,IS as Ee,Iz as Ce,IP as Ge,IO as De}from"./zeni-epic-state-CVqp5cMc.js";import{z as G,db as xe,B as je,A as we,c as b,r as X,v,F as ye,f as V,h as ve,dc as Re,m as A,au as Ue}from"./index-B2-aA0mm.js";import{n as Fe}from"./mui-C6EPTIjM.js";import{u as Be}from"./useInitialThreadRequest-Dt88hhBW.js";import{M as Pe}from"./MobileAppDrawer-BlUKlkof.js";import Le from"./TaskListScreen-DLCl-j3R.js";import"./recharts-CuGywxsn.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.js";import"./useAskAiCfoHostNavButtonProps-NCLc8anu.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]="8fe2fcf8-689e-487c-93d3-fe340bc552eb",e._sentryDebugIdIdentifier="sentry-dbid-8fe2fcf8-689e-487c-93d3-fe340bc552eb")}catch{}})();function $e(){const e=_(),t=M(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),l=c.useCallback((()=>{t(O())}),[t]),k=c.useCallback(((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[t]),a=c.useCallback((o=>{t(de({cannedResponseId:o}))}),[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let q,Z=[];const ze=re((function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=J(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=K(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==q&&(q=S,Z=Object.values(S)),Z),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Ue.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>N(e.taskGroupState,p))).filter((p=>p!=null&&!p.isDeleted)).map((p=>({id:p.id,name:p.name,isDefault:p.isDefault})))}}),(function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function y(){const e=_(),t=M(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>J(i))),k=Be(l?.companyId),{useFeatureGate:a}=we(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,Y]=c.useState(!1),[U,Q]=c.useState(!1),[F,ee]=c.useState(!1),[B,j]=c.useState(!1),T=c.useRef(!1),C=g((i=>i.taskListState.updateTasksFetchState.fetchState)),P=g((i=>K(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(Y(!0),t(H(!1,r)))}),[p,t]),c.useEffect((()=>{U||P.fetchState==="Completed"||(Q(!0),t(pe()))}),[U,t,P.fetchState]),c.useEffect((()=>{F||L==="Completed"||(ee(!0),t(ue()))}),[F,t,L]);const ae=c.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))}),[t,r]);c.useEffect((()=>{if(B)if(C!=="In-Progress"){if(T.current){if(C==="Error")return j(!1),void(T.current=!1);if(C==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0}),[B,C,l,s,e]);const $=g((i=>W(i,r))),w=$.fetchState,z=G.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(w==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[w==="Completed"?n.jsx(ye,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(ze,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:z,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:w,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Fe.div`
1
+ import{j as n}from"./liveblocks-ufh19lah.js";import se from"./NotFoundScreen-BGr9LaDQ.js";import{a as c}from"./sentry-Co2H8v0G.js";import{h as _,u as M,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-QBDM2m9E.js";import{It as O,Iw as le,Iq as de,eZ as J,U4 as K,IK as H,In as pe,Je as ue,J7 as ke,U5 as W,U6 as N,Ij as me,Ig as fe,rY as ge,rM as he,le as Ie,IE as Se,U7 as Te,IV as be,IS as Ee,Iz as Ce,IP as Ge,IO as De}from"./zeni-epic-state-BF09v22i.js";import{z as G,db as xe,B as je,A as we,c as b,r as X,v,F as ye,f as V,h as ve,dc as Re,m as A,au as Ue}from"./index-BzUA8nAy.js";import{n as Fe}from"./mui-CB8RW45Z.js";import{u as Be}from"./useInitialThreadRequest-y87fsb02.js";import{M as Pe}from"./MobileAppDrawer-DrKscogU.js";import Le from"./TaskListScreen-D9kTMlmb.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./useAskAiCfoHostNavButtonProps-DRkfNJU3.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]="8fe2fcf8-689e-487c-93d3-fe340bc552eb",e._sentryDebugIdIdentifier="sentry-dbid-8fe2fcf8-689e-487c-93d3-fe340bc552eb")}catch{}})();function $e(){const e=_(),t=M(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),l=c.useCallback((()=>{t(O())}),[t]),k=c.useCallback(((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[t]),a=c.useCallback((o=>{t(de({cannedResponseId:o}))}),[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let q,Z=[];const ze=re((function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=J(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=K(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==q&&(q=S,Z=Object.values(S)),Z),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Ue.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>N(e.taskGroupState,p))).filter((p=>p!=null&&!p.isDeleted)).map((p=>({id:p.id,name:p.name,isDefault:p.isDefault})))}}),(function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function y(){const e=_(),t=M(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>J(i))),k=Be(l?.companyId),{useFeatureGate:a}=we(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,Y]=c.useState(!1),[U,Q]=c.useState(!1),[F,ee]=c.useState(!1),[B,j]=c.useState(!1),T=c.useRef(!1),C=g((i=>i.taskListState.updateTasksFetchState.fetchState)),P=g((i=>K(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(Y(!0),t(H(!1,r)))}),[p,t]),c.useEffect((()=>{U||P.fetchState==="Completed"||(Q(!0),t(pe()))}),[U,t,P.fetchState]),c.useEffect((()=>{F||L==="Completed"||(ee(!0),t(ue()))}),[F,t,L]);const ae=c.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))}),[t,r]);c.useEffect((()=>{if(B)if(C!=="In-Progress"){if(T.current){if(C==="Error")return j(!1),void(T.current=!1);if(C==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0}),[B,C,l,s,e]);const $=g((i=>W(i,r))),w=$.fetchState,z=G.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(w==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[w==="Completed"?n.jsx(ye,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(ze,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:z,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:w,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Fe.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-ff5jvbRc.js";import i from"./NotFoundScreen-wxvtJzir.js";import{T as r}from"./TransactionDetailScreen-Bn-xSZGA.js";import"./sentry-DRJyi6Lv.js";import{o as s,p as o}from"./core-73g-CRXm.js";import"./zeni-epic-state-CVqp5cMc.js";import"./recharts-CuGywxsn.js";import"./index-B2-aA0mm.js";import"./mui-C6EPTIjM.js";import"./analytics-tnLNAAzo.js";import"./plaid-BGzMn-Ja.js";import"./dnd-CCmj5-_i.js";import"./stripe-cKAAJElX.js";import"./lottie-DvKGbHR7.js";import"./lexical-B-MdcDyi.js";import"./pdf-BJ608N2P.js";import"./utils-DSjwo3lj.js";import"./useAskAiCfoHostNavButtonProps-NCLc8anu.js";import"./decodeURIComponentSafe-vreX6HdN.js";import"./routePaths-D9vDZtOv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-ufh19lah.js";import i from"./NotFoundScreen-BGr9LaDQ.js";import{T as r}from"./TransactionDetailScreen-DoAx_dWo.js";import"./sentry-Co2H8v0G.js";import{o as s,p as o}from"./core-QBDM2m9E.js";import"./zeni-epic-state-BF09v22i.js";import"./recharts-B8SFxg38.js";import"./index-BzUA8nAy.js";import"./mui-CB8RW45Z.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./useAskAiCfoHostNavButtonProps-DRkfNJU3.js";import"./decodeURIComponentSafe-V0q2i3Mt.js";import"./routePaths-GKW140Mx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};