@zeniai/web-app-ui 5.1.81-next → 5.1.82-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/assets/AddressRoutes-B-OHFUYz.js +1 -0
  2. package/dist/assets/AddressScreen-D9Ul8Dxb.js +9 -0
  3. package/dist/assets/{AiCfoScreen-CAf6ZEes.js → AiCfoScreen-DiLxiOHU.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-OOK37dzM.js → BillPayApprovalRoutes-6gAY0XHv.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DrJrm73Q.js → BillPayRoutes-BlVykZyv.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-B-L9gdz1.js → BusinessVerificationPageScreen-DCETvhd8.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-DiqdjAjj.js → CardsAiCfoScreen-CfEdJvYF.js} +3 -3
  8. package/dist/assets/{ChargeCardRoutes-BJkVxY8Z.js → ChargeCardRoutes-COmpcwk4.js} +12 -12
  9. package/dist/assets/{CompanyPassportScreen-BUOnzTWw.js → CompanyPassportScreen-CFy9NTlf.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-DmgL09EP.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-DqBjIeRb.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BMCNuzuH.js → CustomerOnboardingRoutes-zzflyPH3.js} +3 -3
  13. package/dist/assets/{DashboardRoutes-0cSeXm67.js → DashboardRoutes-C4WsA2pG.js} +3 -3
  14. package/dist/assets/{DefaultTenantHome-CP8NoId0.js → DefaultTenantHome-BvJt_3dQ.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-C6o7L4nH.js → DomesticWireDetailScreen-CSRe_o0Z.js} +4 -4
  16. package/dist/assets/{DrawerScreen-BkNTuZZn.js → DrawerScreen-BCogPEDL.js} +1 -1
  17. package/dist/assets/EntityDetailRoutes-C2X5pcIQ.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-CVabqqUr.js → ExpenseAutomationRoutes-B0eoWnRV.js} +3 -3
  19. package/dist/assets/{FeaturePreviewScreen-dZphyDK8.js → FeaturePreviewScreen-BWOweMkx.js} +1 -1
  20. package/dist/assets/HubSpotOAuthCallbackScreen-Bekq0kIS.js +1 -0
  21. package/dist/assets/{MagicLinkRoutes-qhstyQJu.js → MagicLinkRoutes-CHR5JhD6.js} +2 -2
  22. package/dist/assets/MagicLinkSignInScreen-CZXZMVTB.js +12 -0
  23. package/dist/assets/MobileAppDrawer-DUQ59uIE.js +1 -0
  24. package/dist/assets/NotFoundScreen-DbINM0eT.js +1 -0
  25. package/dist/assets/{NotificationRoutes-BrjbH91S.js → NotificationRoutes-Ckjirnas.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-d5agSCvv.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-M-GIvzI6.js +1 -0
  28. package/dist/assets/PeopleRoutes-BtGHFWVD.js +22 -0
  29. package/dist/assets/PerformanceRoutes-WEtJa7Hk.js +1 -0
  30. package/dist/assets/{Preview-Bxn_o2ub.js → Preview-D4ZYcfkK.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-1f76Cjry.js → QBOConnectionScreen-DZ6a6Pn5.js} +1 -1
  32. package/dist/assets/ReferralListScreen-BufpufnF.js +5 -0
  33. package/dist/assets/{ReimbursementApprovalRoutes-DztBHkQc.js → ReimbursementApprovalRoutes-NPPwIK8Y.js} +1 -1
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-_5mmwBdu.js → ReimbursementApprovalRuleDetailScreen-RmB2PavA.js} +1 -1
  35. package/dist/assets/ReimbursementRoutes-CvWaXZJE.js +68 -0
  36. package/dist/assets/{ReportsRoutes-Bty3VgNj.js → ReportsRoutes-BUSlFBpZ.js} +1 -1
  37. package/dist/assets/RewardsRoutes-DZpLem4H.js +1 -0
  38. package/dist/assets/ScreenRoutes-B_EWXDY7.js +2 -0
  39. package/dist/assets/SettingsRoutes-DGpH4sr4.js +57 -0
  40. package/dist/assets/{SetupPagesScreen-DEnNlIFZ.js → SetupPagesScreen-CUJ1-XM4.js} +5 -5
  41. package/dist/assets/SignInScreen-DvbeiFCj.js +1 -0
  42. package/dist/assets/SignOutScreen-C0Ut-fMD.js +9 -0
  43. package/dist/assets/{TaskListScreen-YLciClaW.js → TaskListScreen-BcoWt73W.js} +2 -2
  44. package/dist/assets/TaskRoutes-DuTw4YUa.js +9 -0
  45. package/dist/assets/{TransactionDetailRoutes-DeXE01z1.js → TransactionDetailRoutes-d47zOIxK.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-DYaYb3Dh.js → TransactionDetailScreen-CbI5PBMk.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-DRRo4Xlk.js → TransactionListRoutes-B9szjsIc.js} +1 -1
  48. package/dist/assets/TreasuryRoutes-ChAmTXmv.js +37 -0
  49. package/dist/assets/{VendorsRoutes-CAoEQXHS.js → VendorsRoutes-Bm8I2UHR.js} +1 -1
  50. package/dist/assets/WiseConfirmationScreen--kbx96hY.js +12 -0
  51. package/dist/assets/ZeniAccountRoutes-D6g_ntbO.js +73 -0
  52. package/dist/assets/{ZeniAccountStatementScreen-wVpVNvAj.js → ZeniAccountStatementScreen-CdJ60HCv.js} +2 -2
  53. package/dist/assets/{accountMappingHelper-D5Bw0mp6.js → accountMappingHelper-CaLAZUmW.js} +1 -1
  54. package/dist/assets/{analytics-CpUJgE1w.js → analytics-DyLuuBT1.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CLhyHcZM.js → analyticsHelper-D2oAlw4a.js} +1 -1
  56. package/dist/assets/{core-CDuxXgNT.js → core-BHqQV1j-.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-B8X6jXbR.js → decodeURIComponentSafe-B1lT7PtO.js} +1 -1
  58. package/dist/assets/{dnd-VtUMJCWH.js → dnd-PncgQ6ah.js} +1 -1
  59. package/dist/assets/{empty-Dy_Rugh4.js → empty-CFTi16nV.js} +1 -1
  60. package/dist/assets/{empty-CI6jmlvd.js → empty-DfQxxgrF.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-CzSTlf8_.js → emptyVideoElement-BYWmdxPT.js} +1 -1
  62. package/dist/assets/epic-BHHt9jBJ.js +2 -0
  63. package/dist/assets/{getLocaleForTenant-xMQqjCWD.js → getLocaleForTenant-SgsbGJTJ.js} +1 -1
  64. package/dist/assets/{index-DzOogTqR.js → index-BCSsut58.js} +9952 -9952
  65. package/dist/assets/{index-D4fNRtH0.js → index-BU2Ez_ui.js} +1 -1
  66. package/dist/assets/{index-BQ1ZKP1g.js → index-BpHsaZV0.js} +1 -1
  67. package/dist/assets/{index-BSsnhNl3.js → index-Bq60ilX9.js} +1 -1
  68. package/dist/assets/{index-BqsTwZNl.js → index-CjkK4WZV.js} +1 -1
  69. package/dist/assets/{index-DUxBJrom.js → index-D180oD-b.js} +1 -1
  70. package/dist/assets/{index-D72vEAAO.js → index-DrfsE_ES.js} +2 -2
  71. package/dist/assets/{index-BUfNuy7H.js → index-T9jTnQ8m.js} +1 -1
  72. package/dist/assets/{lexical-CIqawAn4.js → lexical-Boz4mOyF.js} +1 -1
  73. package/dist/assets/{liveblocks-C5Zo4IsV.js → liveblocks-6JNkacrc.js} +1 -1
  74. package/dist/assets/{lottie-B-fnnIRm.js → lottie-C3VtgzwQ.js} +1 -1
  75. package/dist/assets/{mui-BWYOl-fu.js → mui-C5-OLXT3.js} +1 -1
  76. package/dist/assets/{pathToGoBack-YzaQ63IA.js → pathToGoBack-2M7LGiAo.js} +1 -1
  77. package/dist/assets/{pdf-WEHP-u0u.js → pdf-16GwGHdy.js} +3 -3
  78. package/dist/assets/{pdf-lib-eYFk39VK.js → pdf-lib-Ch5CfF-s.js} +1 -1
  79. package/dist/assets/{plaid-2PJJQmCk.js → plaid-BXai4jzs.js} +1 -1
  80. package/dist/assets/{pusher-DG4S91VG.js → pusher-ozRV7lbh.js} +1 -1
  81. package/dist/assets/{react-xbt6TvfU.js → react-BdQcIE7p.js} +1 -1
  82. package/dist/assets/{react-DxeNPC39.js → react-C2tOKb3X.js} +1 -1
  83. package/dist/assets/{react-L4KlSlqR.js → react-CJysfalo.js} +1 -1
  84. package/dist/assets/{react-BBaLVZIY.js → react-CZe6P2aE.js} +1 -1
  85. package/dist/assets/{react-DyOgz1S3.js → react-D1Q0rHoQ.js} +1 -1
  86. package/dist/assets/{react-BruMptWV.js → react-DwMTRWye.js} +1 -1
  87. package/dist/assets/{recharts-DOA55GXl.js → recharts-CZo2yeP8.js} +1 -1
  88. package/dist/assets/{routePaths-rmRxk_gU.js → routePaths-DkQjfNRq.js} +1 -1
  89. package/dist/assets/{sentry-pTjqe1GE.js → sentry-CHrxYia6.js} +1 -1
  90. package/dist/assets/{url-Bx8KkYZ2.js → url-C1h5iywr.js} +1 -1
  91. package/dist/assets/{url--qGqS-sp.js → url-jdVZyqWI.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Ch-s-OUg.js → useAiCfoDashboardSuggestedQuestionsChips-CDQLXIZi.js} +1 -1
  93. package/dist/assets/{useAskAiCfoHostNavButtonProps-DVKlzRut.js → useAskAiCfoHostNavButtonProps-45oJK0hu.js} +1 -1
  94. package/dist/assets/{useCashManagementBanner-BEqGoY3j.js → useCashManagementBanner-CoVbsrBM.js} +1 -1
  95. package/dist/assets/{useChargeCardPusherEvents-DikWnVw6.js → useChargeCardPusherEvents-cQlWV2uK.js} +1 -1
  96. package/dist/assets/{useDeviceId-DxgjldI-.js → useDeviceId-ayvBvlwj.js} +1 -1
  97. package/dist/assets/useEmailConnectResultRefresh-D0dx8xRq.js +1 -0
  98. package/dist/assets/{useInitialThreadRequest-C_oymrXt.js → useInitialThreadRequest-CqGMs5d-.js} +1 -1
  99. package/dist/assets/{utils-C-pFPw5l.js → utils-S8edMjGk.js} +1 -1
  100. package/dist/assets/{withTransactionSidePanel-BzAvEIvv.js → withTransactionSidePanel-DD5T3Sss.js} +2 -2
  101. package/dist/assets/{zeni-epic-state-aFTbMOAR.js → zeni-epic-state-CZM3a-K0.js} +6 -6
  102. package/dist/index.html +1 -1
  103. package/package.json +4 -4
  104. package/dist/assets/AddressRoutes-CZ001L0B.js +0 -1
  105. package/dist/assets/AddressScreen-Cy07AeqE.js +0 -9
  106. package/dist/assets/ConnectionAuthScreen-Bwq_fx00.js +0 -11
  107. package/dist/assets/CustomerOnboardingAuthScreen-CZ5xQsEB.js +0 -1
  108. package/dist/assets/EntityDetailRoutes-D9Vk0h73.js +0 -1
  109. package/dist/assets/HubSpotOAuthCallbackScreen-C2-Grd2S.js +0 -1
  110. package/dist/assets/MagicLinkSignInScreen-Dac_EZMw.js +0 -12
  111. package/dist/assets/MobileAppDrawer-BWG5ZoNF.js +0 -1
  112. package/dist/assets/NotFoundScreen-B_nzx2PP.js +0 -1
  113. package/dist/assets/OAuthConsentScreen-CvlBFjdq.js +0 -1
  114. package/dist/assets/PandLWithForecastRoutes-C_x9Tcg0.js +0 -1
  115. package/dist/assets/PeopleRoutes-DUzH3GNv.js +0 -22
  116. package/dist/assets/PerformanceRoutes-Dm8N0j9j.js +0 -1
  117. package/dist/assets/ReferralListScreen-zKATmg7m.js +0 -5
  118. package/dist/assets/ReimbursementRoutes-DiSfNuHZ.js +0 -68
  119. package/dist/assets/RewardsRoutes-BtSnOW_p.js +0 -1
  120. package/dist/assets/ScreenRoutes-Du9VLb80.js +0 -2
  121. package/dist/assets/SettingsRoutes-DYDw5CwH.js +0 -57
  122. package/dist/assets/SignInScreen-Bd-bOFs3.js +0 -1
  123. package/dist/assets/SignOutScreen-Dqwjcbl7.js +0 -9
  124. package/dist/assets/TaskRoutes-BEsI3ohS.js +0 -9
  125. package/dist/assets/TreasuryRoutes-BkY0fzik.js +0 -37
  126. package/dist/assets/WiseConfirmationScreen-b0LDNO5l.js +0 -12
  127. package/dist/assets/ZeniAccountRoutes-B68Pe7No.js +0 -73
  128. package/dist/assets/epic-DQIIhelC.js +0 -2
  129. package/dist/assets/useEmailConnectResultRefresh-BZf1BjuU.js +0 -1
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-pTjqe1GE.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-CHrxYia6.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-C5Zo4IsV.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-pTjqe1GE.js";import{L as dt,bY as Tc,eX as Ac,LW as Rc,Mo as kl,c6 as Tl,g1 as Al,g2 as Rl}from"./zeni-epic-state-aFTbMOAR.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-C-pFPw5l.js";import{r as un}from"./empty-Dy_Rugh4.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-eYFk39VK.js";import{r as Gl}from"./index-D4fNRtH0.js";import{r as zl}from"./index-BUfNuy7H.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-CDuxXgNT.js";import{u as Kl,z as Pc,L as Wl,M as Jl,N as Xl,n as Ql,f as tf}from"./index-DzOogTqR.js";import"./mui-BWYOl-fu.js";import{d as Pe}from"./decodeURIComponentSafe-B8X6jXbR.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]="f68ed07f-fb50-43a1-bda6-575803ec12f2",t._sentryDebugIdIdentifier="sentry-dbid-f68ed07f-fb50-43a1-bda6-575803ec12f2")}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-6JNkacrc.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CHrxYia6.js";import{L as dt,bY as Tc,eX as Ac,LV as Rc,Mn as kl,c6 as Tl,g0 as Al,g1 as Rl}from"./zeni-epic-state-CZM3a-K0.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-S8edMjGk.js";import{r as un}from"./empty-CFTi16nV.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Ch5CfF-s.js";import{r as Gl}from"./index-BU2Ez_ui.js";import{r as zl}from"./index-T9jTnQ8m.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-BHqQV1j-.js";import{u as Kl,z as Pc,L as Wl,M as Jl,N as Xl,n as Ql,f as tf}from"./index-BCSsut58.js";import"./mui-C5-OLXT3.js";import{d as Pe}from"./decodeURIComponentSafe-B1lT7PtO.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]="ff56c92d-bee1-483e-ba3a-a0bd87642a63",t._sentryDebugIdIdentifier="sentry-dbid-ff56c92d-bee1-483e-ba3a-a0bd87642a63")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-6JNkacrc.js";import{a as o}from"./sentry-CHrxYia6.js";import{j as f,h as L,u as V,g as F,n as N}from"./core-BHqQV1j-.js";import{m as W,Z as _,z as P,bf as $,D as M,Y as U,$ as z,J,f as l,h as K,a8 as X,bg as Y}from"./index-BCSsut58.js";import{fI as Z,eX as q,Pm as R,Pn as G,vH as Q,vx as g,fK as ee,bS as re,vC as ae,Po as ne}from"./zeni-epic-state-CZM3a-K0.js";import{D as te,e as se,n as oe,S as ie}from"./mui-C5-OLXT3.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-45oJK0hu.js";import{M as de}from"./MobileAppDrawer-DUQ59uIE.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="57d4a02d-5327-476c-bbcb-27f712c0834d",e._sentryDebugIdIdentifier="sentry-dbid-57d4a02d-5327-476c-bbcb-27f712c0834d")}catch{}})();const ce={overlayWidth:new M(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=W(),n=_();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>Z(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx($,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,I="refer-and-earn-status-update",we=N(function(e){const r=R(e),a=e.referralViewState.rewardsPlanFetchState,n=re([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(ae(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(X(Y));function ye({isReferralDrawerOpen:e}){const r=L(),a=V(),n=F(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,C]=o.useState(!1),w=P.getSignedInUser(),h=f(t=>q(t)),m=f(t=>R(t)),b=m.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),v=G([m,p]),{areTenantIdsInSync:c}=U();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(a(Q()),E(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&c&&(u(!0),a(g(!0)))},[b,a,c]),o.useEffect(()=>{!d&&p.fetchState==="Not-Started"&&c&&(x(!0),a(ee(!0)))},[p,a,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),y=t=>{A(t)},{isAiCfoAccessEnabled:B,onAskAiCfoClick:O}=le({mobileExploreReferrer:"Rewards"});z({isDataReady:v===!0});const T={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(J,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(K.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:y}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{C(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:r,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:B,onAskAiCfoClick:O,...T})]})}export{ye as R};
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-C5Zo4IsV.js";import _ from"./NotFoundScreen-B_nzx2PP.js";import{a as p}from"./sentry-pTjqe1GE.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as O,p as b}from"./core-CDuxXgNT.js";import{eX as I,Qg as g,Qw as S,FD as V,EM as U,FC as d,Ft as $,QK as B,FF as W}from"./zeni-epic-state-aFTbMOAR.js";import{z as N,a8 as L,b_ as Q,af as T,bD as K,b$ as z}from"./index-DzOogTqR.js";import"./mui-BWYOl-fu.js";import{u as M,R as A}from"./ReimbursementApprovalRuleDetailScreen-_5mmwBdu.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="f2e90a39-cb30-4858-8382-0bbe66f676d6",e._sentryDebugIdIdentifier="sentry-dbid-f2e90a39-cb30-4858-8382-0bbe66f676d6")}catch{}})();const y="reimbursement-approval-rule-update",X=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(L(Q)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,F,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=k(function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}})(L(z)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a));M();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,F,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
1
+ import{j as r}from"./liveblocks-6JNkacrc.js";import F from"./NotFoundScreen-DbINM0eT.js";import{a as p}from"./sentry-CHrxYia6.js";import{h as A,g as x,u as C,j as u,N as D,n as k,o as O,p as b}from"./core-BHqQV1j-.js";import{eX as I,Qg as g,Qw as S,FC as V,EL as U,FB as d,Fs as B,QJ as L,FE as W}from"./zeni-epic-state-CZM3a-K0.js";import{z as N,a8 as $,b_ as Q,af as T,bD as z,b$ as J}from"./index-BCSsut58.js";import"./mui-C5-OLXT3.js";import{u as K,R as E}from"./ReimbursementApprovalRuleDetailScreen-RmB2PavA.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]="6aa0be7e-cb53-494f-8da1-1ec8b926266e",e._sentryDebugIdIdentifier="sentry-dbid-6aa0be7e-cb53-494f-8da1-1ec8b926266e")}catch{}})();const y="reimbursement-approval-rule-update",X=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(L(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})($(Q)),q=({isLoading:e})=>{const o=A(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,_,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=k(function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(L(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}})($(J)),H=()=>{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=A(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a));K();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,_,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(E,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(E,{})}),r.jsx(b,{path:"*",element:r.jsx(F,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as b}from"./liveblocks-C5Zo4IsV.js";import{a as f}from"./sentry-pTjqe1GE.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-CDuxXgNT.js";import{k_ as L,Qw as E,Qg as x,Fw as V,FI as B,FD as A,FE as w,Qx as j,eX as z,FC as K}from"./zeni-epic-state-aFTbMOAR.js";import{z as N,m as P,y as Q,bQ as W,af as $,bD as X,bR as G}from"./index-DzOogTqR.js";import"./mui-BWYOl-fu.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]="f7ce4f81-f9fb-4847-ba89-0f70d768fb65",e._sentryDebugIdIdentifier="sentry-dbid-f7ce4f81-f9fb-4847-ba89-0f70d768fb65")}catch{}})();function H(){const e=T(),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=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(W);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=g(n=>E(n)),i=g(n=>x(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,C=y.selectedRole?.selectedOption;let D=[];S==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const U=y.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=X(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(M,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=g(n=>E(n)),i=g(n=>x(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{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-6JNkacrc.js";import{a as f}from"./sentry-CHrxYia6.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-BHqQV1j-.js";import{kZ as L,Qw as E,Qg as x,Fv as V,FH as B,FC as A,FD as w,Qx as j,eX as z,FB as H}from"./zeni-epic-state-CZM3a-K0.js";import{z as N,m as P,y as Q,bQ as K,af as $,bD as W,bR as X}from"./index-BCSsut58.js";import"./mui-C5-OLXT3.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]="4aef5546-a00e-4e64-b31c-e1fd05dd3775",e._sentryDebugIdIdentifier="sentry-dbid-4aef5546-a00e-4e64-b31c-e1fd05dd3775")}catch{}})();function Z(){const e=T(),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 G=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const u=v=>{const S=[];return v.forEach(d=>{const R=d.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),I=d.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:d.stepType.selectedOption,actors:c,operator:c.length>1?d.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:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:l,criteria:n,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(K);function J(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=g(n=>E(n)),i=g(n=>x(n)),[a,u]=f.useState(!1);if(f.useEffect(()=>{a||(u(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(G,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const M=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const u=c=>{const m=[];return c.forEach(y=>{const b=y.actorKind?.selectedOption,C=y.selectedRole?.selectedOption;let D=[];b==="role"&&C!=null?D=[{type:"attribute",subType:C,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 U=y.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,d={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;d.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&&(d.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=S?.selection.selectedOptions??[];if(I.length>0&&(d.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:d,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:d,steps:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(H(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(X);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(J,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=g(n=>E(n)),i=g(n=>x(n)),[a,u]=f.useState(!1);if(Z(),f.useEffect(()=>{a||(u(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,Z as u};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-6JNkacrc.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-BHqQV1j-.js";import{eX as H,QK as ue,c6 as pe,EG as Fe,kI as dt,ET as oe,ES as re,QL as ut,bn as be,gp as Ue,QM as pt,N7 as bt,kx as Le,N8 as Ae,N9 as gt,js as ht,Q2 as ft,jH as St,Eu as It,ub as Rt,jz as yt,Fe as Pe,QN as $e,QO as At,QP as vt,QQ as kt,QR as Ct,QS as Et,E_ as ve,jN as wt,Qb as xt,EU as Bt,EE as Tt,QT as jt,ED as Dt,QU as Ft,EM as ke,F2 as Ut,F1 as Lt,EZ as Pt,QV as Me,Kd as $t,bq as Mt,EP as _t,Fw as Nt,QW as Ot,QX as Qt,Fa as zt,F7 as Ce,Px as Gt,EB as Zt,QY as _e,FY as Ee,G4 as Ht,QZ as Vt,Q_ as z,Q$ as Wt,R0 as Ne,R1 as Kt,R2 as Oe,R3 as Qe,Fm as le,bu as qt,bK as ge,cG as he,fE as ze,fC as Ge,R4 as Jt,fz as Xt,PK as Yt,R5 as en,R6 as Ze,PO as tn,Qw as nn,R7 as an,QJ as sn,G1 as we,G0 as on,R8 as rn,R9 as ln,Ra as mn,Rb as cn,Rc as dn,Qh as un,FT as pn,FX as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LX as Rn,cQ as yn,cT as An,cS as vn,cz as kn}from"./zeni-epic-state-CZM3a-K0.js";import{A as He,Z as Ve,Q as ee,e as E,z as $,c0 as We,J as te,f as v,aL as xe,o as D,at as X,H as Cn,a as Ke,c1 as En,v as G,$ as qe,c2 as wn,I as ne,c3 as xn,Y as Bn,D as Tn,y as fe,h as Je,a8 as jn,bo as Dn,a3 as Fn,m as Xe,c4 as Un,i as Ln}from"./index-BCSsut58.js";import{n as N,S as Pn}from"./mui-C5-OLXT3.js";import me from"./NotFoundScreen-DbINM0eT.js";import{S as Be}from"./SetupPagesScreen-CUJ1-XM4.js";import{F as Ye}from"./FeaturePreviewScreen-BWOweMkx.js";import{a as f}from"./sentry-CHrxYia6.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-45oJK0hu.js";import{u as et}from"./useInitialThreadRequest-CqGMs5d-.js";import{D as $n}from"./DrawerScreen-BCogPEDL.js";import{M as tt}from"./MobileAppDrawer-DUQ59uIE.js";import{R as Mn}from"./ReimbursementApprovalRoutes-NPPwIK8Y.js";import{FallBackRoute as _n}from"./ScreenRoutes-B_EWXDY7.js";import"./recharts-CZo2yeP8.js";import"./analytics-DyLuuBT1.js";import"./plaid-BXai4jzs.js";import"./dnd-PncgQ6ah.js";import"./stripe-DMRn4zHo.js";import"./lottie-C3VtgzwQ.js";import"./lexical-Boz4mOyF.js";import"./pdf-16GwGHdy.js";import"./utils-S8edMjGk.js";import"./analyticsHelper-D2oAlw4a.js";import"./routePaths-DkQjfNRq.js";import"./BusinessVerificationPageScreen-DCETvhd8.js";import"./ReimbursementApprovalRuleDetailScreen-RmB2PavA.js";import"./getLocaleForTenant-SgsbGJTJ.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]="227bd154-b5b1-4193-b1b1-0af2817904d3",e._sentryDebugIdIdentifier="sentry-dbid-227bd154-b5b1-4193-b1b1-0af2817904d3")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ke.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${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:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({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(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[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=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),k=$.getSignedInUser(),I=w(p=>H(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(k==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
2
+ display: flex;
3
+ position: relative;
4
+ height: 100vh;
5
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,zn=N.div`
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ background-color: ${Cn.overlayBackgroundBlack};
14
+ z-index: 5;
15
+ `,Gn=N.div`
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 42%;
20
+ height: 100%;
21
+ z-index: 6;
22
+ display: flex;
23
+ background-color: transparent;
24
+ overflow: hidden;
25
+ `,Zn=N.div`
26
+ position: fixed;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ z-index: 11;
32
+ display: flex;
33
+ flex-direction: column;
34
+ overflow-y: auto;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ `,Hn=N.button`
37
+ align-self: flex-end;
38
+ background: none;
39
+ border: none;
40
+ cursor: pointer;
41
+ padding: ${D.sp2} ${D.sp3};
42
+ line-height: 1;
43
+ color: ${e=>e.theme.colors.hero};
44
+ &:hover {
45
+ color: ${e=>e.theme.colors.primary};
46
+ }
47
+ svg {
48
+ width: ${D.sp4};
49
+ height: ${D.sp4};
50
+ }
51
+ `,Vn=N.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,Wn=K(function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Qt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=nt(o),i=G(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=G(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(Pe(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=W(),t=de(),n=Z(),r=n.hash.substring(1),d=He(),{reimbursementId:c}=Y(),m=$.getSignedInUser(),o=w(R=>H(R)),a=w(R=>Me(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,A]=f.useState(!1),[F,B]=f.useState(!1),{isFeatureEnabled:k}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w(R=>ue(R,c??"")),L=$t(o),P=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(P||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,P,o.isZeni,L,m]),f.useEffect(()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Fe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(We,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:k,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=K(function(e,t){return{remisReviewView:_e(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}})(xn);function Jn(){const e=W(),t=w(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(c=>_e(c)),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const Q=tn(),at="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Xn,common:je}=Ke.getLocalizedStrings(),De=Xn.reimbursement.bulkActions,Yn=N.div`
57
+ display: flex;
58
+ min-height: 100%;
59
+ width: 100%;
60
+ flex: 1 1 auto;
61
+ flex-direction: column;
62
+ align-items: center;
63
+ background-color: ${e=>e.theme.colors.grey4};
64
+ `,ea=K(function(e,t){const n=Qe(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:Q,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ne(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=G(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=G(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=G(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(sn(!1))},onEventReceived:o=>{o===at&&e(an())}}})(jn(Dn));function ta(){const e=W(),t=de(),n=Z(),r=n.state,d=Ve(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Oe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=w(S=>H(S)),[x,j]=f.useState(!1),[A,F]=f.useState(!1),B=ne(),k=B?.loggedInUserRole?.includes("admin")===!0,I=w(S=>Qe(S,Q,h)),{areTenantIdsInSync:g}=Bn(),L=I.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:M}=Se({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(le(Q,!0,l,!1,!0)))},[A,Q,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=ge(B?.loggedInUserRoleMap),V=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,q=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w(S=>Ue(S.companyState,u.companyId)),st=ie?.company.featuresActivationInfo.connectedAccountProvider,Ie=S=>{j(S)},{isFeatureEnabled:it}=a(E.isDebitCardFeatureEnabled),ot=ze(it,u),rt=Ge(u),{remisProcessed:J,remisProcessing:Re}=w(S=>Jt(S));f.useEffect(()=>{J===Re&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?De.reports:De.report},{variableName:"_has_",variableValue:J>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(le(Q,!0,l,!1,!0,!0))},3e3),m(null))},[J,Re]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,O,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ye,{}):q&&(!R||p)||V&&ae?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(te,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Je.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:x,handleDrawerToggle:Ie}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Q,isAdmin:k,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ie(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:P,onAskAiCfoClick:M,...lt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ze(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
65
+ display: flex;
66
+ min-height: 100%;
67
+ flex-direction: column;
68
+ `,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=Z(),{tenantEmailDomain:n}=Y(),r=Xe(),[d,c]=f.useState(!1),m=w(A=>H(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(Je.Event.reimbursementPromoPage))(A)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=w(ie=>H(ie)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Xe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=ze(a,e),l=Ge(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,j=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,A=j&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b,B=F&&In(t?.loggedInUserRoleMap),k=Rn(t?.loggedInUserRoleMap),I=yn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=j&&I,P=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=vn(t?.loggedInUserRoleMap),R=kn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),V=F&&M,{tenantEmailDomain:ae}=Y(),q=Z(),se=n===!0&&(u||p&&c);return s.jsxs(ct,{children:[q.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(Mn,{}):s.jsx(_n,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:P,isTenantBankingOnly:i,showChargeCardRoute:V,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ze(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):q.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Te,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Te,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{Pa as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-C5Zo4IsV.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-CDuxXgNT.js";import{eX as v,fT as w,Mp as Te,ky as Z,qS as J,rH as A,km as Re,jq as Me,vc as K,rM as Oe,bs as Ae,Mq as Fe,bn as ke,wl as De,Mr as Ee,Ms as je,v4 as Pe,Mt as Y,Mu as ve,Mv as Le,Mw as Be,Mx as Ve,My as I,Mz as F,MA as k,MB as q,MC as D,MD as E,dK as Ue,w1 as xe,vR as N,vS as $,w7 as ze,vW as Q,wd as Ge,ME as He,MF as Ye,MG as qe,MH as Ne,MI as $e,fE as Qe,fC as We}from"./zeni-epic-state-aFTbMOAR.js";import{U as Xe,V as Ze,W as Je,X as Ke,Z as ea,Q as ee,e as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,J as ra,f as P,h as ia,a0 as la,v as se,a1 as ca,a2 as da,a3 as pa}from"./index-DzOogTqR.js";import"./mui-BWYOl-fu.js";import fa from"./NotFoundScreen-B_nzx2PP.js";import{F as ma}from"./FeaturePreviewScreen-dZphyDK8.js";import{a as _}from"./sentry-pTjqe1GE.js";import{u as ua}from"./useInitialThreadRequest-C_oymrXt.js";import{t as W,a as X,b as _a}from"./routePaths-rmRxk_gU.js";import{M as ha}from"./MobileAppDrawer-BWG5ZoNF.js";import"./recharts-DOA55GXl.js";import"./analytics-CpUJgE1w.js";import"./plaid-2PJJQmCk.js";import"./dnd-VtUMJCWH.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-fnnIRm.js";import"./lexical-CIqawAn4.js";import"./pdf-WEHP-u0u.js";import"./utils-C-pFPw5l.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]="08ad8127-a9bf-46a9-89ba-02c51f6650f9",e._sentryDebugIdIdentifier="sentry-dbid-08ad8127-a9bf-46a9-89ba-02c51f6650f9")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(qe()),e(Ne()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Z(e),isAccountingProjectsEnabled: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(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(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(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return W(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(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?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Z(n)),M=d(n=>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&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,g,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=Xe(he??"")==="reports",be=Ze(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Qe(f,e),a=We(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-6JNkacrc.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-BHqQV1j-.js";import{eX as v,fT as w,Mo as Te,kx as J,qR as K,rG as A,kl as Re,jp as Me,vb as W,rL as Oe,bs as Ae,Mp as ke,bn as Fe,wk as De,Mq as Ee,Mr as je,v3 as Pe,Ms as Y,Mt as ve,Mu as Le,Mv as Be,Mw as Ve,Mx as I,My as k,Mz as F,MA as N,MB as D,MC as E,dK as Ue,w0 as xe,vQ as q,vR as $,w6 as ze,vV as Q,wc as Ge,MD as He,ME as Ye,MF as Ne,MG as qe,MH as $e,fE as Qe,fC as Ze}from"./zeni-epic-state-CZM3a-K0.js";import{U as Xe,V as Je,W as Ke,X as We,Z as ea,Q as ee,e as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,J as ra,f as P,h as ia,a0 as la,v as se,a1 as ca,a2 as da,a3 as pa}from"./index-BCSsut58.js";import"./mui-C5-OLXT3.js";import fa from"./NotFoundScreen-DbINM0eT.js";import{F as ma}from"./FeaturePreviewScreen-BWOweMkx.js";import{a as _}from"./sentry-CHrxYia6.js";import{u as ua}from"./useInitialThreadRequest-CqGMs5d-.js";import{t as Z,a as X,b as _a}from"./routePaths-DkQjfNRq.js";import{M as ha}from"./MobileAppDrawer-DUQ59uIE.js";import"./recharts-CZo2yeP8.js";import"./analytics-DyLuuBT1.js";import"./plaid-BXai4jzs.js";import"./dnd-PncgQ6ah.js";import"./stripe-DMRn4zHo.js";import"./lottie-C3VtgzwQ.js";import"./lexical-Boz4mOyF.js";import"./pdf-16GwGHdy.js";import"./utils-S8edMjGk.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]="50d09d1e-1c82-468d-9505-6507d7185664",e._sentryDebugIdIdentifier="sentry-dbid-50d09d1e-1c82-468d-9505-6507d7185664")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e(qe()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:K(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(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(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(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?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),M=d(n=>K(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&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,g,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(W());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=Xe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Ke({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Qe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-6JNkacrc.js";import{Q as j,z as w,aR as y,J as I,f as p,h as F,d7 as P,e as T}from"./index-BCSsut58.js";import"./mui-C5-OLXT3.js";import m from"./NotFoundScreen-DbINM0eT.js";import{a as d}from"./sentry-CHrxYia6.js";import{u as L,j as b,h as R,g as V,n as A,o as U,p as u}from"./core-BHqQV1j-.js";import{eX as z,TC as C,PX as X,TD as v,vH as Y,fK as G,TE as H,vF as J}from"./zeni-epic-state-CZM3a-K0.js";import{R as x}from"./ReferralListScreen-BufpufnF.js";import"./recharts-CZo2yeP8.js";import"./analytics-DyLuuBT1.js";import"./plaid-BXai4jzs.js";import"./dnd-PncgQ6ah.js";import"./stripe-DMRn4zHo.js";import"./lottie-C3VtgzwQ.js";import"./lexical-Boz4mOyF.js";import"./pdf-16GwGHdy.js";import"./utils-S8edMjGk.js";import"./useAskAiCfoHostNavButtonProps-45oJK0hu.js";import"./MobileAppDrawer-DUQ59uIE.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]="7b851583-aeed-4c8f-8e58-d6e6aa0ce2ba",e._sentryDebugIdIdentifier="sentry-dbid-7b851583-aeed-4c8f-8e58-d6e6aa0ce2ba")}catch{}})();const K=A(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(J())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),O=()=>{const e=L(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b(o=>z(o)),c=R(),D=V(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),N=X(k);d.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(K,{navigate:c,location:D,currentTenant:r,companyName:S,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(m,{})}),a.jsx(u,{path:"*",element:a.jsx(m,{})})]})}export{ue as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-C4WsA2pG.js","assets/sentry-CHrxYia6.js","assets/core-BHqQV1j-.js","assets/zeni-epic-state-CZM3a-K0.js","assets/index-BCSsut58.js","assets/mui-C5-OLXT3.js","assets/analytics-DyLuuBT1.js","assets/utils-S8edMjGk.js","assets/withTransactionSidePanel-DD5T3Sss.js","assets/useAskAiCfoHostNavButtonProps-45oJK0hu.js","assets/TransactionDetailScreen-CbI5PBMk.js","assets/decodeURIComponentSafe-B1lT7PtO.js","assets/routePaths-DkQjfNRq.js","assets/NotFoundScreen-DbINM0eT.js","assets/useInitialThreadRequest-CqGMs5d-.js","assets/analyticsHelper-D2oAlw4a.js","assets/CompanyPassportScreen-CFy9NTlf.js","assets/MobileAppDrawer-DUQ59uIE.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CDQLXIZi.js","assets/FeaturePreviewScreen-BWOweMkx.js","assets/ReferralListScreen-BufpufnF.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-BlVykZyv.js","assets/AddressScreen-D9Ul8Dxb.js","assets/DomesticWireDetailScreen-CSRe_o0Z.js","assets/DrawerScreen-BCogPEDL.js","assets/SetupPagesScreen-CUJ1-XM4.js","assets/BusinessVerificationPageScreen-DCETvhd8.js","assets/BillPayApprovalRoutes-6gAY0XHv.js","assets/ReimbursementApprovalRuleDetailScreen-RmB2PavA.js","assets/getLocaleForTenant-SgsbGJTJ.js","assets/ReimbursementRoutes-CvWaXZJE.js","assets/ReimbursementApprovalRoutes-NPPwIK8Y.js","assets/TransactionListRoutes-B9szjsIc.js","assets/ZeniAccountStatementScreen-CdJ60HCv.js","assets/SettingsRoutes-DGpH4sr4.js","assets/accountMappingHelper-CaLAZUmW.js","assets/useEmailConnectResultRefresh-D0dx8xRq.js","assets/QBOConnectionScreen-DZ6a6Pn5.js","assets/empty-CFTi16nV.js","assets/index-BU2Ez_ui.js","assets/url-jdVZyqWI.js","assets/index-T9jTnQ8m.js","assets/ReportsRoutes-BUSlFBpZ.js","assets/ChargeCardRoutes-COmpcwk4.js","assets/useChargeCardPusherEvents-cQlWV2uK.js","assets/PeopleRoutes-BtGHFWVD.js","assets/ExpenseAutomationRoutes-B0eoWnRV.js","assets/TreasuryRoutes-ChAmTXmv.js","assets/useCashManagementBanner-CoVbsrBM.js","assets/VendorsRoutes-Bm8I2UHR.js","assets/pathToGoBack-2M7LGiAo.js","assets/ZeniAccountRoutes-D6g_ntbO.js","assets/AddressRoutes-B-OHFUYz.js","assets/PandLWithForecastRoutes-M-GIvzI6.js","assets/CustomerOnboardingRoutes-zzflyPH3.js","assets/TransactionDetailRoutes-d47zOIxK.js","assets/EntityDetailRoutes-C2X5pcIQ.js","assets/NotificationRoutes-Ckjirnas.js","assets/PerformanceRoutes-WEtJa7Hk.js","assets/RewardsRoutes-DZpLem4H.js","assets/TaskRoutes-DuTw4YUa.js","assets/TaskListScreen-BcoWt73W.js","assets/AiCfoScreen-DiLxiOHU.js","assets/CardsAiCfoScreen-CfEdJvYF.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as rs,eX as is,fE as ls,fC as us,gk as ds,fr as cs,cU as pe,cA as ms,fU as _s,cs as hs,bE as Es,bo as ps,fY as Rs,v as xs,LW as gs,bs as Is,LX as js,bK as Ts,bJ as As,bt as fs,co as Ds,LY as ys,LZ as bs,cQ as Cs,cT as vs,cS as Us,cz as ws,cG as Os,o9 as Re,fA as xe,gu as Ps,g0 as ge,gr as Ie,gs as je,g1 as Ls}from"./zeni-epic-state-CZM3a-K0.js";import{j as e}from"./liveblocks-6JNkacrc.js";import{a as O}from"./sentry-CHrxYia6.js";import{u as Fs,h as ks,i as Hs,g as Bs,j as z,l as Te,N as u,o as Vs,p as a}from"./core-BHqQV1j-.js";import{m as Ss,u as Ns,z as D,Q as Zs,c as Ms,d as zs,e as G,i as Gs,I as $s,L,a as Ae,t as _,P as Ys,f as K,l}from"./index-BCSsut58.js";import"./mui-C5-OLXT3.js";import{f as fe}from"./analyticsHelper-D2oAlw4a.js";import{t as Ws}from"./getLocaleForTenant-SgsbGJTJ.js";import"./recharts-CZo2yeP8.js";import"./analytics-DyLuuBT1.js";import"./plaid-BXai4jzs.js";import"./dnd-PncgQ6ah.js";import"./stripe-DMRn4zHo.js";import"./lottie-C3VtgzwQ.js";import"./lexical-Boz4mOyF.js";import"./pdf-16GwGHdy.js";import"./utils-S8edMjGk.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]="f4f94d71-10fb-4496-a29a-911641a8eb7e",o._sentryDebugIdIdentifier="sentry-dbid-f4f94d71-10fb-4496-a29a-911641a8eb7e")}catch{}})();const qs={dashboard:()=>t(()=>import("./DashboardRoutes-C4WsA2pG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t(()=>import("./BillPayRoutes-BlVykZyv.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t(()=>import("./ReimbursementRoutes-CvWaXZJE.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t(()=>import("./TransactionListRoutes-B9szjsIc.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t(()=>import("./SettingsRoutes-DGpH4sr4.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t(()=>import("./ReportsRoutes-BUSlFBpZ.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t(()=>import("./ChargeCardRoutes-COmpcwk4.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t(()=>import("./PeopleRoutes-BtGHFWVD.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-B0eoWnRV.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t(()=>import("./TreasuryRoutes-ChAmTXmv.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t(()=>import("./VendorsRoutes-Bm8I2UHR.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t(()=>import("./ZeniAccountRoutes-D6g_ntbO.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},Xs=l(()=>t(()=>import("./ReportsRoutes-BUSlFBpZ.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Js=l(()=>t(()=>import("./AddressRoutes-B-OHFUYz.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Ks=l(()=>t(()=>import("./PeopleRoutes-BtGHFWVD.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),et=l(()=>t(()=>import("./PandLWithForecastRoutes-M-GIvzI6.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),st=l(()=>t(()=>import("./CustomerOnboardingRoutes-zzflyPH3.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),tt=l(()=>t(()=>import("./VendorsRoutes-Bm8I2UHR.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nt=l(()=>t(()=>import("./TransactionDetailRoutes-d47zOIxK.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>t(()=>import("./EntityDetailRoutes-C2X5pcIQ.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),at=l(()=>t(()=>import("./DashboardRoutes-C4WsA2pG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),ye=l(()=>t(()=>import("./BillPayRoutes-BlVykZyv.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ot=l(()=>t(()=>import("./SettingsRoutes-DGpH4sr4.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),be=l(()=>t(()=>import("./ReimbursementRoutes-CvWaXZJE.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rt=l(()=>t(()=>import("./ZeniAccountRoutes-D6g_ntbO.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),it=l(()=>t(()=>import("./TreasuryRoutes-ChAmTXmv.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),lt=l(()=>t(()=>import("./TransactionListRoutes-B9szjsIc.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ut=l(()=>t(()=>import("./ChargeCardRoutes-COmpcwk4.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),dt=l(()=>t(()=>import("./NotificationRoutes-Ckjirnas.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ct=l(()=>t(()=>import("./PerformanceRoutes-WEtJa7Hk.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mt=l(()=>t(()=>import("./ExpenseAutomationRoutes-B0eoWnRV.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_t=l(()=>t(()=>import("./RewardsRoutes-DZpLem4H.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),ht=l(()=>t(()=>import("./TaskRoutes-DuTw4YUa.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Et=l(()=>t(()=>import("./AiCfoScreen-DiLxiOHU.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-CfEdJvYF.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),b=l(()=>t(()=>import("./NotFoundScreen-DbINM0eT.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),pt=l(()=>t(()=>import("./TaskListScreen-BcoWt73W.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Ht({setTenantEmailDomain:o}){const T=Fs(),B=ks(),{tenantEmailDomain:r}=Hs(),F=Ss().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ns(),v=D.getSignedInUserTenant(r)?.tenantId,I=D.getSignedInUser(),se=rs(I),$=Bs(),[V,Pe]=O.useState(!1),i=z(n=>is(n)),{useFeatureGate:N}=Zs(),Z=Ms(),te=zs(),Le=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(G.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(G.isDebitCardFeatureEnabled),A=z(n=>n.tenantState.fetchState),j=z(n=>n.tenantState.activeTenantFetchState.fetchState),h=j==="Completed"||A==="Completed"?ls(ne,i):void 0,Q=j==="Completed"||A==="Completed"?us(i):void 0,He=Gs(i,ke,ne),{isFeatureEnabled:Be}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:X}=N(G.isAiCfoFileUploadEnabled),Y=z(n=>ds(n));if(r!=null){const n=D.getSignedInUserTenant(r);I!=null&&n!=null&&fe(I,i,F)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=cs(),E=$s(),Ve=i.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Se=ms(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,J=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=z(n=>M.tenantId!=null?_s(n,M.tenantId):void 0);O.useEffect(()=>{U(L.TENANT_FETCHING),o(r)},[r]),O.useEffect(()=>{if(J!=null&&v!=null){const n=J.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=hs(Number(f[0])),s=Number(f[1]),c=Es(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=ps();c.isAfter(S,"month")===!1?T(Rs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}},[J,v]),O.useEffect(()=>{V||(Pe(!0),U(L.TENANT_FETCHING)),oe.current?oe.current=!1:!xs(ae,M)&&D.isSignedIn()&&(U(L.TENANT_FETCHING),function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ps(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ws(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?K.identify(n.userId,{tenant_id:n.tenantId}):K.resetUserIdentity()}(M,I,T,Ne))},[M,ae,I,T,D]),O.useEffect(()=>{D.isSignedIn()&&(U(L.TENANT_FETCHING),function(n,f,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,ns=d==null||d.tenantId!==s,as=d!=null&&d.excludedResources==null,os=d!=null&&d.externalConnections==null;if(W&&ns){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)))}else W&&as&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),W&&os&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)));if(W){K.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(L.TENANT_FETCHING),H(Ls(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}}(A,j,i,v,I,U,T))},[v,j]),O.useEffect(()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(L.TENANT_FETCHING),D.saveSignedInUserTenants(gs(Y.tenantsBaseInOrder)),I!=null&&fe(I,i,F,void 0,Y.tenantsBaseInOrder))},[Y,A,i,I]),O.useEffect(()=>{j==="In-Progress"&&U(L.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(L.TENANT_FETCHING),k(L.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=Qs,f=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=qs[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=i?.userRole!=null&&Is(i?.userRole),{isFeatureEnabled:Ze}=N(G.isReferralFeatureEnabled),Me=i?.userRole!=null&&i.userRole.includes("charge_card_user"),ze=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&pe(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=He&&!w,Ge=js(E?.loggedInUserRoleMap),$e=i.externalConnections?.accounting[0]?.isValid,de=i.company?.companyOnboardingInfo.isOnboardingCompleted,ce=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&Ts(E?.loggedInUserRoleMap),_e=Le&&!w,Ye=Fe&&!w,We=le&&As(E?.loggedInUserRoleMap),qe=ue&&fs(E?.loggedInUserRoleMap),Qe=_e&&Ds(E?.loggedInUserRoleMap),Xe=ys(E?.loggedInUserRoleMap),Je=bs(E?.loggedInUserRoleMap),Ke=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),p=ws(E?.loggedInUserRoleMap),R=Os(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&Ke,g=Ye&&es,m=ue&&ss,ts=i.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||Ge===!0||Xe===!0||Je===!0;return D.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)&&$e===!1&&h===!1&&Q===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&i?.userRole&&h!=null&&Q!=null&&r!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx(Ys,{}),children:[e.jsx(a,{path:"/",element:e.jsx(Rt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(at,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Xs,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"people/*",element:ts||P?e.jsx(Ks,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(st,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||Me||ze?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(lt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"tasks",element:e.jsx(pt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"address/*",element:We||me||Qe||qe?e.jsx(Js,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(it,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ct,{}):e.jsx(Oe,{tenantEmailDomain:r})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(mt,{}):e.jsx(Oe,{tenantEmailDomain:r})}),e.jsx(a,{path:"notifications/*",element:e.jsx(dt,{})}),e.jsx(a,{path:"vendors/*",element:Ve?e.jsx(tt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(a,{path:"settings/*",element:Be?e.jsx(ot,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(Et,{isFileUploadEnabled:X}):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 Rt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:r,showTreasuryRoute:F,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(F)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"}):F?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):r?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:r,isTenantBankingOnly:F,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(F===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(r)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):r?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(gt,{tenantEmailDomain:C}):B?e.jsx(xt,{tenantEmailDomain:C}):e.jsx(b,{})},xt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),gt=({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{y as FallBackRoute,Ht as default};
@@ -0,0 +1,57 @@
1
+ import{j as o}from"./liveblocks-6JNkacrc.js";import{a as d}from"./sentry-CHrxYia6.js";import{h as L,g as $,u as _,j as b,s as ce,n as Q,i as Z,o as W,p as w}from"./core-BHqQV1j-.js";import{bn as je,eX as D,gp as De,m$ as le,Of as Me,hF as fe,O6 as Te,qR as Ue,kx as he,mX as _e,hH as Fe,O8 as Re,O7 as Be,Qy as Oe,zi as Ve,EL as ze,Q7 as Le,Qg as Ne,c6 as ne,cL as $e,cM as Qe,bs as Ze,M7 as Ge,xK as He,Qz as Ke,Ha as Xe,Er as qe,Ei as be,Ef as Ye,xO as Se,El as ye,Eo as Ce,Eu as te,ub as ae,xN as Je,k9 as q,kc as Ie,QA as We,ld as en,y1 as nn,M_ as tn,M$ as an,k7 as on,QB as sn,ka as cn,rj as ln,MV as rn,MW as dn,rn as un,hq as pn,Mf as J,hi as re,hf as gn,hn as mn,Mg as fn,x_ as hn,QC as bn,QD as Sn,EI as yn,fC as Ae,fE as Ee,QE as Cn,gd as In,Mp as An,xZ as de,gi as ue,gh as En,xY as xn,gg as vn,gf as wn,QF as kn,fH as xe,QG as Pn,QH as jn,y4 as Dn,xX as pe,QI as Mn,fX as Tn,xU as Un,bZ as _n,c5 as Fn,c4 as Rn,b_ as Bn,c2 as On,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-CZM3a-K0.js";import{Q as Y,e as O,z as j,af as ve,bS as $n,f as G,h as Qn,bD as Zn,I as H,y as oe,bT as Gn,i as we,bU as Hn,aq as Kn,n as ke,bV as Xn,bW as qn,bX as Yn,Y as Jn,bY as Wn,v as et,bZ as nt}from"./index-BCSsut58.js";import{n as V}from"./mui-C5-OLXT3.js";import{M as B}from"./MobileAppDrawer-DUQ59uIE.js";import{a as K,g as X,m as tt}from"./accountMappingHelper-CaLAZUmW.js";import{t as at,A as ot}from"./AddressScreen-D9Ul8Dxb.js";import N from"./NotFoundScreen-DbINM0eT.js";import{g as st}from"./analyticsHelper-D2oAlw4a.js";import{B as it}from"./BusinessVerificationPageScreen-DCETvhd8.js";import{C as ct}from"./CompanyPassportScreen-CFy9NTlf.js";import{u as lt,a as rt}from"./useEmailConnectResultRefresh-D0dx8xRq.js";import{q as ge}from"./QBOConnectionScreen-DZ6a6Pn5.js";import{B as dt}from"./BillPayApprovalRoutes-6gAY0XHv.js";import{R as ut}from"./ReimbursementApprovalRoutes-NPPwIK8Y.js";import"./recharts-CZo2yeP8.js";import"./analytics-DyLuuBT1.js";import"./plaid-BXai4jzs.js";import"./dnd-PncgQ6ah.js";import"./stripe-DMRn4zHo.js";import"./lottie-C3VtgzwQ.js";import"./lexical-Boz4mOyF.js";import"./pdf-16GwGHdy.js";import"./utils-S8edMjGk.js";import"./routePaths-DkQjfNRq.js";import"./empty-CFTi16nV.js";import"./pdf-lib-Ch5CfF-s.js";import"./index-BU2Ez_ui.js";import"./url-jdVZyqWI.js";import"./index-T9jTnQ8m.js";import"./decodeURIComponentSafe-B1lT7PtO.js";import"./ReimbursementApprovalRuleDetailScreen-RmB2PavA.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]="823e154e-36c6-46ed-9afe-2a293a33d9b3",e._sentryDebugIdIdentifier="sentry-dbid-823e154e-36c6-46ed-9afe-2a293a33d9b3")}catch{}})();const pt=V.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,gt=Q(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:he(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:u,vendorsAccountSection:p,filing1099Section:m}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:h}=u,{prepaidExpensesAccount:A,fixedAssetsAccount:k,accruedExpensesAccount:x}=p,{bankAccount:f,expenseCategory1099:I}=m,E=K(a.accountMappingView.incomeAccountList,y.selectedOption),F=K(a.accountMappingView.expenseAccountList,g.selectedOption),R=K(a.accountMappingView.billPayAccountList,r.selectedOption),M=K(a.accountMappingView.reimbursementsAccountList,h.selectedOption),z=X(a.accountMappingView.prepaidExpensesAccountList,A.selectedOptions),S=X(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),T=X(a.accountMappingView.accruedExpensesAccountList,x.selectedOptions),C=X(a.accountMappingView.bankAccounts1099FilingAccountList,f.selectedOptions),v=tt(a.accountMappingView.expenseAccounts1099FilingAccountList,I),U={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:R?.accountId,selectedReimbursementsAccountId:M?.accountId,selectedPrepaidExpensesAccountIds:z.map(P=>P.accountId),selectedFixedAssetsAccountIds:S.map(P=>P.accountId),selectedAccruedExpensesAccountIds:T.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:C.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:v};e(Be({data:U}))},onBackClick:()=>{ve(c)===!1?(s("../../dashboard"),e(Re())):e(fe())},onSaveClick:()=>{e(Fe()),l&&G.track(Qn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(_e(a.currentTenant.companyId,n))}}})($n),mt=()=>{const e=L(),a=$(),s=_(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:u}=l("transaction_categorization_config"),p=!u&&i?.capitalization_enabled===!0,m=j.getSignedInUser(),y=je(m),g=b(C=>D(C)),{capitalizableAccounts:r,capitalizableAccountOverrides:h,isCapitalizationThresholdSaving:A,currencySymbol:k}=b(C=>{const v=C.tenantState.currentTenantId,U=v!=null?C.tenantState.tenantsById[v]:void 0,P=De(C.companyState,g.companyId);return{capitalizableAccounts:U?.capitalizableAccounts??null,capitalizableAccountOverrides:U?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:C.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:P?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),x=d.useCallback((C,v)=>{s(le(g.companyId,C,v))},[s,g.companyId]),f=d.useCallback(C=>{const v={...h??{}},U=Object.entries(C);for(const[se,ie]of U)ie===null?delete v[se]:v[se]=ie;const[P,Pe]=U[0]??[];P!=null&&s(le(g.companyId,P,Pe,void 0,Object.keys(v).length>0?v:null))},[s,g.companyId,h]),I=b(C=>Me(C.accountState),ce),E=d.useMemo(()=>{const C={};for(const v of I)v.accountId!=null&&v.accountName!=null&&(C[v.accountId]=v.accountName);return C},[I]),[F,R]=d.useState(!1),[M,z]=d.useState(!1);d.useEffect(()=>{F===!1&&(s(fe()),R(!0))},[F]);const S=b(C=>Te(C)),T=C=>{z(C)};return o.jsxs(pt,{children:[o.jsx(B,{isAppContentDrawerOpen:M,handleDrawerToggle:T}),o.jsx(gt,{currentTenant:g,navigate:e,accountMappingView:S,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:p,capitalizableAccounts:r,accountNamesById:E,capitalizableAccountOverrides:h,currencySymbol:k,isCapitalizationThresholdSaving:A,onSaveCapitalizationAccountThreshold:x,onSaveCapitalizationAccountThresholds:f,location:a,isSettings:ve(a),onClickMenuIcon:()=>T(!0)})]})},ft=V.div`
10
+ display: flex;
11
+ height: 100%;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,ht=Q(function(e,a){const s=D(e),c=Le(e),l=Ne(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ne(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:G}},function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),bt=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=d.useState(!1),[t,i]=d.useState(!1),[u,p]=d.useState(!1),m=b(I=>D(I)),y=b(I=>I.billPaySetupApproverViewState.fetchState),g=b(I=>I.remiSetupApproverViewState.fetchState),r=b(I=>Oe(I)),{isApprovalRulesV3Enabled:h,isLoading:A}=Zn(m?.tenantId),k=m.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const x=H();d.useEffect(()=>{u||y!=="Not-Started"||A||(p(!0),s(Ve(!0,!0,h)))},[u,y,A,h,s]),d.useEffect(()=>{t||g!=="Not-Started"||A||(i(!0),s(ze(!0,!1,!1,h)))},[t,g,A,h,s]);const f=I=>{n(I)};return x?.loggedInUserRoleMap!=null?o.jsxs(ft,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:f}),o.jsx(ht,{navigate:e,location:a,companyId:k,currentTenant:m,roleMap:x.loggedInUserRoleMap,onClickMenuIcon:()=>{f(!0)}})]}):o.jsx(oe,{fetchState:r.fetchState})},St=V.div`
18
+ display: flex;
19
+ height: 100%;
20
+ width: 100%;
21
+ flex: 1 1 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,yt=Q(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,u=D(e);return{bankSetupView:Ke(e,s,n,t,c,l,i),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(ae(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(te(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,u,p)=>{e(Ce(n,t,p,u,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,u)=>{e(ye(!1,n,u,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,u,p)=>{e(p==="paymentAccount"?be(n,t,i,u):Ye(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(qe(l,t,n,i))},onRemoveConnection:n=>{e(Xe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Hn),Ct=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),l=H(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[u,p]=d.useState(!1),[m,y]=d.useState(!1),g=b(M=>D(M)),r=b(M=>M.settingsViewState.bankConnection.fetchState),h=$e(g,l?.loggedInUserRoleMap),A=Qe(g,l?.loggedInUserRoleMap),k=g?.userRole!=null&&Ze(g.userRole),x=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!k,f=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!k,I=we(g,t,i),E=Ge(g,l?.loggedInUserRoleMap)&&I,F=g.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect(()=>{m||r==="Completed"||(y(!0),s(He(!1)))},[m,s,r]);const R=M=>{p(M)};return h||x||A||E?o.jsxs(St,{children:[o.jsx(B,{isAppContentDrawerOpen:u,handleDrawerToggle:R}),o.jsx(yt,{navigate:e,location:a,companyId:F,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:h,isRemiEnabled:A,isZeniAccountEnabled:x,isChargeCardEnabled:E,isTreasuryEnabled:f,onClickMenuIcon:()=>{R(!0)}})]}):o.jsx(N,{})},It=V.div`
26
+ display: flex;
27
+ height: 100%;
28
+ width: 100%;
29
+ flex: 1 1 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,At=Q(function(e,a){const{companyId:s}=a,c=D(e),l=a.roleMap.bill_pay_admin,n=We(e,s),{uiState:t}=n,i=(ne(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:ke.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(ae("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(te(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ce(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(ye(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(be(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ie(n))},handleConfirmCardSetupIntent:n=>{e(cn(n))},updateCardPaymentModalState:n=>{e(sn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(on(n,t,i))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(an())},handleResetCardPaymentErrorStatuses:()=>{e(tn())},onBillingAddressSave:n=>{e(nn(n))},onAddressEditHandler:n=>{if(n!=null){const t=at(n);e(en({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Xn),Et=()=>{const e=L(),a=$(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=d.useState(!1),[t,i]=d.useState(!1),[u,p]=d.useState(!1),m=b(f=>D(f)),y=b(f=>f.cardPaymentViewState),g=b(f=>f.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Kn(y.addCardPaymentSourceStatus.fetchState),h=y.addCardPaymentSourceStatus.fetchState,A=m.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=H();d.useEffect(()=>{A!=null&&s(Je(A,!1))},[A,s]),d.useEffect(()=>{t||(i(!0),s(q()))},[t,s]),d.useEffect(()=>{u||(Ie(["card"]),p(!0))},[u]),d.useEffect(()=>{r==="In-Progress"&&h==="Completed"&&s(q())},[r,h]);const x=f=>{n(f)};return k?.loggedInUserRoleMap!=null?o.jsxs(It,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:x}),o.jsx(At,{navigate:e,location:a,companyId:A,currentTenant:m,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{x(!0)},googleAPIKey:ke.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},ee="external_integrations",xt=Q(function(e){const a=dn(e,ee);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{ge.init("/connection/auth",n),ge.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(hn())},onSaveChargeBeeCredentials:(i,u)=>{const p=c.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;p!=null&&e(mn(t,p,J("revenue"),fn("chargebee"),{api_key:i,site:u}))},onConnectHubSpot:(i,u)=>{const p=c.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(p!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:u,connection_id:p,redirect_uri:m,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(i,u)=>{e(gn(t,i,J(u)))},onConnectGmail:()=>{e(re(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(re(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(pn(t,J("payments"),i))},onNotifyMe:i=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(un(ee,i,l))}}})(qn),vt=()=>{const e=L(),a=_(),{tenantEmailDomain:s}=Z();lt();const[c,l]=d.useState(!1),n=b(f=>f.tenantState.fetchState),t=b(f=>D(f)),i=t.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),p=H(),m=ne(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");d.useEffect(()=>{a(ln(ee))},[a]);const[y,g]=d.useState(!1);d.useEffect(()=>{y||(g(!0),a(q()))},[y,a]);const r=f=>{l(f)},h=b(f=>rn(f,i)),A=b(f=>f.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:k,onAddPlaidAccount:x}=rt({companyId:i??t.companyId});return p?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(B,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(xt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:m,integrationsView:h,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:h.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:h.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:h.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:h.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:h.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(h.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([f,I])=>[f,I?.message])),deleteConnectionState:h.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:h.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:k,onAddPlaidAccount:x,plaidConnectionDetails:A})]}):o.jsx(oe,{fetchState:n})},wt=V.div`
34
+ display: flex;
35
+ height: 100%;
36
+ width: 100%;
37
+ flex: 1 1 auto;
38
+ flex-direction: column;
39
+ align-items: center;
40
+ background-color: ${e=>e.theme.colors.grey4};
41
+ `,kt=V.div`
42
+ display: flex;
43
+ height: 100%;
44
+ width: 100%;
45
+ flex: 1 1 auto;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ background-color: ${e=>e.theme.colors.grey4};
49
+ `,Pt=()=>{const e=_(),{tenantEmailDomain:a}=Z(),[s,c]=d.useState(!1),l=b(r=>D(r)).companyId??j.getSignedInUserTenant(a)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=b(r=>bn(r,n.userId)),i=b(r=>Sn(r,l,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=i,p=r=>{c(r)},m=d.useCallback(r=>{e(ae("user_reimbursement_account",r))},[]),y=d.useCallback(r=>{e(te(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);d.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(yn(n.userId))},[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(kt,{children:[o.jsx(B,{isAppContentDrawerOpen:s,handleDrawerToggle:p}),o.jsx(Yn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:m,onEstablishConnectionClick:y,onClickMenuIcon:()=>{p(!0)}})]})},jt=V.div`
50
+ display: flex;
51
+ height: 100%;
52
+ width: 100%;
53
+ flex: 1 1 auto;
54
+ flex-direction: column;
55
+ align-items: center;
56
+ background-color: ${e=>e.theme.colors.grey4};
57
+ `,me=({appContent:e})=>{const a=_(),s=L(),c=$(),[l,n]=d.useState(!1),t=b(S=>D(S)),{tenantEmailDomain:i}=t,u=t.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:p}=Y(),m=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=p(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=p(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=b(S=>he(S)),A=Ae(t),k=Ee(g,t),x=!k&&h,f=we(t,y,g),{areTenantIdsInSync:I}=Jn();d.useEffect(()=>{I&&a(Cn(u,x))},[u,a,x,I]);const E=b(S=>In(S,x)),F=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||u==null,R=An(t),M=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,z=S=>{n(S)};return o.jsxs(jt,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:z}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Wn,{myProfileView:E,isAccountingClassesEnabled:h,isReimbursementDisabled:M===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:f===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:R===!1,onClickMenuIcon:()=>{z(!0)},isLoading:F,isBankingOnlyTenant:k,isCardsOnlyTenant:A,onAddressClick:S=>{const T=function(v,U){let P=`/${v}/settings/my_profile`;return P=P.concat(`/new/${U}`),P}(i,S),C=et(c.state?.pathnameStackToGoBack,c.pathname);s(T,{state:{pathnameStackToGoBack:C}})},onGetOtp:S=>{const T={...E.myProfileLocalData,phone:S};a(de({localData:T})),a(wn(S,"MyProfile"))},onResendOtp:S=>{a(vn(S,"MyProfile"))},onCancelClick:()=>{a(xn())},onSaveClick:()=>{a(ue("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(S,T)=>{a(En(S,T,"MyProfile"))},onVerifyOtpSuccess:S=>{S!=null&&j.saveZeniOtpToken(S),a(ue("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:S=>{a(de({localData:S}))}})]})};function Dt(){const e=_(),a=b(r=>D(r)).companyId,s=b(r=>kn(r)),c=b(r=>xe(r)),l=j.getSignedInUser(),[n,t]=d.useState(!1),i=d.useCallback(r=>{t(r)},[]),u=d.useCallback(r=>{e(Pn(r))},[]),p=d.useCallback(()=>{l?.userEmail!=null&&e(jn({loggedInUserEmail:l.userEmail}))},[l?.userEmail]),m=d.useCallback(()=>{e(Dn())},[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const y=d.useCallback(()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=d.useCallback(()=>{e(Mn())},[]);return d.useEffect(()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,a))}},[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(B,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(nt,{notificationSettingsView:s,onFormDataChange:u,onCancel:p,onSave:m,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:y,resetUpdateStatus:g})]})}function pa(e){const[a,s]=d.useState(!1),c=b(r=>xe(r)),l=b(r=>D(r)),n=H(),t=j.getSignedInUser(),i=_(),{useFeatureGate:u}=Y(),{isFeatureEnabled:p}=u(O.isDebitCardFeatureEnabled),m=t?.userEmail==null||c.fetchState!=="Completed"||Tn(c.notificationSettings,t.userEmail,p,l);d.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(Un()))},[c.fetchState,a]);const y=Ee(p,l),g=Ae(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||m!==!0?_n(l)?o.jsxs(W,{children:[Fn(n?.loggedInUserRole??[],p,l,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"accounting/*",element:o.jsx(mt,{})}),Rn(n?.loggedInUserRole??[],p,l,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"approval_rules/*",element:o.jsx(Mt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Bn(l,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"my_bank_connections",element:o.jsx(Pt,{})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"bank_connections",element:o.jsx(Ct,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"business_verification",element:o.jsx(it,{productType:y?"zeni_accounts":g?"charge_cards":st(l,n?.loggedInUserRoleMap)})}),zn(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(w,{path:"company_details",element:o.jsx(ct,{})}),Ln(n?.loggedInUserRole??[],l)&&o.jsx(w,{path:"billing",element:o.jsx(Et,{})}),Nn(n?.loggedInUserRole??[],p,l)&&o.jsx(w,{path:"integrations",element:o.jsx(vt,{})}),o.jsx(w,{path:"my_profile/new/:addressType",element:o.jsx(me,{appContent:o.jsx(ot,{isSubPage:!1})})}),o.jsx(w,{path:"my_profile",element:o.jsx(me,{})}),m&&o.jsx(w,{path:"notifications",element:o.jsx(Dt,{})}),o.jsx(w,{path:"*",element:o.jsx(N,{})})]}):o.jsx(W,{children:o.jsx(w,{path:"*",element:o.jsx(N,{})})}):null}function Mt(e){return o.jsxs(W,{children:[o.jsx(w,{path:"/",element:o.jsx(bt,{})}),o.jsx(w,{path:"bills/approval-rules/*",element:o.jsx(dt,{})}),o.jsx(w,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(ut,{}):o.jsx(N,{})}),o.jsx(w,{path:"*",element:o.jsx(N,{})})]})}export{pa as default};