@zeniai/web-app-ui 5.1.53-qa → 5.1.54-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 (121) hide show
  1. package/dist/assets/AddressRoutes-BnLs6Thq.js +1 -0
  2. package/dist/assets/AddressScreen-Bpm1g3GJ.js +9 -0
  3. package/dist/assets/AiCfoScreen-DvB52dzN.js +22 -0
  4. package/dist/assets/{BillPayApprovalRoutes-C0HhO8Zq.js → BillPayApprovalRoutes-7UEPLRsP.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DL446uHm.js → BillPayRoutes-CU7_1N_U.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-BxP_dHBq.js → BusinessVerificationPageScreen-UgGxnQyH.js} +2 -2
  7. package/dist/assets/CardsAiCfoScreen-YZr7g5Lg.js +14 -0
  8. package/dist/assets/{ChargeCardRoutes-BLCb8cIx.js → ChargeCardRoutes-BrW_iL7i.js} +9 -9
  9. package/dist/assets/{CompanyPassportScreen-CkDV3dle.js → CompanyPassportScreen-9Rc5mH-z.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-ClYWnB0t.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-BQzgR-6K.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BySm8MfB.js → CustomerOnboardingRoutes-DwYU0l_J.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-CEgHKVmd.js → DashboardRoutes-BL2dWKop.js} +3 -3
  14. package/dist/assets/{DefaultTenantHome-9fk_ObXB.js → DefaultTenantHome-BMiXfGQc.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-DCT2WFO9.js → DomesticWireDetailScreen-s5k6zIAu.js} +3 -3
  16. package/dist/assets/{DrawerScreen-DAhJy05e.js → DrawerScreen-CeOHT4ro.js} +1 -1
  17. package/dist/assets/EntityDetailRoutes-D87R9ysv.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-CJpBRsLy.js → ExpenseAutomationRoutes-D8RvJ_ZB.js} +3 -3
  19. package/dist/assets/{FeaturePreviewScreen-h089v0nG.js → FeaturePreviewScreen-429nxvjk.js} +1 -1
  20. package/dist/assets/HubSpotOAuthCallbackScreen-Cp6uaYm8.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-DXD8ia4D.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-u1nu2H0O.js +12 -0
  23. package/dist/assets/MobileAppDrawer-Ck77XJrw.js +1 -0
  24. package/dist/assets/NotFoundScreen-DEN1HuyG.js +1 -0
  25. package/dist/assets/NotificationRoutes-CHUbnhGf.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-Dvc66gSg.js +1 -0
  27. package/dist/assets/{PandLWithForecastRoutes-E2IJx1NW.js → PandLWithForecastRoutes-BHreu8Q_.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-DtPRAphk.js → PeopleRoutes-BDfMDBMJ.js} +5 -5
  29. package/dist/assets/PerformanceRoutes-C-1wBoYH.js +1 -0
  30. package/dist/assets/{Preview-L8h-Ibqx.js → Preview-DIHwHgF2.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-l87oL02a.js → QBOConnectionScreen-DNFuV9_h.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-XtU4H9R4.js → ReferralListScreen-ByjwQ5N-.js} +2 -2
  33. package/dist/assets/{ReimbursementApprovalRoutes-BZBu7fQ8.js → ReimbursementApprovalRoutes-D_BWGRLZ.js} +1 -1
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-ByIZjgyO.js → ReimbursementApprovalRuleDetailScreen-Daig4IQ8.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-B0Rnpw8O.js → ReimbursementRoutes-xcHd64qr.js} +5 -5
  36. package/dist/assets/{ReportsRoutes-CnhRcEBw.js → ReportsRoutes-2ShpDZLA.js} +1 -1
  37. package/dist/assets/RewardsRoutes-BZO-KWFq.js +1 -0
  38. package/dist/assets/{ScreenRoutes-dCkGsbaX.js → ScreenRoutes-Dti7-Ixh.js} +2 -2
  39. package/dist/assets/{SettingsRoutes-B_DWLARM.js → SettingsRoutes-BKVt-eGE.js} +6 -6
  40. package/dist/assets/{SetupPagesScreen-CoEYpzVD.js → SetupPagesScreen-0zvJok5y.js} +1 -1
  41. package/dist/assets/SignInScreen-CW9vcCuq.js +1 -0
  42. package/dist/assets/SignOutScreen-ChTjyX5W.js +9 -0
  43. package/dist/assets/{TaskListScreen-DR1N5MLz.js → TaskListScreen-DrRytX06.js} +2 -2
  44. package/dist/assets/{TaskRoutes-DzW21iLL.js → TaskRoutes-DW3-LBMv.js} +1 -1
  45. package/dist/assets/{TransactionDetailRoutes-wUBvx13S.js → TransactionDetailRoutes-DHUqssQz.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-SbXBU7LB.js → TransactionDetailScreen-9-dxedcB.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-BmJWlLYy.js → TransactionListRoutes-DeCDnr6v.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-CiX59e1b.js → TreasuryRoutes-lJD-IQKP.js} +5 -5
  49. package/dist/assets/{VendorsRoutes-BTJDHiaX.js → VendorsRoutes-CpiscP-9.js} +14 -14
  50. package/dist/assets/WiseConfirmationScreen-CJZ2O9Rr.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-Bye-oBEL.js → ZeniAccountRoutes-BVG6Nofx.js} +9 -9
  52. package/dist/assets/{ZeniAccountStatementScreen-DwjBXO74.js → ZeniAccountStatementScreen-BVqdlmkT.js} +1 -1
  53. package/dist/assets/{accountMappingHelper-BwC4ZXQT.js → accountMappingHelper-BSLlTYQH.js} +1 -1
  54. package/dist/assets/{analytics-BpWjaxbv.js → analytics-BHHyMpuV.js} +1 -1
  55. package/dist/assets/{analyticsHelper-VUlrCZ3f.js → analyticsHelper-BYRUUvaV.js} +1 -1
  56. package/dist/assets/{core-Cj3sxYL7.js → core-CLKYLs-8.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-CyYkfiHv.js → decodeURIComponentSafe-Bm32N7cj.js} +1 -1
  58. package/dist/assets/{dnd-WLAr-qfO.js → dnd-BgEYAbRi.js} +1 -1
  59. package/dist/assets/{empty-rEpgHEWF.js → empty-CwSgGrxu.js} +1 -1
  60. package/dist/assets/{empty-DFc-bsca.js → empty-DdtYEopm.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-ClAxGPrQ.js → emptyVideoElement-D6kbFw8A.js} +1 -1
  62. package/dist/assets/{epic-B2EfNSKx.js → epic-DZb8kqBH.js} +1 -1
  63. package/dist/assets/{getLocaleForTenant-ChWLNTj3.js → getLocaleForTenant-CuwnZkK7.js} +1 -1
  64. package/dist/assets/{index-C_Y0yMPY.js → index-BeMQfmRp.js} +10471 -10471
  65. package/dist/assets/{index-2KyAy7Zy.js → index-BzKXgra3.js} +1 -1
  66. package/dist/assets/{index-DUBqop-_.js → index-CTH1zZXf.js} +1 -1
  67. package/dist/assets/{index-B5wYRZoC.js → index-CtRgwYlG.js} +1 -1
  68. package/dist/assets/{index-BftEKN_-.js → index-DR5HeC7u.js} +2 -2
  69. package/dist/assets/{index-BhXRaXnd.js → index-Dr5dodMd.js} +1 -1
  70. package/dist/assets/{index-e7I5m4bW.js → index-DxSdRLh_.js} +1 -1
  71. package/dist/assets/{index-BW1XqAyr.js → index-UrW8im9e.js} +1 -1
  72. package/dist/assets/{lexical--OluaPRa.js → lexical-DN4b_Twn.js} +1 -1
  73. package/dist/assets/{liveblocks-DmbDY3sa.js → liveblocks-B6jAIe9x.js} +1 -1
  74. package/dist/assets/{lottie-W8sR2m8i.js → lottie-C38Bn-X6.js} +1 -1
  75. package/dist/assets/{mui-1V4hRqCa.js → mui-AZmtqUsi.js} +1 -1
  76. package/dist/assets/{pathToGoBack-PTW4YbNu.js → pathToGoBack-ogdURlZM.js} +1 -1
  77. package/dist/assets/{pdf-aJCOHARS.js → pdf-BzNDzZ8_.js} +3 -3
  78. package/dist/assets/{pdf-lib-ovfXHDuI.js → pdf-lib-0dW_LSbG.js} +1 -1
  79. package/dist/assets/{plaid-JtkXopjw.js → plaid-2Q72y6JT.js} +1 -1
  80. package/dist/assets/{pusher-CHPQmkEo.js → pusher-DsUo-9K1.js} +1 -1
  81. package/dist/assets/{react-GL1Pyhji.js → react-BpYPYN78.js} +1 -1
  82. package/dist/assets/{react-CA6ko42q.js → react-BvYGWaT4.js} +1 -1
  83. package/dist/assets/{react-6mQxD1Me.js → react-C_zFJEm7.js} +1 -1
  84. package/dist/assets/{react-BdMLdzsp.js → react-Ckos0IeG.js} +1 -1
  85. package/dist/assets/{react-Ch-GNhUs.js → react-DoYlyteP.js} +1 -1
  86. package/dist/assets/{react-CU-y_lik.js → react-DsxTC2P5.js} +1 -1
  87. package/dist/assets/{recharts-mFhBBFnU.js → recharts-CyaYjFwn.js} +1 -1
  88. package/dist/assets/{routePaths-D0rLO8yN.js → routePaths-2zRQFXqm.js} +1 -1
  89. package/dist/assets/{sentry--Yi43Gx7.js → sentry-95bdnR3R.js} +1 -1
  90. package/dist/assets/{url-10vNaoth.js → url-Br2V-Pa5.js} +1 -1
  91. package/dist/assets/{url-C6HCkI0M.js → url-C5803Pxi.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CSjDWCVT.js → useAiCfoDashboardSuggestedQuestionsChips-iiV0TqB-.js} +1 -1
  93. package/dist/assets/{useAskAiCfoHostNavButtonProps-OU79nJF1.js → useAskAiCfoHostNavButtonProps-k3dV_2QR.js} +1 -1
  94. package/dist/assets/useCashManagementBanner-d2dskVed.js +1 -0
  95. package/dist/assets/{useDeviceId-n-Ow0WdN.js → useDeviceId-B5LKCqFY.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-C_e7mvD1.js → useInitialThreadRequest-CrlDQYJc.js} +1 -1
  97. package/dist/assets/{utils-Bt5dYICv.js → utils-CDpOkGne.js} +1 -1
  98. package/dist/assets/{withTransactionSidePanel-8QHjmr16.js → withTransactionSidePanel-D1EjZ31L.js} +1 -1
  99. package/dist/assets/{zeni-epic-state-BG_x9wwl.js → zeni-epic-state-CjQblqOQ.js} +3 -3
  100. package/dist/index.html +1 -1
  101. package/package.json +2 -2
  102. package/dist/assets/AddressRoutes-BA_Za0FR.js +0 -1
  103. package/dist/assets/AddressScreen-BrXKW3BZ.js +0 -9
  104. package/dist/assets/AiCfoScreen-C3s-4Li8.js +0 -22
  105. package/dist/assets/CardsAiCfoScreen-DCEvVdt-.js +0 -14
  106. package/dist/assets/ConnectionAuthScreen-BlDRBSBs.js +0 -11
  107. package/dist/assets/CustomerOnboardingAuthScreen-ClDUuER9.js +0 -1
  108. package/dist/assets/EntityDetailRoutes-DOcGH-23.js +0 -1
  109. package/dist/assets/HubSpotOAuthCallbackScreen-Bx79fA6b.js +0 -1
  110. package/dist/assets/MagicLinkRoutes-DvqPr1uQ.js +0 -72
  111. package/dist/assets/MagicLinkSignInScreen-YSubZawb.js +0 -12
  112. package/dist/assets/MobileAppDrawer-B8b7sXqB.js +0 -1
  113. package/dist/assets/NotFoundScreen-C5grvltN.js +0 -1
  114. package/dist/assets/NotificationRoutes-kB86UiyF.js +0 -1
  115. package/dist/assets/OAuthConsentScreen-DNPWtBCU.js +0 -1
  116. package/dist/assets/PerformanceRoutes-DR3r_m80.js +0 -1
  117. package/dist/assets/RewardsRoutes-kojWdGBy.js +0 -1
  118. package/dist/assets/SignInScreen-D-GiwcO7.js +0 -1
  119. package/dist/assets/SignOutScreen-KgU4ADq9.js +0 -9
  120. package/dist/assets/WiseConfirmationScreen-B8PpSiXI.js +0 -12
  121. package/dist/assets/useCashManagementBanner-D7ux4QIE.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-DmbDY3sa.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-Cj3sxYL7.js";import{Px as k,PE as W,gg as K,gf as M,ge as q,jp as J,MF as L,rp as Q,eW as V,P3 as D,jn as F,Py as S,PH as T,jl as j,jI as G}from"./zeni-epic-state-BG_x9wwl.js";import{bw as X,K as R,F as N,z as U,m as H,n as p,x as v,B as O,bx as Y,o as Z,by as ee,r as te}from"./index-C_Y0yMPY.js";import{n as z}from"./mui-1V4hRqCa.js";import"./sentry--Yi43Gx7.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]="b914f539-1a14-4276-b677-3517329f9c58",e._sentryDebugIdIdentifier="sentry-dbid-b914f539-1a14-4276-b677-3517329f9c58")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
1
+ import{j as l}from"./liveblocks-B6jAIe9x.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-CLKYLs-8.js";import{Px as k,PE as W,gf as K,ge as M,gd as q,jo as J,MF as L,ro as Q,eW as V,P3 as D,jm as F,Py as S,PH as T,jk as j,jH as G}from"./zeni-epic-state-CjQblqOQ.js";import{bw as X,K as R,F as N,z as U,m as H,n as p,x as v,B as O,bx as Y,o as Z,by as ee,r as te}from"./index-BeMQfmRp.js";import{n as z}from"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.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]="9ec5cafc-2f0d-467d-9b97-0097c6369357",e._sentryDebugIdIdentifier="sentry-dbid-9ec5cafc-2f0d-467d-9b97-0097c6369357")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-DmbDY3sa.js";import{h as w,g as C,j as h,n as P,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{e(j(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??A();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(T({data:i}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??A(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),d=e??s,{useFeatureGate:r}=N(),c=U.getSignedInUser(),b=h(u=>V(u)),g=H(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const A=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},$=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return $(e,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=z.div`
9
+ `,oe=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{e(j(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),r=s.poppedPathname??A();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(T({data:r}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??A(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:r}=B(),i=e??s,{useFeatureGate:c}=N(),d=U.getSignedInUser(),b=h(u=>V(u)),g=H(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,i)),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:i,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const A=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},$=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return $(e,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=z.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-DmbDY3sa.js";import{h as w,g as C,j as h,n as P,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${Z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,ie=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:i}=t,{tenantEmailDomain:d}=i;return{onFetchBankName:r=>{e(G(r))},onSaveHandler:r=>{e(j(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(T({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??E();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),c=r.poppedPathname??E(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:c}=N(),b=H(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${Z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
18
+ `,re=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:i}=r;return{onFetchBankName:c=>{e(G(c))},onSaveHandler:c=>{e(j(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:d}=c;e(T({data:d}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),d=c.poppedPathname??E();a(d,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const d=se(i,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(d,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),d=c.poppedPathname??E(0);t.navigate(d,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:r}=B(),i=e??s,c=U.getSignedInUser(),{useFeatureGate:d}=N(),b=H(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,i)),{isFeatureEnabled:I}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${Z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(_,{vendorId:i,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-DmbDY3sa.js";import{K as c,E as l,m as f}from"./index-C_Y0yMPY.js";import{D as b}from"./mui-1V4hRqCa.js";import"./sentry--Yi43Gx7.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]="b4f83c93-6b8c-4125-b836-c9db747f101c",e._sentryDebugIdIdentifier="sentry-dbid-b4f83c93-6b8c-4125-b836-c9db747f101c")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-B6jAIe9x.js";import{K as c,E as l,m as f}from"./index-BeMQfmRp.js";import{D as b}from"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.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]="b4f83c93-6b8c-4125-b836-c9db747f101c",e._sentryDebugIdIdentifier="sentry-dbid-b4f83c93-6b8c-4125-b836-c9db747f101c")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import{a as d}from"./sentry-95bdnR3R.js";import{h as A,u as B,g as G,i as q,j as c,N as F,n as M,o as O,p as W}from"./core-CLKYLs-8.js";import{NN as _,eW as J,N9 as R,lr as Y,JO as k,NS as $,ME as z,kr as V,JP as S,Ne as H,Nf as K,MG as L,MF as Q}from"./zeni-epic-state-CjQblqOQ.js";import{aS as U,c as X,n as Z,r as tt}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{d as b}from"./decodeURIComponentSafe-Bm32N7cj.js";import{w as et}from"./withTransactionSidePanel-D1EjZ31L.js";import{f as nt,c as at}from"./routePaths-2zRQFXqm.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";import"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import"./TransactionDetailScreen-9-dxedcB.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="d9ec955e-0efb-4d98-bd14-8fc04f4bd9df",n._sentryDebugIdIdentifier="sentry-dbid-d9ec955e-0efb-4d98-bd14-8fc04f4bd9df")}catch{}})();const ot=M(function(n,t){const e=t.entity,o=$(n,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(n,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(n)}},function(n,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${at(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?n(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&n(Q("common"))},onAutoCompleteEntity:e=>{const o=nt(e,t.tenantEmailDomain);n(H()),n(K()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&n(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};n(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),n(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:n,...t}){const e=A(),o=B(),l=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:N}=q(),r=b(x??""),f=b(N??""),p=rt(r,f),j=[r,f].filter(a=>a!=null),i={name:f,id:r,type:n,zeniId:r,qboId:r},g=c(a=>_(a.customerIncomeState,a.vendorExpenseState,a.trendState,i,"quarter")),v=c(a=>J(a).company?.companyInfo.firstMonthOfFY??1),u=c(a=>R(a.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(Y(i)))},[m,p,i]);const E=c(a=>a.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(a,y){return a!=null&&y!=null?{startDate:a.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})}),rt=(n,t)=>t!=null&&t.length>0&&n!=null&&n.length>0,I=(n=2)=>{let t="../";for(let e=0;e<n;e++)t=`${t}../`;return t};function xt({entityType:n}){return s.jsx(O,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:n})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,11 +1,11 @@
1
- import{j as h}from"./liveblocks-DmbDY3sa.js";import oa from"./NotFoundScreen-C5grvltN.js";import{a as o,b as Jt}from"./sentry--Yi43Gx7.js";import{n as Ue,S as sa}from"./mui-1V4hRqCa.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-Cj3sxYL7.js";import{eW as Re,Sz as la,of as Ee,fz as ra,s0 as da,ox as Kt,oS as Qt,SA as Wt,p0 as ua,SB as Zt,oq as ma,ry as pa,fj as Ie,SC as De,t_ as Ht,E7 as Xt,SD as en,SE as ha,r6 as Qe,NO as Pt,NQ as Sa,kv as ga,NR as Ca,kC as fa,c_ as Ia,va as We,oD as tn,p5 as Fe,ov as de,SF as Ea,MG as Rt,MF as we,SG as Dt,kT as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oK as Aa,p8 as xe,SL as wa,SM as xa,SN as Pa,pf as Ra,kG as Da,kx as Fa,SO as Ua,kF as Ft,NY as Ba,SP as _a,SQ as Va,r2 as Oa,qG as za,p6 as me,qF as Ne,SR as Ma,SS as ja,ST as La,ma as $a,bq as qa,m5 as Ut,lT as Ga,SU as Na,f9 as Bt,gw as Ja,m2 as Ya,x3 as Ka,SV as Qa,pG as Wa,pB as Za,pF as Ha,pq as Xa,SW as eo,fm as nn,oV as to,oG as no,fA as _t,pa as ao,SX as oo,SY as so,p7 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as Vt,re as uo,qx as mo,ME as po,T2 as ho,T3 as So,kE as go,T4 as Co,IP as fo,kD as Io,ks as Eo,fl as ko,q3 as on,qp as yo,p4 as Ot,p9 as bo,bE as To,l$ as vo,lY as Ao,T5 as wo,pp as zt,ql as Mt,qj as xo,T6 as Po,q8 as Ro,pQ as Do,qm as Fo,T7 as Uo,T8 as Bo,pU as _o,T9 as Vo,pL as Oo,pT as zo,pR as Mo,qs as jo}from"./zeni-epic-state-BG_x9wwl.js";import{F as sn,x as X,c as q,r as ae,X as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as Pe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Ko,d0 as Qo,W as Wo,d1 as Zo,d2 as Ho,w as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,E as ss,aQ as cs}from"./index-C_Y0yMPY.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-SbXBU7LB.js";import{w as us}from"./withTransactionSidePanel-8QHjmr16.js";import{h as ms,v as ps}from"./routePaths-D0rLO8yN.js";import{g as Ye}from"./accountMappingHelper-BwC4ZXQT.js";import{D as hs}from"./DrawerScreen-DAhJy05e.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./decodeURIComponentSafe-CyYkfiHv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="dd815045-0c72-40b4-b07c-d0f82761f6d2",t._sentryDebugIdIdentifier="sentry-dbid-dd815045-0c72-40b4-b07c-d0f82761f6d2")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
1
+ import{j as h}from"./liveblocks-B6jAIe9x.js";import oa from"./NotFoundScreen-DEN1HuyG.js";import{a as o,b as Jt}from"./sentry-95bdnR3R.js";import{n as Ue,S as sa}from"./mui-AZmtqUsi.js";import{u as pe,h as Yt,g as Ke,j as P,n as ca,i as Pt,o as ia,p as Ge}from"./core-CLKYLs-8.js";import{eW as Re,Sz as la,oe as Ee,fW as ra,r$ as da,ow as Kt,oR as Qt,SA as Wt,o$ as ua,SB as Zt,op as ma,rx as pa,fG as Ie,SC as De,tZ as Ht,E7 as Xt,SD as en,SE as ha,r5 as Qe,NO as xt,NQ as Sa,ku as ga,NR as Ca,kB as fa,c_ as Ia,v9 as We,oC as tn,p4 as Fe,ou as de,SF as Ea,MG as Rt,MF as we,SG as Dt,kS as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oJ as Aa,p7 as Pe,SL as wa,SM as Pa,SN as xa,pe as Ra,kF as Da,kw as Fa,SO as Ua,kE as Ft,NY as Ba,SP as _a,SQ as Oa,r1 as Va,qF as za,p5 as me,qE as Ne,SR as Ma,SS as ja,ST as La,m9 as $a,bq as qa,m4 as Ut,lS as Ga,SU as Na,fw as Bt,gv as Ja,m1 as Ya,x2 as Ka,SV as Qa,pF as Wa,pA as Za,pE as Ha,pp as Xa,SW as eo,fJ as nn,oU as to,oF as no,fX as _t,p9 as ao,SX as oo,SY as so,p6 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as Ot,rd as uo,qw as mo,ME as po,T2 as ho,T3 as So,kD as go,T4 as Co,IP as fo,kC as Io,kr as Eo,fI as ko,q2 as on,qo as yo,p3 as Vt,p8 as bo,bE as To,l_ as vo,lX as Ao,T5 as wo,po as zt,qk as Mt,qi as Po,T6 as xo,q7 as Ro,pP as Do,ql as Fo,T7 as Uo,T8 as Bo,pT as _o,T9 as Oo,pK as Vo,pS as zo,pQ as Mo,qr as jo}from"./zeni-epic-state-CjQblqOQ.js";import{F as sn,x as X,c as q,r as ae,X as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as xe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Ko,d0 as Qo,W as Wo,d1 as Zo,d2 as Ho,w as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,E as ss,aQ as cs}from"./index-BeMQfmRp.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-9-dxedcB.js";import{w as us}from"./withTransactionSidePanel-D1EjZ31L.js";import{h as ms,v as ps}from"./routePaths-2zRQFXqm.js";import{g as Ye}from"./accountMappingHelper-BSLlTYQH.js";import{D as hs}from"./DrawerScreen-CeOHT4ro.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";import"./decodeURIComponentSafe-Bm32N7cj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="5399ad0d-1030-452c-95b8-46a4c43a5d73",t._sentryDebugIdIdentifier="sentry-dbid-5399ad0d-1030-452c-95b8-46a4c43a5d73")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Ke(),f=P(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=P(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=P(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),x=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,Cs=Jt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:T})=>{const C=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,S=u[l],m=S?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{C(pa(e,n.split(".")[0]))},E=e=>{m!=null&&C(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},y=()=>{C(Wt({statementUploadChosen:!1}))},d=e=>{C(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{C(Zt({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback(()=>{C(Kt({accountId:l}))},[C,l]),z=o.useCallback(()=>{C(Qt({accountId:l}))},[C,l]),V=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return S!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:S,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:P,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:ee})})}):V!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:V,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
8
+ `,Cs=Jt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:T})=>{const C=pe(),r=Be.getSignedInUser(),I=P(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,S=u[l],m=S?.accountReconEntity.statementMetaData?.statementUploadId,x=(e,n)=>{C(pa(e,n.split(".")[0]))},E=e=>{m!=null&&C(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},y=()=>{C(Wt({statementUploadChosen:!1}))},d=e=>{C(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{C(Zt({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback(()=>{C(Kt({accountId:l}))},[C,l]),z=o.useCallback(()=>{C(Qt({accountId:l}))},[C,l]),O=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return S!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:S,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:x,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:ee})})}):O!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:O,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
@@ -18,7 +18,7 @@ import{j as h}from"./liveblocks-DmbDY3sa.js";import oa from"./NotFoundScreen-C5g
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const T=Be.getSignedInUser();if(T==null)throw Error("Can't access Customer Request page without signing in...");const C=x(r=>ha(r,t,T));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:C.fetchState==="In-Progress"||C.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:C.companyMonthEndReportTemplatesData,bulletPoints:C.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=No.getLocalizedStrings(),Nt=jo,ys=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:S}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:S,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:C,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:S,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),V=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,b,g)=>{t(Vt(e,n,{fetchState:"In-Progress"}));const A=()=>t(Vt(e,n,{fetchState:"Error"}));Qo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,c,i,b).then(_=>{_!=null?t(uo(e,_)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{V!=null&&z!=null&&t(an({start:z,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Vo(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(_o(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),V!=null&&z!=null&&t(me(c,{start:z,end:V},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(C))},onClose:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0})),v("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,g=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),_=Ye(G.accruedExpensesAccountList,b.selectedOptions),R={selectedPrepaidExpensesAccountIds:g.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:_.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:g,vendor:A}=n,{allAccountList:_,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(J=>J.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(J=>J.value===A?.selectedOption)?.label??"",logo:j?.logo},se=g?.selectedOption!=null?_.find(J=>J.qboId===g.selectedOption):void 0,_e=b?.selectedOption!=null?R.find(J=>J.classId===b.selectedOption):void 0,Ve=i?.selectedOption!=null?D.find(J=>J.qboId===i.selectedOption):void 0;t(Ha({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:_e?.classId,updatedAccumulatedDepreciationCategoryID:Ve?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Za(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Wa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Qa())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:S,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ja())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,g,A,_,R,D,j,oe,se)=>{t(La(e,n,c,i,k,b,g,A,_,R,D,j,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(me(e,{start:z,end:V},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:V},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),V!=null&&z!=null&&t(me(e,{start:z,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,g,A)=>{V!=null&&z!=null&&t(me(e,{start:z,end:V},!0,c,n,i,b,g,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,g,A,_)=>{t(za(e,n,c,i,_??null,b,g,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Oa(e,n,c,C))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Va({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&t(Ba({transactionId:_,customerUpdates:g})),t(_a({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&(t(Da({transactionId:_,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(Fa({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Ft({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:_.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ht("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Zt({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Wt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ta({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ba({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(ya({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Qe("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Qt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(de(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(C,r,I){return{...C,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,C.authParams)}}}(t,l,T)})(Jo(Yo)),bs=us(function(t){const l=t.displayName??t.name??"Component",B=Jt.memo(t),f=T=>{const C=pe(),r=function(){const P=pe(),E=x(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(y=>{P(De({selectedDrawerAccountId:y}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,E)=>{C(Ht("expense_automation_reconcile",P,E))},[C]),u=o.useCallback((P,E)=>{const y=s?.companyId;y!=null&&(C(Xt(P,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),C(en({accountId:E,connectionInProgress:!0})))},[C,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Cs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),S=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:S,[r.isOpen,r.closePanel,r.selectedAccountId,S]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...T,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:T,reconPanelContent:C,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Wo(),u=Zo(),{isOpen:k}=Ho(),v=Yt(),S=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{T===!0&&f!==!0&&t?.()},[t,T,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(N=>Ie(N)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,Z=Je($),Y=Je(L.fetchState),W=o.useCallback(N=>{const H=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,H??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,H??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,H??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,H??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),H??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,H??null)},[w,a]);return o.useEffect(()=>{Y===L.fetchState&&$===Z||L.fetchState!=="Completed"||W(!1)},[$,L.fetchState,Z]),W})(),ee=Xo(),[z,V]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[b,g]=o.useState(!1),[A,_]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[y,s,u,p]),_e=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),Ve=o.useCallback(()=>{u(),j(),y(),E()},[y,j,E,u]),J=o.useRef(s);o.useEffect(()=>{s===!0&&J.current===!1&&(u(),j(),y()),J.current=s},[y,j,s,u]);const Ze=o.useRef(k);o.useEffect(()=>{k===!0&&Ze.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),Ze.current=k},[j,t,k,s,p,f,T]);const ke=T===!0&&f!==!0,He=o.useRef(ke);o.useEffect(()=>{ke&&!He.current&&(s&&p(!1),u(),j()),He.current=ke},[j,s,ke,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:Sn}=xt(),[Oe,nt]=o.useState(S.state?.message==="comingFromTransactionDetail"),at=S.state?.message==="comingFromOverview",gn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Cn,useFeatureGate:ce}=sn(),{configValue:fn}=Cn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=ce(X.isJEScheduleCOTEnabled),yn=o.useCallback(a=>{const U=Qe(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),bn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:Tn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>So(a.classState)),{monthEndCloseChecksView:Q,currentSelectedView:F,selectedPeriod:O,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:Le,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const Z of Object.values($.transactionReviewLocalDataById)){const Y=Z?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const W of Object.values(Y)){const N=W?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const Z of w)for(const Y of Z.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&T!==!0||se(void 0)},[F,se,T]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Rn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,F==="transaction_categorization"&&j()):be.current=ye},[j,F,ye]);const Dn=x(a=>oe==null?void 0:go(a.transactionState,oe)),le=Dn?.qboId,mt=x(a=>le==null?void 0:Co(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:St}=M.transactionView,gt=o.useCallback(a=>rs(m,a),[m]),Ct=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:St,onClose:()=>D(null),onCreateTransfer:gt,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,St,gt]),Fn=Ct!=null,{selectedAccountId:Se}=xn,ft=Je(Le.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>Eo(a)),ge=tt!=null?ko(tt):F,_n=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(O),Ce=Fe(It.start),fe=Fe(It.end);if(Ce==null||fe==null)throw Error(`Invalid start - ${Ce} and end - ${fe} period from given ${O}`);const Vn=o.useCallback(()=>{i(!1)},[]),On=o.useCallback(()=>{g(!0)},[]),zn=o.useCallback(a=>{_(a),g(!1)},[]),Mn=o.useCallback(()=>{_([])},[]),Te=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&Te==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,F,Te,Et,m]);const kt=ze?.userId,jn=O.month,Ln=O.year,yt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&Te==="idle"&&kt!=null&&yt!=null&&m(yo())},[F,he,Te,kt,yt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?V(!0):V(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{ge!=null&&F!==ge&&m(nn(ge))},[ge]),o.useEffect(()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Ot(!1,!1,te)))},[Xe,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(Ot(!1,!1,te)),m(de(O,Se,!1,!1)))},[O.month,O.year,d,te]);const bt=o.useCallback((a=!1,U=!1)=>{const L={start:Ce,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!Oe,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(O,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(O.year,O.month,0),w=To($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(bo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(O,Se,a,U))}},[F,Ce,fe,n.companyId,n.tenantId,je,O,Se,Oe,nt,te]);o.useEffect(()=>{F===ge&&ie.fetchState==="Not-Started"&&d&&bt(!0)},[ie,Ce,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Oe||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!1}))},[Q.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,O,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Q.fetchState,n.tenantId,O,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&Se==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(O,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,Se,O]);const $n=Lt();o.useEffect(()=>{const a=(Q.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Q.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Q.monthEndCloseChecks]);const qn=r===!0?C:B,Gn=r===!0||T===!0,Nn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let Z,Y,W;const N=Lt(),H=a.transactionView;let vt=()=>{};const{transactions:Zn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Hn}=H;if(L==="transaction_categorization"){const $e=Hn.find(re=>re.transactionId===ue),K=Zn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,Z=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(W={id:ue,type:Qe(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=H.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(We({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x($e=>Pt($e,void 0,Z,Y));return{transactionId:W,onSaveVendor:()=>{w(fa(W,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{W!=null&&w(Sa({transactionId:W})),w(ga()),w(Ca()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{V(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Wn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return gn?.loggedInUserRoleMap==null?Q.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:b,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{g(!1)},children:h.jsx(Ts,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),Tt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}),h.jsx(ys,{...Wn,navigate:v,location:S,themeState:ee,categoryOptions:Tn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:_n,entityAutoCompleteView:bn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:Ct,onOpenTransferRightPanel:st===!0?_e:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:On,handleEditClick:Vn,tenantEmailDomain:Sn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:Ve,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:yn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),Ts=Ue(sa)`
21
+ `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const T=Be.getSignedInUser();if(T==null)throw Error("Can't access Customer Request page without signing in...");const C=P(r=>ha(r,t,T));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:C.fetchState==="In-Progress"||C.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:C.companyMonthEndReportTemplatesData,bulletPoints:C.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=No.getLocalizedStrings(),Nt=jo,ys=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:S}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:S,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:C,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:S,handleEditClick:m,setActivityLogTransactionId:x}=l,{selectedPeriod:E,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),O=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,b,g)=>{t(Ot(e,n,{fetchState:"In-Progress"}));const A=()=>t(Ot(e,n,{fetchState:"Error"}));Qo(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,c,i,b).then(_=>{_!=null?t(uo(e,_)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{O!=null&&z!=null&&t(an({start:z,end:O},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Vo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Oo(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(_o(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(xo())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(Po())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),O!=null&&z!=null&&t(me(c,{start:z,end:O},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(C))},onClose:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0})),v("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,g=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),_=Ye(G.accruedExpensesAccountList,b.selectedOptions),R={selectedPrepaidExpensesAccountIds:g.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:_.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:g,vendor:A}=n,{allAccountList:_,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(J=>J.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(J=>J.value===A?.selectedOption)?.label??"",logo:j?.logo},se=g?.selectedOption!=null?_.find(J=>J.qboId===g.selectedOption):void 0,_e=b?.selectedOption!=null?R.find(J=>J.classId===b.selectedOption):void 0,Oe=i?.selectedOption!=null?D.find(J=>J.qboId===i.selectedOption):void 0;t(Ha({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:_e?.classId,updatedAccumulatedDepreciationCategoryID:Oe?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Za(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Wa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Qa())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:S,setActivityLogTransactionId:x,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ja())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,g,A,_,R,D,j,oe,se)=>{t(La(e,n,c,i,k,b,g,A,_,R,D,j,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),O!=null&&z!=null&&(t(me(e,{start:z,end:O},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),O!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:O},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),O!=null&&z!=null&&t(me(e,{start:z,end:O},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,g,A)=>{O!=null&&z!=null&&t(me(e,{start:z,end:O},!0,c,n,i,b,g,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,g,A,_)=>{t(za(e,n,c,i,_??null,b,g,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Va(e,n,c,C))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Oa({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&t(Ba({transactionId:_,customerUpdates:g})),t(_a({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&(t(Da({transactionId:_,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(Fa({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Ft({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:_.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Pe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Pe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(xa(e))},updateOperatingExpensesIdsForReview:e=>{t(Pa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(Pe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ht("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Zt({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Wt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ta({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ba({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(ya({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Qe("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Qt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(de(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(C,r,I){return{...C,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,C.authParams)}}}(t,l,T)})(Jo(Yo)),bs=us(function(t){const l=t.displayName??t.name??"Component",B=Jt.memo(t),f=T=>{const C=pe(),r=function(){const x=pe(),E=P(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(y=>{x(De({selectedDrawerAccountId:y}))},[x]),closePanel:o.useCallback(()=>{x(De({selectedDrawerAccountId:void 0}))},[x])}}(),I=P(x=>Ie(x).reconciliation),s=P(x=>Re(x)),p=o.useCallback((x,E)=>{C(Ht("expense_automation_reconcile",x,E))},[C]),u=o.useCallback((x,E)=>{const y=s?.companyId;y!=null&&(C(Xt(x,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),C(en({accountId:E,connectionInProgress:!0})))},[C,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Cs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),S=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:S,[r.isOpen,r.closePanel,r.selectedAccountId,S]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...T,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:T,reconPanelContent:C,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Wo(),u=Zo(),{isOpen:k}=Ho(),v=Yt(),S=Ke(),m=pe(),{isAiCfoAccessEnabled:x,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{T===!0&&f!==!0&&t?.()},[t,T,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=P(N=>Ie(N)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,Z=Je($),Y=Je(L.fetchState),W=o.useCallback(N=>{const H=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,H??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,H??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,H??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,H??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),H??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,H??null)},[w,a]);return o.useEffect(()=>{Y===L.fetchState&&$===Z||L.fetchState!=="Completed"||W(!1)},[$,L.fetchState,Z]),W})(),ee=Xo(),[z,O]=o.useState(!1),e=P(a=>xt(a)),n=P(a=>Re(a)),[c,i]=o.useState(!1),[b,g]=o.useState(!1),[A,_]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[y,s,u,p]),_e=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),Oe=o.useCallback(()=>{u(),j(),y(),E()},[y,j,E,u]),J=o.useRef(s);o.useEffect(()=>{s===!0&&J.current===!1&&(u(),j(),y()),J.current=s},[y,j,s,u]);const Ze=o.useRef(k);o.useEffect(()=>{k===!0&&Ze.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),Ze.current=k},[j,t,k,s,p,f,T]);const ke=T===!0&&f!==!0,He=o.useRef(ke);o.useEffect(()=>{ke&&!He.current&&(s&&p(!1),u(),j()),He.current=ke},[j,s,ke,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=Pt(),{tenantEmailDomain:Sn}=Pt(),[Ve,nt]=o.useState(S.state?.message==="comingFromTransactionDetail"),at=S.state?.message==="comingFromOverview",gn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Cn,useFeatureGate:ce}=sn(),{configValue:fn}=Cn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=ce(X.isJEScheduleCOTEnabled),yn=o.useCallback(a=>{const U=Qe(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),bn=P(a=>po(a,"common")),M=P(a=>Ie(a)),{categoryOptions:Tn,paymentAccountNames:vn}=P(a=>ho(a.accountState)),An=P(a=>So(a.classState)),{monthEndCloseChecksView:Q,currentSelectedView:F,selectedPeriod:V,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:Le,reconciliation:Pn}=M;is(F==="transaction_categorization");const xn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=P(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=P(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(xn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const Z of Object.values($.transactionReviewLocalDataById)){const Y=Z?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const W of Object.values(Y)){const N=W?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const Z of w)for(const Y of Z.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&T!==!0||se(void 0)},[F,se,T]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Rn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,F==="transaction_categorization"&&j()):be.current=ye},[j,F,ye]);const Dn=P(a=>oe==null?void 0:go(a.transactionState,oe)),le=Dn?.qboId,mt=P(a=>le==null?void 0:Co(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:St}=M.transactionView,gt=o.useCallback(a=>rs(m,a),[m]),Ct=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:St,onClose:()=>D(null),onCreateTransfer:gt,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,St,gt]),Fn=Ct!=null,{selectedAccountId:Se}=Pn,ft=Je(Le.accountSettingsView.saveState.fetchState),Un=P(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=P(a=>Eo(a)),ge=tt!=null?ko(tt):F,_n=P(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(V),Ce=Fe(It.start),fe=Fe(It.end);if(Ce==null||fe==null)throw Error(`Invalid start - ${Ce} and end - ${fe} period from given ${V}`);const On=o.useCallback(()=>{i(!1)},[]),Vn=o.useCallback(()=>{g(!0)},[]),zn=o.useCallback(a=>{_(a),g(!1)},[]),Mn=o.useCallback(()=>{_([])},[]),Te=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&Te==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,F,Te,Et,m]);const kt=ze?.userId,jn=V.month,Ln=V.year,yt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&Te==="idle"&&kt!=null&&yt!=null&&m(yo())},[F,he,Te,kt,yt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?O(!0):O(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{ge!=null&&F!==ge&&m(nn(ge))},[ge]),o.useEffect(()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Vt(!1,!1,te)))},[Xe,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(Vt(!1,!1,te)),m(de(V,Se,!1,!1)))},[V.month,V.year,d,te]);const bt=o.useCallback((a=!1,U=!1)=>{const L={start:Ce,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!Ve,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(Pe(V,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(V.year,V.month,0),w=To($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(bo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(V,Se,a,U))}},[F,Ce,fe,n.companyId,n.tenantId,je,V,Se,Ve,nt,te]);o.useEffect(()=>{F===ge&&ie.fetchState==="Not-Started"&&d&&bt(!0)},[ie,Ce,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Ve||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!1}))},[Q.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,V,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Q.fetchState,n.tenantId,V,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&Se==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(V,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,Se,V]);const $n=Lt();o.useEffect(()=>{const a=(Q.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Q.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Q.monthEndCloseChecks]);const qn=r===!0?C:B,Gn=r===!0||T===!0,Nn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let Z,Y,W;const N=Lt(),H=a.transactionView;let vt=()=>{};const{transactions:Zn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Hn}=H;if(L==="transaction_categorization"){const $e=Hn.find(re=>re.transactionId===ue),K=Zn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,Z=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(W={id:ue,type:Qe(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=H.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(We({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=P($e=>xt($e,void 0,Z,Y));return{transactionId:W,onSaveVendor:()=>{w(fa(W,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{W!=null&&w(Sa({transactionId:W})),w(ga()),w(Ca()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{O(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Wn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return gn?.loggedInUserRoleMap==null?Q.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:b,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{g(!1)},children:h.jsx(Ts,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),Tt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}),h.jsx(ys,{...Wn,navigate:v,location:S,themeState:ee,categoryOptions:Tn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:_n,entityAutoCompleteView:bn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:Ct,onOpenTransferRightPanel:st===!0?_e:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:Vn,handleEditClick:On,tenantEmailDomain:Sn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:x,onAskAiCfoClick:Oe,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:yn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),Ts=Ue(sa)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DmbDY3sa.js";import{a as r}from"./sentry--Yi43Gx7.js";import{a3 as l,a4 as p,a5 as d,n as m}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import c from"./NotFoundScreen-C5grvltN.js";import{h as u,g as b}from"./core-Cj3sxYL7.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]="e5992879-11fa-4121-8a97-eb0ecebef062",e._sentryDebugIdIdentifier="sentry-dbid-e5992879-11fa-4121-8a97-eb0ecebef062")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:d(o),onDemoClick:t,onGoBack:i}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import{a as r}from"./sentry-95bdnR3R.js";import{a3 as l,a4 as p,a5 as d,n as m}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import c from"./NotFoundScreen-DEN1HuyG.js";import{h as u,g as b}from"./core-CLKYLs-8.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]="e5992879-11fa-4121-8a97-eb0ecebef062",e._sentryDebugIdIdentifier="sentry-dbid-e5992879-11fa-4121-8a97-eb0ecebef062")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:d(o),onDemoClick:t,onGoBack:i}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -0,0 +1 @@
1
+ import{a as r}from"./sentry-95bdnR3R.js";import{u as l,h as f,g as m}from"./core-CLKYLs-8.js";import{hn as p,LU as g,LV as _}from"./zeni-epic-state-CjQblqOQ.js";import{u as b,L as h,z as y}from"./index-BeMQfmRp.js";import"./liveblocks-B6jAIe9x.js";import"./recharts-CyaYjFwn.js";import"./mui-AZmtqUsi.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9021c12e-8f7e-4581-8b2d-7f221029bc2e",e._sentryDebugIdIdentifier="sentry-dbid-9021c12e-8f7e-4581-8b2d-7f221029bc2e")}catch{}})();function j(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
@@ -0,0 +1,72 @@
1
+ import{j as a}from"./liveblocks-B6jAIe9x.js";import{i as S,n as x,h as C,g as y,u as ee,t as ae,j as E,N as te,o as ne,p}from"./core-CLKYLs-8.js";import{LN as k,LO as v,LP as T,AZ as A,AL as G,LQ as L,LR as oe,LS as ie,AP as se,fx as $,AW as le,AT as re}from"./zeni-epic-state-CjQblqOQ.js";import{K as g,o as r,p as de,c as j,h as M,k as ce,n as me,q as pe,r as H,F as ue,x as he,v as xe,w as ge,m as fe,y as we,B as be,A as Se,M as ye,S as ke,C as ve,E as je,H as $e}from"./index-BeMQfmRp.js";import{n as m}from"./mui-AZmtqUsi.js";import f from"./NotFoundScreen-DEN1HuyG.js";import{a as I}from"./sentry-95bdnR3R.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="c98ac92f-1279-4fc7-91ea-ab921651bfa6",e._sentryDebugIdIdentifier="sentry-dbid-c98ac92f-1279-4fc7-91ea-ab921651bfa6")}catch{}})();const Ie=m.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
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=x(function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(A(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(T({data:l}))}}})(de);function F(){const e=g(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const Ae=m.div`
11
+ display: flex;
12
+ height: 100vh;
13
+ width: 100%;
14
+ flex: 1 1 auto;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ background-color: ${e=>e.theme.colors.grey4};
18
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Le=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:L(e),googleAPIKey:M.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,i=()=>{const l=me(o.state?.pathnameStackToGoBack),s=l.poppedPathname??De();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Pe(l);e(oe({addressToCreate:s})),i()},onCancel:()=>{i()}}})(ce);function Be({isSubPage:e}){const t=C(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx(Ae,{windowSize:o,children:a.jsx(Le,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:M.googleMapsAPIKey})})})}const De=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),ze=m.div`
20
+ display: flex;
21
+ height: 100%;
22
+ width: 100%;
23
+ flex: 1 1 auto;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ background-color: ${e=>e.theme.colors.grey4};
27
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Ne=x(function(e){const t=k(e),n=v(e),o=L(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),t=y(),n=g(),{vendorId:o,billId:i}=S();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(ze,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Te=x(function(e){const t=k(e),n=v(e),o=L(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(ie({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),t=y(),n=g(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Te,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Me={containerWidth:new je(100,58)},He=m(ke)`
38
+ width: ${r.sp4};
39
+ height: ${r.sp4};
40
+ margin-bottom: ${r.sp3};
41
+ margin-top: ${r.sp3};
42
+ margin-left: ${r.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,Ke=m.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,Ve=m.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Me.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
+ `,We=m.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,_e=x(function(e,t){return{file:t.file,type:t.type}})(ve);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=ae(),d=s.get("token"),K=n.pathname.includes("address"),w=g(),V=ge(),B=fe(),b=we(),W=()=>{V.toggle()},_=E(u=>k(u)),U=E(u=>v(u)),{authParams:O,fetchState:c,billAttachment:Q,billFetchState:D,companyName:R,currencySymbol:Z,amount:q}=_,{tenantId:P,userId:z,sessionId:N}=O,{fetchState:J,internationalBankAccountCreateStatus:X}=U;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&i!=null&&o!=null&&d!=null&&t(le(i,o,d))},[b,c,i,o,d,t]),I.useEffect(()=>{b&&c==="Completed"&&($(z,N,P),l!=null&&t(re(l)))},[c,b,z,N,P,l,t]),c==="Error"?a.jsx(f,{}):J==="Completed"||X.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&D==="Completed"&&a.jsx(Se,{analytics:j,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",i??"",R,l??"",Ue(n.pathname),Z,q))(u)}),a.jsxs(Ke,{windowSize:w,children:[w!=="small"?a.jsx(He,{onClick:W}):null,a.jsx(We,{windowSize:w,isAddressPage:K,children:D==="In-Progress"?a.jsx(ye,{size:"ExtraLarge",start:!0}):a.jsx(_e,{file:Q,type:"bill"})}),a.jsx(Ve,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Oe(){return a.jsx($e,{})}function da(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Oe,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Ge,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{da as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-B6jAIe9x.js";import{a as f}from"./sentry-95bdnR3R.js";import{u as U,g as _,h as w,t as M,j as l,N as x}from"./core-CLKYLs-8.js";import{z as r,m as P,D as V,d as A,c as N,e as W,Y,M as J,g as K}from"./index-BeMQfmRp.js";import{eW as R,Ly as $,LI as q,Lz as B,fx as G,f_ as H,LE as Q,gm as X,cY as Z,LJ as ee,LK as te}from"./zeni-epic-state-CjQblqOQ.js";import{n as ne}from"./mui-AZmtqUsi.js";import{u as se}from"./useDeviceId-B5LKCqFY.js";import{f as ae}from"./analyticsHelper-BYRUUvaV.js";import{t as ie}from"./getLocaleForTenant-CuwnZkK7.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="5de3b975-e9fe-4ded-8a70-56e6a4f0f500",t._sentryDebugIdIdentifier="sentry-dbid-5de3b975-e9fe-4ded-8a70-56e6a4f0f500")}catch{}})();const z=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function ze(){const t=U(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:T,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>R(e)),y=l(e=>$(e)),E=r.getSignedInUser(),L=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&z(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(q(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(y.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,L,void 0,y.tenantsInOrder),X().then(()=>{const e=K();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,b,s,o,y,L,a.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),F=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(Y,{phoneNumber:D,verifyOtpFetchState:T.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(x,{to:e,state:{...a.state,origin:""}})}if(!z(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(x,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(J,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{ze as default};
@@ -0,0 +1 @@
1
+ import{j as V}from"./liveblocks-B6jAIe9x.js";import{a as c}from"./sentry-95bdnR3R.js";import{u as pe,j as s,i as Ke,g as Qe,h as qe,l as G}from"./core-CLKYLs-8.js";import{eW as he,fC as Je,fD as Se,fo as Xe,bn as ea,eV as aa,fE as ta,fF as na,fH as sa,fK as oa,fT as ia,fL as g,fN as ra,fO as ue,fR as da,fP as la,fQ as ca,fS as ua,cO as fa,fV as ma,cT as ba,bt as pa,fn as ha,f_ as Sa,f$ as ga,fZ as Ea}from"./zeni-epic-state-CjQblqOQ.js";import{a7 as Ca,a8 as ka,w as ya,F as Ia,z as C,y as Ta,u as wa,x as r,a9 as Fa,aa as _a,j as Aa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ra,ae as fe,af as me,L as xa,ag as Ga,ah as be,c as M,$ as Ma,r as F,ai as N,aj as Na}from"./index-BeMQfmRp.js";import{D as Va}from"./mui-AZmtqUsi.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="9c708970-a0f2-4abb-9c2d-6d7c5a88814d",f._sentryDebugIdIdentifier="sentry-dbid-9c708970-a0f2-4abb-9c2d-6d7c5a88814d")}catch{}})();const Ua=Ca(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ke(),a=Qe(),k=ya(),o=qe(),U=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=C.getSignedInUser(),_=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,P=s(e=>aa(e)),j=P.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[A,L]=c.useState(void 0),D=G("/:tenantEmailDomain/dashboard")!==null,z=G("/:tenantEmailDomain/reports")!==null,I=G("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ce}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=Fa(n,Ce,Y),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=C.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:K}=i(r.isExpenseAutomationEnabledV2),Q=K||W&&_,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Re=n.company!=null&&ia(n.company),w=ve&&Re,xe=s(e=>g(e).totalUnreadCount),Ge=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{A!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:A},"comments")))},[A,B.fetchState]);const Ve={fetchStatus:Ge,count:xe},ne=t!=null?C.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ue=Aa(),oe=s(e=>la(e,S,h,K,W,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Pe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(Pe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,n),re=Da(),He=re&&va(a),de=ba(Ue?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,R=c.useCallback(()=>w&&de&&!C.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[Ye,ce]=c.useState(R);c.useEffect(()=>{ce(R())},[R]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,We=Ba(Ze);return V.jsx(Va,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Ra,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:We,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:ze,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:Q&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(a)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=F(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(M.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=F(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&M.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(xa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ga(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;M.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{C.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{k.toggle()},isAiCfo:He,aiCfoView:P,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Ae,newYearAnimationEnabled:De})})}),Ya=f=>{const d=pe(),t=s(k=>he(k)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ua,{...f,...a})};export{Ya as M};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-B6jAIe9x.js";import{h as n,n as e}from"./core-CLKYLs-8.js";import{R as i}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.js";import"./zeni-epic-state-CjQblqOQ.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="9ceba748-25d5-4d32-9a3c-da4194015415",o._sentryDebugIdIdentifier="sentry-dbid-9ceba748-25d5-4d32-9a3c-da4194015415")}catch{}})();const a=e(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
@@ -0,0 +1 @@
1
+ import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-B6jAIe9x.js";import lt from"./NotFoundScreen-DEN1HuyG.js";import{a as k}from"./sentry-95bdnR3R.js";import{h as ft,g as ut,i as ht,u as pt,j as g,n as kt,o as St,p as H}from"./core-CLKYLs-8.js";import{cv as gt,fE as K,eW as X,fS as bt,fL as b,Su as Q,fO as d,fD as y,sj as j,xF as It,Sv as Ct,fC as Tt,fV as yt,so as _t,Sw as F,bq as $,fw as B,ss as J,Sx as At,cH as Et,cA as xt}from"./zeni-epic-state-CjQblqOQ.js";import{X as Nt,z as wt,F as Bt,x as vt,_ as Dt,cU as Rt,r as x,a7 as Ut,cV as Gt,a8 as Pt,n as Ft}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="b1c6157f-5697-4620-8cbf-ac5f7108418e",t._sentryDebugIdIdentifier="sentry-dbid-b1c6157f-5697-4620-8cbf-ac5f7108418e")}catch{}})();const jt=(t,l)=>new Promise((n,u)=>{const S=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(S).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),Mt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:S}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,S,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:S,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:N,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=x(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=x(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(N(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=x(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(S)&&(r="not-found"),c[1].startsWith("bill")&&!xt(S)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=x(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(j("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(N(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),jt(s,N).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=x(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Ut(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:S}=Nt(),i=gt(u??""),s=pt(),h=wt.getSignedInUser(),[N,v]=k.useState(!1),a=g(e=>K(e)),o=g(e=>X(e)),{useFeatureGate:m}=Bt(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const M=g(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=g(e=>b(e).currentTab),D=g(e=>b(e).currentSubTab),Z=g(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=g(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=g(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=g(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:U,fetchMore:ot}=ct(),{threads:L,isLoading:W,fetchMore:q,isFetchingMore:z,hasFetchedAll:O}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=x(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{M!=="In-Progress"&&S&&s(j("task_manager","dashboard",["read","unread"]))},[S]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||U===!0||C!==!0||_||U===!0||C!==!0;k.useEffect(()=>{G&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&N===!1&&(v(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&w!=null&&L!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=L.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||O===!0||q==null||q(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,U,z,C,O,W,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),M!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(j("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(Mt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(St,{children:[E.jsx(H,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(H,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -0,0 +1 @@
1
+ import{j as m}from"./liveblocks-B6jAIe9x.js";import{a as r}from"./sentry-95bdnR3R.js";import{u as T,g as A,j as o,N as j}from"./core-CLKYLs-8.js";import{LX as C,eW as P,fK as x,LY as z,LZ as D,L_ as M,L$ as R,o4 as k,KU as N}from"./zeni-epic-state-CjQblqOQ.js";import{z as h,J as I}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="7f7f5cbf-877d-4dd0-91e4-6c23ec15fbf1",n._sentryDebugIdIdentifier="sentry-dbid-7f7f5cbf-877d-4dd0-91e4-6c23ec15fbf1")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-DmbDY3sa.js";import{h as z,u as J,g as X,i as Z,j as d,n as H,o as K,p as I}from"./core-Cj3sxYL7.js";import{eW as M,s8 as P,rI as Q,Ms as O,rD as S,bt as ee,bn as ae,bY as te,rE as se,Mt as oe,Mf as C,dJ as re,vD as ne,Mu as ce,v_ as ie,fe as le,fc as de}from"./zeni-epic-state-BG_x9wwl.js";import{z as fe,X as me,_ as pe,j as ue,F as U,x as $,A as he,c as w,ao as Fe,r as ge}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import be from"./NotFoundScreen-C5grvltN.js";import{F as Ie}from"./FeaturePreviewScreen-h089v0nG.js";import{a as F}from"./sentry--Yi43Gx7.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{u as Se}from"./useInitialThreadRequest-C_e7mvD1.js";import{t as Te}from"./routePaths-D0rLO8yN.js";import{M as ye}from"./MobileAppDrawer-B8b7sXqB.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="6d0f417f-1c09-4e36-bf56-f94b4a936fc7",s._sentryDebugIdIdentifier="sentry-dbid-6d0f417f-1c09-4e36-bf56-f94b4a936fc7")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=H(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(f,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(Fe);function v(){const s=z(),e=J(),a=X(),{forecastId:o,tenantEmailDomain:r}=Z(),[c,p]=F.useState(!1),[f,u]=F.useState(!1),h=fe.getSignedInUser(),y=d(t=>M(t)),_=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>x.pandLByForecastID[t]!=null&&se(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=me();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect(()=>{if(!c&&g)p(!0),l||e(Q());else if(l&&!f){u(!0);const t=((m,L,R)=>L!=null?m.forecasts.findIndex(b=>b.id===L):R!=null?m.forecasts.findIndex(b=>b.id===R):m.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(O(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&g&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,f,u,P,S,g]);const k=ue(),W=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:q}=U(),{isFeatureEnabled:j}=q($.isReportsCommentingEnabled),G=Se(j?y?.companyId:void 0,{clearParams:l&&f}),[V,Y]=F.useState(!1),E=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(xe,{firstMonthOfFY:_,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d(c=>M(c)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
1
+ import{j as n}from"./liveblocks-B6jAIe9x.js";import{h as z,u as Z,g as H,i as J,j as d,n as X,o as K,p as I}from"./core-CLKYLs-8.js";import{eW as M,s7 as P,rH as Q,Ms as O,rC as S,bt as ee,bn as ae,bY as te,rD as se,Mt as oe,Mf as C,dJ as re,vC as ne,Mu as ce,vZ as ie,fB as le,fz as de}from"./zeni-epic-state-CjQblqOQ.js";import{z as fe,X as me,_ as pe,j as ue,F as U,x as $,A as he,c as w,ao as Fe,r as ge}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import be from"./NotFoundScreen-DEN1HuyG.js";import{F as Ie}from"./FeaturePreviewScreen-429nxvjk.js";import{a as F}from"./sentry-95bdnR3R.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{u as Se}from"./useInitialThreadRequest-CrlDQYJc.js";import{t as Te}from"./routePaths-2zRQFXqm.js";import{M as ye}from"./MobileAppDrawer-Ck77XJrw.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="efbcd0ec-5d7f-4857-894a-e8a8a3779b2f",s._sentryDebugIdIdentifier="sentry-dbid-efbcd0ec-5d7f-4857-894a-e8a8a3779b2f")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=X(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(f,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(Fe);function v(){const s=z(),e=Z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=F.useState(!1),[f,u]=F.useState(!1),h=fe.getSignedInUser(),y=d(t=>M(t)),B=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>x.pandLByForecastID[t]!=null&&se(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=me();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect(()=>{if(!c&&g)p(!0),l||e(Q());else if(l&&!f){u(!0);const t=((m,L,R)=>L!=null?m.forecasts.findIndex(b=>b.id===L):R!=null?m.forecasts.findIndex(b=>b.id===R):m.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(O(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&g&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,f,u,P,S,g]);const k=ue(),W=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:q}=U(),{isFeatureEnabled:j}=q($.isReportsCommentingEnabled),G=Se(j?y?.companyId:void 0,{clearParams:l&&f}),[V,Y]=F.useState(!1),E=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(xe,{firstMonthOfFY:B,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:N,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d(c=>M(c)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -1,22 +1,22 @@
1
- import{j as s}from"./liveblocks-DmbDY3sa.js";import{Mo as te,eW as Q,ks as z,fe as J,fc as ne,JS as X,M2 as oe,uB as Ee,Mp as N,uq as ke,uK as Ie,uE as ie,uu as re,uI as Pe,uF as je,Mq as le,wp as Te,ga as Le,gd as ve,Mr as M,uy as de,ux as ce,uN as Fe,c7 as Ae}from"./zeni-epic-state-BG_x9wwl.js";import{K as pe,F as Y,x as E,z as G,a9 as ue,I as me,ak as ge,al as Re,E as he,o as R,N as fe,D as Ce,am as Oe,X as Ve,_ as Ue,A as Be,c as be,e as Ze,r as $e,an as Me,j as _e}from"./index-C_Y0yMPY.js";import{D as ye,n as H,S as Se}from"./mui-1V4hRqCa.js";import ae from"./NotFoundScreen-C5grvltN.js";import{a as r}from"./sentry--Yi43Gx7.js";import{u as ee,i as Ke,j as m,h as ze,g as Ge,n as He,o as se,p as $}from"./core-Cj3sxYL7.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{M as qe}from"./MobileAppDrawer-B8b7sXqB.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="bd7ba780-d4de-4021-935c-5e5a775028d2",a._sentryDebugIdIdentifier="sentry-dbid-bd7ba780-d4de-4021-935c-5e5a775028d2")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=Ke(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>z(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=J(k,u),L=ne(u),v=X(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?S(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Je,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Je=H(Se)`
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import{Mo as te,eW as Q,kr as G,fB as q,fz as ne,JS as X,M2 as oe,uA as Ee,Mp as N,up as ke,uJ as Ie,uD as ie,ut as re,uH as Pe,uE as je,Mq as le,wo as Te,fl as Le,gc as ve,Mr as M,ux as de,uw as ce,uM as Fe,c7 as Ae}from"./zeni-epic-state-CjQblqOQ.js";import{K as pe,F as Y,x as E,z as H,a9 as ue,I as me,ak as ge,al as Re,E as he,o as R,N as fe,D as Ce,am as Oe,X as Ve,_ as Ue,A as Be,c as be,e as Ze,r as $e,an as Me,j as _e}from"./index-BeMQfmRp.js";import{D as ye,n as W,S as we}from"./mui-AZmtqUsi.js";import ae from"./NotFoundScreen-DEN1HuyG.js";import{a as r}from"./sentry-95bdnR3R.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as We,o as se,p as $}from"./core-CLKYLs-8.js";import{u as Ke}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{M as Je}from"./MobileAppDrawer-Ck77XJrw.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="77ce3a50-c009-4aa1-8337-90f982b57020",a._sentryDebugIdIdentifier="sentry-dbid-77ce3a50-c009-4aa1-8337-90f982b57020")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>G(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),L=ne(u),v=X(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},qe=W(we)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,we=H(fe.H6Regular)`
5
+ `,Se=W(fe.H6Regular)`
6
6
  margin-top: ${R.sp7};
7
7
  padding-left: ${R.sp8};
8
8
  padding-right: ${R.sp8};
9
9
  color: ${a=>a.theme.colors.primary};
10
10
  word-break: break-word;
11
- `,De=H(fe.LargeRegularSp)`
11
+ `,De=W(fe.LargeRegularSp)`
12
12
  color: ${a=>a.theme.colors.hero};
13
13
  padding-left: ${R.sp8};
14
14
  padding-right: ${R.sp8};
15
15
  margin-bottom: 30px;
16
16
  margin-top: ${R.sp4};
17
17
  white-space: pre-line;
18
- `,Xe={overlayWidth:new he(100,100,48)},K=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,S]=r.useState(!1),w=m(i=>te(i)),d=m(i=>Q(i)),u=m(i=>z(i)),{useFeatureGate:D}=Y(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=J(f,d),P=ne(d),L=X(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{O===!0?S(!0):x()},F={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{w.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[w.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=H(Se)`
18
+ `,Xe={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>Q(i)),u=m(i=>G(i)),{useFeatureGate:D}=Y(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=q(f,d),P=ne(d),L=X(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:z.discardTitle}),descriptionComponent:s.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=W(we)`
19
19
  display: flex;
20
20
  min-height: 100%;
21
21
  flex-direction: column;
22
- `,aa=He(function(a,t){const l=le(a),n=G.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:z(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(M({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(M({searchText:o}))}}}})(Me);function q({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=Ge(),{areTenantIdsInSync:o}=Ve(),y=G.getSignedInUser(),h=m(e=>Q(e)),{useFeatureGate:p}=Y(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>z(e)),I=!J(O,h)&&V,S=X(h),w=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(M({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,w,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),L(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(M({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Be,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Ye,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(qe,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(M({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function Sa(){const a=_e();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(q,{})}),s.jsx($,{path:"new",element:s.jsx(q,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(q,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{Sa as default};
22
+ `,aa=We(function(a,t){const l=le(a),n=H.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(M({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(M({searchText:o}))}}}})(Me);function J({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=Ge(),n=ee(),g=He(),{areTenantIdsInSync:o}=Ve(),y=H.getSignedInUser(),h=m(e=>Q(e)),{useFeatureGate:p}=Y(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>G(e)),I=!q(O,h)&&V,w=X(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=Ke({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(M({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),L(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(M({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Be,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Ye,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Je,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,K)=>{n(M({sortKey:e,sortOrder:K}))},onRowClick:e=>{const K=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(K,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function wa(){const a=_e();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(J,{})}),s.jsx($,{path:"new",element:s.jsx(J,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(J,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};