@zeniai/web-app-ui 5.2.10-next → 5.2.10-prod
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-LVNeLYP6.js +1 -0
- package/dist/assets/{AddressScreen-B73AJWKw.js → AddressScreen-DU5PGaHa.js} +1 -1
- package/dist/assets/{AiCfoScreen-DWBh_hN_.js → AiCfoScreen-Dal50I05.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Buf7hiCY.js → BillPayApprovalRoutes--b4dOiqh.js} +1 -1
- package/dist/assets/{BillPayRoutes-CKcpO7_D.js → BillPayRoutes-Qe9oLK0G.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BqeDbW3o.js → BusinessVerificationPageScreen-cj0nBAsz.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-DQ4N5BPh.js → CardsAiCfoScreen-CAljriY-.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-Bh_MBpoB.js → ChargeCardRoutes-DmiqgV52.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-BGd7r7TH.js → CompanyPassportScreen-t77EmDuD.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-k1a7GClm.js → ConnectionAuthScreen-BwHNPTK_.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DXVwJIIc.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DF-eWgjd.js → CustomerOnboardingRoutes-rv9-7YBi.js} +1 -1
- package/dist/assets/{DashboardRoutes-B2NW2nXj.js → DashboardRoutes-Bd6QrGII.js} +1 -1
- package/dist/assets/{DefaultTenantHome-BgbFIrms.js → DefaultTenantHome-HL_AEVdw.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-BUWvP3WY.js → DomesticWireDetailScreen-E8Co6RZt.js} +1 -1
- package/dist/assets/{DrawerScreen-EFBnv5Mb.js → DrawerScreen-CNi8v2mr.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-Cc8VvCzZ.js → EntityDetailRoutes-Bplb0S27.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-MQoA8t4l.js → ExpenseAutomationRoutes-YzoXuupQ.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-Cbvy-g_f.js → FeaturePreviewScreen-BwTdLVoX.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-BrdOuYlK.js → HubSpotOAuthCallbackScreen-4pIGrClP.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-CDWPjCWd.js → MagicLinkRoutes-DoSx-07S.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-PzfGPMzn.js → MagicLinkSignInScreen-DTUj3h_k.js} +1 -1
- package/dist/assets/{MobileAppDrawer-B1LrayEB.js → MobileAppDrawer-DPnpVzNw.js} +1 -1
- package/dist/assets/NotFoundScreen-bK1Cn_wC.js +1 -0
- package/dist/assets/{NotificationRoutes-ihqDhPX-.js → NotificationRoutes-Bdz73ibp.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BRT_dqI8.js → OAuthConsentScreen-BafIaR7e.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DEhZGiD0.js → PandLWithForecastRoutes-zdcF7G57.js} +1 -1
- package/dist/assets/{PeopleRoutes-DVY4Q7Hp.js → PeopleRoutes-DlbJ8dOb.js} +1 -1
- package/dist/assets/{PerformanceRoutes-wBIg8p9P.js → PerformanceRoutes-DeI_nXsA.js} +1 -1
- package/dist/assets/{Preview-DGLS-lai.js → Preview-DaJjExSY.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DIBhM5-n.js → QBOConnectionScreen-DhOl-9x_.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-C644QT_s.js → ReimbursementApprovalRoutes-OUQT5-BG.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-NFqVNR5p.js → ReimbursementApprovalRuleDetailScreen-BnbdeeWc.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BUFparp-.js → ReimbursementRoutes-CrULGDHR.js} +1 -1
- package/dist/assets/{ReportsRoutes-Ds1taqXk.js → ReportsRoutes-CdScy2zn.js} +1 -1
- package/dist/assets/{RewardsRoutes-_lHVDHEf.js → RewardsRoutes-CtmDndAw.js} +1 -1
- package/dist/assets/{ScreenRoutes-RB2hJZ9G.js → ScreenRoutes-CBcxlaZK.js} +2 -2
- package/dist/assets/{SettingsRoutes-B7vdsHFZ.js → SettingsRoutes-BGeuaV1b.js} +1 -1
- package/dist/assets/{SetupPagesScreen-qTCCS6UQ.js → SetupPagesScreen-CQ95f144.js} +1 -1
- package/dist/assets/{SignInScreen-Dvuboby-.js → SignInScreen-DvZlzfq_.js} +1 -1
- package/dist/assets/{SignOutScreen-0_rqdeHx.js → SignOutScreen-DKEcTPkt.js} +1 -1
- package/dist/assets/{TaskListScreen-C7iXr721.js → TaskListScreen-CV57txpG.js} +1 -1
- package/dist/assets/{TaskRoutes-e1ZDknQo.js → TaskRoutes-mEz36n_L.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-CtXEemBb.js → TransactionDetailRoutes-YS_iY6Y7.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-iUr_rYom.js → TransactionDetailScreen-lfSrrM4Y.js} +1 -1
- package/dist/assets/{TransactionListRoutes-C_zmVTtQ.js → TransactionListRoutes-DU3cCLxD.js} +1 -1
- package/dist/assets/{TreasuryRoutes-ChTRfqeJ.js → TreasuryRoutes-_3uNtw6X.js} +1 -1
- package/dist/assets/{VendorsRoutes-Dkh7xobi.js → VendorsRoutes-BEt_9WSK.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-CdcPlCa7.js → WiseConfirmationScreen-D9iGvn-U.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-DA4l0GWi.js → ZeniAccountRoutes-ByZ9pCIW.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-DpRHhmKq.js → ZeniAccountStatementScreen-CdpIbZhl.js} +1 -1
- package/dist/assets/{accountMappingHelper-21INvCOu.js → accountMappingHelper-CLGTWOoZ.js} +1 -1
- package/dist/assets/{analytics-B2y6XFqy.js → analytics-4jOsnRSg.js} +1 -1
- package/dist/assets/{analyticsHelper-BJUmcZdp.js → analyticsHelper-Cp79iEuP.js} +1 -1
- package/dist/assets/{core-BNlQPmZI.js → core-DX0hI4Tj.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CKfw0Bv2.js → decodeURIComponentSafe-WcasGT-q.js} +1 -1
- package/dist/assets/{dnd-DMxdSMN6.js → dnd-ALP2Xi80.js} +1 -1
- package/dist/assets/{empty-42Sdxle4.js → empty-BpEutNe3.js} +1 -1
- package/dist/assets/{empty-BTu4iQMe.js → empty-J417TvG7.js} +1 -1
- package/dist/assets/{emptyVideoElement-yYZvjhoB.js → emptyVideoElement-DVNg1h83.js} +1 -1
- package/dist/assets/{epic-D-skpuz3.js → epic-BxVmKmeQ.js} +1 -1
- package/dist/assets/{getLocaleForTenant-CVqf6lDC.js → getLocaleForTenant-DiDMSDVJ.js} +1 -1
- package/dist/assets/{index-kig8y22l.js → index-7WvsQFFM.js} +1 -1
- package/dist/assets/{index-DQ627A2Y.js → index-C7vAMpwE.js} +7 -7
- package/dist/assets/{index-DCefQivt.js → index-CIWkA9Mz.js} +1 -1
- package/dist/assets/{index-DJcninHi.js → index-CSb5Sa29.js} +1 -1
- package/dist/assets/{index-_V5d2kT2.js → index-DqG9AY5b.js} +1 -1
- package/dist/assets/{index-kp8GJUPv.js → index-DzJXaiyv.js} +2 -2
- package/dist/assets/{index-BonmQyt5.js → index-IQOFc2Vd.js} +1 -1
- package/dist/assets/{index-CVQQCz3n.js → index-zHyFO506.js} +1 -1
- package/dist/assets/{lexical-DIwcPOOX.js → lexical-CIEinSVu.js} +1 -1
- package/dist/assets/{liveblocks-CgB-eS47.js → liveblocks-CPUhr7cG.js} +1 -1
- package/dist/assets/{lottie-D0T6TwWM.js → lottie-Be-cIbgZ.js} +1 -1
- package/dist/assets/{mui-DrQknmqv.js → mui-Wlh0ww8-.js} +1 -1
- package/dist/assets/{pathToGoBack-Dm-okQyO.js → pathToGoBack-bofP9cDL.js} +1 -1
- package/dist/assets/{pdf-D8esTcXH.js → pdf-ca3_zM2m.js} +3 -3
- package/dist/assets/{pdf-lib-BfsDfw00.js → pdf-lib-Be1Qg4G4.js} +1 -1
- package/dist/assets/{plaid-Dur2bXd_.js → plaid-B7CiXQXe.js} +1 -1
- package/dist/assets/{pusher-DJ5ROm_G.js → pusher-QIJZMqPb.js} +1 -1
- package/dist/assets/{react-BpvUO2gB.js → react-BzpMRZzx.js} +1 -1
- package/dist/assets/{react-j9qkVCsv.js → react-C1CYmKxl.js} +1 -1
- package/dist/assets/{react-BR4lxG6C.js → react-Cl_O1OBs.js} +1 -1
- package/dist/assets/{react-Bo4r-vUu.js → react-DdfZNhsN.js} +1 -1
- package/dist/assets/{react-BY8yRlvS.js → react-DhrM74f3.js} +1 -1
- package/dist/assets/{react-D4eYJxhr.js → react-EF6fn4Fj.js} +1 -1
- package/dist/assets/{recharts-CSVdRl0H.js → recharts-D49X9rAt.js} +1 -1
- package/dist/assets/{routePaths-CFy0gTEG.js → routePaths-DGHjnhpU.js} +1 -1
- package/dist/assets/{sentry-wTFBBAPh.js → sentry-BKza4F3H.js} +1 -1
- package/dist/assets/{url-vmJOCnxQ.js → url-B1eUhLzQ.js} +1 -1
- package/dist/assets/{url-D7_Ps5yN.js → url-Dr5UUWLE.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DEu155ok.js → useAiCfoDashboardSuggestedQuestionsChips-B88ydPFN.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-CwKalBPx.js → useAskAiCfoHostNavButtonProps-DQl9y6iE.js} +1 -1
- package/dist/assets/{useCashManagementBanner-DGKAUjch.js → useCashManagementBanner-LtjNHMQW.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-DgSJu8gn.js → useChargeCardPusherEvents-BzJO8XO6.js} +1 -1
- package/dist/assets/{useDeviceId-khuJ_mL7.js → useDeviceId-Bz0ISaO9.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-Kpmy9G5p.js → useEmailConnectResultRefresh-BPgsDDxP.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BHfpSTJ4.js → useInitialThreadRequest-D7aWfHSp.js} +1 -1
- package/dist/assets/{utils-B74IeKSG.js → utils-DdOI8_Qy.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-B9LYNV9j.js → withTransactionSidePanel-ZsvmJkYL.js} +1 -1
- package/dist/assets/{zeni-epic-state-BAdkLncB.js → zeni-epic-state-D7J6ldp5.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-C_khJILT.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-C3Bv8pSC.js +0 -1
- package/dist/assets/NotFoundScreen-CEYKR6EV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-CPUhr7cG.js";import{a as u}from"./sentry-BKza4F3H.js";import{u as y,j as b,n as w,g as A,N}from"./core-DX0hI4Tj.js";import{M7 as U,eW as _,g0 as k,M8 as L,oc as R,M9 as z}from"./zeni-epic-state-D7J6ldp5.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import{t as P}from"./getLocaleForTenant-DiDMSDVJ.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="8e7fec1b-e31b-4a12-a88e-1034ebf6820a",t._sentryDebugIdIdentifier="sentry-dbid-8e7fec1b-e31b-4a12-a88e-1034ebf6820a")}catch{}})();const M=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=$(c,p);return v.jsx(N,{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}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>U(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(k(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"&&!L(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(M,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],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 Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-BUWvP3WY.js → DomesticWireDetailScreen-E8Co6RZt.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-CPUhr7cG.js";import{h as w,g as C,j as f,n as A,i as B}from"./core-DX0hI4Tj.js";import{Qe as k,Ql as _,gi as W,gh as J,gg as M,jx as X,No as q,rH as K,eW as V,PM as D,jv as T,Qf as v,Qo as j,jt as F,jQ as G}from"./zeni-epic-state-D7J6ldp5.js";import{bz as L,J as N,A as R,z as U,y as Q,r as p,X as S,B as z,bA as Y,o as H,bB as ee,s as te}from"./index-C7vAMpwE.js";import{n as O}from"./mui-Wlh0ww8-.js";import"./sentry-BKza4F3H.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]="9860cbee-9d75-4542-a9ba-b514e2a55ebe",e._sentryDebugIdIdentifier="sentry-dbid-9860cbee-9d75-4542-a9ba-b514e2a55ebe")}catch{}})();const ne=A(null,(function(e,t){return{onSaveVendor:n=>{e(X(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(M(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(L);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=f((i=>k(i,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-
|
|
1
|
+
import{j as i}from"./liveblocks-CPUhr7cG.js";import{J as b,C as l,y as c}from"./index-C7vAMpwE.js";import{D as f}from"./mui-Wlh0ww8-.js";import"./sentry-BKza4F3H.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]="cbe115b8-fbab-4acf-b3b1-0a78dd11e74a",e._sentryDebugIdIdentifier="sentry-dbid-cbe115b8-fbab-4acf-b3b1-0a78dd11e74a")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=b(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),d=c();return i.jsx(f,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{h as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CPUhr7cG.js";import{a as d}from"./sentry-BKza4F3H.js";import{h as A,u as B,g as q,i as G,j as l,N as O,n as F,o as _,p as W}from"./core-DX0hI4Tj.js";import{Ow as z,eW as K,NU as M,lA as R,Kp as k,OB as Y,Nn as $,kA as U,Kq as S,NZ as V,N_ as X,Np as Z,No as H}from"./zeni-epic-state-D7J6ldp5.js";import{aX as J,c as L,r as Q,s as tt}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import{d as b}from"./decodeURIComponentSafe-WcasGT-q.js";import{w as et}from"./withTransactionSidePanel-ZsvmJkYL.js";import{f as at,c as nt}from"./routePaths-DGHjnhpU.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.js";import"./useAskAiCfoHostNavButtonProps-DQl9y6iE.js";import"./TransactionDetailScreen-lfSrrM4Y.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]="21bc137b-588f-4297-a342-8191817ebb5f",a._sentryDebugIdIdentifier="sentry-dbid-21bc137b-588f-4297-a342-8191817ebb5f")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:L,isAccountingClassesEnabled:U(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(Z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(H("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Q(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}))}}}}))(J),it=et((function({entityType:a,...t}){const e=A(),o=B(),c=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:N,entityNameEncoded:w}=G(),r=b(N??""),p=b(w??""),f=rt(r,p),x=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),j=l((n=>K(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(R(i)))}),[m,f,i]);const E=l((n=>n.trendState.fetchState)),P=u?.selectedPeriod?.timePeriod??g,v=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(O,{to:I(x.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(_,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Nt as EntityDetailRoutes,Nt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-MQoA8t4l.js → ExpenseAutomationRoutes-YzoXuupQ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-
|
|
1
|
+
import{j as I}from"./liveblocks-CPUhr7cG.js";import ia from"./NotFoundScreen-bK1Cn_wC.js";import{a,b as Ht}from"./sentry-BKza4F3H.js";import{n as ze,S as la}from"./mui-Wlh0ww8-.js";import{u as Ce,h as Zt,g as Ze,j as x,n as ra,i as Dt,o as da,p as Ye}from"./core-DX0hI4Tj.js";import{eW as _e,Tc as ua,om as Te,fX as ma,si as pa,ef as ha,fh as Ca,Td as Ft,Te as Fe,p4 as ga,Tf as Sa,pj as fa,oE as Wt,oC as ie,Tg as Xt,Th as Ia,oZ as en,pf as Ea,Ti as tn,ox as ka,rQ as Ta,fI as ke,Tj as Ve,uo as nn,EK as an,Tk as on,Tl as ya,ro as We,Ox as Ut,Oz as ba,kD as va,OA as Aa,kK as wa,c_ as Pa,vE as Xe,oK as sn,pn as Be,p0 as Ra,Tm as xa,Np as _t,No as De,Tn as Vt,k$ as Da,To as Fa,Tp as Ua,Tq as _a,Tr as Va,oR as Ba,pq as Ue,Ts as Oa,Tt as za,Tu as Ma,px as La,kO as ja,kF as $a,Tv as qa,kN as Bt,OH as Ga,Tw as Na,Tx as Ja,rk as Ya,qY as Ka,po as he,qX as Ke,Ty as Qa,Tz as Ha,TA as Za,mi as Wa,bo as Xa,md as Ot,l$ as eo,TB as to,fy as zt,gy as no,ma as ao,xx as oo,TC as so,pY as co,pT as io,pX as lo,pI as ro,TD as uo,fL as cn,p8 as mo,oN as po,fY as Mt,ps as ho,TE as Co,TF as go,pp as ln,TG as So,TH as fo,TI as Io,TJ as Eo,TK as Lt,rw as ko,qP as To,Nn as yo,TL as bo,TM as vo,kM as Ao,TN as wo,Jq as Po,kL as Ro,kA as xo,fK as Do,ql as rn,qH as Fo,pm as jt,pr as Uo,bE as _o,m7 as Vo,m4 as Bo,TO as Oo,pH as $t,qD as qt,qB as zo,TP as Mo,qq as Lo,q6 as jo,qE as $o,TQ as qo,TR as Go,qa as No,TS as Jo,q1 as Yo,q9 as Ko,q7 as Qo,qK as Ho}from"./zeni-epic-state-D7J6ldp5.js";import{A as Oe,X as Y,c as N,s as ce,Z as dn,a0 as un,cZ as Zo,z as Me,c_ as Wo,c$ as Xo,au as ye,d0 as es,aZ as Gt,B as mn,d1 as ts,ar as Qe,O as ns,a9 as as,d2 as os,a4 as ss,d3 as cs,Y as is,d4 as ls,d5 as rs,w as ds,T as us,aS as ms,d6 as ps,d7 as hs,be as Cs,C as gs,aV as Ss}from"./index-C7vAMpwE.js";import{u as pn}from"./useAskAiCfoHostNavButtonProps-DQl9y6iE.js";import{f as Nt,a as fs,b as Is,g as Es,C as ks}from"./TransactionDetailScreen-lfSrrM4Y.js";import{w as Ts}from"./withTransactionSidePanel-ZsvmJkYL.js";import{h as ys,v as bs}from"./routePaths-DGHjnhpU.js";import{g as He}from"./accountMappingHelper-CLGTWOoZ.js";import{D as vs}from"./DrawerScreen-CNi8v2mr.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.js";import"./decodeURIComponentSafe-WcasGT-q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="25aea337-421a-4446-ae84-90f75457af74",t._sentryDebugIdIdentifier="sentry-dbid-25aea337-421a-4446-ae84-90f75457af74")}catch{}})();const As=()=>{const t=Ce(),i=Zt(),P=Ze(),y=x((m=>_e(m))),{useFeatureGate:v}=Oe(),{isFeatureEnabled:r}=v(Y.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:h}=v(Y.aiAuditScorePercentage),k=x((m=>m.expenseAutomationViewState.selectedPeriodByTenantId)),c=x((m=>ua(m,y.tenantId))),{isAiCfoAccessEnabled:S,onAskAiCfoClick:g}=pn({mobileExploreReferrer:"Month-End Close Overview"}),R=a.useCallback(((m,V,le=!1)=>{t(Te({tenantId:V,period:{month:m.month,year:m.year},refreshViewInBackground:le}))}),[]),w=a.useCallback((m=>{const V=P.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&N.trackMonthCloseAuditPage(m.month,m.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,V??null),t(ma(y.tenantId,m))}),[y.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),d=k[y.tenantId],C=a.useCallback((()=>{const m=P.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&N.trackMonthCloseAuditPage(d.month,d.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,m??null),R(d,y.tenantId,!0)}),[R,d,y.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),M=ce(P.state?.pathnameStackToGoBack,P.pathname),q=a.useCallback((()=>{if(c.monthEndCloseChecks!=null&&d!=null){const m=c.monthEndCloseChecks.monthEndCloseCheckList.find((V=>V.progress<100));if(m!=null)return void i(`./${m.id}/${d.month}-${d.year}`,{state:{pathnameStackToGoBack:M,message:"comingFromOverview"}});i(`./month_end_insights/${d.month}-${d.year}`,{state:{pathnameStackToGoBack:M,message:"comingFromOverview"}})}}),[c.monthEndCloseChecks,d]),{areTenantIdsInSync:u}=dn();return un({isDataReady:c.fetchState==="Completed"}),a.useEffect((()=>{d!=null&&c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&u&&R(d,y.tenantId)}),[R,d,c.fetchState,y.tenantId,u]),a.useEffect((()=>{d!=null&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&u&&t(pa(d))}),[d,c.monthClosePerformanceTrendFetchStatus.fetchState,u]),a.useEffect((()=>{const m=setInterval((()=>{c.fetchState!=="In-Progress"&&c.fetchState==="Completed"&&C()}),3e5);return()=>clearInterval(m)}),[c.fetchState]),a.useEffect((()=>{if(c.fetchState==="Completed"&&c.monthEndCloseChecks?.auditSummary!=null){const m=P.state?.referrer;N.trackMonthCloseAuditPage(c.selectedPeriod.month,c.selectedPeriod.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,m??null)}}),[c.fetchState,c.selectedPeriod,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),I.jsx(ws,{children:I.jsx(Zo,{monthEndCloseChecksView:c,isRealtimeInsightsFeatureEnabled:r,onMonthEndCheckClick:m=>{i(`./${m}/${d.month}-${d.year}`,{state:{pathnameStackToGoBack:M,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:w,handleReviewButtonClick:q,onBackClick:()=>{i("../../dashboard")},onReload:C,isAiCfoAccessEnabled:S,onAskAiCfoClick:g,aiAuditScorePercentageEnabled:h})})},ws=ze.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CPUhr7cG.js";import{a as r}from"./sentry-BKza4F3H.js";import{a5 as l,a6 as p,a7 as m,r as c}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import f from"./NotFoundScreen-bK1Cn_wC.js";import{h as u,g as b}from"./core-DX0hI4Tj.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./sentry-
|
|
1
|
+
import{a as r}from"./sentry-BKza4F3H.js";import{u as f,h as l,g as m}from"./core-DX0hI4Tj.js";import{hu as p,Mv as g,Mw as _}from"./zeni-epic-state-D7J6ldp5.js";import{u as h,L as b,z as y}from"./index-C7vAMpwE.js";import"./liveblocks-CPUhr7cG.js";import"./recharts-D49X9rAt.js";import"./mui-Wlh0ww8-.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="7882270d-57cd-4301-9867-67e96e1718ff",e._sentryDebugIdIdentifier="sentry-dbid-7882270d-57cd-4301-9867-67e96e1718ff")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:c}=h(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(b.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,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{R as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-CPUhr7cG.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-DX0hI4Tj.js";import{Mo as k,Mp as v,Mq as F,Bs as B,Be as T,Mr as D,Ms as oe,Mt as se,Bi as ie,fz as $,Bp as le,Bm as re}from"./zeni-epic-state-D7J6ldp5.js";import{J as g,o as r,m as de,c as j,j as G,p as ce,r as me,R as pe,s as _,A as ue,X as he,v as xe,w as ge,y as fe,x as we,B as be,_ as Se,V as ye,S as ke,D as ve,C as je,E as $e}from"./index-C7vAMpwE.js";import{n as m}from"./mui-Wlh0ww8-.js";import f from"./NotFoundScreen-bK1Cn_wC.js";import{a as I}from"./sentry-BKza4F3H.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="5ce287ff-42f1-4c99-ad74-bdba577561a7",e._sentryDebugIdIdentifier="sentry-dbid-5ce287ff-42f1-4c99-ad74-bdba577561a7")}catch{}})();const Ie=m.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-CPUhr7cG.js";import{a as g}from"./sentry-BKza4F3H.js";import{u as F,g as O,h as _,t as w,j as l,N as T}from"./core-DX0hI4Tj.js";import{z as r,y as V,O as P,e as A,c as N,f as W,k as $,V as R,h as Z}from"./index-C7vAMpwE.js";import{eW as q,M9 as B,Mj as G,Ma as H,fz as J,f$ as K,Mf as Q,gp as X,cZ as Y,Mk as ee,Ml as te}from"./zeni-epic-state-D7J6ldp5.js";import{n as ne}from"./mui-Wlh0ww8-.js";import{u as ae}from"./useDeviceId-Bz0ISaO9.js";import{f as se}from"./analyticsHelper-Cp79iEuP.js";import{t as ie}from"./getLocaleForTenant-DiDMSDVJ.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="0de4e637-089c-4701-a51a-8916322b4a27",t._sentryDebugIdIdentifier="sentry-dbid-0de4e637-089c-4701-a51a-8916322b4a27")}catch{}})();const z=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function ze(){const t=F(),s=O(),m=_(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),b=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),a=l((e=>e.tenantState.loggedInUser)),o=l((e=>q(e))),k=l((e=>B(e))),M=r.getSignedInUser(),v=V().mode;g.useEffect((()=>{a?.zeniSessionId==null&&n!=null&&z(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,f)))}),[n,p,t,i,f,a?.zeniSessionId]),g.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(H(k.tenantsInOrder),a.zeniSessionId),J(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),P.updateAppLocaleID(ie(o)),se(a,o,v,void 0,k.tenantsInOrder),X().then((()=>{const e=Z();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(W.Event.loginSuccess,"email",Y(o.productSettings))}),2e3))}),[h,S,b,a,o,k,v,s.state,t]);const E=g.useCallback((()=>{m("/signin/auth")}),[m]),j=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),U=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx($,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:j,onVerifyOtp:U,onCancelVerifyDevice:E});if(h==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||M!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!z(n,p)||f==null||I==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as V}from"./liveblocks-
|
|
1
|
+
import{j as V}from"./liveblocks-CPUhr7cG.js";import{a as l}from"./sentry-BKza4F3H.js";import{u as fe,j as n,i as We,g as Ye,h as qe,l as G}from"./core-DX0hI4Tj.js";import{eW as me,fE as Je,fF as pe,fq as Qe,bn as Xe,eV as Ke,fG as ea,fH as aa,fJ as ta,fM as na,fN as g,fP as sa,fQ as de,fT as oa,fR as ia,fS as ra,fU as da,cP as ca,fW as la,cV as ua,fp as fa,f$ as ma,g0 as pa,f_ as ba}from"./zeni-epic-state-D7J6ldp5.js";import{a9 as ha,aa as Sa,w as ga,A as Ea,z as k,x as ka,u as Ca,X as r,i as ya,M as Ia,ab as Ta,T as _a,a as wa,ac as Aa,a5 as Fa,ad as Da,ae as va,af as ce,ag as le,L as $a,ah as Ma,ai as ue,c as x,a1 as Pa,s as _,aj as R,ak as Ga}from"./index-C7vAMpwE.js";import{D as xa}from"./mui-Wlh0ww8-.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]="eaa093c8-ae4b-4acf-8dde-36d29dfa4e34",f._sentryDebugIdIdentifier="sentry-dbid-eaa093c8-ae4b-4acf-8dde-36d29dfa4e34")}catch{}})();const Ra=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=Ye(),C=ga(),o=qe(),N=Qe(),m=fe(),{useFeatureGate:i}=Ea(),B=k.getSignedInUser(),U=Xe(B),s=n((e=>me(e))),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>Ke(e))),j=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[w,L]=l.useState(void 0),A=G("/:tenantEmailDomain/dashboard")!==null,z=G("/:tenantEmailDomain/reports")!==null,I=G("/: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),H=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),F=n((e=>aa(e)));l.useEffect((()=>{y&&T&&!I&&F.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,F.fetchState,I]);const h=k.getSignedInUser(),D=n((e=>e.tenantState)),Ce=n((e=>D.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),W=Ia(),{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,Me=n((e=>g(e).totalUnreadCount)),Pe=n((e=>g(e).reducedFetchCountState)),Y=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),q=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),Ge=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:J,isLoading:Q,isFetchingMore:X,hasFetchedAll:K,fetchMore:xe}=Ta();l.useEffect((()=>{const e=setTimeout((()=>xe?.()),0);return()=>clearTimeout(e)})),l.useEffect((()=>{if(Q===!1&&X===!1&&K===!0)if(s?.companyId!=null&&J!=null){const e=`dashboard_${s.companyId}`;L(J.filter((u=>u.roomId===e&&u.readAt==null)).length)}else L(0)}),[Q,X,K]),l.useEffect((()=>{y&&!I&&Ge.fetchState==="Not-Started"&&N.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,N.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 Re={fetchStatus:Pe,count:Me},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"),W===!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)),Ne=A&&(te==="Completed"||te==="Error")||z&&(ne==="Completed"||ne==="Error")||!A&&!z?void 0:"disabled",Be=l.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=ca(Be),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&H.fetchState==="Completed"&&la(H.notificationSettings,h.userEmail,Z,s),se=wa(),Le=se&&Aa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=l.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Fa(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[ze,re]=l.useState(M);l.useEffect((()=>{re(M())}),[M]);const Ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,He=Da(Ze);return V.jsx(xa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:B,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Ne,isSettings:le(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:He,isTreasuryPopupVisible:ze,isNotificationsTabVisible:je,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:W,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:F.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=Y===0&&q>0?"notifications/comments":"notifications/tasks";le(a)&&(e=Y===0&&q>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(x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!be)return void Pa({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=R(c)&&c!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&x.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 P=Ga(e.type);ue(e.type)?(j!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{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 P=R(c);c==="home"?p+="dashboard":c==="users_and_roles"?p+="people":Ma(c)?p+="settings/my_profile":ue(c)?p+=`ai-cfo/${c}`:p+=c==="task_checklist"?"tasks":P?"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;x.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Le,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:Fe,newYearAnimationEnabled:De})})})),La=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)&&Je(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ra,{...f,...a})};export{La as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-CPUhr7cG.js";import{h as r,n}from"./core-DX0hI4Tj.js";import{N as i}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import"./sentry-BKza4F3H.js";import"./zeni-epic-state-D7J6ldp5.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="0d8bbeee-ef94-478e-b36a-0f30a9be8cda",e._sentryDebugIdIdentifier="sentry-dbid-0d8bbeee-ef94-478e-b36a-0f30a9be8cda")}catch{}})();const a=n(null,(function(e,o){return{onGoBack:()=>{o.navigate(-1)},onGoHome:()=>{o.navigate("/")}}}))(i);function _(){const e=r();return t.jsx(a,{navigate:e})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-
|
|
1
|
+
import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-CPUhr7cG.js";import lt from"./NotFoundScreen-bK1Cn_wC.js";import{a as k}from"./sentry-BKza4F3H.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 Z}from"./core-DX0hI4Tj.js";import{cw as St,fG as J,eW as Q,fU as bt,fN as b,T7 as K,fQ as d,fF as y,sC as M,y8 as It,T8 as Tt,fE as Ct,fW as yt,sH as At,T9 as F,bo as $,fy as x,sL as z,Ta as Et,cI as _t,cB as Nt}from"./zeni-epic-state-D7J6ldp5.js";import{Z as Bt,z as wt,A as xt,X as Rt,a0 as Ut,cW as Dt,s as N,a9 as vt,cX as Gt,aa as Pt,r as Ft}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-DQl9y6iE.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="0de27e35-6091-4d42-8bb7-f9e3c241e61e",t._sentryDebugIdIdentifier="sentry-dbid-0de27e35-6091-4d42-8bb7-f9e3c241e61e")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=J(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Q(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(z("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(z("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{m==="read"&&(B(r),t(F([r],$())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then((()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=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}})}}}))(vt(Gt)),Wt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,R]=k.useState(!1),a=S((e=>J(e))),o=S((e=>Q(e))),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Ut({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)),W=S((e=>b(e).currentTab)),U=S((e=>b(e).currentSubTab)),Y=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),D=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Dt().allUsers,{inboxNotifications:w,isLoading:A,hasFetchedAll:T,isFetchingMore:v,fetchMore:ot}=ct(),{threads:V,isLoading:L,fetchMore:q,isFetchingMore:H,hasFetchedAll:X}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(W!==i&&i!=null&&s(K(i)),i==null){const e=`../${W}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(A===!1&&T===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter((C=>C.roomId===e&&C.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[A,T]),k.useEffect((()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const G=A||v===!0||T!==!0||A||v===!0||T!==!0;k.useEffect((()=>{G&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))}),[G,D]),k.useEffect((()=>{s(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(A===!1&&L===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),E=p.map((f=>f.id)),it=p.map((f=>{const P=V.find((rt=>rt.id===f.threadId));return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(H||X===!0||q==null||q(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[A,v,H,T,X,L,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];U==="all"?E.push("read","unread"):U!=="mentions"&&E.push(U),s(M("task_manager",C,E,!0))}}}},nt=dt();return _.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 _.jsxs(gt,{children:[_.jsx(Z,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(Z,{path:"*",element:_.jsx(lt,{})})]})}export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-CPUhr7cG.js";import{a as r}from"./sentry-BKza4F3H.js";import{u as A,g as T,j as o,N as C}from"./core-DX0hI4Tj.js";import{My as j,eW as z,fM as P,Mz as x,MA as D,MB as L,MC as R,oc as k,Lv as N}from"./zeni-epic-state-D7J6ldp5.js";import{z as h,H as I}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="1312531d-2da9-4422-9276-7e4dcfe0ddbd",n._sentryDebugIdIdentifier="sentry-dbid-1312531d-2da9-4422-9276-7e4dcfe0ddbd")}catch{}})();function ee(){const n=A(),s=T(),{params:t,error:i}=r.useMemo((()=>j(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(),f=o((e=>z(e))),d=o((e=>P(e))),l=o((e=>e.tenantState.fetchState)),y=o(x),v=o(D),c=o(L),[S,b]=r.useState(null),[E,M]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(R())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{p&&a!=null&&!g.current&&(l!=="Not-Started"&&l!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[p,a,l,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&d.some((U=>U.tenantId===e))?e:d.length===1?d[0].tenantId:null}),[f?.tenantId,d]),u=S??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:l!=="Completed",tenants:d,selectedTenantId:u,onSelectTenant:b,approveError:E??v,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{M("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
package/dist/assets/{PandLWithForecastRoutes-DEhZGiD0.js → PandLWithForecastRoutes-zdcF7G57.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-CPUhr7cG.js";import{h as Z,u as z,g as X,i as H,j as d,n as J,o as K,p as I}from"./core-DX0hI4Tj.js";import{eW as U,sq as R,r_ as Q,N3 as v,rV as S,bs as ee,bn as ae,bZ as te,rW as se,N4 as oe,MS as C,dI as re,w5 as ne,N5 as ie,ws as ce,fD as le,fB as de}from"./zeni-epic-state-D7J6ldp5.js";import{z as me,Z as fe,a0 as pe,T as ue,A as w,X as M,_ as he,c as N,ap as be,s as ge}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import Fe from"./NotFoundScreen-bK1Cn_wC.js";import{F as Ie}from"./FeaturePreviewScreen-BwTdLVoX.js";import{a as b}from"./sentry-BKza4F3H.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-DQl9y6iE.js";import{u as Se}from"./useInitialThreadRequest-D7aWfHSp.js";import{t as Te}from"./routePaths-DGHjnhpU.js";import{M as ye}from"./MobileAppDrawer-DPnpVzNw.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="419ddb8f-bd73-4219-b95c-5f092b74b8bf",s._sentryDebugIdIdentifier="sentry-dbid-419ddb8f-bd73-4219-b95c-5f092b74b8bf")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((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:N}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(be);function O(){const s=Z(),e=z(),a=X(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d((t=>U(t))),$=y.company?.companyInfo.firstMonthOfFY??1,c=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),A=d((t=>t.profitAndLossState)),k=d((t=>t.reportUIOptionsState.selectedForecast)),D=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:B}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect((()=>{if(!i&&g)p(!0),l||e(Q());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex((F=>F.id===L)):P!=null?f.forecasts.findIndex((F=>F.id===P)):f.forecasts.length>0?0:-1)(c,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(v(c.forecasts[t].id,t)),T(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!D(c.forecasts[t].id)&&g&&e(S(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,R,S,g]);const x=ue(),W=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:q}=w(),{isFeatureEnabled:j}=q(M.isReportsCommentingEnabled),G=Se(j?y?.companyId:void 0,{clearParams:l&&m}),[V,Y]=b.useState(!1),E=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:N,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(Ae,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d((i=>U(i))),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-CPUhr7cG.js";import{M$ as oe,eW as J,kA as G,fD as Q,fB as ie,Kt as ee,MF as re,v2 as ke,N0 as Y,uT as Ee,vc as Pe,v6 as le,uX as ce,va as ve,v7 as je,N1 as de,wT as Te,fn as Le,gf as Ae,N2 as z,u$ as pe,u_ as ue,vf as Fe,c7 as Oe}from"./zeni-epic-state-D7J6ldp5.js";import{J as me,A as ae,X as H,z as K,i as ge,l as fe,F as he,al as Ce,am as Re,C as ye,o as R,G as be,O as M,an as Ve,Z as Ze,a0 as Be,_ as Ue,c as Se,f as $e,s as _e,ao as ze,T as He}from"./index-C7vAMpwE.js";import{D as we,n as N,S as xe}from"./mui-Wlh0ww8-.js";import te from"./NotFoundScreen-bK1Cn_wC.js";import{a as c}from"./sentry-BKza4F3H.js";import{u as se,i as Ge,j as g,h as Ke,g as Me,n as Ne,o as ne,p as _}from"./core-DX0hI4Tj.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-DQl9y6iE.js";import{M as Xe}from"./MobileAppDrawer-DPnpVzNw.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="2566774c-2fa4-4233-ad88-7a1e981c576f",e._sentryDebugIdIdentifier="sentry-dbid-2566774c-2fa4-4233-ad88-7a1e981c576f")}catch{}})();const qe={overlayWidth:new ye(100,100,48)},W=M.getLocalizedStrings().peoplePage.invitePage,Ye=M.getLocalizedStrings().common,Je=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:w}=Ge(),r=g((l=>oe(l))),p=g((l=>J(l))),E=g((l=>G(l))),{useFeatureGate:D}=ae(),{isFeatureEnabled:I}=D(H.isDebitCardFeatureEnabled),P=Q(I,p),T=ie(p),L=ee(p),B=re(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(Y()),b()},A=()=>{V===!0?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:v}=D(H.isChargeCardFeatureEnabled),j=ge(p,v,I),{isCardsHidden:F}=fe(p?.tenantId),y=!j||F,O=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:L,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:l=>{m(ce(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(le({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?Ee(e):Pe(L))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Qe,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:Ye.no,action:o,isEditPopup:!0}):null,a.jsx(Re,{...s})]})})},Qe=N(xe)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CPUhr7cG.js";import E from"./NotFoundScreen-bK1Cn_wC.js";import{a as r}from"./sentry-BKza4F3H.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as O,p as b}from"./core-DX0hI4Tj.js";import{eW as B,Tb as h,bq as F,bn as N,ig as V,fy as q}from"./zeni-epic-state-D7J6ldp5.js";import{w as W,z as I,a0 as Y,cY as $}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DQl9y6iE.js";import{M as H}from"./MobileAppDrawer-DPnpVzNw.js";import"./recharts-D49X9rAt.js";import"./analytics-4jOsnRSg.js";import"./plaid-B7CiXQXe.js";import"./dnd-ALP2Xi80.js";import"./stripe-cKAAJElX.js";import"./lottie-Be-cIbgZ.js";import"./lexical-CIEinSVu.js";import"./pdf-ca3_zM2m.js";import"./utils-DdOI8_Qy.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]="b146cbd2-51d8-4303-bf79-61fa91a0abe7",e._sentryDebugIdIdentifier="sentry-dbid-b146cbd2-51d8-4303-bf79-61fa91a0abe7")}catch{}})();const J=z((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)}}}))($),K=()=>{const e=_(),t=v(),c=W(),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 f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(l),x=C||k||y,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return Y({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser: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(O,{children:[s.jsx(b,{path:"*",element:s.jsx(K,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as t}from"./sentry-
|
|
1
|
+
import{a as h,b as t}from"./sentry-BKza4F3H.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})}),[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Ol}from"./liveblocks-
|
|
1
|
+
import{j as Ol}from"./liveblocks-CPUhr7cG.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BKza4F3H.js";import{L as dt,bZ as Tc,eW as Ac,M9 as Rc,MD as kl,c7 as Tl,f$ as Al,g0 as Rl}from"./zeni-epic-state-D7J6ldp5.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-DdOI8_Qy.js";import{r as un}from"./empty-BpEutNe3.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Be1Qg4G4.js";import{r as Gl}from"./index-DqG9AY5b.js";import{r as zl}from"./index-zHyFO506.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-DX0hI4Tj.js";import{u as Kl,z as Pc,L as Wl,I as Jl,K as Xl,j as Ql,c as tf}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import{d as Pe}from"./decodeURIComponentSafe-WcasGT-q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="2f3fe16f-3843-4633-b473-a36b406588f7",t._sentryDebugIdIdentifier="sentry-dbid-2f3fe16f-3843-4633-b473-a36b406588f7")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return(function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g})(d)})(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=(function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return(function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")})(this,g),S=b.call(this,(function(w,_,M){return typeof e=="string"?e:e(w,_,M)})(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d})(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map((function(p){return String(p)})),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",(function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",(function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c})(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=(function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1})(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))}),TypeError),i("ERR_INVALID_ARG_VALUE",(function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)}),TypeError),i("ERR_INVALID_RETURN_VALUE",(function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")}),TypeError),i("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map((function(d){return'"'.concat(d,'"')})),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")}),TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter((function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable}))),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach((function(x){m(k,x,j[x])})):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach((function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))}))}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&(function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}})(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=(function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)})(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach((function(x){j[x]=k[x]})),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
|
|
2
2
|
`),I=_(E).split(`
|
|
3
3
|
`),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-CPUhr7cG.js";import _ from"./NotFoundScreen-bK1Cn_wC.js";import{a as p}from"./sentry-BKza4F3H.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as F,p as b}from"./core-DX0hI4Tj.js";import{eW as j,Qt as g,QJ as S,FS as V,E$ as U,FR as d,FI as $,QW as B,FU as O}from"./zeni-epic-state-D7J6ldp5.js";import{z as N,a9 as L,bZ as Q,ag as T,bC as z,b_ as J}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";import{u as K,R as A}from"./ReimbursementApprovalRuleDetailScreen-BnbdeeWc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="286a50a0-4cdf-4b5c-9f44-e1e45a19cbbd",e._sentryDebugIdIdentifier="sentry-dbid-286a50a0-4cdf-4b5c-9f44-e1e45a19cbbd")}catch{}})();const y="reimbursement-approval-rule-update",Z=k((function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(L(Q)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>j(a))),c=u((a=>g(a))),v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(Z,{currentTenant:l,location:s,navigate:o,...w})},I="reimbursement-approval-rule-update",G=k((function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(O(t,!0))}}}))(L(J)),H=()=>{const e=u((n=>j(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=z(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(q,{isLoading:s})},M=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>j(a))),c=u((a=>g(a)));K();const v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${I}`]:[],eventCallback:(a,W,h)=>{a.endsWith(I)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(F,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-CPUhr7cG.js";import{a as f}from"./sentry-BKza4F3H.js";import{u as w,j as g,h as _,g as O,i as F,n as k}from"./core-DX0hI4Tj.js";import{l0 as q,QJ as T,Qt as C,FL as V,FX as B,FS as A,FT as E,QK as j,eW as K,FR as W}from"./zeni-epic-state-D7J6ldp5.js";import{z as P,y as N,B as L,bP as z,ag as Q,bC as J,bQ as X}from"./index-C7vAMpwE.js";import"./mui-Wlh0ww8-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="2ae3d963-5796-48f2-b238-911e87c48c85",e._sentryDebugIdIdentifier="sentry-dbid-2ae3d963-5796-48f2-b238-911e87c48c85")}catch{}})();function G(){const e=w(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(q({})))}),[p,t,e])}const H=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const y=(b=m.value,j(b)==null);var b;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(I);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(z);function M(){const e=_(),s=w(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(L,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];b==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(($=>({type:"user",subType:void 0,userId:$.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=S?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(W(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(X);function ne(){const e=g((t=>K(t))),{isApprovalRulesV3Enabled:s}=J(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(M,{})}function Z(){const e=_(),s=w(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(G(),f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(L,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,G as u};
|