@zeniai/web-app-ui 5.1.99-qa → 5.2.0-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.
- package/dist/assets/AddressRoutes-DGCDOoKb.js +1 -0
- package/dist/assets/{AddressScreen-CBnElFxM.js → AddressScreen-Dzf83tSk.js} +2 -2
- package/dist/assets/AiCfoScreen-TZ---AU4.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-CB55AV0C.js → BillPayApprovalRoutes-iPPwT0JG.js} +1 -1
- package/dist/assets/{BillPayRoutes-UVA-u63A.js → BillPayRoutes-U0Aszwdv.js} +17 -17
- package/dist/assets/{BusinessVerificationPageScreen-DsowR4fB.js → BusinessVerificationPageScreen-B4os1LkS.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-BaEolMVN.js → CardsAiCfoScreen-Db20Cfsg.js} +3 -3
- package/dist/assets/{ChargeCardRoutes-D3n7KJn0.js → ChargeCardRoutes-rxetskAF.js} +10 -10
- package/dist/assets/{CompanyPassportScreen-wSnqdrZm.js → CompanyPassportScreen-COm4H_kf.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-C5LpJddx.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BIc9nbPF.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DT_Ih6lH.js → CustomerOnboardingRoutes-Id7ixv-a.js} +5 -5
- package/dist/assets/{DashboardRoutes-B4SpN_q5.js → DashboardRoutes-D_SbIh49.js} +4 -4
- package/dist/assets/{DefaultTenantHome-C-Q9oQmt.js → DefaultTenantHome-BsKeybH6.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BKpkRMty.js +18 -0
- package/dist/assets/DrawerScreen-BPgZ_1JF.js +1 -0
- package/dist/assets/EntityDetailRoutes-BZ9Mr897.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-nIGBHuEd.js → ExpenseAutomationRoutes-CN3ihdCO.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-Di3PuVRR.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CW56Ncxa.js +1 -0
- package/dist/assets/{MagicLinkRoutes-BTau9CfB.js → MagicLinkRoutes-DJ7vyce1.js} +5 -5
- package/dist/assets/MagicLinkSignInScreen-BZfit8o3.js +12 -0
- package/dist/assets/MobileAppDrawer-NdU6zrS3.js +1 -0
- package/dist/assets/NotFoundScreen-wlhddpbg.js +1 -0
- package/dist/assets/{NotificationRoutes-CkKMsCoc.js → NotificationRoutes-DbRksc78.js} +1 -1
- package/dist/assets/OAuthConsentScreen-sL3GodJ_.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-BoM4q2mR.js +1 -0
- package/dist/assets/PeopleRoutes-0fm-JoER.js +22 -0
- package/dist/assets/PerformanceRoutes-Cq8pT07f.js +1 -0
- package/dist/assets/{Preview-Dh_7Y2V1.js → Preview-CuOg-A8H.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BOAmyhRI.js → QBOConnectionScreen-D9vGR9Iz.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DfMng3xh.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js → ReimbursementApprovalRuleDetailScreen-w7TPHMbb.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CnfaWQKq.js → ReimbursementRoutes-uHKvr9EG.js} +8 -8
- package/dist/assets/{ReportsRoutes-ZKjtrrXu.js → ReportsRoutes-BosLV3TS.js} +1 -1
- package/dist/assets/RewardsRoutes-BPVfq5Np.js +1 -0
- package/dist/assets/ScreenRoutes-Drpg91zT.js +2 -0
- package/dist/assets/{SettingsRoutes-0RQL-spt.js → SettingsRoutes-BmbweE5j.js} +8 -8
- package/dist/assets/{SetupPagesScreen-lXVOcLJ8.js → SetupPagesScreen-HhCCJlo-.js} +5 -5
- package/dist/assets/SignInScreen-B8UhmfC2.js +1 -0
- package/dist/assets/SignOutScreen-CxWWZOhK.js +9 -0
- package/dist/assets/TaskListScreen-B7M-Cqce.js +9 -0
- package/dist/assets/TaskRoutes-CyLfJ8Tw.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-DFhCPCQa.js → TransactionDetailRoutes-Ct4erWuE.js} +1 -1
- package/dist/assets/TransactionDetailScreen-DRzSksYw.js +5 -0
- package/dist/assets/{TransactionListRoutes-kn0wMJaj.js → TransactionListRoutes-B191v9kk.js} +1 -1
- package/dist/assets/{TreasuryRoutes-h3ROpRx5.js → TreasuryRoutes-DZNZaxYZ.js} +6 -6
- package/dist/assets/{VendorsRoutes-x1VmRs4J.js → VendorsRoutes-CvrHlc-r.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-B9yx7qcI.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BOVvauFK.js → ZeniAccountRoutes-YPhOuFwx.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-DJU3198J.js +9 -0
- package/dist/assets/{accountMappingHelper-DNCKLg7K.js → accountMappingHelper-SWFIL59M.js} +1 -1
- package/dist/assets/{analytics-1WMvk5Rb.js → analytics-DhULAPA0.js} +1 -1
- package/dist/assets/{analyticsHelper-C8vUB4gm.js → analyticsHelper-CbsMOq15.js} +1 -1
- package/dist/assets/{core-0WK0Zss8.js → core-CnGMK-sC.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DYdex7Fp.js → decodeURIComponentSafe-uWfgYCNH.js} +1 -1
- package/dist/assets/{dnd-Dwsdp5ty.js → dnd-BqCGp7Ed.js} +1 -1
- package/dist/assets/{empty-o2YkWI97.js → empty-AGnm4bIq.js} +1 -1
- package/dist/assets/{empty-B_vMxB0z.js → empty-CZCaQm4J.js} +1 -1
- package/dist/assets/{emptyVideoElement-Cmrnn243.js → emptyVideoElement-Cqm9YLjS.js} +1 -1
- package/dist/assets/epic-CTjjWhpg.js +2 -0
- package/dist/assets/getLocaleForTenant-BuGWeb9s.js +1 -0
- package/dist/assets/{index-DptRs9ko.js → index-BuTuhkuP.js} +2 -2
- package/dist/assets/{index-CmH-4r8j.js → index-CUaM5Y1I.js} +1 -1
- package/dist/assets/{index-Dy73EgcO.js → index-D7tfVykC.js} +14303 -14311
- package/dist/assets/{index-C3zdsXK_.js → index-D88Jaev3.js} +1 -1
- package/dist/assets/{index-B4Kzctdg.js → index-S4IFBgph.js} +1 -1
- package/dist/assets/{index-CcesBH_n.js → index-XkyLBJ61.js} +1 -1
- package/dist/assets/{index-CqKRE3AP.js → index-b64yysEr.js} +1 -1
- package/dist/assets/{index-CFATCouK.js → index-uYv86E98.js} +1 -1
- package/dist/assets/{lexical-B9WqgH9H.js → lexical-DlqthnSG.js} +1 -1
- package/dist/assets/{liveblocks-tpE-grBU.js → liveblocks-s55OcG-D.js} +1 -1
- package/dist/assets/{lottie-dQMhiLBj.js → lottie-DMKCl4ti.js} +1 -1
- package/dist/assets/{mui-NHWzIwJg.js → mui-CggbPNN2.js} +2 -2
- package/dist/assets/{pathToGoBack-BmJj5cme.js → pathToGoBack-DpxbYxCk.js} +1 -1
- package/dist/assets/{pdf-C4fX1mA3.js → pdf-BD0zxvar.js} +3 -3
- package/dist/assets/{pdf-lib-CxgB1_73.js → pdf-lib-BzRjr6sI.js} +1 -1
- package/dist/assets/{plaid-59NT4aqa.js → plaid-d_bwfWrk.js} +1 -1
- package/dist/assets/{pusher-CY-7JGv2.js → pusher-Cfk4rd_d.js} +1 -1
- package/dist/assets/{react-D8u5JcH6.js → react-BKWnIOym.js} +1 -1
- package/dist/assets/{react-C2Lbn6h8.js → react-BdjYstH9.js} +1 -1
- package/dist/assets/{react-DhqMtE92.js → react-C8X5xuWi.js} +1 -1
- package/dist/assets/{react-SLQy3m4e.js → react-CSLZes-L.js} +1 -1
- package/dist/assets/{react-OZ0ubAW7.js → react-D5Ky_KQN.js} +1 -1
- package/dist/assets/{react-C3I7c7kB.js → react-onoaKP_J.js} +1 -1
- package/dist/assets/{recharts-CUzwcISX.js → recharts-CmLekiCG.js} +1 -1
- package/dist/assets/routePaths-CVAI7AUa.js +1 -0
- package/dist/assets/{sentry-D58SEIt0.js → sentry-qwy54zvC.js} +1 -1
- package/dist/assets/{url-BRZfE6CD.js → url-BKJ8Udjp.js} +1 -1
- package/dist/assets/{url-wdUk7Rbg.js → url-CF9Fx3Jk.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DwtRgARG.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-Bl-nKTXG.js +1 -0
- package/dist/assets/useCashManagementBanner-SbCmMLis.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-DGhBtw5K.js → useChargeCardPusherEvents-Cg9Qn_oP.js} +1 -1
- package/dist/assets/{useDeviceId-SayLljl1.js → useDeviceId-DPOieVuC.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-gsc6JcZn.js +1 -0
- package/dist/assets/{useInitialThreadRequest-B7WOjZ27.js → useInitialThreadRequest-CXnpfTcs.js} +1 -1
- package/dist/assets/{utils-CHGPa257.js → utils-5Fz6z6US.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BsJ58rSa.js → withTransactionSidePanel-ZQvLeKiY.js} +2 -2
- package/dist/assets/{zeni-epic-state-Bx_bp9Xr.js → zeni-epic-state-NrbJoBOX.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-ChIEG7ZZ.js +0 -1
- package/dist/assets/AiCfoScreen-DXLxFBnQ.js +0 -22
- package/dist/assets/ConnectionAuthScreen-RH-ZQnmS.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Bro8vP9Q.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DmspT9Qv.js +0 -18
- package/dist/assets/DrawerScreen-CTBdvd2J.js +0 -1
- package/dist/assets/EntityDetailRoutes-DPOfKd1l.js +0 -1
- package/dist/assets/FeaturePreviewScreen-CS0na0Uv.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CDdCifUI.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BQxK3HJS.js +0 -12
- package/dist/assets/MobileAppDrawer-By5kqJZy.js +0 -1
- package/dist/assets/NotFoundScreen-BUpSeNgf.js +0 -1
- package/dist/assets/OAuthConsentScreen-BzkRmkhL.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DB98rpg8.js +0 -1
- package/dist/assets/PeopleRoutes-BPQhjQKR.js +0 -22
- package/dist/assets/PerformanceRoutes-Cu8GwbPn.js +0 -1
- package/dist/assets/ReferralListScreen-Bg4MIsqb.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-CLqW8bjU.js +0 -1
- package/dist/assets/RewardsRoutes-Dmsl5Hhz.js +0 -1
- package/dist/assets/ScreenRoutes-DtVjvGeB.js +0 -2
- package/dist/assets/SignInScreen-Caakz2DY.js +0 -1
- package/dist/assets/SignOutScreen-CtzEkEl4.js +0 -9
- package/dist/assets/TaskListScreen-BtTYiD21.js +0 -9
- package/dist/assets/TaskRoutes-X8P3xHwH.js +0 -9
- package/dist/assets/TransactionDetailScreen-CRWTcneH.js +0 -5
- package/dist/assets/WiseConfirmationScreen-CIMiBhET.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-DZHjDSg5.js +0 -9
- package/dist/assets/epic-BqLIdimv.js +0 -2
- package/dist/assets/getLocaleForTenant-CqQ308VG.js +0 -1
- package/dist/assets/routePaths-YBRbNv0i.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-B3JxpD0o.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Dx1w_2sk.js +0 -1
- package/dist/assets/useCashManagementBanner-MgmXXc9G.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-CG-YyoOP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-s55OcG-D.js";import{a as u}from"./sentry-qwy54zvC.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-CnGMK-sC.js";import{LX as N,eV as _,f$ as U,LY as k,ob as R,LZ as z}from"./zeni-epic-state-NrbJoBOX.js";import{u as $,z as f,L as T,t as I,a as j,b as O}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import{t as P}from"./getLocaleForTenant-BuGWeb9s.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="85a13326-229a-4748-97de-9d2c90286e64",t._sentryDebugIdIdentifier="sentry-dbid-85a13326-229a-4748-97de-9d2c90286e64")}catch{}})();const Q=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),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,S=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,S=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=O(c,p);return v.jsx(L,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading: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&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.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,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(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 V=["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"],q={"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 V)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-s55OcG-D.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-CnGMK-sC.js";import{Q2 as k,Q9 as _,gh as W,gg as q,gf as J,jw as K,Nc as L,rv as M,eV as V,PA as D,ju as T,Q3 as v,Qc as j,js as F,jP as G}from"./zeni-epic-state-NrbJoBOX.js";import{bz as X,m as N,C as R,z as U,y as z,r as p,G as S,B as O,bA as Y,o as Q,bB as ee,v as te}from"./index-D7tfVykC.js";import{n as Z}from"./mui-CggbPNN2.js";import"./sentry-qwy54zvC.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]="c7535589-2ce3-48e5-8cf1-8bc6148d58e3",e._sentryDebugIdIdentifier="sentry-dbid-c7535589-2ce3-48e5-8cf1-8bc6148d58e3")}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(M(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,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(G(s))},onSaveHandler:s=>{e(F(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),r=s.poppedPathname??P();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(j({data:r}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}}))(Y);function me({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=B(),d=e??s,{useFeatureGate:c}=R(),i=U.getSignedInUser(),b=h((u=>V(u))),g=z(),x=p(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h((u=>k(u,d))),{isFeatureEnabled:I}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:b,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},fe=(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=(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 ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=Z.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${Q.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,re=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:r}=t,{tenantEmailDomain:d}=r;return{onFetchBankName:c=>{e(G(c))},onSaveHandler:c=>{e(F(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:i}=c;e(j({data:i}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),i=c.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:c.newStack}})})(),e(v())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,c,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 c=p(t.location.state?.pathnameStackToGoBack),i=c.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:c.newStack}})}e(v())}}}))(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:r}=B(),d=e??s,c=U.getSignedInUser(),{useFeatureGate:i}=R(),b=z(),g=h((u=>V(u))),x=p(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h((u=>k(u,d))),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${Q.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:g,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{me as A,xe as D,H as V,fe as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-s55OcG-D.js";import{m as l,F as c,y as f}from"./index-D7tfVykC.js";import{D as p}from"./mui-CggbPNN2.js";import"./sentry-qwy54zvC.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]="b1f1e181-2dd7-4674-a7e9-de5dedc4fc70",e._sentryDebugIdIdentifier="sentry-dbid-b1f1e181-2dd7-4674-a7e9-de5dedc4fc70")}catch{}})();const u={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:d,onClose:t}=e,n=l(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),a=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:d})}export{m as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-s55OcG-D.js";import{a as d}from"./sentry-qwy54zvC.js";import{h as A,u as B,g as O,i as G,j as l,N as q,n as F,o as z,p as _}from"./core-CnGMK-sC.js";import{Ok as K,eV as M,NI as R,lz as V,Kd as k,Op as W,Nb as Y,kz as $,Ke as S,NN as X,NO as H,Nd as J,Nc as L}from"./zeni-epic-state-NrbJoBOX.js";import{aX as Q,d as U,r as Z,v as tt}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import{d as b}from"./decodeURIComponentSafe-uWfgYCNH.js";import{w as et}from"./withTransactionSidePanel-ZQvLeKiY.js";import{f as at,c as nt}from"./routePaths-CVAI7AUa.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";import"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import"./TransactionDetailScreen-DRzSksYw.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]="9aabb11b-1066-4a2d-8a84-b50f62e25d91",a._sentryDebugIdIdentifier="sentry-dbid-9aabb11b-1066-4a2d-8a84-b50f62e25d91")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:$(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(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(X()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&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(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(Q),it=et((function({entityType:a,...t}){const e=A(),o=B(),c=O(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:N,entityNameEncoded:v}=G(),r=b(N??""),p=b(v??""),u=rt(r,p),w=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>K(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),j=l((n=>M(n).company?.companyInfo.firstMonthOfFY??1)),f=l((n=>R(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&u===!0&&(T(!0),o(V(i)))}),[m,u,i]);const E=l((n=>n.trendState.fetchState)),P=f?.selectedPeriod?.timePeriod??g,x=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(f?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:x,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(w.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function Nt({entityType:a}){return s.jsx(z,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Nt as EntityDetailRoutes,Nt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-nIGBHuEd.js → ExpenseAutomationRoutes-CN3ihdCO.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-s55OcG-D.js";import oa from"./NotFoundScreen-wlhddpbg.js";import{a as o,b as Jt}from"./sentry-qwy54zvC.js";import{n as Ue,S as sa}from"./mui-CggbPNN2.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-CnGMK-sC.js";import{eV as Re,T0 as la,ol as Ee,fW as ra,s6 as da,oD as Kt,oY as Zt,T1 as Qt,p6 as ua,T2 as Ht,ow as ma,rE as pa,fH as Ie,T3 as De,uc as Wt,Ey as Xt,T4 as en,T5 as ha,rc as Ze,Ol as Pt,On as ga,kC as Ca,Oo as Sa,kJ as fa,cZ as Ia,vs as Qe,oJ as tn,pb as Fe,oB as de,T6 as Ea,Nd as Rt,Nc as we,T7 as Dt,k_ as ka,T8 as Ta,T9 as ya,Ta as ba,Tb as va,oQ as Aa,pe as xe,Tc as wa,Td as xa,Te as Pa,pl as Ra,kN as Da,kE as Fa,Tf as Ua,kM as Ft,Ov as Ba,Tg as Oa,Th as _a,r8 as Va,qM as za,pc as me,qL as Ne,Ti as Ma,Tj as La,Tk as ja,mh as $a,bo as qa,mc as Ut,l_ as Ga,Tl as Na,fx as Bt,gx as Ja,m9 as Ya,xl as Ka,Tm as Za,pM as Qa,pH as Ha,pL as Wa,pw as Xa,Tn as eo,fK as nn,o$ as to,oM as no,fX as Ot,pg as ao,To as oo,Tp as so,pd as an,Tq as co,Tr as io,Ts as lo,Tt as ro,Tu as _t,rk as uo,qD as mo,Nb as po,Tv as ho,Tw as go,kL as Co,Tx as So,Je as fo,kK as Io,kz as Eo,fJ as ko,q9 as on,qv as To,pa as Vt,pf as yo,bE as bo,m6 as vo,m3 as Ao,Ty as wo,pv as zt,qr as Mt,qp as xo,Tz as Po,qe as Ro,pW as Do,qs as Fo,TA as Uo,TB as Bo,p_ as Oo,TC as _o,pR as Vo,pZ as zo,pX as Mo,qy as Lo}from"./zeni-epic-state-NrbJoBOX.js";import{C as sn,G as X,d as q,v as ae,_ as cn,a0 as ln,cZ as jo,z as Be,c_ as $o,au as Pe,c$ as qo,aZ as Lt,B as rn,d0 as Go,ar as Je,a as No,a9 as Jo,d1 as Yo,a4 as Ko,d2 as Zo,Z as Qo,d3 as Ho,d4 as Wo,Q as Xo,T as es,aS as ts,d5 as ns,d6 as as,be as os,F as ss,aV as cs}from"./index-D7tfVykC.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import{f as jt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-DRzSksYw.js";import{w as us}from"./withTransactionSidePanel-ZQvLeKiY.js";import{h as ms,v as ps}from"./routePaths-CVAI7AUa.js";import{g as Ye}from"./accountMappingHelper-SWFIL59M.js";import{D as hs}from"./DrawerScreen-BPgZ_1JF.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";import"./decodeURIComponentSafe-uWfgYCNH.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]="d22bd39b-2c1d-45d5-82cd-1c792f7af4d0",t._sentryDebugIdIdentifier="sentry-dbid-d22bd39b-2c1d-45d5-82cd-1c792f7af4d0")}catch{}})();const gs=()=>{const t=pe(),l=Yt(),B=Ke(),f=x((d=>Re(d))),{useFeatureGate:b}=sn(),{isFeatureEnabled:S}=b(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=b(X.aiAuditScorePercentage),I=x((d=>d.expenseAutomationViewState.selectedPeriodByTenantId)),s=x((d=>la(d,f.tenantId))),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback(((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))}),[]),v=o.useCallback((d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))}),[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback((()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(g,f.tenantId,!0)}),[k,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback((()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find((G=>G.progress<100));if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}}),[s.monthEndCloseChecks,g]),{areTenantIdsInSync:T}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect((()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&T&&k(g,f.tenantId)}),[k,g,s.fetchState,f.tenantId,T]),o.useEffect((()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(da(g))}),[g,s.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect((()=>{const d=setInterval((()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()}),3e5);return()=>clearInterval(d)}),[s.fetchState]),o.useEffect((()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}}),[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(Cs,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},Cs=Ue.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex: 1 1 auto;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
-
`,Ss=Jt.memo((({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:b})=>{const S=pe(),r=Be.getSignedInUser(),I=x((e=>Re(e))),s=t.excludedAccountIDs,p=o.useMemo((()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""})),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:
|
|
8
|
+
`,Ss=Jt.memo((({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:b})=>{const S=pe(),r=Be.getSignedInUser(),I=x((e=>Re(e))),s=t.excludedAccountIDs,p=o.useMemo((()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""})),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,g=u[l],m=g?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{S(pa(e,n.split(".")[0]))},E=e=>{m!=null&&S(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},T=()=>{S(Qt({statementUploadChosen:!1}))},d=e=>{S(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{S(Ht({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback((()=>{S(Kt({accountId:l}))}),[S,l]),z=o.useCallback((()=>{S(Zt({accountId:l}))}),[S,l]),_=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return g!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:g,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onEditFileName:P,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:T,onExcludeFromReconciliation:ee})})}):_!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null})),$t=Ue.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
@@ -18,7 +18,7 @@ import{j as h}from"./liveblocks-tpE-grBU.js";import oa from"./NotFoundScreen-BUp
|
|
|
18
18
|
min-width: 0;
|
|
19
19
|
overflow-x: hidden;
|
|
20
20
|
overflow-y: auto;
|
|
21
|
-
`;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const b=Be.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const S=x((r=>ha(r,t,b)));return o.useEffect((()=>{f()}),[]),h.jsx(h.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:Ts}},dateFormat:pn}=No.getLocalizedStrings(),Nt=Lo,ks=ca((function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,T={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:g}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:T,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:g,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}}),(function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:b,isUncategorizedExpenseCategoryEnabled:S,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:T,navigate:v,onClickCustomerRequest:g,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:k,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),_=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,y,C)=>{t(_t(e,n,{fetchState:"In-Progress"}));const A=()=>t(_t(e,n,{fetchState:"Error"}));Zo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,C,n,c,i,y).then((O=>{O!=null?t(uo(e,O)):A()})).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?Ts+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{_!=null&&z!=null&&t(an({start:z,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Vo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(_o(e))},onConfirmBulkUploadMatch:(e,n,c,i,y)=>{t(Oo(e,n,c,i,y))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),_!=null&&z!=null&&t(me(c,{start:z,end:_},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(S))},onClose:()=>{k==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0})),v("../")},onBack:()=>{k==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:y}=n,C=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),O=Ye(G.accruedExpensesAccountList,y.selectedOptions),R={selectedPrepaidExpensesAccountIds:C.map((D=>D.accountId)),selectedFixedAssetsAccountIds:A.map((D=>D.accountId)),selectedAccruedExpensesAccountIds:O.map((D=>D.accountId))};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:y,scheduleExpenseCategory:C,vendor:A}=n,{allAccountList:O,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,L=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((J=>J.id===A?.selectedOption)):void 0,oe={id:L?.zeniId??A?.selectedOption??"",name:L?.name??A?.defaultOptions.find((J=>J.value===A?.selectedOption))?.label??"",logo:L?.logo},se=C?.selectedOption!=null?O.find((J=>J.qboId===C.selectedOption)):void 0,Oe=y?.selectedOption!=null?R.find((J=>J.classId===y.selectedOption)):void 0,_e=i?.selectedOption!=null?D.find((J=>J.qboId===i.selectedOption)):void 0;t(Wa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Oe?.classId,updatedAccumulatedDepreciationCategoryID:_e?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ha(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Qa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Za())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ja())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,y,C,A,O,R,D,L,oe,se)=>{t(ja(e,n,c,i,T,y,C,A,O,R,D,L,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(me(e,{start:z,end:_},!1,!1)),t(La(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:_},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),_!=null&&z!=null&&t(me(e,{start:z,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,y,C,A)=>{_!=null&&z!=null&&t(me(e,{start:z,end:_},!0,c,n,i,y,C,A))},resetTransactionCategorizationLocalData:(e,n,c,i,y,C,A,O)=>{t(za(e,n,c,i,O??null,y,C,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,y)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:T,updatedVendor:y,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Va(e,n,c,S))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(_a({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&t(Ba({transactionId:O,customerUpdates:C})),t(Oa({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:T,updatedCustomer:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Qe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&(t(Da({transactionId:O,vendorUpdates:{name:C.name,id:C.id?C.id:void 0}})),t(Fa({vendorId:C.id?C.id:void 0,localData:{vendorName:C.name,vendorId:C.id?C.id:void 0}}))),C?.id?(t(Ft({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:T,updatedVendor:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Qe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:O.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ht({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Qt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(ba({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ya({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(Ta(i)),t(ka({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ze("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Zt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||k!=="reconciliation"||t(de(E,d,!0,!0))}}}),((t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...b}=B;return(function(S,r,I){return{...S,...r,...I,onUploadTransactionReceipt:(s,p,u,T,v)=>{r.onUploadTransactionReceipt(s,p,u,T,v,S.authParams)}}})(t,l,b)}))(Jo(Yo)),ys=us((function(t){const l=t.displayName??t.name??"Component",B=Jt.memo(t),f=b=>{const S=pe(),r=(function(){const P=pe(),E=x((k=>Ie(k).reconciliation.selectedDrawerAccountId));return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback((k=>{P(De({selectedDrawerAccountId:k}))}),[P]),closePanel:o.useCallback((()=>{P(De({selectedDrawerAccountId:void 0}))}),[P])}})(),I=x((P=>Ie(P).reconciliation)),s=x((P=>Re(P))),p=o.useCallback(((P,E)=>{S(Wt("expense_automation_reconcile",P,E))}),[S]),u=o.useCallback(((P,E)=>{const k=s?.companyId;k!=null&&(S(Xt(P,k,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),S(en({accountId:E,connectionInProgress:!0})))}),[S,s?.companyId]),T=o.useMemo((()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Ss,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})}),[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo((()=>({reconPanelContent:T,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel})),[T,r.isOpen,r.closePanel]),g=o.useContext(Lt),m=o.useMemo((()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:g),[r.isOpen,r.closePanel,r.selectedAccountId,g]);return h.jsx(Lt.Provider,{value:m,children:h.jsx(B,{...b,...v})})};return f.displayName=`withReconSidePanel(${l})`,f})((({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:b,reconPanelContent:S,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Qo(),u=Ho(),{isOpen:T}=Wo(),v=Yt(),g=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),k=o.useCallback((()=>{b===!0&&f!==!0&&t?.()}),[t,b,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x((N=>Ie(N))),U=Ke(),{currentSelectedViewFetchState:j,currentSelectedView:$,selectedPeriod:w}=a,H=Je($),Y=Je(j.fetchState),Q=o.useCallback((N=>{const W=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,W??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,W??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,W??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,W??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),W??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,W??null)}),[w,a]);return o.useEffect((()=>{Y===j.fetchState&&$===H||j.fetchState!=="Completed"||Q(!1)}),[$,j.fetchState,H]),Q})(),ee=Xo(),[z,_]=o.useState(!1),e=x((a=>Pt(a))),n=x((a=>Re(a))),[c,i]=o.useState(!1),[y,C]=o.useState(!1),[A,O]=o.useState([]),[R,D]=o.useState(null),L=o.useCallback((()=>{D(null)}),[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback((a=>{a!=null?(s&&p(!1),u(),k(),D({contentType:"activity",detail:{transactionId:a}})):D((U=>U?.contentType==="activity"?null:U))}),[k,s,u,p]),Oe=o.useCallback((a=>{s&&p(!1),u(),k(),D({contentType:"transfer",detail:a})}),[k,s,u,p]),_e=o.useCallback((()=>{u(),L(),k(),E()}),[k,L,E,u]),J=o.useRef(s);o.useEffect((()=>{s===!0&&J.current===!1&&(u(),L(),k()),J.current=s}),[k,L,s,u]);const He=o.useRef(T);o.useEffect((()=>{T===!0&&He.current===!1&&(s&&p(!1),L(),b===!0&&f!==!0&&t?.()),He.current=T}),[L,t,T,s,p,f,b]);const Te=b===!0&&f!==!0,We=o.useRef(Te);o.useEffect((()=>{Te&&!We.current&&(s&&p(!1),u(),L()),We.current=Te}),[L,s,Te,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:gn}=xt(),[Ve,nt]=o.useState(g.state?.message==="comingFromTransactionDetail"),at=g.state?.message==="comingFromOverview",Cn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Sn,useFeatureGate:ce}=sn(),{configValue:fn}=Sn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:Tn}=ce(X.isJEScheduleCOTEnabled),kn=o.useCallback((a=>{const U=Ze(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)}),[l]),yn=x((a=>po(a,"common"))),M=x((a=>Ie(a))),{categoryOptions:bn,paymentAccountNames:vn}=x((a=>ho(a.accountState))),An=x((a=>go(a.classState))),{monthEndCloseChecksView:Z,currentSelectedView:F,selectedPeriod:V,selectedTransactionCategorizationTab:Le,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:je,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x((a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView)),rt=x((a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,(()=>{const a=[],U=ut.current,j=dt.current,$=j!=null&&U!=null?j[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const Y=H?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const Q of Object.values(Y)){const N=Q?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const H of w)for(const Y of H.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a}));o.useEffect((()=>{F==="transaction_categorization"&&b!==!0||se(void 0)}),[F,se,b]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ke=`${Le}|${Rn}`,ye=o.useRef(null);o.useEffect((()=>{ye.current!==null?ye.current!==ke&&(ye.current=ke,F==="transaction_categorization"&&L()):ye.current=ke}),[L,F,ke]);const Dn=x((a=>oe==null?void 0:Co(a.transactionState,oe))),le=Dn?.qboId,mt=x((a=>le==null?void 0:So(a,le)));o.useEffect((()=>{le!=null&&m(fo(le))}),[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:gt}=M.transactionView,Ct=o.useCallback((a=>rs(m,a)),[m]),St=o.useMemo((()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:gt,onClose:()=>D(null),onCreateTransfer:Ct,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null),[F,R,Me,mt,le,pt,ht,gt,Ct]),Fn=St!=null,{selectedAccountId:ge}=xn,ft=Je(je.accountSettingsView.saveState.fetchState),Un=x((a=>Io(a.accountState,a.accountListState,"accountList"))),Bn=x((a=>Eo(a))),Ce=tt!=null?To(tt):F,On=x((a=>a.entityAutoCompleteState.autoCompleteText.common));if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(V),Se=Fe(It.start),fe=Fe(It.end);if(Se==null||fe==null)throw Error(`Invalid start - ${Se} and end - ${fe} period from given ${V}`);const _n=o.useCallback((()=>{i(!1)}),[]),Vn=o.useCallback((()=>{C(!0)}),[]),zn=o.useCallback((a=>{O(a),C(!1)}),[]),Mn=o.useCallback((()=>{O([])}),[]),be=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect((()=>{he===!0&&F==="missing_receipts"&&be==="matching"&&Et!=null&&m(on({cacheOverride:!0}))}),[he,F,be,Et,m]);const Tt=ze?.userId,Ln=V.month,jn=V.year,kt=n?.tenantId;o.useEffect((()=>{F==="missing_receipts"&&he!==!1&&be==="idle"&&Tt!=null&&kt!=null&&m(ko())}),[F,he,be,Tt,kt,Ln,jn,m]),o.useEffect((()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)}),[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect((()=>{Ce!=null&&F!==Ce&&m(nn(Ce))}),[Ce]),o.useEffect((()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Vt(!1,!1,te)))}),[Xe,ie,d,te]),o.useEffect((()=>{!at&&d&&(m(Vt(!1,!1,te)),m(de(V,ge,!1,!1)))}),[V.month,V.year,d,te]);const yt=o.useCallback(((a=!1,U=!1)=>{const j={start:Se,end:fe};switch(F){case"transaction_categorization":m(me(Le,j,a,!Ve,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(V,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(V.year,V.month,0),w=bo($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(yo(j,U));break;case"missing_receipts":m(an(j,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(V,ge,a,U))}}),[F,Se,fe,n.companyId,n.tenantId,Le,V,ge,Ve,nt,te]);o.useEffect((()=>{F===Ce&&ie.fetchState==="Not-Started"&&d&&yt(!0)}),[ie,Se,fe,n.companyId,n.tenantId,d]),o.useEffect((()=>{at||Ve||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,yt(!0,!0))}),[]),o.useEffect((()=>{Z.fetchState!=="In-Progress"&&Z.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!1}))}),[Z.fetchState,n.tenantId]),o.useEffect((()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)}),[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect((()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))}),[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,V,n.companyId,d]),o.useEffect((()=>{const a=setInterval((()=>{Z.fetchState!=="In-Progress"&&Z.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(a)}),[Z.fetchState,n.tenantId,V,m]),o.useEffect((()=>{const a=setInterval((()=>{F==="reconciliation"&&ge==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(V,void 0,!0,!0))}),3e5);return()=>clearInterval(a)}),[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,ge,V]);const $n=jt();o.useEffect((()=>{const a=(Z.monthEndCloseChecks?.monthEndCloseCheckList.find((U=>U.id==="month_end_insights"))?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Z.monthEndCloseChecks?.reportEmailSentDate==null||v("../")}),[F,Z.monthEndCloseChecks]);const qn=r===!0?S:B,Gn=r===!0||b===!0,Nn=r===!0?I:t;o.useEffect((()=>{ft==="In-Progress"&&je.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())}),[ft,je.accountSettingsView.saveState.fetchState,zt]);const{transactionId:bt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:j,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let H,Y,Q;const N=jt(),W=a.transactionView;let vt=()=>{};const{transactions:Hn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Wn}=W;if(j==="transaction_categorization"){const $e=Wn.find((re=>re.transactionId===ue)),K=Hn.find((re=>re.id===ue)),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(Q={id:ue,type:Ze(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=W.transactionLocalData.find((Ae=>Ae.transactionId===ue))?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map((aa=>aa.id))??[]};w(Qe({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x(($e=>Pt($e,void 0,H,Y)));return{transactionId:Q,onSaveVendor:()=>{w(fa(Q,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{Q!=null&&w(ga({transactionId:Q})),w(Ca()),w(Sa()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{_(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Qn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,j)=>{j.onReconciliationPusherEventReceived(a)}};return Cn?.loggedInUserRoleMap==null?Z.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:y,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{C(!1)},children:h.jsx(bs,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>C(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),bt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:bt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}),h.jsx(ks,{...Qn,navigate:v,location:g,themeState:ee,categoryOptions:bn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:On,entityAutoCompleteView:yn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:Tn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:St,onOpenTransferRightPanel:st===!0?Oe:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:Vn,handleEditClick:_n,tenantEmailDomain:gn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:_e,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:kn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})}))),bs=Ue(sa)`
|
|
21
|
+
`;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const b=Be.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const S=x((r=>ha(r,t,b)));return o.useEffect((()=>{f()}),[]),h.jsx(h.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=No.getLocalizedStrings(),Nt=Lo,Ts=ca((function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:g}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:g,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}}),(function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:b,isUncategorizedExpenseCategoryEnabled:S,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:g,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),_=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,y,C)=>{t(_t(e,n,{fetchState:"In-Progress"}));const A=()=>t(_t(e,n,{fetchState:"Error"}));Zo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,C,n,c,i,y).then((O=>{O!=null?t(uo(e,O)):A()})).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{_!=null&&z!=null&&t(an({start:z,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Vo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(_o(e))},onConfirmBulkUploadMatch:(e,n,c,i,y)=>{t(Oo(e,n,c,i,y))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),_!=null&&z!=null&&t(me(c,{start:z,end:_},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(S))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:y}=n,C=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),O=Ye(G.accruedExpensesAccountList,y.selectedOptions),R={selectedPrepaidExpensesAccountIds:C.map((D=>D.accountId)),selectedFixedAssetsAccountIds:A.map((D=>D.accountId)),selectedAccruedExpensesAccountIds:O.map((D=>D.accountId))};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:y,scheduleExpenseCategory:C,vendor:A}=n,{allAccountList:O,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,L=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((J=>J.id===A?.selectedOption)):void 0,oe={id:L?.zeniId??A?.selectedOption??"",name:L?.name??A?.defaultOptions.find((J=>J.value===A?.selectedOption))?.label??"",logo:L?.logo},se=C?.selectedOption!=null?O.find((J=>J.qboId===C.selectedOption)):void 0,Oe=y?.selectedOption!=null?R.find((J=>J.classId===y.selectedOption)):void 0,_e=i?.selectedOption!=null?D.find((J=>J.qboId===i.selectedOption)):void 0;t(Wa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Oe?.classId,updatedAccumulatedDepreciationCategoryID:_e?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ha(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Qa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Za())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ja())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,y,C,A,O,R,D,L,oe,se)=>{t(ja(e,n,c,i,k,y,C,A,O,R,D,L,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(me(e,{start:z,end:_},!1,!1)),t(La(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:_},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),_!=null&&z!=null&&t(me(e,{start:z,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,y,C,A)=>{_!=null&&z!=null&&t(me(e,{start:z,end:_},!0,c,n,i,y,C,A))},resetTransactionCategorizationLocalData:(e,n,c,i,y,C,A,O)=>{t(za(e,n,c,i,O??null,y,C,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,y)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:y,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Va(e,n,c,S))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(_a({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&t(Ba({transactionId:O,customerUpdates:C})),t(Oa({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Qe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&(t(Da({transactionId:O,vendorUpdates:{name:C.name,id:C.id?C.id:void 0}})),t(Fa({vendorId:C.id?C.id:void 0,localData:{vendorName:C.name,vendorId:C.id?C.id:void 0}}))),C?.id?(t(Ft({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Qe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:O.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ht({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Qt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(ba({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ya({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(Ta({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ze("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Zt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||T!=="reconciliation"||t(de(E,d,!0,!0))}}}),((t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...b}=B;return(function(S,r,I){return{...S,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,S.authParams)}}})(t,l,b)}))(Jo(Yo)),ys=us((function(t){const l=t.displayName??t.name??"Component",B=Jt.memo(t),f=b=>{const S=pe(),r=(function(){const P=pe(),E=x((T=>Ie(T).reconciliation.selectedDrawerAccountId));return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback((T=>{P(De({selectedDrawerAccountId:T}))}),[P]),closePanel:o.useCallback((()=>{P(De({selectedDrawerAccountId:void 0}))}),[P])}})(),I=x((P=>Ie(P).reconciliation)),s=x((P=>Re(P))),p=o.useCallback(((P,E)=>{S(Wt("expense_automation_reconcile",P,E))}),[S]),u=o.useCallback(((P,E)=>{const T=s?.companyId;T!=null&&(S(Xt(P,T,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),S(en({accountId:E,connectionInProgress:!0})))}),[S,s?.companyId]),k=o.useMemo((()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Ss,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})}),[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo((()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel})),[k,r.isOpen,r.closePanel]),g=o.useContext(Lt),m=o.useMemo((()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:g),[r.isOpen,r.closePanel,r.selectedAccountId,g]);return h.jsx(Lt.Provider,{value:m,children:h.jsx(B,{...b,...v})})};return f.displayName=`withReconSidePanel(${l})`,f})((({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:b,reconPanelContent:S,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Qo(),u=Ho(),{isOpen:k}=Wo(),v=Yt(),g=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),T=o.useCallback((()=>{b===!0&&f!==!0&&t?.()}),[t,b,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x((N=>Ie(N))),U=Ke(),{currentSelectedViewFetchState:j,currentSelectedView:$,selectedPeriod:w}=a,H=Je($),Y=Je(j.fetchState),Q=o.useCallback((N=>{const W=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,W??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,W??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,W??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,W??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),W??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,W??null)}),[w,a]);return o.useEffect((()=>{Y===j.fetchState&&$===H||j.fetchState!=="Completed"||Q(!1)}),[$,j.fetchState,H]),Q})(),ee=Xo(),[z,_]=o.useState(!1),e=x((a=>Pt(a))),n=x((a=>Re(a))),[c,i]=o.useState(!1),[y,C]=o.useState(!1),[A,O]=o.useState([]),[R,D]=o.useState(null),L=o.useCallback((()=>{D(null)}),[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback((a=>{a!=null?(s&&p(!1),u(),T(),D({contentType:"activity",detail:{transactionId:a}})):D((U=>U?.contentType==="activity"?null:U))}),[T,s,u,p]),Oe=o.useCallback((a=>{s&&p(!1),u(),T(),D({contentType:"transfer",detail:a})}),[T,s,u,p]),_e=o.useCallback((()=>{u(),L(),T(),E()}),[T,L,E,u]),J=o.useRef(s);o.useEffect((()=>{s===!0&&J.current===!1&&(u(),L(),T()),J.current=s}),[T,L,s,u]);const He=o.useRef(k);o.useEffect((()=>{k===!0&&He.current===!1&&(s&&p(!1),L(),b===!0&&f!==!0&&t?.()),He.current=k}),[L,t,k,s,p,f,b]);const ke=b===!0&&f!==!0,We=o.useRef(ke);o.useEffect((()=>{ke&&!We.current&&(s&&p(!1),u(),L()),We.current=ke}),[L,s,ke,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:gn}=xt(),[Ve,nt]=o.useState(g.state?.message==="comingFromTransactionDetail"),at=g.state?.message==="comingFromOverview",Cn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Sn,useFeatureGate:ce}=sn(),{configValue:fn}=Sn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=ce(X.isJEScheduleCOTEnabled),Tn=o.useCallback((a=>{const U=Ze(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)}),[l]),yn=x((a=>po(a,"common"))),M=x((a=>Ie(a))),{categoryOptions:bn,paymentAccountNames:vn}=x((a=>ho(a.accountState))),An=x((a=>go(a.classState))),{monthEndCloseChecksView:Z,currentSelectedView:F,selectedPeriod:V,selectedTransactionCategorizationTab:Le,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:je,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x((a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView)),rt=x((a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,(()=>{const a=[],U=ut.current,j=dt.current,$=j!=null&&U!=null?j[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const Y=H?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const Q of Object.values(Y)){const N=Q?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const H of w)for(const Y of H.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a}));o.useEffect((()=>{F==="transaction_categorization"&&b!==!0||se(void 0)}),[F,se,b]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,Te=`${Le}|${Rn}`,ye=o.useRef(null);o.useEffect((()=>{ye.current!==null?ye.current!==Te&&(ye.current=Te,F==="transaction_categorization"&&L()):ye.current=Te}),[L,F,Te]);const Dn=x((a=>oe==null?void 0:Co(a.transactionState,oe))),le=Dn?.qboId,mt=x((a=>le==null?void 0:So(a,le)));o.useEffect((()=>{le!=null&&m(fo(le))}),[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:gt}=M.transactionView,Ct=o.useCallback((a=>rs(m,a)),[m]),St=o.useMemo((()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:gt,onClose:()=>D(null),onCreateTransfer:Ct,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null),[F,R,Me,mt,le,pt,ht,gt,Ct]),Fn=St!=null,{selectedAccountId:ge}=xn,ft=Je(je.accountSettingsView.saveState.fetchState),Un=x((a=>Io(a.accountState,a.accountListState,"accountList"))),Bn=x((a=>Eo(a))),Ce=tt!=null?ko(tt):F,On=x((a=>a.entityAutoCompleteState.autoCompleteText.common));if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(V),Se=Fe(It.start),fe=Fe(It.end);if(Se==null||fe==null)throw Error(`Invalid start - ${Se} and end - ${fe} period from given ${V}`);const _n=o.useCallback((()=>{i(!1)}),[]),Vn=o.useCallback((()=>{C(!0)}),[]),zn=o.useCallback((a=>{O(a),C(!1)}),[]),Mn=o.useCallback((()=>{O([])}),[]),be=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect((()=>{he===!0&&F==="missing_receipts"&&be==="matching"&&Et!=null&&m(on({cacheOverride:!0}))}),[he,F,be,Et,m]);const kt=ze?.userId,Ln=V.month,jn=V.year,Tt=n?.tenantId;o.useEffect((()=>{F==="missing_receipts"&&he!==!1&&be==="idle"&&kt!=null&&Tt!=null&&m(To())}),[F,he,be,kt,Tt,Ln,jn,m]),o.useEffect((()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)}),[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect((()=>{Ce!=null&&F!==Ce&&m(nn(Ce))}),[Ce]),o.useEffect((()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Vt(!1,!1,te)))}),[Xe,ie,d,te]),o.useEffect((()=>{!at&&d&&(m(Vt(!1,!1,te)),m(de(V,ge,!1,!1)))}),[V.month,V.year,d,te]);const yt=o.useCallback(((a=!1,U=!1)=>{const j={start:Se,end:fe};switch(F){case"transaction_categorization":m(me(Le,j,a,!Ve,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(V,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(V.year,V.month,0),w=bo($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(yo(j,U));break;case"missing_receipts":m(an(j,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(V,ge,a,U))}}),[F,Se,fe,n.companyId,n.tenantId,Le,V,ge,Ve,nt,te]);o.useEffect((()=>{F===Ce&&ie.fetchState==="Not-Started"&&d&&yt(!0)}),[ie,Se,fe,n.companyId,n.tenantId,d]),o.useEffect((()=>{at||Ve||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,yt(!0,!0))}),[]),o.useEffect((()=>{Z.fetchState!=="In-Progress"&&Z.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!1}))}),[Z.fetchState,n.tenantId]),o.useEffect((()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)}),[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect((()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))}),[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,V,n.companyId,d]),o.useEffect((()=>{const a=setInterval((()=>{Z.fetchState!=="In-Progress"&&Z.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:V,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(a)}),[Z.fetchState,n.tenantId,V,m]),o.useEffect((()=>{const a=setInterval((()=>{F==="reconciliation"&&ge==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(V,void 0,!0,!0))}),3e5);return()=>clearInterval(a)}),[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,ge,V]);const $n=jt();o.useEffect((()=>{const a=(Z.monthEndCloseChecks?.monthEndCloseCheckList.find((U=>U.id==="month_end_insights"))?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Z.monthEndCloseChecks?.reportEmailSentDate==null||v("../")}),[F,Z.monthEndCloseChecks]);const qn=r===!0?S:B,Gn=r===!0||b===!0,Nn=r===!0?I:t;o.useEffect((()=>{ft==="In-Progress"&&je.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())}),[ft,je.accountSettingsView.saveState.fetchState,zt]);const{transactionId:bt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:j,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let H,Y,Q;const N=jt(),W=a.transactionView;let vt=()=>{};const{transactions:Hn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Wn}=W;if(j==="transaction_categorization"){const $e=Wn.find((re=>re.transactionId===ue)),K=Hn.find((re=>re.id===ue)),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(Q={id:ue,type:Ze(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=W.transactionLocalData.find((Ae=>Ae.transactionId===ue))?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map((aa=>aa.id))??[]};w(Qe({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x(($e=>Pt($e,void 0,H,Y)));return{transactionId:Q,onSaveVendor:()=>{w(fa(Q,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{Q!=null&&w(ga({transactionId:Q})),w(Ca()),w(Sa()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{_(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Qn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,j)=>{j.onReconciliationPusherEventReceived(a)}};return Cn?.loggedInUserRoleMap==null?Z.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:y,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{C(!1)},children:h.jsx(bs,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>C(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),bt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:bt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}),h.jsx(Ts,{...Qn,navigate:v,location:g,themeState:ee,categoryOptions:bn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:On,entityAutoCompleteView:yn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:St,onOpenTransferRightPanel:st===!0?Oe:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:Vn,handleEditClick:_n,tenantEmailDomain:gn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:_e,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:Tn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})}))),bs=Ue(sa)`
|
|
22
22
|
display: flex;
|
|
23
23
|
min-height: 100%;
|
|
24
24
|
flex-direction: column;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-s55OcG-D.js";import{a as r}from"./sentry-qwy54zvC.js";import{a5 as l,a6 as p,a7 as m,r as c}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import f from"./NotFoundScreen-wlhddpbg.js";import{h as u,g as b}from"./core-CnGMK-sC.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]="5a21547d-8d37-447e-91de-3190153d226c",e._sentryDebugIdIdentifier="sentry-dbid-5a21547d-8d37-447e-91de-3190153d226c")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=c(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./sentry-qwy54zvC.js";import{u as f,h as l,g as m}from"./core-CnGMK-sC.js";import{ht as p,Mj as b,Mk as g}from"./zeni-epic-state-NrbJoBOX.js";import{u as _,L as h,z as y}from"./index-D7tfVykC.js";import"./liveblocks-s55OcG-D.js";import"./recharts-CmLekiCG.js";import"./mui-CggbPNN2.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7bdb0c0b-4008-400a-98f6-b177b9affb24",e._sentryDebugIdIdentifier="sentry-dbid-7bdb0c0b-4008-400a-98f6-b177b9affb24")}catch{}})();function C(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,b("revenue"),g("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{C as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-s55OcG-D.js";import{i as S,n as g,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-CnGMK-sC.js";import{Mc as k,Md as v,Me as F,Bg as B,B2 as T,Mf as D,Mg as oe,Mh as ie,B6 as se,fy as $,Bd as le,Ba as re}from"./zeni-epic-state-NrbJoBOX.js";import{m as x,o as r,n as de,d as j,j as G,q as ce,r as me,s as pe,v as V,C as ue,G as he,D as ge,Q as xe,y as fe,w as we,B as be,x as Se,H as ye,S as ke,A as ve,F as je,M as $e}from"./index-D7tfVykC.js";import{n as m}from"./mui-CggbPNN2.js";import f from"./NotFoundScreen-wlhddpbg.js";import{a as I}from"./sentry-qwy54zvC.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="6eed3f7c-2655-4ccc-b517-1e498012ee1f",e._sentryDebugIdIdentifier="sentry-dbid-6eed3f7c-2655-4ccc-b517-1e498012ee1f")}catch{}})();const Ie=m.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -7,7 +7,7 @@ import{j as t}from"./liveblocks-tpE-grBU.js";import{i as S,n as g,h as C,g as y,
|
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
9
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
-
`,Ce=g((function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}}),(function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(
|
|
10
|
+
`,Ce=g((function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}}),(function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(F({data:l}))}}}))(de);function M(){const e=x(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
height: 100vh;
|
|
13
13
|
width: 100%;
|
|
@@ -25,7 +25,7 @@ import{j as t}from"./liveblocks-tpE-grBU.js";import{i as S,n as g,h as C,g as y,
|
|
|
25
25
|
align-items: center;
|
|
26
26
|
background-color: ${e=>e.theme.colors.grey4};
|
|
27
27
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
-
`,Ne=g((function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(
|
|
28
|
+
`,Ne=g((function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=V(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}}))(pe);function Ee(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:i})})})}const Me=m.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
height: 100%;
|
|
31
31
|
width: 100%;
|
|
@@ -34,7 +34,7 @@ import{j as t}from"./liveblocks-tpE-grBU.js";import{i as S,n as g,h as C,g as y,
|
|
|
34
34
|
align-items: center;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
36
|
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
-
`,
|
|
37
|
+
`,Fe=g((function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}}),(function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(ie({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=V(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}}))(ge);function Te(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Me,{windowSize:n,children:t.jsx(Fe,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Ge={containerWidth:new je(100,58)},Ve=m(ke)`
|
|
38
38
|
width: ${r.sp4};
|
|
39
39
|
height: ${r.sp4};
|
|
40
40
|
margin-bottom: ${r.sp3};
|
|
@@ -69,4 +69,4 @@ import{j as t}from"./liveblocks-tpE-grBU.js";import{i as S,n as g,h as C,g as y,
|
|
|
69
69
|
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
70
|
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
71
|
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
-
`,We=g((function(e,a){return{file:a.file,type:a.type}}))(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),d=s.get("token"),_=n.pathname.includes("address"),
|
|
72
|
+
`,We=g((function(e,a){return{file:a.file,type:a.type}}))(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),d=s.get("token"),_=n.pathname.includes("address"),w=x(),H=xe(),A=fe(),b=we(),K=()=>{H.toggle()},W=E((u=>k(u))),U=E((u=>v(u))),{authParams:q,fetchState:c,billAttachment:Q,billFetchState:P,companyName:J,currencySymbol:O,amount:R}=W,{tenantId:z,userId:L,sessionId:N}=q,{fetchState:X,internationalBankAccountCreateStatus:Y}=U;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{b&&c==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(le(i,o,d))}),[b,c,i,o,d,a]),I.useEffect((()=>{b&&c==="Completed"&&($(L,N,z),l!=null&&a(re(l)))}),[c,b,L,N,z,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",i??"",J,l??"",Ue(n.pathname),O,R))(u)}),t.jsxs(_e,{windowSize:w,children:[w!=="small"?t.jsx(Ve,{onClick:K}):null,t.jsx(Ke,{windowSize:w,isAddressPage:_,children:P==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(We,{file:Q,type:"bill"})}),t.jsx(He,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function qe(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(qe,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(M,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(M,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Ae,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Te,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-s55OcG-D.js";import{a as g}from"./sentry-qwy54zvC.js";import{u as j,g as F,h as O,t as w,j as l,N as T}from"./core-CnGMK-sC.js";import{z as r,y as V,a as P,e as A,d as N,f as H,p as R,H as W,g as Y}from"./index-D7tfVykC.js";import{eV as Z,LZ as $,M7 as q,L_ as B,fy as G,f_ as J,M3 as K,go as Q,cY as X,M8 as ee,M9 as te}from"./zeni-epic-state-NrbJoBOX.js";import{n as ne}from"./mui-CggbPNN2.js";import{u as se}from"./useDeviceId-DPOieVuC.js";import{f as ae}from"./analyticsHelper-CbsMOq15.js";import{t as ie}from"./getLocaleForTenant-BuGWeb9s.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c1928785-1b3f-43ba-97c8-9eeb106b2f1c",t._sentryDebugIdIdentifier="sentry-dbid-c1928785-1b3f-43ba-97c8-9eeb106b2f1c")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=j(),a=F(),m=O(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:z,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),k=l((e=>e.tenantState.activeTenantFetchState.fetchState)),I=l((e=>e.tenantState.signInState)),b=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>Z(e))),h=l((e=>$(e))),E=r.getSignedInUser(),v=V().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(q(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),g.useEffect((()=>{I!=="In-Progress"||S!=="Completed"&&k!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(h.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(J(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,h.tenantsInOrder),Q().then((()=>{const e=Y();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(H.Event.loginSuccess,"email",X(o.productSettings))}),2e3))}),[I,S,k,s,o,h,v,a.state,t]);const M=g.useCallback((()=>{m("/signin/auth")}),[m]),U=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),_=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(b==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:z,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:U,onVerifyOtp:_,onCancelVerifyDevice:M});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||f==null||b==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||b==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{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{xe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as V}from"./liveblocks-s55OcG-D.js";import{a as l}from"./sentry-qwy54zvC.js";import{u as fe,j as n,i as He,g as Qe,h as We,l as P}from"./core-CnGMK-sC.js";import{eV as me,fD as qe,fE as pe,fp as Je,bn as Ke,eU as Xe,fF as ea,fG as aa,fI as ta,fL as na,fM as g,fO as sa,fP as de,fS as oa,fQ as ia,fR as ra,fT as da,cO as ca,fV as la,cU as ua,fo as fa,f_ as ma,f$ as pa,fZ as ba}from"./zeni-epic-state-NrbJoBOX.js";import{a9 as ha,aa as Sa,Q as ga,C as Ea,z as k,w as ka,u as Ca,G as r,i as ya,E as Ia,ab as Ta,T as _a,c as wa,ac as Aa,a5 as Da,ad as Fa,ae as va,af as ce,ag as le,L as $a,ah as Ga,ai as ue,d as R,a1 as Ma,v as _,aj as x,ak as Pa}from"./index-D7tfVykC.js";import{D as Ra}from"./mui-CggbPNN2.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]="bcc94a11-05ec-4440-a28f-d1639da287b1",f._sentryDebugIdIdentifier="sentry-dbid-bcc94a11-05ec-4440-a28f-d1639da287b1")}catch{}})();const xa=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=He(),a=Qe(),C=ga(),o=We(),U=Je(),m=fe(),{useFeatureGate:i}=Ea(),B=k.getSignedInUser(),N=Ke(B),s=n((e=>me(e))),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>Xe(e))),L=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[w,j]=l.useState(void 0),A=P("/:tenantEmailDomain/dashboard")!==null,Z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n((e=>aa(e)));l.useEffect((()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,D.fetchState,I]);const h=k.getSignedInUser(),F=n((e=>e.tenantState)),Ce=n((e=>F.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:_e}=i(r.isExpenseAutomationEnabledV2),H=Ia(),{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=N||!N&&ve,Ge=n((e=>g(e).totalUnreadCount)),Me=n((e=>g(e).reducedFetchCountState)),Q=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),W=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),Pe=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:q,isLoading:J,isFetchingMore:K,hasFetchedAll:X,fetchMore:Re}=Ta();l.useEffect((()=>{const e=setTimeout((()=>Re?.()),0);return()=>clearTimeout(e)})),l.useEffect((()=>{if(J===!1&&K===!1&&X===!0)if(s?.companyId!=null&&q!=null){const e=`dashboard_${s.companyId}`;j(q.filter((u=>u.roomId===e&&u.readAt==null)).length)}else j(0)}),[J,K,X]),l.useEffect((()=>{y&&!I&&Pe.fetchState==="Not-Started"&&U.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,U.tenantId]),l.useEffect((()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),l.useEffect((()=>{w!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:w},"comments")))}),[w,$.fetchState]);const xe={fetchStatus:Me,count:Ge},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),H===!1&&S.push("expense_automation_card");const Ve=_a(),te=n((e=>ia(e,S,h,_e,Te).fetchState)),ne=n((e=>ra(e).fetchState)),Ue=A&&(te==="Completed"||te==="Error")||Z&&(ne==="Completed"||ne==="Error")||!A&&!Z?void 0:"disabled",Be=l.useMemo((()=>da(s.userRole)),[s.userRole]),Ne=ca(Be),Oe=s?.rewardsLastViewedTime==null,Le=h?.userEmail!=null&&Y.fetchState==="Completed"&&la(Y.notificationSettings,h.userEmail,z,s),se=wa(),je=se&&Aa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=l.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Da(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[Ze,re]=l.useState(G);l.useEffect((()=>{re(G())}),[G]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);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(va,{signedInUser:B,currentTenantId:F.currentTenantId??"",tenants:F.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:le(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ne,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:Le,notificationCountDetails:xe,isExpenseAutomationEnabledForUser:H,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=Q===0&&W>0?"notifications/comments":"notifications/tasks";le(a)&&(e=Q===0&&W>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),!be)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=_(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=_(a.state?.pathnameStackToGoBack,a.pathname),c=e.type,p=x(c)&&c!=="command_center";if(x(e.type)&&E[s.tenantId]!=null&&R.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),p&&E[s.tenantId]!=null){const b=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=Pa(e.type);ue(e.type)?(L!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,c=ce(a);let p=`/${encodeURIComponent(u)}/`;const M=x(c);c==="home"?p+="dashboard":c==="users_and_roles"?p+="people":Ga(c)?p+="settings/my_profile":ue(c)?p+=`ai-cfo/${c}`:p+=c==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(c),o(p,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(pa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;R.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:je,aiCfoView:O,isOnDashboard:A,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:De,newYearAnimationEnabled:Fe})})})),ja=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&qe(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return V.jsx(xa,{...f,...a})};export{ja as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-s55OcG-D.js";import{h as n,n as e}from"./core-CnGMK-sC.js";import{U as i}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import"./sentry-qwy54zvC.js";import"./zeni-epic-state-NrbJoBOX.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="8f21ada1-163d-445e-848f-3449dc675a20",o._sentryDebugIdIdentifier="sentry-dbid-8f21ada1-163d-445e-848f-3449dc675a20")}catch{}})();const a=e(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as ct,a as dt,m as mt,j as E}from"./liveblocks-
|
|
1
|
+
import{l as ct,a as dt,m as mt,j as E}from"./liveblocks-s55OcG-D.js";import lt from"./NotFoundScreen-wlhddpbg.js";import{a as k}from"./sentry-qwy54zvC.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as L}from"./core-CnGMK-sC.js";import{cv as St,fF as Z,eV as J,fT as bt,fM as b,SX as K,fP as m,fE as y,sq as $,xY as It,SY as Ct,fD as Tt,fV as yt,sv as _t,SZ as F,bo as M,fx as w,sz as Y,S_ as At,cH as Et,cA as Nt}from"./zeni-epic-state-NrbJoBOX.js";import{_ as xt,z as Bt,C as wt,G as vt,a0 as Dt,cW as Rt,v as N,a9 as Pt,cX as Gt,aa as Ut,r as Ft}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="35f8dfda-e464-4721-abdd-9702087b2e0e",t._sentryDebugIdIdentifier="sentry-dbid-35f8dfda-e464-4721-abdd-9702087b2e0e")}catch{}})();const $t=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=Z(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=J(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:x,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,d,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"}})}d==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,d)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){d==="unread"&&(x(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(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(m(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const d=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(d,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const d=[];o==="all"?d.push("read","unread"):o!=="mentions"&&d.push(o),t($("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(a,o,d,c)=>{a==="tasks"?t(Y("task_manager",d,c)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{d==="read"&&(x(r),t(F([r],M())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),$t(s,x).then((()=>{t(F(s,M())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(m({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Pt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,v]=k.useState(!1),a=S((e=>Z(e))),o=S((e=>J(e))),{useFeatureGate:d}=wt(),{isFeatureEnabled:c}=d(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Mt({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const O=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),Q=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),R=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Rt().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:P,fetchMore:ot}=ct(),{threads:W,isLoading:z,fetchMore:X,isFetchingMore:q,hasFetchedAll:H}=dt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Q.fetchState==="Not-Started"&&s(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter((T=>T.roomId===e&&T.readAt==null)).length;s(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,C]),k.useEffect((()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const G=_||P===!0||C!==!0||_||P===!0||C!==!0;k.useEffect((()=>{G&&R!=="In-Progress"?s(m({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(m({fetchState:"Completed",error:void 0},"comments"))}),[G,R]),k.useEffect((()=>{s(y({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(v(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&z===!1&&B!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=B.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),T=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const U=W.find((rt=>rt.id===f.threadId));return U!=null?{inboxNotification:{...f,threadId:U.id},thread:U}:(q||H===!0||X==null||X(),null)})).filter((f=>f!=null));s(m({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}}),[_,P,q,C,H,z,B?.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 A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s($("task_manager",T,A,!0))}}}},nt=mt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:O,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(L,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(L,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-s55OcG-D.js";import{a as r}from"./sentry-qwy54zvC.js";import{u as T,g as j,j as o,N as A}from"./core-CnGMK-sC.js";import{Mm as C,eV as L,fL as P,Mn as x,Mo as z,Mp as D,Mq as N,ob as R,Lj as q}from"./zeni-epic-state-NrbJoBOX.js";import{z as h,N as I}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="4c80c875-6314-4b23-840f-eaa535d40740",n._sentryDebugIdIdentifier="sentry-dbid-4c80c875-6314-4b23-840f-eaa535d40740")}catch{}})();function ee(){const n=T(),s=j(),{params:t,error:i}=r.useMemo((()=>C(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o((e=>L(e))),l=o((e=>P(e))),d=o((e=>e.tenantState.fetchState)),y=o(x),b=o(z),c=o(D),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(N())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(R(a.userId,a.zeniSessionId??void 0))))}),[p,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const M=r.useMemo((()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((U=>U.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[m?.tenantId,l]),u=v??M;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(q(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(A,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-s55OcG-D.js";import{h as z,u as H,g as J,i as K,j as d,n as Z,o as Q,p as I}from"./core-CnGMK-sC.js";import{eV as U,se as O,rO as X,MT as v,rJ as T,bs as ee,bn as ae,bY as te,rK as se,MU as oe,MG as C,dH as re,vV as ne,MV as ie,wg as ce,fC as le,fA as de}from"./zeni-epic-state-NrbJoBOX.js";import{z as me,_ as fe,a0 as pe,T as ue,C as M,G as $,x as he,d as w,ap as ge,v as Fe}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import be from"./NotFoundScreen-wlhddpbg.js";import{F as Ie}from"./FeaturePreviewScreen-Di3PuVRR.js";import{a as g}from"./sentry-qwy54zvC.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import{u as Te}from"./useInitialThreadRequest-CXnpfTcs.js";import{t as Se}from"./routePaths-CVAI7AUa.js";import{M as ye}from"./MobileAppDrawer-NdU6zrS3.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="10e0a30f-2227-4447-90db-e04f27f848e6",s._sentryDebugIdIdentifier="sentry-dbid-10e0a30f-2227-4447-90db-e04f27f848e6")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=Z((function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(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=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=Fe(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("../../")}}}))(ge);function P(){const s=z(),e=H(),a=J(),{forecastId:o,tenantEmailDomain:r}=K(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d((t=>U(t))),V=y.company?.companyInfo.firstMonthOfFY??1,c=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),A=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>x.pandLByForecastID[t]!=null&&se(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex((b=>b.id===L)):R!=null?f.forecasts.findIndex((b=>b.id===R)):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!k(c.forecasts[t].id)&&F&&e(T(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,O,T,F]);const D=ue(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:N}=M(),{isFeatureEnabled:j}=N($.isReportsCommentingEnabled),W=Te(j?y?.companyId:void 0,{clearParams:l&&m}),[q,Y]=g.useState(!1),E=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:q,handleDrawerToggle:E}),n.jsx(xe,{firstMonthOfFY:V,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:k,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d((i=>U(i))),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-s55OcG-D.js";import{MP as ne,eV as Y,kz as G,fC as X,fA as oe,Kh as q,Mt as ie,uS as ke,MQ as N,uH as Pe,v0 as Ee,uW as re,uL as le,u_ as je,uX as ve,MR as de,wH as Le,fm as Te,ge as Ae,MS as M,uP as ce,uO as pe,v3 as Re,c6 as Fe}from"./zeni-epic-state-NrbJoBOX.js";import{m as ue,C as ee,G as z,z as W,i as me,J as ge,I as fe,al as he,am as Oe,F as Ce,o as O,K as ye,a as be,an as Ve,_ as Ze,a0 as Be,x as Ue,d as Se,f as $e,v as He,ao as Me,T as ze}from"./index-D7tfVykC.js";import{D as we,n as J,S as xe}from"./mui-CggbPNN2.js";import se from"./NotFoundScreen-wlhddpbg.js";import{a as d}from"./sentry-qwy54zvC.js";import{u as ae,i as Ke,j as g,h as _e,g as Ge,n as We,o as te,p as H}from"./core-CnGMK-sC.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import{M as Qe}from"./MobileAppDrawer-NdU6zrS3.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="acc0961b-cd18-4d5e-8173-c4dba9122819",e._sentryDebugIdIdentifier="sentry-dbid-acc0961b-cd18-4d5e-8173-c4dba9122819")}catch{}})();const Ne={overlayWidth:new Ce(100,100,48)},K=be.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=ue(),m=ae(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ke(),r=g((l=>ne(l))),p=g((l=>Y(l))),P=g((l=>G(l))),{useFeatureGate:D}=ee(),{isFeatureEnabled:I}=D(z.isDebitCardFeatureEnabled),E=X(I,p),L=oe(p),T=q(p),B=ie(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!E&&P&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(N()),b()},A=()=>{V===!0?S(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=D(z.isChargeCardFeatureEnabled),v=me(p,j,I),{isCardsHidden:R}=ge(p?.tenantId),y=!v||R,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:P,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(le(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(re({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?Pe(e):Ee(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Xe,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(he,{titleComponent:a.jsx(De,{children:K.discardTitle}),descriptionComponent:a.jsx(Ie,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:o,isEditPopup:!0}):null,a.jsx(Oe,{...s})]})})},Xe=J(xe)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,De=J(ye.H6Regular)`
|
|
6
|
+
margin-top: ${O.sp7};
|
|
7
|
+
padding-left: ${O.sp8};
|
|
8
|
+
padding-right: ${O.sp8};
|
|
9
|
+
color: ${e=>e.theme.colors.primary};
|
|
10
|
+
word-break: break-word;
|
|
11
|
+
`,Ie=J(ye.LargeRegularSp)`
|
|
12
|
+
color: ${e=>e.theme.colors.hero};
|
|
13
|
+
padding-left: ${O.sp8};
|
|
14
|
+
padding-right: ${O.sp8};
|
|
15
|
+
margin-bottom: 30px;
|
|
16
|
+
margin-top: ${O.sp4};
|
|
17
|
+
white-space: pre-line;
|
|
18
|
+
`,qe={overlayWidth:new Ce(100,100,48)},_=be.getLocalizedStrings().peoplePage.invitePage,ea=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=ue(),m=ae(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),w=g((o=>ne(o))),r=g((o=>Y(o))),p=g((o=>G(o))),{useFeatureGate:P}=ee(),{isFeatureEnabled:D}=P(z.isDebitCardFeatureEnabled),I=X(D,r),E=oe(r),L=q(r),T=ie(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{b(),m(N())},C=()=>{V===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=P(z.isChargeCardFeatureEnabled),v=me(r,j,D),{isCardsHidden:R}=ge(r?.tenantId),y=!v||R,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:o=>{m(re({peopleLocalData:o})),Z(!0)},onResetClick:x,onSaveClick:()=>{m(f==="zeni_only"?je(e):ve())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:E,isLoading:U};return d.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(b(),m(N()))}),[w.invitePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(aa,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(he,{titleComponent:a.jsx(De,{children:_.discardTitle}),descriptionComponent:a.jsx(Ie,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:A}):null,a.jsx(Ve,{...s})]})})},aa=J(xe)`
|
|
19
|
+
display: flex;
|
|
20
|
+
min-height: 100%;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
`,sa=We((function(e,t){const c=de(e),n=W.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:Se}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(le(i,b))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(ce()),e(pe(n,f))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(M({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(M({searchText:i}))}}}}))(Me);function Q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=_e(),n=ae(),f=Ge(),{areTenantIdsInSync:i}=Ze(),b=W.getSignedInUser(),h=g((s=>Y(s))),{useFeatureGate:m}=ee(),{isFeatureEnabled:V}=m(z.isDebitCardFeatureEnabled),Z=g((s=>G(s))),k=!X(V,h)&&Z,S=q(h),w=h?.tenantId,{tenantEmailDomain:r}=h,[p,P]=d.useState(!1),[D,I]=d.useState(!1),[E,L]=d.useState(!1),[T,B]=d.useState("off"),[U,x]=d.useState(!1),C=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Je({mobileExploreReferrer:"People"}),u=g((s=>de(s)));Be({isDataReady:u.fetchState==="Completed"});const j=g((s=>Le(s.classState,s.classListState))),v=g((s=>Te(s.userState,s.userRoleState,s.userListViewState,"manager"))),R=g((s=>Ae(s))),y=h?.companyId;d.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(M({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),P(!0),n(ce()))}),[p,b,w,n,u.uiState.mode,i]),d.useEffect((()=>{y!=null&&i&&n(pe(y,k))}),[y,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),L(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(M({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),L(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(Ue,{analytics:Se,onLoad:s=>s.trackPageLoaded($e.Event.members)}):null,D===!0?a.jsx(ea,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:D,managersListView:v,companyPassportView:R,classListView:j,companyId:y,mode:u.uiState.mode}):null,E===!0?a.jsx(Ye,{closeDrawerHandler:F,isEditPeopleDrawerOpen:E,managersListView:v,companyPassportView:R,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Qe,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(sa,{navigate:c,signedInUser:b,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:v,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(M({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(f.state?.pathnameStackToGoBack,f.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function wa(){const e=ze();return Fe(e?.loggedInUserRole??[])?a.jsxs(te,{children:[a.jsx(H,{path:"/",element:a.jsx(Q,{})}),a.jsx(H,{path:"new",element:a.jsx(Q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(H,{path:":userId/edit",element:a.jsx(Q,{isEditPeopleDrawerOpen:!0})}),a.jsx(H,{path:"*",element:a.jsx(se,{})})]}):a.jsx(te,{children:a.jsx(H,{path:"*",element:a.jsx(se,{})})})}export{wa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-s55OcG-D.js";import E from"./NotFoundScreen-wlhddpbg.js";import{a as r}from"./sentry-qwy54zvC.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as V,o as z,p as b}from"./core-CnGMK-sC.js";import{eV as B,S$ as h,bq as F,bn as N,ie as O,fx as $}from"./zeni-epic-state-NrbJoBOX.js";import{Q as q,z as I,a0 as Q,cY as Y}from"./index-D7tfVykC.js";import"./mui-CggbPNN2.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-Bl-nKTXG.js";import{M as H}from"./MobileAppDrawer-NdU6zrS3.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="2e15c30f-60e3-47f4-be3b-cbf1bbcaffbf",e._sentryDebugIdIdentifier="sentry-dbid-2e15c30f-60e3-47f4-be3b-cbf1bbcaffbf")}catch{}})();const J=V((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(Y),K=()=>{const e=_(),t=v(),c=q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const d=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),x=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(l),y=C||x||k,f=r.useCallback(((a,i,T)=>{u(O({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&d.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),d.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||f(a,i,!0),d.current=!0}),[n?.fetchState,f]),j=r.useCallback(((a,i)=>{f(a,i,!1)}),[f]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return Q({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(K,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
|