@zeniai/web-app-ui 5.0.66-qa → 5.0.67-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/AddressRoutes-cN2hvu5k.js +1 -0
  2. package/dist/assets/{AddressScreen-BAjnEp-X.js → AddressScreen-Cdrj5W4-.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BHXlYJhk.js → AiCfoScreen-B-1grS8G.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-CzGAg-RT.js → BillPayApprovalRoutes-CYVk-fEO.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BrT44OKb.js → BillPayRoutes-DDC6qHPH.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DxAzWOOG.js → BusinessVerificationPageScreen-Cc1IIWeU.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-Bz9nItR4.js → ChargeCardRoutes-WudejbU5.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-QZ_mGMd4.js → CompanyPassportScreen-BKSfyJ-l.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CpuUuu-_.js → ConnectionAuthScreen-_imXUbd-.js} +2 -2
  10. package/dist/assets/CustomerOnboardingAuthScreen-CEMPHR45.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BfehFPND.js → CustomerOnboardingRoutes-F1vVB2Sv.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-eN0rJLLD.js → DashboardRoutes-BRu36Tfy.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-CcXzOxRp.js → DefaultTenantHome-DfbzoS5K.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BcnlrXA2.js → DomesticWireDetailScreen-ZGxx9s_z.js} +3 -3
  15. package/dist/assets/DrawerScreen-CNcA0NWW.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-BmYxwbUk.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes--daJtdEl.js → ExpenseAutomationRoutes-BlEicy7A.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-Ck2p6Gja.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-RaFYANW2.js → MagicLinkRoutes-DWwHzbiU.js} +1 -1
  20. package/dist/assets/MagicLinkSignInScreen-BSZMqjA8.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-DeylJyoS.js → MobileAppDrawer-DlNmDt_G.js} +1 -1
  22. package/dist/assets/NotFoundScreen-Bn00COMT.js +1 -0
  23. package/dist/assets/{NotificationRoutes-BRIAt45r.js → NotificationRoutes-DKQO1vhK.js} +1 -1
  24. package/dist/assets/{OAuthConsentScreen-SSJxi6bW.js → OAuthConsentScreen-DgYck1Vm.js} +1 -1
  25. package/dist/assets/PandLWithForecastRoutes-CBeCFkpZ.js +1 -0
  26. package/dist/assets/{PeopleRoutes-CdSAFFKy.js → PeopleRoutes-Bx6vvHyi.js} +1 -1
  27. package/dist/assets/PerformanceRoutes-Dzf_Gbv_.js +1 -0
  28. package/dist/assets/{Preview-BHNHm504.js → Preview-CX-Kq6YO.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CxOACLF0.js → QBOConnectionScreen-Ik56pHVf.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-C4TUE7u-.js → ReferralListScreen-CQbl2UNi.js} +2 -2
  31. package/dist/assets/ReimbursementApprovalRoutes-DODnS_H8.js +1 -0
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DHJfikzO.js → ReimbursementApprovalRuleDetailScreen-D47IilTw.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-CEvVhZii.js → ReimbursementRoutes-CPirKpDw.js} +4 -4
  34. package/dist/assets/{ReportsRoutes-BfvsU1EY.js → ReportsRoutes-Bt0cxiUC.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-Cio16rVo.js → RewardsRoutes-DPjrSm5w.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-Bdf3ftuj.js → ScreenRoutes-BzreoX2P.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-B0yuOT8Q.js → SettingsRoutes-BUAI7US9.js} +8 -8
  38. package/dist/assets/{SetupPagesScreen-Cescu0d2.js → SetupPagesScreen-CIwH3ZZF.js} +1 -1
  39. package/dist/assets/{SignInScreen-CsSIJ__Q.js → SignInScreen-Bt9puaku.js} +1 -1
  40. package/dist/assets/SignOutScreen-CM2ECVcQ.js +9 -0
  41. package/dist/assets/{TaskListScreen-CxNhJaSH.js → TaskListScreen-ByuOJ-7H.js} +2 -2
  42. package/dist/assets/{TaskRoutes-BSrgrKDO.js → TaskRoutes-QKzr6xVQ.js} +1 -1
  43. package/dist/assets/TransactionDetailRoutes-DMctD9qf.js +1 -0
  44. package/dist/assets/{TransactionDetailScreen-BS1m1uHz.js → TransactionDetailScreen-nBKG_H4f.js} +2 -2
  45. package/dist/assets/{TransactionListRoutes-Dt5XVEa1.js → TransactionListRoutes-BB1zFFVN.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-66dAv4dI.js → TreasuryRoutes-dG47aDHP.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-C_EbMO1S.js → VendorsRoutes-CvbRdyyA.js} +1 -1
  48. package/dist/assets/WiseConfirmationScreen-Df9zLzqA.js +12 -0
  49. package/dist/assets/{ZeniAccountRoutes-CTB93z0S.js → ZeniAccountRoutes-BhBRZUQz.js} +11 -11
  50. package/dist/assets/{ZeniAccountStatementScreen-DmzWGfwC.js → ZeniAccountStatementScreen-BbT_F5EY.js} +2 -2
  51. package/dist/assets/{accountMappingHelper-BHhQdza1.js → accountMappingHelper-l5KQkq0O.js} +1 -1
  52. package/dist/assets/{analytics-DQCQhWLc.js → analytics-DwbKC7qV.js} +1 -1
  53. package/dist/assets/{analyticsHelper-DUWn4fSe.js → analyticsHelper-tcwBG-lH.js} +1 -1
  54. package/dist/assets/{core-j0LqCeu3.js → core-DxYppZiZ.js} +1 -1
  55. package/dist/assets/{decodeURIComponentSafe-DFYfbcv3.js → decodeURIComponentSafe-B26owMY4.js} +1 -1
  56. package/dist/assets/{dnd-DAo38rm8.js → dnd-rWx_BA4U.js} +1 -1
  57. package/dist/assets/{index-4NAZbGj1.js → empty-DNik0LMv.js} +1 -1
  58. package/dist/assets/{empty-CK9odIeO.js → empty-DULS5Nrn.js} +1 -1
  59. package/dist/assets/{emptyVideoElement-C-uPKIxs.js → emptyVideoElement-mPx-9nkL.js} +1 -1
  60. package/dist/assets/{epic-DSNvXFJG.js → epic-S-I_KsoV.js} +1 -1
  61. package/dist/assets/{getLocaleForTenant-BLNl-Ho3.js → getLocaleForTenant-ClNmnFx1.js} +1 -1
  62. package/dist/assets/{index-cC6roLBs.js → index-BL-5UCyS.js} +1 -1
  63. package/dist/assets/{empty-Ca3lmO0X.js → index-Bwjy1Btm.js} +1 -1
  64. package/dist/assets/{index-71d39Q7D.js → index-C8TMxWTj.js} +2 -2
  65. package/dist/assets/{index-CZgerGBH.js → index-CVOKCo3k.js} +1 -1
  66. package/dist/assets/{index-CFtYCyfm.js → index-DPw038da.js} +7 -7
  67. package/dist/assets/index-DYHaARhd.js +2 -0
  68. package/dist/assets/{index-BX6ANtNh.js → index-GW-ogFZi.js} +1 -1
  69. package/dist/assets/index-dNGgc_CZ.js +1 -0
  70. package/dist/assets/{lexical-D-QBA09y.js → lexical-DPitEa2C.js} +1 -1
  71. package/dist/assets/{liveblocks-C3aHR2ug.js → liveblocks-BqO7Df-p.js} +1 -1
  72. package/dist/assets/{lottie-CAFVLjo0.js → lottie-B5P7nQ0g.js} +1 -1
  73. package/dist/assets/{mui-D78cc8iD.js → mui-DdrzQvkp.js} +1 -1
  74. package/dist/assets/{pathToGoBack-Dzva26FJ.js → pathToGoBack-D8OnmrBJ.js} +1 -1
  75. package/dist/assets/{pdf-C20YOa73.js → pdf-BeAAQRBu.js} +3 -3
  76. package/dist/assets/{pdf-lib-bl9YSMz9.js → pdf-lib-CHquFnr8.js} +1 -1
  77. package/dist/assets/{plaid-DsDYZOgp.js → plaid-DOFGuYBC.js} +1 -1
  78. package/dist/assets/{pusher-l3ERSdYl.js → pusher-BNXqMhSN.js} +1 -1
  79. package/dist/assets/{react-YfQWR1Yb.js → react--drtz5zi.js} +1 -1
  80. package/dist/assets/{react-oAtqdYpb.js → react-BaDxvM18.js} +1 -1
  81. package/dist/assets/{react-9NHYx8CN.js → react-BpFOakYv.js} +1 -1
  82. package/dist/assets/{react-DJWA5bIH.js → react-C840tf_D.js} +1 -1
  83. package/dist/assets/{react-Cf73dofS.js → react-CRUVsP_a.js} +1 -1
  84. package/dist/assets/{react-CslKeU46.js → react-CYhWGyVz.js} +1 -1
  85. package/dist/assets/{recharts-B0MOj05b.js → recharts-BucGjD65.js} +1 -1
  86. package/dist/assets/{routePaths-D7CLql-E.js → routePaths-CgcmkaKJ.js} +1 -1
  87. package/dist/assets/{sentry-cQZrhfVh.js → sentry-DS2EspaF.js} +1 -1
  88. package/dist/assets/{url-Oh4YprMm.js → url--J2koNP1.js} +1 -1
  89. package/dist/assets/url-C9We36rv.js +1 -0
  90. package/dist/assets/useAskAiCfoHostNavButtonProps-DpRKl1_2.js +1 -0
  91. package/dist/assets/{useDeviceId-CE3ipTvl.js → useDeviceId-CsxMPdAN.js} +1 -1
  92. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js → useFetchSuggestedQuestionsWhenReady-k6PyaabR.js} +1 -1
  93. package/dist/assets/useInitialThreadRequest-Wi13xyTC.js +1 -0
  94. package/dist/assets/{utils-BBuNXoTI.js → utils-B6prU8As.js} +1 -1
  95. package/dist/assets/{withTransactionSidePanel-BbFtF7db.js → withTransactionSidePanel-jaVwinxd.js} +1 -1
  96. package/dist/assets/{zeni-epic-state-DiQZjsue.js → zeni-epic-state-CXLj5Oko.js} +6 -6
  97. package/dist/index.html +1 -1
  98. package/package.json +2 -2
  99. package/dist/assets/AddressRoutes-ZBiq4EJc.js +0 -1
  100. package/dist/assets/CustomerOnboardingAuthScreen-CfmQ932p.js +0 -1
  101. package/dist/assets/DrawerScreen-I-2xB5eA.js +0 -1
  102. package/dist/assets/EntityDetailRoutes-BhPGNOQf.js +0 -1
  103. package/dist/assets/FeaturePreviewScreen-BD0F_lti.js +0 -1
  104. package/dist/assets/MagicLinkSignInScreen-B-f7LLOR.js +0 -12
  105. package/dist/assets/NotFoundScreen-BeCKiN3K.js +0 -1
  106. package/dist/assets/PandLWithForecastRoutes-D5ZL-4Av.js +0 -1
  107. package/dist/assets/PerformanceRoutes-CH31J9F9.js +0 -1
  108. package/dist/assets/ReimbursementApprovalRoutes-BsXJVvJR.js +0 -1
  109. package/dist/assets/SignOutScreen-B9jFNEAZ.js +0 -9
  110. package/dist/assets/TransactionDetailRoutes-Cd8hk8fd.js +0 -1
  111. package/dist/assets/WiseConfirmationScreen-B1r4FA9z.js +0 -12
  112. package/dist/assets/index-B2tWZgTJ.js +0 -1
  113. package/dist/assets/url-BbfnqyeH.js +0 -1
  114. package/dist/assets/useAskAiCfoHostNavButtonProps-CLV01Vra.js +0 -1
  115. package/dist/assets/useInitialThreadRequest-kL3BFKKo.js +0 -1
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfVh.js";import{h as y,g as b,k as A,u as w,N as k}from"./core-j0LqCeu3.js";import{Iy as N,eO as _,fj as U,Iz as z,mm as L,IA as R}from"./zeni-epic-state-DiQZjsue.js";import{u as O,z as f,L as T,t as S,D as j,b as $}from"./index-CFtYCyfm.js";import"./mui-D78cc8iD.js";import{t as P}from"./getLocaleForTenant-BLNl-Ho3.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="61888d11-6de4-4a15-ad45-2220c3e1aa4f",t._sentryDebugIdIdentifier="sentry-dbid-61888d11-6de4-4a15-ad45-2220c3e1aa4f")}catch{}})();const Q=A(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:R(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!z(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-BqO7Df-p.js";import{a as u}from"./sentry-DS2EspaF.js";import{h as y,g as b,k as A,u as w,N as k}from"./core-DxYppZiZ.js";import{Iy as N,eO as _,fj as U,Iz as z,mm as L,IA as R}from"./zeni-epic-state-CXLj5Oko.js";import{u as O,z as f,L as T,t as S,D as j,b as $}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import{t as P}from"./getLocaleForTenant-ClNmnFx1.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="7c1b996e-f0e3-428e-a01b-680e39933f04",t._sentryDebugIdIdentifier="sentry-dbid-7c1b996e-f0e3-428e-a01b-680e39933f04")}catch{}})();const Q=A(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:R(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!z(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-C3aHR2ug.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-j0LqCeu3.js";import{Mz as k,MG as _,fA as J,fz as q,fy as W,io as K,JH as L,pw as Q,eO as V,M5 as D,il as T,MA as S,MJ as F,ij as G,iH as j}from"./zeni-epic-state-DiQZjsue.js";import{bo as X,Z as R,C as N,z as U,m as z,p,$ as v,B as H,bp as Y,d as M,bq as ee,s as te}from"./index-CFtYCyfm.js";import{n as O}from"./mui-D78cc8iD.js";import"./sentry-cQZrhfVh.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]="cc210175-2afb-4b8e-9fdc-0e96529bd92d",e._sentryDebugIdIdentifier="sentry-dbid-cc210175-2afb-4b8e-9fdc-0e96529bd92d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(K(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(W(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
1
+ import{j as l}from"./liveblocks-BqO7Df-p.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DxYppZiZ.js";import{Mz as k,MG as _,fA as J,fz as q,fy as W,io as K,JH as L,pw as Q,eO as V,M5 as D,il as T,MA as S,MJ as F,ij as G,iH as j}from"./zeni-epic-state-CXLj5Oko.js";import{bo as X,Z as R,C as N,z as U,m as z,p,$ as v,B as H,bp as Y,d as M,bq as ee,s as te}from"./index-DPw038da.js";import{n as O}from"./mui-DdrzQvkp.js";import"./sentry-DS2EspaF.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]="3f6bb051-4771-41f5-932a-9716dc17ff2d",e._sentryDebugIdIdentifier="sentry-dbid-3f6bb051-4771-41f5-932a-9716dc17ff2d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(K(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(W(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-C3aHR2ug.js";import{j as w,u as C,g as h,k as A,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=A(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(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??E();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??E(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=B(),i=e??s,{useFeatureGate:c}=N(),r=U.getSignedInUser(),b=h(u=>V(u)),g=z(),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(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(Z,{vendorId:i,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(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=O.div`
9
+ `,oe=A(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(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??E();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??E(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=B(),c=e??s,{useFeatureGate:r}=N(),i=U.getSignedInUser(),b=h(u=>V(u)),g=z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(Z,{vendorId:c,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(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=O.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-C3aHR2ug.js";import{j as w,u as C,g as h,k as A,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${M.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,de=A(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:d}=t,{tenantEmailDomain:i}=d;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(G(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:r}=c;e(F({data:r}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),r=c.poppedPathname??P();a(r,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const r=se(i,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(r,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),r=c.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=B(),i=e??s,c=U.getSignedInUser(),{useFeatureGate:r}=N(),b=z(),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}=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(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${M.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(Z,{vendorId:i,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,Z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
18
+ `,de=A(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:d}=t,{tenantEmailDomain:c}=d;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??P();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=B(),c=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=N(),b=z(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=i(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(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(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${M.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(Z,{vendorId:c,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,Z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-BqO7Df-p.js";import{Z as c,A as l,m as f}from"./index-DPw038da.js";import{D as p}from"./mui-DdrzQvkp.js";import"./sentry-DS2EspaF.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]="6c7fcb16-2846-45a2-9de2-7f28416bec9e",e._sentryDebugIdIdentifier="sentry-dbid-6c7fcb16-2846-45a2-9de2-7f28416bec9e")}catch{}})();const b={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)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{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-BqO7Df-p.js";import{a as d}from"./sentry-DS2EspaF.js";import{j as A,h as B,u as O,l as q,g as l,N as K,k as F,n as J,o as N}from"./core-DxYppZiZ.js";import{KO as _,eO as M,Kb as R,kr as W,GO as I,KT as Y,JG as $,jr as z,GP as S,Kg as H,Kh as V,JI as L,JH as Q}from"./zeni-epic-state-CXLj5Oko.js";import{aO as U,c as X,p as Z,s as tt}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import{d as k}from"./decodeURIComponentSafe-B26owMY4.js";import{w as et}from"./withTransactionSidePanel-jaVwinxd.js";import{e as at,b as nt}from"./routePaths-CgcmkaKJ.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import"./TransactionDetailScreen-nBKG_H4f.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]="112dda24-24ff-4376-91d5-cabc75842ef4",a._sentryDebugIdIdentifier="sentry-dbid-112dda24-24ff-4376-91d5-cabc75842ef4")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(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};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=O(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=q(),r=k(j??""),p=k(x??""),f=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>M(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(W(i)))},[m,f,i]);const P=l(n=>n.trendState.fetchState),E=u?.selectedPeriod?.timePeriod??D,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(g(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(K,{to:b(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(J,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,11 +1,11 @@
1
- import{j as C}from"./liveblocks-C3aHR2ug.js";import wn from"./NotFoundScreen-BeCKiN3K.js";import{a as o,b as Tt}from"./sentry-cQZrhfVh.js";import{n as De,S as xn}from"./mui-D78cc8iD.js";import{h as se,j as wt,u as qe,g as F,k as Rn,l as rt,n as Dn,o as je}from"./core-j0LqCeu3.js";import{eO as we,P5 as Un,mw as Ce,fe as Fn,q7 as Bn,mO as xt,n7 as Rt,P6 as Dt,nh as _n,P7 as Ut,mH as Vn,pF as Mn,eZ as he,P8 as xe,s6 as Ft,Bh as Bt,P9 as _t,Pa as On,pk as Ge,KP as dt,KR as jn,ju as zn,KS as Ln,jB as $n,cV as qn,t9 as Je,jr as Gn,mU as Vt,nm as Re,Pb as Jn,JI as ut,JH as be,Pc as mt,jS as Nn,Pd as Kn,Pe as Yn,Pf as Hn,Pg as Zn,m$ as Qn,mM as ce,np as Ae,Ph as Wn,Pi as Xn,Pj as ea,nw as ta,jF as na,jw as aa,Pk as oa,jE as ht,KZ as sa,Pl as ca,Pm as ia,pg as la,oX as ra,nn as pe,oW as ze,Pn as da,Po as ua,l9 as ma,bq as ha,l4 as pt,kS as pa,Pp as ga,gD as gt,fQ as Ca,l1 as Sa,v2 as Ia,Pq as fa,nX as ka,nS as Ea,nW as va,nH as ya,Pr as Pa,f0 as Mt,na as ba,mX as Aa,ff as Ct,nr as Ta,Ps as wa,no as Ot,Pt as xa,Pu as Ra,Pv as Da,Pw as Ua,Px as St,ps as Fa,oN as Ba,JG as _a,jD as Va,Py as Ma,FP as Oa,jC as ja,e$ as za,om as jt,oF as La,nl as It,nq as $a,bD as qa,k_ as Ga,kX as Ja,Pz as Na,nG as ft,oD as kt,oB as Ka,or as Ya,o6 as Ha,oE as Za,PA as Qa,PB as Wa,oa as Xa,PC as eo,o0 as to,o9 as no,o7 as ao,oI as oo}from"./zeni-epic-state-DiQZjsue.js";import{C as zt,$ as ge,c as z,s as Q,O as Lt,cx as so,z as Ue,cy as co,aq as Te,cz as io,aQ as Et,B as $t,cA as lo,an as Le,D as ro,cB as uo,U as mo,cC as ho,N as po,cD as go,cE as Co,H as So,I as Io,aK as fo,b2 as ko,A as Eo,cF as vo}from"./index-CFtYCyfm.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{c as vt,C as yo}from"./TransactionDetailScreen-BS1m1uHz.js";import{w as Po}from"./withTransactionSidePanel-BbFtF7db.js";import{h as bo,v as Ao}from"./routePaths-D7CLql-E.js";import{g as $e}from"./accountMappingHelper-BHhQdza1.js";import{D as To}from"./DrawerScreen-I-2xB5eA.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./decodeURIComponentSafe-DFYfbcv3.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]="b356b9fc-0235-4563-a055-caae9420e28a",t._sentryDebugIdIdentifier="sentry-dbid-b356b9fc-0235-4563-a055-caae9420e28a")}catch{}})();const wo=()=>{const t=se(),l=wt(),A=qe(),f=F(d=>we(d)),{useFeatureGate:P}=zt(),{isFeatureEnabled:S}=P(ge.isRealtimeInsightsFeatureEnabled),s=F(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),i=F(d=>Un(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=qt({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,w,Z=!1)=>{t(Ce({tenantId:w,period:{month:d.month,year:d.year},refreshViewInBackground:Z}))},[]),v=o.useCallback(d=>{const w=A.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,w??null),t(Fn(f.tenantId,d))},[f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),h=s[f.tenantId],B=o.useCallback(()=>{const d=A.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(h.month,h.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(h,f.tenantId,!0)},[E,h,f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),u=Q(A.state?.pathnameStackToGoBack,A.pathname),g=o.useCallback(()=>{if(i.monthEndCloseChecks!=null&&h!=null){const d=i.monthEndCloseChecks.monthEndCloseCheckList.find(w=>w.progress<100);if(d!=null)return void l(`./${d.id}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}});l(`./month_end_insights/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}})}},[i.monthEndCloseChecks,h]),{areTenantIdsInSync:T}=Lt();return Gt({isDataReady:i.fetchState==="Completed"}),o.useEffect(()=>{h!=null&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&T&&E(h,f.tenantId)},[E,h,i.fetchState,f.tenantId,T]),o.useEffect(()=>{h!=null&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(Bn(h))},[h,i.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{i.fetchState!=="In-Progress"&&i.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[i.fetchState]),o.useEffect(()=>{if(i.fetchState==="Completed"&&i.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;z.trackMonthCloseAuditPage(i.selectedPeriod.month,i.selectedPeriod.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[i.fetchState,i.selectedPeriod,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(xo,{children:C.jsx(so,{monthEndCloseChecksView:i,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:g,onBackClick:()=>{l("../../dashboard")},onReload:B,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})})},xo=De.div`
1
+ import{j as C}from"./liveblocks-BqO7Df-p.js";import wn from"./NotFoundScreen-Bn00COMT.js";import{a as o,b as Tt}from"./sentry-DS2EspaF.js";import{n as De,S as xn}from"./mui-DdrzQvkp.js";import{h as se,j as wt,u as qe,g as F,k as Rn,l as rt,n as Dn,o as je}from"./core-DxYppZiZ.js";import{eO as we,P5 as Un,mw as Ce,fe as Fn,q7 as Bn,mO as xt,n7 as Rt,P6 as Dt,nh as _n,P7 as Ut,mH as Vn,pF as Mn,eZ as he,P8 as xe,s6 as Ft,Bh as Bt,P9 as _t,Pa as On,pk as Ge,KP as dt,KR as jn,ju as zn,KS as Ln,jB as $n,cV as qn,t9 as Je,jr as Gn,mU as Vt,nm as Re,Pb as Jn,JI as ut,JH as be,Pc as mt,jS as Nn,Pd as Kn,Pe as Yn,Pf as Hn,Pg as Xn,m$ as Qn,mM as ce,np as Ae,Ph as Wn,Pi as Zn,Pj as ea,nw as ta,jF as na,jw as aa,Pk as oa,jE as ht,KZ as sa,Pl as ca,Pm as ia,pg as la,oX as ra,nn as pe,oW as ze,Pn as da,Po as ua,l9 as ma,bq as ha,l4 as pt,kS as pa,Pp as ga,gD as gt,fQ as Ca,l1 as Sa,v2 as Ia,Pq as fa,nX as ka,nS as Ea,nW as va,nH as ya,Pr as Pa,f0 as Mt,na as ba,mX as Aa,ff as Ct,nr as Ta,Ps as wa,no as Ot,Pt as xa,Pu as Ra,Pv as Da,Pw as Ua,Px as St,ps as Fa,oN as Ba,JG as _a,jD as Va,Py as Ma,FP as Oa,jC as ja,e$ as za,om as jt,oF as La,nl as It,nq as $a,bD as qa,k_ as Ga,kX as Ja,Pz as Na,nG as ft,oD as kt,oB as Ka,or as Ya,o6 as Ha,oE as Xa,PA as Qa,PB as Wa,oa as Za,PC as eo,o0 as to,o9 as no,o7 as ao,oI as oo}from"./zeni-epic-state-CXLj5Oko.js";import{C as zt,$ as ge,c as z,s as Q,U as Lt,cx as so,z as Ue,cy as co,aq as Te,cz as io,aQ as Et,B as $t,cA as lo,an as Le,D as ro,cB as uo,X as mo,cC as ho,R as po,cD as go,cE as Co,H as So,I as Io,aK as fo,b2 as ko,A as Eo,cF as vo}from"./index-DPw038da.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{c as vt,C as yo}from"./TransactionDetailScreen-nBKG_H4f.js";import{w as Po}from"./withTransactionSidePanel-jaVwinxd.js";import{h as bo,v as Ao}from"./routePaths-CgcmkaKJ.js";import{g as $e}from"./accountMappingHelper-l5KQkq0O.js";import{D as To}from"./DrawerScreen-CNcA0NWW.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./decodeURIComponentSafe-B26owMY4.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]="22934d0a-433f-46ea-8bed-effca05b1d22",t._sentryDebugIdIdentifier="sentry-dbid-22934d0a-433f-46ea-8bed-effca05b1d22")}catch{}})();const wo=()=>{const t=se(),l=wt(),A=qe(),f=F(d=>we(d)),{useFeatureGate:P}=zt(),{isFeatureEnabled:S}=P(ge.isRealtimeInsightsFeatureEnabled),s=F(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),i=F(d=>Un(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=qt({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,w,X=!1)=>{t(Ce({tenantId:w,period:{month:d.month,year:d.year},refreshViewInBackground:X}))},[]),v=o.useCallback(d=>{const w=A.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,w??null),t(Fn(f.tenantId,d))},[f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),h=s[f.tenantId],B=o.useCallback(()=>{const d=A.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(h.month,h.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(h,f.tenantId,!0)},[E,h,f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),u=Q(A.state?.pathnameStackToGoBack,A.pathname),g=o.useCallback(()=>{if(i.monthEndCloseChecks!=null&&h!=null){const d=i.monthEndCloseChecks.monthEndCloseCheckList.find(w=>w.progress<100);if(d!=null)return void l(`./${d.id}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}});l(`./month_end_insights/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}})}},[i.monthEndCloseChecks,h]),{areTenantIdsInSync:T}=Lt();return Gt({isDataReady:i.fetchState==="Completed"}),o.useEffect(()=>{h!=null&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&T&&E(h,f.tenantId)},[E,h,i.fetchState,f.tenantId,T]),o.useEffect(()=>{h!=null&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(Bn(h))},[h,i.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{i.fetchState!=="In-Progress"&&i.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[i.fetchState]),o.useEffect(()=>{if(i.fetchState==="Completed"&&i.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;z.trackMonthCloseAuditPage(i.selectedPeriod.month,i.selectedPeriod.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[i.fetchState,i.selectedPeriod,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(xo,{children:C.jsx(so,{monthEndCloseChecksView:i,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:g,onBackClick:()=>{l("../../dashboard")},onReload:B,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})})},xo=De.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
- `,Ro=Tt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:P})=>{const S=se(),s=Ue.getSignedInUser(),i=F(n=>we(n)),p=t.excludedAccountIDs,m=o.useMemo(()=>({userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i?.tenantId??""}),[s?.userId,s?.zeniSessionId,i?.tenantId]),{accountReconciliationsByAccountID:E,monthYearPeriod:v,statementUploadChosen:h}=t,B=E[l],u=B?.accountReconEntity.statementMetaData?.statementUploadId,g=(n,a)=>{S(Mn(n,a.split(".")[0]))},T=n=>{u!=null&&S(Vn({accountId:l,selectedPeriod:v,fileId:n,statementUploadId:u}))},d=()=>{S(Dt({statementUploadChosen:!1}))},w=n=>{S(_n({accountId:l,selectedPeriod:v,payload:n}))},Z=n=>{S(Ut({accountId:l,selectedPeriod:v,localData:{accountSource:n}}))},M=o.useCallback(()=>{S(xt({accountId:l}))},[S,l]),V=o.useCallback(()=>{S(Rt({accountId:l}))},[S,l]),e=p.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(co,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:v,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:P,onEditFileName:g,onDeleteFile:T,onSelectSourceType:Z,filesEndPoint:Te.fileMicroServiceBaseUrl,authParams:m,openFilePicker:h,onStatementUploadSuccess:w,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:M})})}):e!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(io,{excludedAccountReconciliation:e,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:V})})}):null}),yt=De.div`
8
+ `,Ro=Tt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:P})=>{const S=se(),s=Ue.getSignedInUser(),i=F(n=>we(n)),p=t.excludedAccountIDs,m=o.useMemo(()=>({userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i?.tenantId??""}),[s?.userId,s?.zeniSessionId,i?.tenantId]),{accountReconciliationsByAccountID:E,monthYearPeriod:v,statementUploadChosen:h}=t,B=E[l],u=B?.accountReconEntity.statementMetaData?.statementUploadId,g=(n,a)=>{S(Mn(n,a.split(".")[0]))},T=n=>{u!=null&&S(Vn({accountId:l,selectedPeriod:v,fileId:n,statementUploadId:u}))},d=()=>{S(Dt({statementUploadChosen:!1}))},w=n=>{S(_n({accountId:l,selectedPeriod:v,payload:n}))},X=n=>{S(Ut({accountId:l,selectedPeriod:v,localData:{accountSource:n}}))},M=o.useCallback(()=>{S(xt({accountId:l}))},[S,l]),V=o.useCallback(()=>{S(Rt({accountId:l}))},[S,l]),e=p.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(co,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:v,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:P,onEditFileName:g,onDeleteFile:T,onSelectSourceType:X,filesEndPoint:Te.fileMicroServiceBaseUrl,authParams:m,openFilePicker:h,onStatementUploadSuccess:w,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:M})})}):e!=null?C.jsx(yt,{children:C.jsx(Pt,{children:C.jsx(io,{excludedAccountReconciliation:e,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:V})})}):null}),yt=De.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
@@ -18,7 +18,7 @@ import{j as C}from"./liveblocks-C3aHR2ug.js";import wn from"./NotFoundScreen-BeC
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function Do({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:A,resetCustomerRequest:f}){const P=Ue.getSignedInUser();if(P==null)throw Error("Can't access Customer Request page without signing in...");const S=F(s=>On(s,t,P));return o.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(lo,{onCloseClick:l,addCustomerRequest:A,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Uo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Fo,comma:bt,space:Bo}},dateFormat:Jt}=ro.getLocalizedStrings(),At=oo,_o=Rn(function(t,l){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:P,monthEndInsightsPreviewMode:S,companyId:s,isMissingReceiptsBulkUploadEnabled:i,isTransactionActivityEnabled:p}=l,m=Ue.getSignedInUser(),E=t.tenantState.currentTenantId,v={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:E??""},h=he(t),{selectedTransactionCategorizationTab:B}=h;return{expenseAutomationViewSelector:h,bulkUploadSelector:i===!0?h.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:v,receiptUploadEndpoint:`${Te.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${mo}/transaction_attachments`,bulkUploadEndpoint:i===!0?`${Te.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:P,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:m,uncategorizedAccounts:A,companyId:s,isTransactionActivityEnabled:p,isAccountingClassesEnabled:Gn(t)}},function(t,l){const{themeState:A,isCOTEnabled:f,isUncategorizedExpenseCategoryEnabled:P,isMissingReceiptsBulkUploadEnabled:S,location:s,vendorSearchAutoCompleteData:i,expenseAutomationViewSelector:p,currentTenant:m,uncategorizedAccounts:E,navigate:v,onClickCustomerRequest:h,handleEditClick:B,setActivityLogTransactionId:u}=l,{selectedPeriod:g,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:w}=p.jeSchedules,Z=Vt(g),M=Re(Z.start),V=Re(Z.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(g.month,g.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,a,r,k,I)=>{t(St(e,n,{fetchState:"In-Progress"}));const y=()=>t(St(e,n,{fetchState:"Error"}));ho(`${Te.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,I,n,a,r,k).then(R=>{R!=null?t(Fa(e,R)):y()}).catch(y)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Ce({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,a,r)=>{t(Da(e,{fetchState:n,error:a})),a!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:r!=null?Bo+Fo+r+bt:bt}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{V!=null&&M!=null&&t(Ot({start:M,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...S===!0?{onBulkUploadFiles:e=>{t(ao(e))},onBulkUploadProgress:e=>{t(no(e))},onBulkUploadSuccess:e=>{t(to({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(eo(e))},onConfirmBulkUploadMatch:(e,n,a,r,k)=>{t(Xa(e,n,a,r,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Wa())},onSetBulkUploadResultsTab:e=>{t(Qa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Za(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ha())},onSearchTransactionsForManualMatch:(e,n)=>{t(At(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(At(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ya(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=p.currentSelectedView,a=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:a,uiState:{searchString:e}})),V!=null&&M!=null&&t(pe(a,{start:M,end:V},!0,!1,e,void 0,!0)))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(Ta(P))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Aa(e))},onSaveReconciliationReview:e=>{t(ba(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,a=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:a,referrer:p.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=Q(s.state?.pathnameStackToGoBack,s.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:a,fixedAssetsAccount:r,accruedExpensesAccount:k}=n,I=$e(w.prepaidExpensesAccountList,a.selectedOptions),y=$e(w.fixedAssetsAccountList,r.selectedOptions),R=$e(w.accruedExpensesAccountList,k.selectedOptions),$={selectedPrepaidExpensesAccountIds:I.map(b=>b.accountId),selectedFixedAssetsAccountIds:y.map(b=>b.accountId),selectedAccruedExpensesAccountIds:R.map(b=>b.accountId)};t(Pa({data:$}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:a,accumulatedDepreciationCategory:r,scheduleClass:k,scheduleExpenseCategory:I,vendor:y}=n,{allAccountList:R,allClassList:$,allDepreciationAccountList:b}=p.jeSchedules,q=i.entityAutoCompleteView.vendor.length>0?i.entityAutoCompleteView.vendor.find(O=>O.id===y?.selectedOption):void 0,Y={id:q?.zeniId??y?.selectedOption??"",name:q?.name??y?.defaultOptions.find(O=>O.value===y?.selectedOption)?.label??"",logo:q?.logo},Fe=I?.selectedOption!=null?R.find(O=>O.qboId===I.selectedOption):void 0,Se=k?.selectedOption!=null?$.find(O=>O.classId===k.selectedOption):void 0,Ie=r?.selectedOption!=null?b.find(O=>O.qboId===r.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:a,scheduledJournalEntryID:e,updatedCategoryId:Fe?.accountId,updatedClassId:Se?.classId,updatedAccumulatedDepreciationCategoryID:Ie?.accountId,updatedVendor:{id:Y.id,name:Y.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(be("common"))},onCancelAutoComplete:()=>{t(be("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,a)=>{t(Ia({selectedJEScheduleKey:n}));const r=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../vendors/schedules/${a}/details/${e}`,{state:{pathnameStackToGoBack:r,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:h,setActivityLogTransactionId:u,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!0,a,r,m.tenantId))},saveMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!1,a,r,m.tenantId))},onEditMonthEndInsightsClick:B,sendMonthEndReport:e=>{const n=s.state?.referrer,{selectedPeriod:a,auditSummary:r}=p;m!=null&&r?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(a.month,a.year,!1,"draft",r.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,a,r,k,I,y,R,$,b,q)=>{t(ua(e,n,a,r,E,k,I,y,R,$,b,q))},onCancelAutoComplete:()=>{t(be("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),V!=null&&M!=null&&(t(pe(e,{start:M,end:V},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),V!=null&&M!=null&&t(pe(e,{start:M,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,a,r,k,I,y)=>{V!=null&&M!=null&&t(pe(e,{start:M,end:V},!0,a,n,r,k,I,y))},resetTransactionCategorizationLocalData:(e,n,a,r,k,I,y,R)=>{t(ra(e,n,a,r,R??null,k,I,!1,y))},updateSelectedVendorForTransaction:(e,n,a,r,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:a,selectedTransaction:r,uncategorizedAccounts:E,updatedVendor:k}))},onSaveUpdateTransactionCategorization:(e,n,a)=>{const r=s.state?.referrer;e==="autoCategorized"?z.trackTransactionsAutoCategorisedPage(g.month,g.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,r??null):z.trackTransactionsReviewPage(g.month,g.year,p.transactionView.totalCountByTab.review,n.length,!1,r??null),t(la(e,n,a,P))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:b}=n;I!=null&&t(sa({transactionId:R,customerUpdates:I})),t(ca({selectedTab:r,transactionId:R.id,lineId:b[0],selectedTransaction:$,uncategorizedAccounts:E,updatedCustomer:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))},onFetchRecommendationsForEntityCategorization:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:b}=n;I!=null&&(t(na({transactionId:R,vendorUpdates:{name:I.name,id:I.id?I.id:void 0}})),t(aa({vendorId:I.id?I.id:void 0,localData:{vendorName:I.name,vendorId:I.id?I.id:void 0}}))),I?.id?(t(ht({selectedTab:r,transactionId:R.id,lineId:b[0],selectedTransaction:$,uncategorizedAccounts:E,updatedVendor:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))):t(oa({selectedTab:r,transactionId:R.id,lineId:b[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ae(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ae(g,!0,!1,null,!1,!1))},markAsReview:(e,n,a,r)=>{z.trackFluxAnalysisReviewed(a.month,a.year,r??!1,e),t(ta(n,e,a,r??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:g}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=Ao(e.id,e.qboId,l.tenantEmailDomain),a=Q(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Wn({sectionId:e,selectedPeriod:g}))},onFetchReimbursementView:(e,n,a)=>{t(Ae(e,!0,!1,n,!0,a))},onReviewClicked:e=>{t(ce(g,e))},setOpenDrawerClicked:e=>{t(xe({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const a=m?.companyId;a!=null&&(t(Bt(e,a,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(xe({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:g,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ce(g,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Qn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(Yn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,a)=>{const r=e.vendor?.id;a&&r!=null&&t(Nn(r)),t(Kn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ge("bill"));const n=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(be("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,l,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...P}=A;return function(S,s,i){return{...S,...s,...i,onUploadTransactionReceipt:(p,m,E,v,h)=>{s.onUploadTransactionReceipt(p,m,E,v,h,S.authParams)}}}(t,l,P)})(uo),Vo=Po(function(t){const l=t.displayName??t.name??"Component",A=Tt.memo(t),f=P=>{const S=se(),s=function(){const g=se(),T=F(d=>he(d).reconciliation.selectedDrawerAccountId);return{isOpen:T!=null,selectedAccountId:T,openPanel:o.useCallback(d=>{g(xe({selectedDrawerAccountId:d}))},[g]),closePanel:o.useCallback(()=>{g(xe({selectedDrawerAccountId:void 0}))},[g])}}(),i=F(g=>he(g).reconciliation),p=F(g=>we(g)),m=o.useCallback((g,T)=>{S(Ft("expense_automation_reconcile",g,T))},[S]),E=o.useCallback((g,T)=>{const d=p?.companyId;d!=null&&(S(Bt(g,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),S(_t({accountId:T,connectionInProgress:!0})))},[S,p?.companyId]),v=o.useMemo(()=>{if(s.isOpen&&s.selectedAccountId!=null)return C.jsx(Ro,{reconciliation:i,selectedDrawerAccountId:s.selectedAccountId,onClose:s.closePanel,onFetchLinkTokenClick:m,onEstablishConnectionClick:E})},[s.isOpen,s.selectedAccountId,s.closePanel,i,m,E]),h=o.useMemo(()=>({reconPanelContent:v,reconSidePanelIsOpen:s.isOpen,closeReconSidePanel:s.closePanel}),[v,s.isOpen,s.closePanel]),B=o.useContext(Et),u=o.useMemo(()=>s.isOpen?{closePanel:s.closePanel,selectedItemId:s.selectedAccountId}:B,[s.isOpen,s.closePanel,s.selectedAccountId,B]);return C.jsx(Et.Provider,{value:u,children:C.jsx(A,{...P,...h})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:P,reconPanelContent:S,reconSidePanelIsOpen:s,closeReconSidePanel:i})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:m}=po(),E=go(),{isOpen:v}=Co(),h=wt(),B=qe(),u=se(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:T}=qt({mobileExploreReferrer:"Transaction categorization"}),d=o.useCallback(()=>{P===!0&&f!==!0&&t?.()},[t,P,f]),{areTenantIdsInSync:w}=Lt(),Z=(()=>{const c=F(G=>he(G)),j=qe(),{currentSelectedViewFetchState:K,currentSelectedView:_,selectedPeriod:U}=c,me=Le(_),ee=Le(K.fetchState),ve=o.useCallback(G=>{const H=j.state?.referrer;_==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(U.month,U.year,c.transactionView.totalCountByTab.review,0,G,H??null):z.trackTransactionsAutoCategorisedPage(U.month,U.year,c.transactionView.totalCountByTab.autoCategorized,0,G,H??null)),_==="missing_receipts"&&z.trackMissingReceiptsPage(U.month,U.year,G,c.missingReceipts.transactions.length,H??null),_==="je_schedules"&&z.trackMonthCloseScheduleListPage(U.month,U.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,H??null),_==="flux_analysis"&&z.trackFluxAnalysisPage(U.month,U.year,G,Uo(c.fluxAnalysis),H??null),_==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(U.month,U.year,G,"draft",c.auditSummary.auditScorePercentage,null,H??null)},[U,c]);return o.useEffect(()=>{ee===K.fetchState&&_===me||K.fetchState!=="Completed"||ve(!1)},[_,K.fetchState,me]),ve})(),M=So(),[V,e]=o.useState(!1),n=F(c=>dt(c)),a=F(c=>we(c)),[r,k]=o.useState(!1),[I,y]=o.useState(!1),[R,$]=o.useState([]),[b,q]=o.useState(void 0),Y=o.useCallback(c=>{c!=null&&(p&&m(!1),E(),d()),q(c)},[d,p,E,m]),Fe=o.useCallback(()=>{E(),q(void 0),d(),T()},[d,T,E]),Se=o.useRef(p);o.useEffect(()=>{p===!0&&Se.current===!1&&(E(),q(void 0),d()),Se.current=p},[d,p,E]);const Ie=o.useRef(v);o.useEffect(()=>{v===!0&&Ie.current===!1&&(p&&m(!1),q(void 0),P===!0&&f!==!0&&t?.()),Ie.current=v},[t,v,p,m,f,P]);const O=P===!0&&f!==!0,Ne=o.useRef(O);o.useEffect(()=>{O&&!Ne.current&&(p&&m(!1),E(),q(void 0)),Ne.current=O},[p,O,E,m]);const[Ke,Nt]=o.useState(!1),Ye=o.useRef(!1),{selectedTab:He}=rt(),{tenantEmailDomain:Kt}=rt(),[Be,Ze]=o.useState(B.state?.message==="comingFromTransactionDetail"),Qe=B.state?.message==="comingFromOverview",Yt=Io(),_e=Ue.getSignedInUser(),{useDynamicConfig:Ht,useFeatureGate:fe}=zt(),{configValue:Zt}=Ht(fo.enableUncategorizedExpenseCategory),W=Zt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=fe(ge.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:ie}=fe(ge.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=fe(ge.isTransactionActivityEnabled),{isFeatureEnabled:Qt}=fe(ge.isExpenseAutomationCommentingEnabled),Wt=o.useCallback(c=>{const j=Ge(c.view==="reconciliation"?"bill":"expense");l?.(c.entityId,j)},[l]),Xt=F(c=>_a(c,"common")),L=F(c=>he(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ne,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:X,jeSchedules:Ve,reconciliation:tn}=L;o.useEffect(()=>{x==="transaction_categorization"&&P!==!0||Y(void 0)},[x,Y,P]);const ke=o.useRef(null);o.useEffect(()=>{ke.current!==null?ke.current!==ne&&(ke.current=ne,x==="transaction_categorization"&&Y(void 0)):ke.current=ne},[x,ne,Y]);const nn=F(c=>b==null?void 0:Va(c.transactionState,b)),ae=nn?.qboId,an=F(c=>ae==null?void 0:Ma(c,ae));o.useEffect(()=>{ae!=null&&u(Oa(ae))},[u,ae]);const{selectedAccountId:le}=tn,et=Le(Ve.accountSettingsView.saveState.fetchState),on=F(c=>ja(c.accountState,c.accountListState,"accountList")),re=He!=null?za(He):x,sn=F(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:X.fetchState==="Completed"}),_e==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),de=Re(tt.start),ue=Re(tt.end);if(de==null||ue==null)throw Error(`Invalid start - ${de} and end - ${ue} period from given ${D}`);const cn=o.useCallback(()=>{k(!1)},[]),ln=o.useCallback(()=>{y(!0)},[]),rn=o.useCallback(c=>{$(c),y(!1)},[]),dn=o.useCallback(()=>{$([])},[]),Ee=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{ie===!0&&x==="missing_receipts"&&Ee==="matching"&&nt!=null&&u(jt({cacheOverride:!0}))},[ie,x,Ee,nt,u]);const at=_e?.userId,un=D.month,mn=D.year,ot=a?.tenantId;o.useEffect(()=>{x==="missing_receipts"&&ie!==!1&&Ee==="idle"&&at!=null&&ot!=null&&u(La())},[x,ie,Ee,at,ot,un,mn,u]),o.useEffect(()=>{n.newVendorState?.vendorDetailLocalData?.vendorName!=null?e(!0):e(!1)},[n.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{re!=null&&x!==re&&u(Mt(re))},[re]),o.useEffect(()=>{Ke!==!1||X.fetchState!=="Completed"&&X.fetchState!=="Error"||!w||(Nt(!0),u(It(!1,!1,W)))},[Ke,X,w,W]),o.useEffect(()=>{!Qe&&w&&(u(It(!1,!1,W)),u(ce(D,le,!1,!1)))},[D.month,D.year,w,W]);const st=o.useCallback((c=!1,j=!1)=>{const K={start:de,end:ue};switch(x){case"transaction_categorization":u(pe(ne,K,c,!Be,void 0,void 0,j,void 0,W)),Ze(!1);break;case"flux_analysis":u(Ae(D,c,j,null));break;case"month_end_insights":if(j===!1){const _=new Date(D.year,D.month,0),U=qa(_.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);u(Ga(!0,a.companyId,a.tenantId,U)),u(Ja(a.companyId,a.tenantId))}break;case"je_schedules":u($a(K,j));break;case"missing_receipts":u(Ot(K,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:u(ce(D,le,c,j))}},[x,de,ue,a.companyId,a.tenantId,ne,D,le,Be,Ze,W]);o.useEffect(()=>{x===re&&X.fetchState==="Not-Started"&&w&&st(!0)},[X,de,ue,a.companyId,a.tenantId,w]),o.useEffect(()=>{Qe||Be||Ye.current||en.fetchState==="In-Progress"||X.fetchState!=="Completed"||(Ye.current=!0,st(!0,!0))},[]),o.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,a.tenantId]),o.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?k(!0):k(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&w&&(u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0})),u(Na({companyId:a.companyId})),h("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,a.tenantId,D,a.companyId,w]),o.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,a.tenantId,D,u]),o.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&le==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&u(ce(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,u,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ce,le,D]);const hn=vt();o.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||h("../")},[x,N.monthEndCloseChecks]);const pn=s===!0?S:A,gn=s===!0||P===!0,Cn=s===!0?i:t;o.useEffect(()=>{et==="In-Progress"&&Ve.accountSettingsView.saveState.fetchState==="Completed"&&u(ft())},[et,Ve.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:K})=>{const _=se();let U,me,ee;const ve=vt(),G=c.transactionView;let H=()=>{};const{transactions:En,selectedTransactionId:oe,selectedTransactionLineId:ye,transactionLocalData:vn}=G;if(K==="transaction_categorization"){const Me=vn.find(te=>te.transactionId===oe),J=En.find(te=>te.id===oe),it=ye!=null?Me?.transactionReviewLocalData?.lineItemById[ye]:void 0,lt=it?.account;me=it?.class?.classId,U=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Pn=bo(oe,J?.typeOfTransaction);J!=null&&Pn&&(ee={id:oe,type:Ge(J.typeOfTransaction)}),H=()=>{if(oe!=null&&ye!=null&&J!=null){const te=G.transactionLocalData.find(Pe=>Pe.transactionId===oe)?.transactionReviewLocalData;if(te!=null&&J.lines!=null&&J.lines.length>0){const Pe=te.lineItemById[ye];let Oe=te.selectedEntity;if(qn(J)||(Oe=Pe.selectedEntityLine),Oe!=null){const bn=Oe,An={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(Tn=>Tn.id)??[]};_(Je(bn,Pe.amount.amount,An,!1,!0,ve))}}}}}const yn=F(Me=>dt(Me,void 0,U,me));return{transactionId:ee,onSaveVendor:()=>{_($n(ee,void 0,!1,!0))},onSaveSuccess:H,onCancel:()=>{ee!=null&&_(jn({transactionId:ee})),_(zn()),_(Ln()),j()},vendorViewDetails:yn}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{e(!1)},currentSelectedView:x});return Yt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(ko,{onGoHome:()=>h("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(To,{isOpen:I,drawerLeftMargin:new Eo(0,0,300,650),onClose:()=>{y(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Do,{companyId:a.companyId,closeCustomerRequestDrawer:()=>y(!1),addCustomerRequest:rn,resetCustomerRequest:dn})})}),ct!=null&&V&&C.jsx(yo,{isOpen:V,transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}),C.jsx(_o,{navigate:h,location:B,themeState:M,vendorSearchAutoCompleteData:{autoCompleteText:sn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:ie,monthEndInsightsPreviewMode:r,monthEndInsightsCustomerRequestData:R,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:W,isCOTEnabled:hn,currentTenant:a,companyId:a.companyId,signedInUser:_e,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?b:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&b!=null?C.jsx(vo,{activityLogView:an,qboId:ae,onClose:()=>Y(void 0),selectedTransactionId:b},String(b)):null,uncategorizedAccounts:on,onClickCustomerRequest:ln,handleEditClick:cn,tenantEmailDomain:Kt,trackExpenseAutomationTabAnalytics:Z,setActivityLogTransactionId:Y,closeSidePanel:Cn,openTransactionPanel:l,sidePanelIsOpen:gn,sidePanelIsFullView:s!==!0&&f,panelContent:pn,isAiCfoAccessEnabled:g,onAskAiCfoClick:Fe,isExpenseAutomationCommentingEnabled:Qt,onExpenseAutomationCommentingThreadClick:Wt,sidePanelListPercent:s===!0?66:void 0})]})})),Mo=De(xn)`
21
+ `;function Do({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:A,resetCustomerRequest:f}){const P=Ue.getSignedInUser();if(P==null)throw Error("Can't access Customer Request page without signing in...");const S=F(s=>On(s,t,P));return o.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(lo,{onCloseClick:l,addCustomerRequest:A,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Uo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Fo,comma:bt,space:Bo}},dateFormat:Jt}=ro.getLocalizedStrings(),At=oo,_o=Rn(function(t,l){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:P,monthEndInsightsPreviewMode:S,companyId:s,isMissingReceiptsBulkUploadEnabled:i,isTransactionActivityEnabled:p}=l,m=Ue.getSignedInUser(),E=t.tenantState.currentTenantId,v={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:E??""},h=he(t),{selectedTransactionCategorizationTab:B}=h;return{expenseAutomationViewSelector:h,bulkUploadSelector:i===!0?h.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:v,receiptUploadEndpoint:`${Te.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${mo}/transaction_attachments`,bulkUploadEndpoint:i===!0?`${Te.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:P,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:m,uncategorizedAccounts:A,companyId:s,isTransactionActivityEnabled:p,isAccountingClassesEnabled:Gn(t)}},function(t,l){const{themeState:A,isCOTEnabled:f,isUncategorizedExpenseCategoryEnabled:P,isMissingReceiptsBulkUploadEnabled:S,location:s,vendorSearchAutoCompleteData:i,expenseAutomationViewSelector:p,currentTenant:m,uncategorizedAccounts:E,navigate:v,onClickCustomerRequest:h,handleEditClick:B,setActivityLogTransactionId:u}=l,{selectedPeriod:g,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:w}=p.jeSchedules,X=Vt(g),M=Re(X.start),V=Re(X.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(g.month,g.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,a,r,k,I)=>{t(St(e,n,{fetchState:"In-Progress"}));const y=()=>t(St(e,n,{fetchState:"Error"}));ho(`${Te.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,I,n,a,r,k).then(R=>{R!=null?t(Fa(e,R)):y()}).catch(y)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Ce({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,a,r)=>{t(Da(e,{fetchState:n,error:a})),a!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:r!=null?Bo+Fo+r+bt:bt}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{V!=null&&M!=null&&t(Ot({start:M,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...S===!0?{onBulkUploadFiles:e=>{t(ao(e))},onBulkUploadProgress:e=>{t(no(e))},onBulkUploadSuccess:e=>{t(to({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(eo(e))},onConfirmBulkUploadMatch:(e,n,a,r,k)=>{t(Za(e,n,a,r,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Wa())},onSetBulkUploadResultsTab:e=>{t(Qa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Xa(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ha())},onSearchTransactionsForManualMatch:(e,n)=>{t(At(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(At(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ya(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=p.currentSelectedView,a=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:a,uiState:{searchString:e}})),V!=null&&M!=null&&t(pe(a,{start:M,end:V},!0,!1,e,void 0,!0)))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(Ta(P))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Aa(e))},onSaveReconciliationReview:e=>{t(ba(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,a=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:a,referrer:p.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=Q(s.state?.pathnameStackToGoBack,s.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:a,fixedAssetsAccount:r,accruedExpensesAccount:k}=n,I=$e(w.prepaidExpensesAccountList,a.selectedOptions),y=$e(w.fixedAssetsAccountList,r.selectedOptions),R=$e(w.accruedExpensesAccountList,k.selectedOptions),$={selectedPrepaidExpensesAccountIds:I.map(b=>b.accountId),selectedFixedAssetsAccountIds:y.map(b=>b.accountId),selectedAccruedExpensesAccountIds:R.map(b=>b.accountId)};t(Pa({data:$}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:a,accumulatedDepreciationCategory:r,scheduleClass:k,scheduleExpenseCategory:I,vendor:y}=n,{allAccountList:R,allClassList:$,allDepreciationAccountList:b}=p.jeSchedules,q=i.entityAutoCompleteView.vendor.length>0?i.entityAutoCompleteView.vendor.find(O=>O.id===y?.selectedOption):void 0,Y={id:q?.zeniId??y?.selectedOption??"",name:q?.name??y?.defaultOptions.find(O=>O.value===y?.selectedOption)?.label??"",logo:q?.logo},Fe=I?.selectedOption!=null?R.find(O=>O.qboId===I.selectedOption):void 0,Se=k?.selectedOption!=null?$.find(O=>O.classId===k.selectedOption):void 0,Ie=r?.selectedOption!=null?b.find(O=>O.qboId===r.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:a,scheduledJournalEntryID:e,updatedCategoryId:Fe?.accountId,updatedClassId:Se?.classId,updatedAccumulatedDepreciationCategoryID:Ie?.accountId,updatedVendor:{id:Y.id,name:Y.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(be("common"))},onCancelAutoComplete:()=>{t(be("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,a)=>{t(Ia({selectedJEScheduleKey:n}));const r=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../vendors/schedules/${a}/details/${e}`,{state:{pathnameStackToGoBack:r,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:h,setActivityLogTransactionId:u,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!0,a,r,m.tenantId))},saveMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!1,a,r,m.tenantId))},onEditMonthEndInsightsClick:B,sendMonthEndReport:e=>{const n=s.state?.referrer,{selectedPeriod:a,auditSummary:r}=p;m!=null&&r?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(a.month,a.year,!1,"draft",r.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,a,r,k,I,y,R,$,b,q)=>{t(ua(e,n,a,r,E,k,I,y,R,$,b,q))},onCancelAutoComplete:()=>{t(be("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),V!=null&&M!=null&&(t(pe(e,{start:M,end:V},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),V!=null&&M!=null&&t(pe(e,{start:M,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,a,r,k,I,y)=>{V!=null&&M!=null&&t(pe(e,{start:M,end:V},!0,a,n,r,k,I,y))},resetTransactionCategorizationLocalData:(e,n,a,r,k,I,y,R)=>{t(ra(e,n,a,r,R??null,k,I,!1,y))},updateSelectedVendorForTransaction:(e,n,a,r,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:a,selectedTransaction:r,uncategorizedAccounts:E,updatedVendor:k}))},onSaveUpdateTransactionCategorization:(e,n,a)=>{const r=s.state?.referrer;e==="autoCategorized"?z.trackTransactionsAutoCategorisedPage(g.month,g.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,r??null):z.trackTransactionsReviewPage(g.month,g.year,p.transactionView.totalCountByTab.review,n.length,!1,r??null),t(la(e,n,a,P))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:b}=n;I!=null&&t(sa({transactionId:R,customerUpdates:I})),t(ca({selectedTab:r,transactionId:R.id,lineId:b[0],selectedTransaction:$,uncategorizedAccounts:E,updatedCustomer:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))},onFetchRecommendationsForEntityCategorization:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:b}=n;I!=null&&(t(na({transactionId:R,vendorUpdates:{name:I.name,id:I.id?I.id:void 0}})),t(aa({vendorId:I.id?I.id:void 0,localData:{vendorName:I.name,vendorId:I.id?I.id:void 0}}))),I?.id?(t(ht({selectedTab:r,transactionId:R.id,lineId:b[0],selectedTransaction:$,uncategorizedAccounts:E,updatedVendor:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))):t(oa({selectedTab:r,transactionId:R.id,lineId:b[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ae(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ae(g,!0,!1,null,!1,!1))},markAsReview:(e,n,a,r)=>{z.trackFluxAnalysisReviewed(a.month,a.year,r??!1,e),t(ta(n,e,a,r??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Zn({operatingExpenseIds:e,selectedPeriod:g}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=Ao(e.id,e.qboId,l.tenantEmailDomain),a=Q(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Wn({sectionId:e,selectedPeriod:g}))},onFetchReimbursementView:(e,n,a)=>{t(Ae(e,!0,!1,n,!0,a))},onReviewClicked:e=>{t(ce(g,e))},setOpenDrawerClicked:e=>{t(xe({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const a=m?.companyId;a!=null&&(t(Bt(e,a,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(xe({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:g,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ce(g,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Qn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Xn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(Yn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,a)=>{const r=e.vendor?.id;a&&r!=null&&t(Nn(r)),t(Kn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ge("bill"));const n=Q(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(be("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,l,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...P}=A;return function(S,s,i){return{...S,...s,...i,onUploadTransactionReceipt:(p,m,E,v,h)=>{s.onUploadTransactionReceipt(p,m,E,v,h,S.authParams)}}}(t,l,P)})(uo),Vo=Po(function(t){const l=t.displayName??t.name??"Component",A=Tt.memo(t),f=P=>{const S=se(),s=function(){const g=se(),T=F(d=>he(d).reconciliation.selectedDrawerAccountId);return{isOpen:T!=null,selectedAccountId:T,openPanel:o.useCallback(d=>{g(xe({selectedDrawerAccountId:d}))},[g]),closePanel:o.useCallback(()=>{g(xe({selectedDrawerAccountId:void 0}))},[g])}}(),i=F(g=>he(g).reconciliation),p=F(g=>we(g)),m=o.useCallback((g,T)=>{S(Ft("expense_automation_reconcile",g,T))},[S]),E=o.useCallback((g,T)=>{const d=p?.companyId;d!=null&&(S(Bt(g,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),S(_t({accountId:T,connectionInProgress:!0})))},[S,p?.companyId]),v=o.useMemo(()=>{if(s.isOpen&&s.selectedAccountId!=null)return C.jsx(Ro,{reconciliation:i,selectedDrawerAccountId:s.selectedAccountId,onClose:s.closePanel,onFetchLinkTokenClick:m,onEstablishConnectionClick:E})},[s.isOpen,s.selectedAccountId,s.closePanel,i,m,E]),h=o.useMemo(()=>({reconPanelContent:v,reconSidePanelIsOpen:s.isOpen,closeReconSidePanel:s.closePanel}),[v,s.isOpen,s.closePanel]),B=o.useContext(Et),u=o.useMemo(()=>s.isOpen?{closePanel:s.closePanel,selectedItemId:s.selectedAccountId}:B,[s.isOpen,s.closePanel,s.selectedAccountId,B]);return C.jsx(Et.Provider,{value:u,children:C.jsx(A,{...P,...h})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:P,reconPanelContent:S,reconSidePanelIsOpen:s,closeReconSidePanel:i})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:m}=po(),E=go(),{isOpen:v}=Co(),h=wt(),B=qe(),u=se(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:T}=qt({mobileExploreReferrer:"Transaction categorization"}),d=o.useCallback(()=>{P===!0&&f!==!0&&t?.()},[t,P,f]),{areTenantIdsInSync:w}=Lt(),X=(()=>{const c=F(G=>he(G)),j=qe(),{currentSelectedViewFetchState:K,currentSelectedView:_,selectedPeriod:U}=c,me=Le(_),ee=Le(K.fetchState),ve=o.useCallback(G=>{const H=j.state?.referrer;_==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(U.month,U.year,c.transactionView.totalCountByTab.review,0,G,H??null):z.trackTransactionsAutoCategorisedPage(U.month,U.year,c.transactionView.totalCountByTab.autoCategorized,0,G,H??null)),_==="missing_receipts"&&z.trackMissingReceiptsPage(U.month,U.year,G,c.missingReceipts.transactions.length,H??null),_==="je_schedules"&&z.trackMonthCloseScheduleListPage(U.month,U.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,H??null),_==="flux_analysis"&&z.trackFluxAnalysisPage(U.month,U.year,G,Uo(c.fluxAnalysis),H??null),_==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(U.month,U.year,G,"draft",c.auditSummary.auditScorePercentage,null,H??null)},[U,c]);return o.useEffect(()=>{ee===K.fetchState&&_===me||K.fetchState!=="Completed"||ve(!1)},[_,K.fetchState,me]),ve})(),M=So(),[V,e]=o.useState(!1),n=F(c=>dt(c)),a=F(c=>we(c)),[r,k]=o.useState(!1),[I,y]=o.useState(!1),[R,$]=o.useState([]),[b,q]=o.useState(void 0),Y=o.useCallback(c=>{c!=null&&(p&&m(!1),E(),d()),q(c)},[d,p,E,m]),Fe=o.useCallback(()=>{E(),q(void 0),d(),T()},[d,T,E]),Se=o.useRef(p);o.useEffect(()=>{p===!0&&Se.current===!1&&(E(),q(void 0),d()),Se.current=p},[d,p,E]);const Ie=o.useRef(v);o.useEffect(()=>{v===!0&&Ie.current===!1&&(p&&m(!1),q(void 0),P===!0&&f!==!0&&t?.()),Ie.current=v},[t,v,p,m,f,P]);const O=P===!0&&f!==!0,Ne=o.useRef(O);o.useEffect(()=>{O&&!Ne.current&&(p&&m(!1),E(),q(void 0)),Ne.current=O},[p,O,E,m]);const[Ke,Nt]=o.useState(!1),Ye=o.useRef(!1),{selectedTab:He}=rt(),{tenantEmailDomain:Kt}=rt(),[Be,Xe]=o.useState(B.state?.message==="comingFromTransactionDetail"),Qe=B.state?.message==="comingFromOverview",Yt=Io(),_e=Ue.getSignedInUser(),{useDynamicConfig:Ht,useFeatureGate:fe}=zt(),{configValue:Xt}=Ht(fo.enableUncategorizedExpenseCategory),W=Xt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=fe(ge.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:ie}=fe(ge.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Ze}=fe(ge.isTransactionActivityEnabled),{isFeatureEnabled:Qt}=fe(ge.isExpenseAutomationCommentingEnabled),Wt=o.useCallback(c=>{const j=Ge(c.view==="reconciliation"?"bill":"expense");l?.(c.entityId,j)},[l]),Zt=F(c=>_a(c,"common")),L=F(c=>he(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ne,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:Z,jeSchedules:Ve,reconciliation:tn}=L;o.useEffect(()=>{x==="transaction_categorization"&&P!==!0||Y(void 0)},[x,Y,P]);const ke=o.useRef(null);o.useEffect(()=>{ke.current!==null?ke.current!==ne&&(ke.current=ne,x==="transaction_categorization"&&Y(void 0)):ke.current=ne},[x,ne,Y]);const nn=F(c=>b==null?void 0:Va(c.transactionState,b)),ae=nn?.qboId,an=F(c=>ae==null?void 0:Ma(c,ae));o.useEffect(()=>{ae!=null&&u(Oa(ae))},[u,ae]);const{selectedAccountId:le}=tn,et=Le(Ve.accountSettingsView.saveState.fetchState),on=F(c=>ja(c.accountState,c.accountListState,"accountList")),re=He!=null?za(He):x,sn=F(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:Z.fetchState==="Completed"}),_e==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),de=Re(tt.start),ue=Re(tt.end);if(de==null||ue==null)throw Error(`Invalid start - ${de} and end - ${ue} period from given ${D}`);const cn=o.useCallback(()=>{k(!1)},[]),ln=o.useCallback(()=>{y(!0)},[]),rn=o.useCallback(c=>{$(c),y(!1)},[]),dn=o.useCallback(()=>{$([])},[]),Ee=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{ie===!0&&x==="missing_receipts"&&Ee==="matching"&&nt!=null&&u(jt({cacheOverride:!0}))},[ie,x,Ee,nt,u]);const at=_e?.userId,un=D.month,mn=D.year,ot=a?.tenantId;o.useEffect(()=>{x==="missing_receipts"&&ie!==!1&&Ee==="idle"&&at!=null&&ot!=null&&u(La())},[x,ie,Ee,at,ot,un,mn,u]),o.useEffect(()=>{n.newVendorState?.vendorDetailLocalData?.vendorName!=null?e(!0):e(!1)},[n.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{re!=null&&x!==re&&u(Mt(re))},[re]),o.useEffect(()=>{Ke!==!1||Z.fetchState!=="Completed"&&Z.fetchState!=="Error"||!w||(Nt(!0),u(It(!1,!1,W)))},[Ke,Z,w,W]),o.useEffect(()=>{!Qe&&w&&(u(It(!1,!1,W)),u(ce(D,le,!1,!1)))},[D.month,D.year,w,W]);const st=o.useCallback((c=!1,j=!1)=>{const K={start:de,end:ue};switch(x){case"transaction_categorization":u(pe(ne,K,c,!Be,void 0,void 0,j,void 0,W)),Xe(!1);break;case"flux_analysis":u(Ae(D,c,j,null));break;case"month_end_insights":if(j===!1){const _=new Date(D.year,D.month,0),U=qa(_.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);u(Ga(!0,a.companyId,a.tenantId,U)),u(Ja(a.companyId,a.tenantId))}break;case"je_schedules":u($a(K,j));break;case"missing_receipts":u(Ot(K,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:u(ce(D,le,c,j))}},[x,de,ue,a.companyId,a.tenantId,ne,D,le,Be,Xe,W]);o.useEffect(()=>{x===re&&Z.fetchState==="Not-Started"&&w&&st(!0)},[Z,de,ue,a.companyId,a.tenantId,w]),o.useEffect(()=>{Qe||Be||Ye.current||en.fetchState==="In-Progress"||Z.fetchState!=="Completed"||(Ye.current=!0,st(!0,!0))},[]),o.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,a.tenantId]),o.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?k(!0):k(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&w&&(u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0})),u(Na({companyId:a.companyId})),h("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,a.tenantId,D,a.companyId,w]),o.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,a.tenantId,D,u]),o.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&le==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&u(ce(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,u,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ce,le,D]);const hn=vt();o.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||h("../")},[x,N.monthEndCloseChecks]);const pn=s===!0?S:A,gn=s===!0||P===!0,Cn=s===!0?i:t;o.useEffect(()=>{et==="In-Progress"&&Ve.accountSettingsView.saveState.fetchState==="Completed"&&u(ft())},[et,Ve.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:K})=>{const _=se();let U,me,ee;const ve=vt(),G=c.transactionView;let H=()=>{};const{transactions:En,selectedTransactionId:oe,selectedTransactionLineId:ye,transactionLocalData:vn}=G;if(K==="transaction_categorization"){const Me=vn.find(te=>te.transactionId===oe),J=En.find(te=>te.id===oe),it=ye!=null?Me?.transactionReviewLocalData?.lineItemById[ye]:void 0,lt=it?.account;me=it?.class?.classId,U=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Pn=bo(oe,J?.typeOfTransaction);J!=null&&Pn&&(ee={id:oe,type:Ge(J.typeOfTransaction)}),H=()=>{if(oe!=null&&ye!=null&&J!=null){const te=G.transactionLocalData.find(Pe=>Pe.transactionId===oe)?.transactionReviewLocalData;if(te!=null&&J.lines!=null&&J.lines.length>0){const Pe=te.lineItemById[ye];let Oe=te.selectedEntity;if(qn(J)||(Oe=Pe.selectedEntityLine),Oe!=null){const bn=Oe,An={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(Tn=>Tn.id)??[]};_(Je(bn,Pe.amount.amount,An,!1,!0,ve))}}}}}const yn=F(Me=>dt(Me,void 0,U,me));return{transactionId:ee,onSaveVendor:()=>{_($n(ee,void 0,!1,!0))},onSaveSuccess:H,onCancel:()=>{ee!=null&&_(jn({transactionId:ee})),_(zn()),_(Ln()),j()},vendorViewDetails:yn}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{e(!1)},currentSelectedView:x});return Yt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(ko,{onGoHome:()=>h("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(To,{isOpen:I,drawerLeftMargin:new Eo(0,0,300,650),onClose:()=>{y(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Do,{companyId:a.companyId,closeCustomerRequestDrawer:()=>y(!1),addCustomerRequest:rn,resetCustomerRequest:dn})})}),ct!=null&&V&&C.jsx(yo,{isOpen:V,transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}),C.jsx(_o,{navigate:h,location:B,themeState:M,vendorSearchAutoCompleteData:{autoCompleteText:sn,entityAutoCompleteView:Zt},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:ie,monthEndInsightsPreviewMode:r,monthEndInsightsCustomerRequestData:R,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:W,isCOTEnabled:hn,currentTenant:a,companyId:a.companyId,signedInUser:_e,isTransactionActivityEnabled:Ze,activityLogTransactionId:x==="transaction_categorization"?b:void 0,activityLogPanel:x==="transaction_categorization"&&Ze===!0&&b!=null?C.jsx(vo,{activityLogView:an,qboId:ae,onClose:()=>Y(void 0),selectedTransactionId:b},String(b)):null,uncategorizedAccounts:on,onClickCustomerRequest:ln,handleEditClick:cn,tenantEmailDomain:Kt,trackExpenseAutomationTabAnalytics:X,setActivityLogTransactionId:Y,closeSidePanel:Cn,openTransactionPanel:l,sidePanelIsOpen:gn,sidePanelIsFullView:s!==!0&&f,panelContent:pn,isAiCfoAccessEnabled:g,onAskAiCfoClick:Fe,isExpenseAutomationCommentingEnabled:Qt,onExpenseAutomationCommentingThreadClick:Wt,sidePanelListPercent:s===!0?66:void 0})]})})),Mo=De(xn)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BqO7Df-p.js";import{a as r}from"./sentry-DS2EspaF.js";import{Y as i,_ as l,a0 as p,p as d}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import m from"./NotFoundScreen-Bn00COMT.js";import{j as u,u as b}from"./core-DxYppZiZ.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]="6cc6e893-8e4c-439b-a6ff-557044a4a5fa",e._sentryDebugIdIdentifier="sentry-dbid-6cc6e893-8e4c-439b-a6ff-557044a4a5fa")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-C3aHR2ug.js";import{l as y,k as x,j as C,u as S,h as ee,q as ae,g as E,N as te,n as ne,o as p}from"./core-j0LqCeu3.js";import{IP as k,IQ as v,IR as F,yU as B,yG as G,IS as D,IT as oe,IU as se,yK as ie,eP as j,yR as le,yO as re}from"./zeni-epic-state-DiQZjsue.js";import{Z as g,d as r,n as de,c as I,i as H,E as ce,p as me,q as pe,s as K,C as ue,$ as he,v as xe,H as ge,m as fe,w as we,B as be,x as ye,k as Se,S as ke,y as ve,A as Ie,T as je}from"./index-CFtYCyfm.js";import{n as m}from"./mui-D78cc8iD.js";import f from"./NotFoundScreen-BeCKiN3K.js";import{a as $}from"./sentry-cQZrhfVh.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.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]="e45ae7e4-fe4f-4697-a12b-515f5a3e41ef",e._sentryDebugIdIdentifier="sentry-dbid-e45ae7e4-fe4f-4697-a12b-515f5a3e41ef")}catch{}})();const $e=m.div`
1
+ import{j as a}from"./liveblocks-BqO7Df-p.js";import{l as y,k as x,j as C,u as S,h as ee,q as ae,g as E,N as te,n as ne,o as p}from"./core-DxYppZiZ.js";import{IP as k,IQ as v,IR as F,yU as B,yG as G,IS as D,IT as oe,IU as se,yK as ie,eP as j,yR as le,yO as re}from"./zeni-epic-state-CXLj5Oko.js";import{Z as g,d as r,n as de,c as I,i as H,E as ce,p as me,q as pe,s as K,C as ue,$ as he,v as xe,H as ge,m as fe,w as we,B as be,x as ye,k as Se,S as ke,y as ve,A as Ie,T as je}from"./index-DPw038da.js";import{n as m}from"./mui-DdrzQvkp.js";import f from"./NotFoundScreen-Bn00COMT.js";import{a as $}from"./sentry-DS2EspaF.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="936b5834-35f7-410c-a898-6daea56dc0af",e._sentryDebugIdIdentifier="sentry-dbid-936b5834-35f7-410c-a898-6daea56dc0af")}catch{}})();const $e=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-BqO7Df-p.js";import{a as g}from"./sentry-DS2EspaF.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-DxYppZiZ.js";import{z as r,m as P,D as A,e as V,c as N,f as q,j as B,k as G,h as H}from"./index-DPw038da.js";import{eO as K,IA as R,IK as W,IB as $,eP as J,fi as Q,IG as X,fH as Y,cT as Z,IL as ee,IM as te}from"./zeni-epic-state-CXLj5Oko.js";import{n as ne}from"./mui-DdrzQvkp.js";import{u as se}from"./useDeviceId-CsxMPdAN.js";import{f as ie}from"./analyticsHelper-tcwBG-lH.js";import{t as ae}from"./getLocaleForTenant-ClNmnFx1.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="e1e28fd9-dd84-4900-b96c-9ec863bb9da4",t._sentryDebugIdIdentifier="sentry-dbid-e1e28fd9-dd84-4900-b96c-9ec863bb9da4")}catch{}})();const D=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function De(){const t=O(),i=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>K(e)),b=l(e=>R(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&a!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(W(n,a,f)))},[n,p,t,a,f,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants($(b.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),A.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=H();e!=null&&V(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,i.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),U=g.useCallback(()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))},[a,d,t,c]),F=g.useCallback(e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))},[a,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(B,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:U,onVerifyOtp:F,onCancelVerifyDevice:j});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return u.jsx(T,{to:e,state:{...i.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(G,{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{De as default};
@@ -1 +1 @@
1
- import{j as V}from"./liveblocks-C3aHR2ug.js";import{a as c}from"./sentry-cQZrhfVh.js";import{h as pe,g as s,l as qe,u as Je,j as Ke,i as P}from"./core-j0LqCeu3.js";import{eO as he,eV as ea,eW as Se,eQ as aa,bn as ta,f3 as na,eX as sa,eY as oa,e_ as ia,f1 as ra,fb as da,f2 as g,f5 as la,f6 as ue,f9 as ca,f7 as ua,f8 as fa,fa as ma,cI as ba,fd as pa,cO as ha,bv as Sa,eN as ga,fi as Ea,fj as ka,fh as Ca}from"./zeni-epic-state-DiQZjsue.js";import{a3 as Ia,a4 as ya,H as Ta,C as wa,z as k,a5 as _a,N as Aa,w as Fa,u as Da,$ as r,a6 as va,a7 as $a,I as Ba,a as Ga,a8 as Ma,Y as Pa,a9 as Ra,aa as Na,ab as fe,ac as me,L as Va,ad as Oa,ae as be,c as R,s as _,af as N,ag as Ua}from"./index-CFtYCyfm.js";import{D as xa}from"./mui-D78cc8iD.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]="04e9fe42-6eab-4974-aa87-bc3f34c1b16c",f._sentryDebugIdIdentifier="sentry-dbid-04e9fe42-6eab-4974-aa87-bc3f34c1b16c")}catch{}})();const ja=Ia(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=qe(),t=Je(),C=Ta(),o=Ke(),O=aa(),m=pe(),{useFeatureGate:i}=wa(),U=k.getSignedInUser(),A=ta(U),n=s(e=>he(e)),ge=_a(),Ee=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:ke}=Aa(),x=s(e=>na(e)),j=x.uiState.currentChatSessionId,I=Fa(),{setLoading:Ce}=Da(),[F,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,Y=P("/:tenantEmailDomain/reports")!==null,y=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),ye=va(n,Ie,H),{isFeatureEnabled:Te}=i(r.isSettingsFeatureEnabled),W=s(e=>sa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>oa(e));c.useEffect(()=>{I&&T&&!y&&v.fetchState==="Not-Started"&&m(ia(!0))},[I,T,v.fetchState,y]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?ra(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:_e}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ae}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Z}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Q}=i(r.isExpenseAutomationEnabledV2),X=Q||Z&&A,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Be}=i(r.isTreasuryEnabled),{isFeatureEnabled:Ge}=i(r.isTaskManagerCustomerUserAccessEnabled),Me=A||!A&&Ge,Pe=n.company!=null&&da(n.company),w=Be&&Pe,Re=s(e=>g(e).totalUnreadCount),Ne=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ve=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Oe}=$a();c.useEffect(()=>{const e=setTimeout(()=>Oe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{I&&!y&&Ve.fetchState==="Not-Started"&&O.tenantId!=null&&m(la("task_manager","dashboard"))},[I,O.tenantId]),c.useEffect(()=>{y||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Ne,count:Re},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ca(e,ne.tenantId):void 0),S=[];_e===!1&&S.push("accounts_payable_aging"),Ae===!1&&S.push("accounts_receivable_aging"),z===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),X===!1&&S.push("expense_automation_card");const xe=Ba(),oe=s(e=>ua(e,S,h,Q,Z,w).fetchState),ie=s(e=>fa(e).fetchState),je=D&&(oe==="Completed"||oe==="Error")||Y&&(ie==="Completed"||ie==="Error")||!D&&!Y?void 0:"disabled",Le=c.useMemo(()=>ma(n.userRole),[n.userRole]),Ye=ba(Le),ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&W.fetchState==="Completed"&&pa(W.notificationSettings,h.userEmail,H,n),re=Ga(),We=re&&Ma(t),de=ha(xe?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Pa(t.pathname)!=="treasury",[w,de,le,t.pathname,a]),[Ze,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Xe=Ra(Qe);return V.jsx(xa,{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(Na,{signedInUser:U,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:je,isSettings:me(t),isSettingsFeatureEnabled:Te,isVendorsTabVisible:Ye,isZeniAccountEnabled:z,isChargeCardEnabled:ye,isTreasuryEnabled:w,treasuryYieldPercentage:Xe,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:He,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:X&&Sa(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=_(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const b=_(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),Ee?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}}):void(ge?ke(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=_(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,p=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),p&&E[n.tenantId]!=null){const b=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=Ua(e.type);be(e.type)?(j!=null&&m(Ca()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{Ce(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let p=`/${encodeURIComponent(u)}/`;const M=N(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Oa(l)?p+="settings/my_profile":be(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(Ea(e.tenantId)),m(ka(h.userId,e.tenantId,h.zeniSessionId)));const b=e;R.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ga({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:Me,thanksGivingAnimationEnabled:De,christmasAnimationEnabled:ve,newYearAnimationEnabled:$e})})}),Qa=f=>{const d=pe(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ya(o)&&ea(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(ja,{...f,...t})};export{Qa as M};
1
+ import{j as V}from"./liveblocks-BqO7Df-p.js";import{a as c}from"./sentry-DS2EspaF.js";import{h as be,g as s,l as qe,u as Je,j as Ke,i as M}from"./core-DxYppZiZ.js";import{eO as he,eV as ea,eW as Se,eQ as aa,bn as ta,f3 as na,eX as sa,eY as oa,e_ as ia,f1 as ra,fb as da,f2 as g,f5 as la,f6 as ue,f9 as ca,f7 as ua,f8 as fa,fa as ma,cI as pa,fd as ba,cO as ha,bv as Sa,eN as ga,fi as Ea,fj as ka,fh as Ca}from"./zeni-epic-state-CXLj5Oko.js";import{a3 as Ia,a4 as ya,H as Ta,C as wa,z as k,a5 as _a,R as Aa,w as Fa,u as Da,$ as r,a6 as va,a7 as $a,I as Ba,a as Ga,a8 as xa,Y as Ma,a9 as Pa,aa as Na,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,c as P,s as _,af as N,ag as Ua}from"./index-DPw038da.js";import{D as Ra}from"./mui-DdrzQvkp.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]="6f52100a-19cd-4f02-85c8-e8a3a72e5a9f",f._sentryDebugIdIdentifier="sentry-dbid-6f52100a-19cd-4f02-85c8-e8a3a72e5a9f")}catch{}})();const ja=Ia(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=qe(),t=Je(),C=Ta(),o=Ke(),O=aa(),m=be(),{useFeatureGate:i}=wa(),U=k.getSignedInUser(),A=ta(U),n=s(e=>he(e)),ge=_a(),Ee=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:ke}=Aa(),R=s(e=>na(e)),j=R.uiState.currentChatSessionId,I=Fa(),{setLoading:Ce}=Da(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,Y=M("/:tenantEmailDomain/reports")!==null,y=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),ye=va(n,Ie,H),{isFeatureEnabled:Te}=i(r.isSettingsFeatureEnabled),W=s(e=>sa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>oa(e));c.useEffect(()=>{I&&T&&!y&&v.fetchState==="Not-Started"&&m(ia(!0))},[I,T,v.fetchState,y]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?ra(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:_e}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ae}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Z}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Q}=i(r.isExpenseAutomationEnabledV2),X=Q||Z&&A,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Be}=i(r.isTreasuryEnabled),{isFeatureEnabled:Ge}=i(r.isTaskManagerCustomerUserAccessEnabled),xe=A||!A&&Ge,Me=n.company!=null&&da(n.company),w=Be&&Me,Pe=s(e=>g(e).totalUnreadCount),Ne=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ve=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Oe}=$a();c.useEffect(()=>{const e=setTimeout(()=>Oe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{I&&!y&&Ve.fetchState==="Not-Started"&&O.tenantId!=null&&m(la("task_manager","dashboard"))},[I,O.tenantId]),c.useEffect(()=>{y||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Ne,count:Pe},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ca(e,ne.tenantId):void 0),S=[];_e===!1&&S.push("accounts_payable_aging"),Ae===!1&&S.push("accounts_receivable_aging"),z===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),X===!1&&S.push("expense_automation_card");const Re=Ba(),oe=s(e=>ua(e,S,h,Q,Z,w).fetchState),ie=s(e=>fa(e).fetchState),je=D&&(oe==="Completed"||oe==="Error")||Y&&(ie==="Completed"||ie==="Error")||!D&&!Y?void 0:"disabled",Le=c.useMemo(()=>ma(n.userRole),[n.userRole]),Ye=pa(Le),ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&W.fetchState==="Completed"&&ba(W.notificationSettings,h.userEmail,H,n),re=Ga(),We=re&&xa(t),de=ha(Re?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Ma(t.pathname)!=="treasury",[w,de,le,t.pathname,a]),[Ze,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Xe=Pa(Qe);return V.jsx(Ra,{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(Na,{signedInUser:U,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:je,isSettings:me(t),isSettingsFeatureEnabled:Te,isVendorsTabVisible:Ye,isZeniAccountEnabled:z,isChargeCardEnabled:ye,isTreasuryEnabled:w,treasuryYieldPercentage:Xe,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:He,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:X&&Sa(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=_(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const p=_(t.state?.pathnameStackToGoBack,t.pathname);return P.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),Ee?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}}):void(ge?ke(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=_(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&P.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Ua(e.type);pe(e.type)?(j!=null&&m(Ca()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{Ce(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Ea(e.tenantId)),m(ka(h.userId,e.tenantId,h.zeniSessionId)));const p=e;P.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:R,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ga({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:xe,thanksGivingAnimationEnabled:De,christmasAnimationEnabled:ve,newYearAnimationEnabled:$e})})}),Qa=f=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ya(o)&&ea(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(ja,{...f,...t})};export{Qa as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BqO7Df-p.js";import{j as r,k as i}from"./core-DxYppZiZ.js";import{O as n}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import"./sentry-DS2EspaF.js";import"./zeni-epic-state-CXLj5Oko.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="6abb37d2-952f-4fd9-932f-e89903f793e2",o._sentryDebugIdIdentifier="sentry-dbid-6abb37d2-952f-4fd9-932f-e89903f793e2")}catch{}})();const f=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(f,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-C3aHR2ug.js";import lt from"./NotFoundScreen-BeCKiN3K.js";import{a as k}from"./sentry-cQZrhfVh.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-j0LqCeu3.js";import{cq as St,eX as J,eO as K,fa as bt,f2 as b,P0 as Q,f6 as d,eW as y,qr as M,vF as It,P1 as Ct,eV as Tt,fd as yt,qw as At,P2 as $,bq as F,gD as x,qA as H,P3 as Et,cB as _t,cv as Nt}from"./zeni-epic-state-DiQZjsue.js";import{O as Bt,z as wt,C as xt,$ as Pt,cu as vt,s as N,a3 as Dt,cv as Rt,a4 as Ut,p as Gt}from"./index-CFtYCyfm.js";import"./mui-D78cc8iD.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as Ft}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.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]="b8439dd7-e574-42fc-9b01-0eaffaaa95e6",t._sentryDebugIdIdentifier="sentry-dbid-b8439dd7-e574-42fc-9b01-0eaffaaa95e6")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=J(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=K(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(H("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(H("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(Rt)),qt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>J(e)),o=S(e=>K(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Ft({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),q=S(e=>b(e).currentTab),v=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:w,isLoading:A,hasFetchedAll:C,isFetchingMore:R,fetchMore:ot}=ct(),{threads:V,isLoading:W,fetchMore:z,isFetchingMore:L,hasFetchedAll:O}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(q!==i&&i!=null&&s(Q(i)),i==null){const e=`../${q}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&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"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||R===!0||C!==!0||A||R===!0||C!==!0;k.useEffect(()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&w!=null&&V!=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),E=p.map(f=>f.id),it=p.map(f=>{const G=V.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(L||O===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,R,L,C,O,W,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];v==="all"?E.push("read","unread"):v!=="mentions"&&E.push(v),s(M("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(qt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
1
+ import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-BqO7Df-p.js";import lt from"./NotFoundScreen-Bn00COMT.js";import{a as k}from"./sentry-DS2EspaF.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-DxYppZiZ.js";import{cq as St,eX as H,eO as K,fa as bt,f2 as b,P0 as Q,f6 as d,eW as y,qr as M,vF as It,P1 as Ct,eV as Tt,fd as yt,qw as At,P2 as $,bq as F,gD as x,qA as J,P3 as Et,cB as _t,cv as Nt}from"./zeni-epic-state-CXLj5Oko.js";import{U as Bt,z as wt,C as xt,$ as Pt,cu as vt,s as N,a3 as Dt,cv as Rt,a4 as Ut,p as Gt}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as Ft}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="f095d00e-4e8a-42b0-80fc-076dc4dd5b8a",t._sentryDebugIdIdentifier="sentry-dbid-f095d00e-4e8a-42b0-80fc-076dc4dd5b8a")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=H(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=K(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},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"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(Rt)),qt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>H(e)),o=S(e=>K(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Ft({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),q=S(e=>b(e).currentTab),v=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:w,isLoading:A,hasFetchedAll:C,isFetchingMore:R,fetchMore:ot}=ct(),{threads:V,isLoading:W,fetchMore:z,isFetchingMore:L,hasFetchedAll:O}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(q!==i&&i!=null&&s(Q(i)),i==null){const e=`../${q}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&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"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||R===!0||C!==!0||A||R===!0||C!==!0;k.useEffect(()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&w!=null&&V!=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),E=p.map(f=>f.id),it=p.map(f=>{const G=V.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(L||O===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,R,L,C,O,W,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];v==="all"?E.push("read","unread"):v!=="mentions"&&E.push(v),s(M("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(qt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-C3aHR2ug.js";import{a as r}from"./sentry-cQZrhfVh.js";import{h as A,u as j,g as o,N as C}from"./core-j0LqCeu3.js";import{IX as P,eO as x,f1 as z,IY as D,IZ as M,I_ as R,I$ as L,mm as N,HV as k}from"./zeni-epic-state-DiQZjsue.js";import{z as h,K as g}from"./index-CFtYCyfm.js";import"./mui-D78cc8iD.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="c4851487-7a4a-403f-b415-7eee4daec991",n._sentryDebugIdIdentifier="sentry-dbid-c4851487-7a4a-403f-b415-7eee4daec991")}catch{}})();function ee(){const n=A(),a=j(),{params:t,error:i}=r.useMemo(()=>P(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),m=h.isSignedIn(),s=h.getSignedInUser(),p=o(e=>x(e)),l=o(e=>z(e)),d=o(e=>e.tenantState.fetchState),y=o(D),v=o(M),c=o(R),[S,b]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const I=r.useRef(!1);r.useEffect(()=>{m&&s!=null&&!I.current&&(d!=="Not-Started"&&d!=="Error"||(I.current=!0,n(N(s.userId,s.zeniSessionId??void 0))))},[m,s,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(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=S??U;return i!=null?f.jsx(g,{variant:"invalid_params",paramsError:i}):m?f.jsx(g,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:b,approveError:E??v,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(k(s.userId,s.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.")}}}):f.jsx(C,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
1
+ import{j as f}from"./liveblocks-BqO7Df-p.js";import{a as r}from"./sentry-DS2EspaF.js";import{h as A,u as j,g as o,N as C}from"./core-DxYppZiZ.js";import{IX as P,eO as x,f1 as z,IY as D,IZ as M,I_ as R,I$ as L,mm as k,HV as N}from"./zeni-epic-state-CXLj5Oko.js";import{z as h,K as g}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="a7602632-3630-4f6e-ba8a-b2da9be48031",n._sentryDebugIdIdentifier="sentry-dbid-a7602632-3630-4f6e-ba8a-b2da9be48031")}catch{}})();function ee(){const n=A(),a=j(),{params:t,error:i}=r.useMemo(()=>P(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),m=h.isSignedIn(),s=h.getSignedInUser(),p=o(e=>x(e)),l=o(e=>z(e)),d=o(e=>e.tenantState.fetchState),b=o(D),y=o(M),u=o(R),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const I=r.useRef(!1);r.useEffect(()=>{m&&s!=null&&!I.current&&(d!=="Not-Started"&&d!=="Error"||(I.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))},[m,s,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),c=v??U;return i!=null?f.jsx(g,{variant:"invalid_params",paramsError:i}):m?f.jsx(g,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(N(s.userId,s.zeniSessionId??void 0,c,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.")}}}):f.jsx(C,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-BqO7Df-p.js";import{j as Y,h as Z,u as z,l as K,g as d,k as H,n as Q,o as I}from"./core-DxYppZiZ.js";import{eO as O,qf as R,pP as X,Ju as v,pK as S,bv as ee,bn as ae,bS as te,pL as se,Jv as oe,Jg as C,dC as re,tC as ne,Jw as ie,tZ as ce,eU as le,eS as de}from"./zeni-epic-state-CXLj5Oko.js";import{z as me,U as fe,I as pe,C as w,$ as M,x as ue,c as $,al as he,s as ge}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import Fe from"./NotFoundScreen-Bn00COMT.js";import{F as be}from"./FeaturePreviewScreen-Ck2p6Gja.js";import{a as g}from"./sentry-DS2EspaF.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as Ce}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{u as Se}from"./useInitialThreadRequest-Wi13xyTC.js";import{t as Te}from"./routePaths-CgcmkaKJ.js";import{M as ye}from"./MobileAppDrawer-DlNmDt_G.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="31a9f78e-1de9-43d0-be16-10bc894e2276",s._sentryDebugIdIdentifier="sentry-dbid-31a9f78e-1de9-43d0-be16-10bc894e2276")}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})}},ke=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:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(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,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function U(){const s=Y(),e=Z(),a=z(),{forecastId:o,tenantEmailDomain:r}=K(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),q=y.company?.companyInfo.firstMonthOfFY??1,c=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),x=d(t=>t.reportUIOptionsState.selectedForecast),A=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Ce({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,E,P)=>E!=null?f.forecasts.findIndex(b=>b.id===E):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(c,o,x?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=x?.index?(e(v(c.forecasts[t].id,t)),T(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!A(c.forecasts[t].id)&&F&&e(S(c.forecasts[t].id))}},[i,p,e,l,c,m,u,R,S,F]);const D=pe(),_=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:G}=w(),{isFeatureEnabled:L}=G(M.isReportsCommentingEnabled),J=Se(L?y?.companyId:void 0,{clearParams:l&&m}),[V,W]=g.useState(!1),j=t=>{W(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:q,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:A,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:_,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:J,onClickMenuIcon:()=>{j(!0)}})]})}function Ye(){const s=d(i=>O(i)),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-C3aHR2ug.js";import{Jp as te,eO as Q,jr as H,eU as Y,eS as ne,GS as q,J2 as oe,sK as Ee,Jq as N,sy as ke,sT as Ie,sN as ie,sC as re,sR as Pe,sO as je,Jr as le,uo as Te,Js as Le,fx as ve,Jt as J,sH as de,sF as ce,sW as Fe,c1 as Oe}from"./zeni-epic-state-DiQZjsue.js";import{Z as pe,C as X,$ as E,z as K,a6 as ue,F as me,ah as ge,ai as Re,A as he,d as R,J as fe,D as Ce,aj as Ae,O as Ve,x as Ue,c as be,f as Ze,s as Be,ak as $e,I as Je}from"./index-CFtYCyfm.js";import{D as ye,n as M,S as we}from"./mui-D78cc8iD.js";import se from"./NotFoundScreen-BeCKiN3K.js";import{a as r}from"./sentry-cQZrhfVh.js";import{h as ee,l as Ge,g as m,j as ze,u as He,k as Ke,n as ae,o as $}from"./core-j0LqCeu3.js";import{u as Me}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as We}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{M as _e}from"./MobileAppDrawer-DeylJyoS.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="aa846479-8320-4a76-951b-65ebf109e722",s._sentryDebugIdIdentifier="sentry-dbid-aa846479-8320-4a76-951b-65ebf109e722")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},G=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[A,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=Ge(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>H(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Y(k,u),L=ne(u),v=q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{A===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:O}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:O===!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(s):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]),a.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:a.jsxs(Ye,{onClick:e=>e.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(Se,{children:G.discardTitle}),descriptionComponent:a.jsx(De,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:i,isEditPopup:!0}):null,a.jsx(Re,{...b})]})})},Ye=M(we)`
1
+ import{j as a}from"./liveblocks-BqO7Df-p.js";import{Jp as te,eO as Q,jr as H,eU as Y,eS as ne,GS as q,J3 as oe,sK as Ee,Jq as N,sy as ke,sT as Ie,sN as ie,sC as re,sR as Pe,sO as je,Jr as le,uo as Te,Js as Le,fx as ve,Jt as J,sH as de,sF as ce,sW as Fe,c1 as Oe}from"./zeni-epic-state-CXLj5Oko.js";import{Z as pe,C as X,$ as E,z as K,a6 as ue,F as me,ah as ge,ai as Re,A as he,d as R,J as fe,D as Ce,aj as Ae,U as Ve,x as Ue,c as be,f as Ze,s as Be,ak as $e,I as Je}from"./index-DPw038da.js";import{D as ye,n as M,S as we}from"./mui-DdrzQvkp.js";import se from"./NotFoundScreen-Bn00COMT.js";import{a as r}from"./sentry-DS2EspaF.js";import{h as ee,l as Ge,g as m,j as ze,u as He,k as Ke,n as ae,o as $}from"./core-DxYppZiZ.js";import{u as Me}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as We}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{M as _e}from"./MobileAppDrawer-DlNmDt_G.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="182954f3-6ff3-47db-ab84-995482f2aa58",s._sentryDebugIdIdentifier="sentry-dbid-182954f3-6ff3-47db-ab84-995482f2aa58")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},G=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[A,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=Ge(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>H(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Y(k,u),L=ne(u),v=q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{A===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:O}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:O===!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(s):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]),a.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:a.jsxs(Ye,{onClick:e=>e.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(Se,{children:G.discardTitle}),descriptionComponent:a.jsx(De,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:i,isEditPopup:!0}):null,a.jsx(Re,{...b})]})})},Ye=M(we)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BqO7Df-p.js";import E from"./NotFoundScreen-Bn00COMT.js";import{a as r}from"./sentry-DS2EspaF.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as h}from"./core-DxYppZiZ.js";import{eO as B,P4 as b,bo as F,bn as N,h7 as V,gD as H}from"./zeni-epic-state-CXLj5Oko.js";import{H as $,z as I,cw as q}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as J}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{M as K}from"./MobileAppDrawer-DlNmDt_G.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="73131d1c-f51e-4648-a817-a39c73f95fac",e._sentryDebugIdIdentifier="sentry-dbid-73131d1c-f51e-4648-a817-a39c73f95fac")}catch{}})();const L=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(q),Q=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,D=N(d),x=S||k||D,l=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(H({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const y=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-cQZrhfVh.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-DS2EspaF.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};