@zeniai/web-app-ui 5.0.95-dev → 5.0.96-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-DrJ0R4zA.js +1 -0
- package/dist/assets/{AddressScreen-C1kNIoFW.js → AddressScreen-Bg11cvW7.js} +2 -2
- package/dist/assets/{AiCfoScreen-DiEWR7_7.js → AiCfoScreen-ttXGMdMj.js} +5 -5
- package/dist/assets/{BillPayApprovalRoutes-BFuKAoJn.js → BillPayApprovalRoutes-DSmsDGfo.js} +1 -1
- package/dist/assets/{BillPayRoutes-yYgD8ElZ.js → BillPayRoutes-DJZxWW5J.js} +34 -34
- package/dist/assets/{BusinessVerificationPageScreen-LVeN_2_9.js → BusinessVerificationPageScreen-Bgww5Eni.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-Dqh0dx38.js → ChargeCardRoutes-DBBIBX3p.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-CoCoQTkp.js → CompanyPassportScreen-BY6KqDn5.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-BBpw2AR4.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BwmSNWEA.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BeOSK0bV.js → CustomerOnboardingRoutes-CBskXxxc.js} +1 -1
- package/dist/assets/{DashboardRoutes-DeXVvCqq.js → DashboardRoutes-B7wfzxUf.js} +4 -4
- package/dist/assets/{DefaultTenantHome-DZiebdrx.js → DefaultTenantHome--GVn7qHn.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-CdWlbEyV.js +18 -0
- package/dist/assets/DrawerScreen-Cme8vixt.js +1 -0
- package/dist/assets/EntityDetailRoutes-mC151u-W.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-hIKcsGeT.js → ExpenseAutomationRoutes-BI8ssrmn.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-CKIBiLol.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-C_sETmGk.js → HubSpotOAuthCallbackScreen-BooPYq0F.js} +1 -1
- package/dist/assets/MagicLinkRoutes-6F4w3fCs.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CBTOwBE4.js +12 -0
- package/dist/assets/{MobileAppDrawer-CgbJlL9u.js → MobileAppDrawer-6SipHCGH.js} +1 -1
- package/dist/assets/NotFoundScreen-BbD7D-7R.js +1 -0
- package/dist/assets/{NotificationRoutes-HNy89jXR.js → NotificationRoutes-CZA_Ly2E.js} +1 -1
- package/dist/assets/OAuthConsentScreen-BQ6c6hkL.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CFV6-GFH.js +1 -0
- package/dist/assets/{PeopleRoutes-B7-ewz69.js → PeopleRoutes-CQZMU4bx.js} +5 -5
- package/dist/assets/PerformanceRoutes-D4TOcMhX.js +1 -0
- package/dist/assets/{Preview-DVbW5PS-.js → Preview-De8DjXIQ.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BRbkYHuP.js → QBOConnectionScreen-C6YL0sDk.js} +1 -1
- package/dist/assets/ReferralListScreen-pub9zNod.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-CtZYMXXf.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CO_HtFbP.js → ReimbursementApprovalRuleDetailScreen-Cyjo3GHG.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-pmb5ZMBe.js → ReimbursementRoutes-MFX8Bud0.js} +4 -4
- package/dist/assets/{ReportsRoutes-C9h_dCJo.js → ReportsRoutes-CFENeNIe.js} +1 -1
- package/dist/assets/RewardsRoutes-C9SyzdEY.js +1 -0
- package/dist/assets/{ScreenRoutes-DB3q5PNA.js → ScreenRoutes-BeA1lKqC.js} +2 -2
- package/dist/assets/{SettingsRoutes-DEx1uOuX.js → SettingsRoutes-CeD2DwUh.js} +7 -7
- package/dist/assets/{SetupPagesScreen-DM0dhGt1.js → SetupPagesScreen-A0QZWQlp.js} +5 -5
- package/dist/assets/SignInScreen-BLRkAV-s.js +1 -0
- package/dist/assets/SignOutScreen-BmLBsLVz.js +9 -0
- package/dist/assets/{TaskListScreen-CQTVeDwe.js → TaskListScreen-oD_ucU4f.js} +2 -2
- package/dist/assets/{TaskRoutes-DzCuQY-E.js → TaskRoutes-DE3EZJLP.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-BjnNsU6t.js → TransactionDetailRoutes-DUjSaKyf.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BSarw1vq.js → TransactionDetailScreen-B3uLE8LG.js} +2 -2
- package/dist/assets/{TransactionListRoutes-CXfUmvjI.js → TransactionListRoutes-BlbqsdwG.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CDE_tE4t.js → TreasuryRoutes-BzlbCHr7.js} +6 -6
- package/dist/assets/{VendorsRoutes-Cz9uX3LH.js → VendorsRoutes-CW522oMp.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-D-jXv9gV.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DIt49_h_.js → ZeniAccountRoutes-CSBwxnuu.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-Dmd7_0nF.js +9 -0
- package/dist/assets/{accountMappingHelper-DdryjbCH.js → accountMappingHelper-CoDQ683a.js} +1 -1
- package/dist/assets/{analytics-B35UERag.js → analytics-CztvM7Zo.js} +1 -1
- package/dist/assets/{analyticsHelper-D8sAsSDg.js → analyticsHelper-DidHWGct.js} +1 -1
- package/dist/assets/{core-B20PugrR.js → core-CAUatE6D.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-HZX6LUOb.js → decodeURIComponentSafe-M2sJXq9C.js} +1 -1
- package/dist/assets/{dnd-CTNaOehy.js → dnd-DoUvAW-O.js} +1 -1
- package/dist/assets/{empty-DbjE3Pml.js → empty-BtvkP3hw.js} +1 -1
- package/dist/assets/{empty-DqPV1QMu.js → empty-D8yvrubO.js} +1 -1
- package/dist/assets/{emptyVideoElement-D5A8Alvf.js → emptyVideoElement-Bd8ec_3G.js} +1 -1
- package/dist/assets/{epic-C05Fn23e.js → epic-CGb2Dbds.js} +1 -1
- package/dist/assets/getLocaleForTenant-DjpfkvqM.js +1 -0
- package/dist/assets/{index-DODLcfP6.js → index--Cei8VXn.js} +1 -1
- package/dist/assets/{index-DwJt1swd.js → index-7hhSQ-_M.js} +1 -1
- package/dist/assets/{index-qbNk-Sh2.js → index-BBI_6CLT.js} +1 -1
- package/dist/assets/{index-BJUGjRvu.js → index-BRSfwvH4.js} +1 -1
- package/dist/assets/{index-DDN5QRfh.js → index-DklNZPEZ.js} +2 -2
- package/dist/assets/{index-Dh7l3Ca4.js → index-eEJDMus_.js} +1 -1
- package/dist/assets/{index-D8hCAHx9.js → index-ssCDruz8.js} +7428 -7430
- package/dist/assets/{index-Dx-tgz0s.js → index-uJrW53Lh.js} +1 -1
- package/dist/assets/{lexical-BDpP_OMn.js → lexical-B4m6CLZ0.js} +1 -1
- package/dist/assets/{liveblocks-BSDLCmF2.js → liveblocks-Do-nuGO9.js} +1 -1
- package/dist/assets/{lottie-DG71PfmK.js → lottie-DhqFkmtq.js} +1 -1
- package/dist/assets/{mui-BBkBdMVO.js → mui-Ee2kkUYC.js} +1 -1
- package/dist/assets/{pathToGoBack-BJj5tqvK.js → pathToGoBack-m6LhD1oT.js} +1 -1
- package/dist/assets/{pdf-Cp8DoYAG.js → pdf-DGClrODY.js} +4 -4
- package/dist/assets/{pdf-lib-BqwRJQ00.js → pdf-lib-QKmlG01y.js} +1 -1
- package/dist/assets/{plaid-DHvUog4a.js → plaid-BfqKUq3C.js} +1 -1
- package/dist/assets/{pusher-DsZLo3j0.js → pusher-D-t7eVeO.js} +1 -1
- package/dist/assets/{react-DpONCvOo.js → react-BJcwMgz5.js} +1 -1
- package/dist/assets/{react-BUTkVbbW.js → react-C1ZZYDEp.js} +1 -1
- package/dist/assets/{react-D4RyndA4.js → react-D7LvJpSs.js} +1 -1
- package/dist/assets/{react-zGcoIiO8.js → react-DNnZi339.js} +1 -1
- package/dist/assets/{react-Uu6ZW5p-.js → react-DWvyJqE6.js} +1 -1
- package/dist/assets/{react-BPL_4xi4.js → react-mujJLjaM.js} +1 -1
- package/dist/assets/{recharts-BzjcN9SN.js → recharts-DfwJcvGU.js} +1 -1
- package/dist/assets/{routePaths-XreQojZr.js → routePaths-C0HYOQUJ.js} +1 -1
- package/dist/assets/{sentry-67DqaLi1.js → sentry-CpVyi-77.js} +1 -1
- package/dist/assets/{url-DgheZiFv.js → url-Dj6kXEk9.js} +1 -1
- package/dist/assets/{url-D5ovKX_j.js → url-Dp0KhTaX.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CvDMoudE.js → useAiCfoDashboardSuggestedQuestionsChips-BymSQq_a.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BiHuzfAQ.js +1 -0
- package/dist/assets/{useDeviceId-CZrGGxHD.js → useDeviceId-BXZMNB1t.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BHiBt2ra.js → useInitialThreadRequest-DnRRNYgw.js} +1 -1
- package/dist/assets/{utils-C7uJ9upL.js → utils-Bgxe0MRZ.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C7OFQuvJ.js → withTransactionSidePanel-DKaQybw-.js} +3 -3
- package/dist/assets/{zeni-epic-state-B3AwsZqW.js → zeni-epic-state-Cb-J9Nxh.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-0Eyzeqmo.js +0 -1
- package/dist/assets/ConnectionAuthScreen-B7BFXXXS.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-D5Bh3dbO.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BU_VenPR.js +0 -18
- package/dist/assets/DrawerScreen-BbhUunYL.js +0 -1
- package/dist/assets/EntityDetailRoutes-DdiBSVG3.js +0 -1
- package/dist/assets/FeaturePreviewScreen-C1-h6LMu.js +0 -1
- package/dist/assets/MagicLinkRoutes-DZdU0REk.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BDghb4vk.js +0 -12
- package/dist/assets/NotFoundScreen-DjvK1NbN.js +0 -1
- package/dist/assets/OAuthConsentScreen-BRyPWMqe.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CBP1v8tZ.js +0 -1
- package/dist/assets/PerformanceRoutes-COR3BTZa.js +0 -1
- package/dist/assets/ReferralListScreen-C5_wj8jW.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DNyMDR4t.js +0 -1
- package/dist/assets/RewardsRoutes-COWJicvP.js +0 -1
- package/dist/assets/SignInScreen-BIF8y6r_.js +0 -1
- package/dist/assets/SignOutScreen-D0ouX99i.js +0 -9
- package/dist/assets/WiseConfirmationScreen-B9n09x9Y.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Dafm8AUT.js +0 -9
- package/dist/assets/getLocaleForTenant-ht-6GSU5.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CDnIxewv.js +0 -1
package/dist/assets/{ExpenseAutomationRoutes-hIKcsGeT.js → ExpenseAutomationRoutes-BI8ssrmn.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-Do-nuGO9.js";import Rn from"./NotFoundScreen-BbD7D-7R.js";import{a,b as Pt}from"./sentry-CpVyi-77.js";import{n as Fe,S as Dn}from"./mui-Ee2kkUYC.js";import{u as re,h as wt,g as Ge,j as U,n as Un,i as rt,o as Fn,p as Le}from"./core-CAUatE6D.js";import{eP as Re,PX as Bn,n1 as ke,fj as _n,qG as Vn,nj as xt,nE as Rt,PY as Dt,nO as On,PZ as Ut,nc as jn,qc as Mn,f3 as Ie,P_ as De,sM as Ft,BZ as Bt,P$ as _t,Q0 as Ln,pT as qe,LB as dt,LD as zn,jG as Qn,LE as $n,jN as Gn,cV as qn,tR as Ye,np as Vt,nT as Ue,Q1 as Yn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Jn,Q3 as Nn,Q4 as Kn,Q5 as Hn,Q6 as Zn,nw as Wn,nh as de,nW as we,Q7 as Xn,Q8 as ea,Q9 as ta,o1 as na,jR as aa,jI as oa,Qa as sa,jQ as ht,LL as ca,Qb as ia,Qc as la,pP as ra,ps as da,nU as fe,pr as ze,Qd as ua,Qe as ma,ll as ha,bq as pa,lg as pt,l2 as ga,Qf as Ca,gQ as gt,fU as Sa,ld as Ia,vK as fa,Qg as ka,os as Ea,on as va,or as ba,oc as ya,Qh as Aa,f6 as Ot,nH as Ta,ns as Pa,fk as Ct,nY as wa,Qi as xa,nV as jt,Qj as Ra,Qk as Da,Ql as Ua,Qm as Fa,Qn as St,p$ as Ba,pi as _a,Ks as Va,jP as Oa,Qo as ja,Gv as Ma,jO as La,jD as za,f5 as Qa,oT as Mt,pa as $a,nS as It,nX as Ga,bE as qa,la as Ya,l7 as Ja,Qp as Na,ob as ft,p8 as kt,p6 as Ka,oY as Ha,oD as Za,p9 as Wa,Qq as Xa,Qr as eo,oH as to,Qs as no,ox as ao,oG as oo,oE as so,pd as co}from"./zeni-epic-state-Cb-J9Nxh.js";import{w as Lt,I as le,c as L,m as H,W as zt,Y as Qt,cD as io,z as Be,cE as lo,at as xe,cF as ro,aT as Et,B as $t,cG as uo,aq as Qe,D as mo,cH as ho,a2 as po,cI as go,U as Co,cJ as So,cK as Io,F as fo,k as ko,aN as Eo,b7 as vo,r as bo,cL as yo}from"./index-ssCDruz8.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import{c as vt,C as Ao}from"./TransactionDetailScreen-B3uLE8LG.js";import{w as To}from"./withTransactionSidePanel-DKaQybw-.js";import{h as Po,v as wo}from"./routePaths-C0HYOQUJ.js";import{g as $e}from"./accountMappingHelper-CoDQ683a.js";import{D as xo}from"./DrawerScreen-Cme8vixt.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";import"./decodeURIComponentSafe-M2sJXq9C.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]="786a58b6-8bf0-4522-8c29-819b16b6fa20",t._sentryDebugIdIdentifier="sentry-dbid-786a58b6-8bf0-4522-8c29-819b16b6fa20")}catch{}})();const Ro=()=>{const t=re(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(le.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Bn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,N=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:N}))},[]),b=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Do,{children:C.jsx(io,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:b,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Do=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex: 1 1 auto;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
-
`,Uo=Pt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=re(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:
|
|
8
|
+
`,Uo=Pt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=re(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:b,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,T=(e,n)=>{g(Mn(e,n.split(".")[0]))},I=e=>{h!=null&&g(jn({accountId:i,selectedPeriod:b,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(On({accountId:i,selectedPeriod:b,payload:e}))},N=e=>{g(Ut({accountId:i,selectedPeriod:b,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),j=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(bt,{children:C.jsx(yt,{children:C.jsx(lo,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:b,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:T,onDeleteFile:I,onSelectSourceType:N,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(bt,{children:C.jsx(yt,{children:C.jsx(ro,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:j})})}):null}),bt=Fe.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
12
|
-
`,
|
|
12
|
+
`,yt=Fe.div`
|
|
13
13
|
flex: 1;
|
|
14
14
|
min-height: 0;
|
|
15
15
|
display: flex;
|
|
@@ -18,7 +18,7 @@ import{j as C}from"./liveblocks-BSDLCmF2.js";import Rn from"./NotFoundScreen-Djv
|
|
|
18
18
|
min-width: 0;
|
|
19
19
|
overflow-x: hidden;
|
|
20
20
|
overflow-y: auto;
|
|
21
|
-
`;function Fo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>Ln(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(uo,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Bo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:_o,comma:At,space:Vo}},dateFormat:qt}=mo.getLocalizedStrings(),Tt=co,Oo=Un(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=Ie(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${po}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:N}=S.jeSchedules,te=Vt(I),j=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(I.month,I.year),t(_a(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));go(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(P=>{P!=null?t(Ba(e,P)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Fa(e,n)),m!=null&&t(ke({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Ua(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?Vo+_o+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Da(e))},onUpdateMissingReceiptsUIState:e=>{t(Ra(e))},onFetchMissingReceiptsList:()=>{_!=null&&j!=null&&t(jt({start:j,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(so(e))},onBulkUploadProgress:e=>{t(oo(e))},onBulkUploadSuccess:e=>{t(ao({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(no(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(to(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(eo())},onSetBulkUploadResultsTab:e=>{t(Xa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Wa(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ha(e,n))},onFetchBulkUploadBatches:e=>{t(Mt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(xa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&j!=null&&t(fe(s,{start:j,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(wa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Pa(e))},onSaveReconciliationReview:e=>{t(Ta(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Ot(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(N.prepaidExpensesAccountList,s.selectedOptions),b=$e(N.fixedAssetsAccountList,l.selectedOptions),P=$e(N.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:P.map(w=>w.accountId)};t(Aa({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ba())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:P,allClassList:V,allDepreciationAccountList:w}=S.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,ne={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},ae=p?.selectedOption!=null?P.find($=>$.qboId===p.selectedOption):void 0,Ee=k?.selectedOption!=null?V.find($=>$.classId===k.selectedOption):void 0,oe=l?.selectedOption!=null?w.find($=>$.qboId===l.selectedOption):void 0;t(ya({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:ae?.accountId,updatedClassId:Ee?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ne.id,name:ne.name}}}))},ignoreRecommendedJeSchedule(e,n){t(va(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onCancelAutoComplete:()=>{t(Pe("common"))}},onPostJESchedule(e,n){t(Ea({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ka())},handleJeScheduleClick:(e,n,s)=>{t(fa({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Ia(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Sa())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ca(e))},onUpdateFileAttachment:e=>{t(ga({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ha(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,pa().format(qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,P,V,w,Q,ne,ae)=>{t(ma(e,n,s,l,y,k,p,b,P,V,w,Q,ne,ae))},onCancelAutoComplete:()=>{t(Pe("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&j!=null&&(t(fe(e,{start:j,end:_},!1,!1)),t(ua(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&j!=null&&t(fe(e,{start:j,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{_!=null&&j!=null&&t(fe(e,{start:j,end:_},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,P)=>{t(da(e,n,s,l,P??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(ra(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(la({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&t(ca({transactionId:P,customerUpdates:p})),t(ia({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ye(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&(t(aa({transactionId:P,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(oa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ye(k,e,n,s,!0,E,b))):t(sa({selectedTab:l,transactionId:P.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(na(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ta(e))},updateOperatingExpensesIdsForReview:e=>{t(ea({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=wo(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Xn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(de(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Wn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Kn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Jn(l)),t(Nn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,qe("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Yn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(ho),jo=To(function(t){const i=t.displayName??t.name??"Component",A=Pt.memo(t),f=E=>{const g=re(),u=function(){const T=re(),I=U(d=>Ie(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=U(T=>Ie(T).reconciliation),v=U(T=>Re(T)),S=a.useCallback((T,I)=>{g(Ft("expense_automation_reconcile",T,I))},[g]),m=a.useCallback((T,I)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Uo,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=Co(),m=So(),{isOpen:y}=Io(),r=wt(),B=Ge(),h=re(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:I}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=zt(),N=(()=>{const c=U(G=>Ie(G)),M=Ge(),{currentSelectedViewFetchState:J,currentSelectedView:O,selectedPeriod:F}=c,Se=Qe(O),X=Qe(J.fetchState),be=a.useCallback(G=>{const K=M.state?.referrer;O==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,G,K??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,G,K??null)),O==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,G,c.missingReceipts.transactions.length,K??null),O==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,K??null),O==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,G,Bo(c.fluxAnalysis),K??null),O==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,G,"draft",c.auditSummary.auditScorePercentage,null,K??null)},[F,c]);return a.useEffect(()=>{X===J.fetchState&&O===Se||J.fetchState!=="Completed"||be(!1)},[O,J.fetchState,Se]),be})(),te=fo(),[j,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,P]=a.useState([]),[V,w]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),ne=a.useCallback(()=>{m(),w(void 0),d(),I()},[d,I,m]),ae=a.useRef(v);a.useEffect(()=>{v===!0&&ae.current===!1&&(m(),w(void 0),d()),ae.current=v},[d,v,m]);const Ee=a.useRef(y);a.useEffect(()=>{y===!0&&Ee.current===!1&&(v&&S(!1),w(void 0),E===!0&&f!==!0&&t?.()),Ee.current=y},[t,y,v,S,f,E]);const oe=E===!0&&f!==!0,$=a.useRef(oe);a.useEffect(()=>{oe&&!$.current&&(v&&S(!1),m(),w(void 0)),$.current=oe},[v,oe,m,S]);const[Je,Yt]=a.useState(!1),Ne=a.useRef(!1),{selectedTab:Ke}=rt(),{tenantEmailDomain:Jt}=rt(),[_e,He]=a.useState(B.state?.message==="comingFromTransactionDetail"),Ze=B.state?.message==="comingFromOverview",Nt=ko(),Ve=Be.getSignedInUser(),{useDynamicConfig:Kt,useFeatureGate:ue}=Lt(),{configValue:Ht}=Kt(Eo.enableUncategorizedExpenseCategory),Z=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=ue(le.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:me}=ue(le.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=ue(le.isTransactionActivityEnabled),{isFeatureEnabled:Zt}=ue(le.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Wt}=ue(le.isProjectsTransactionsEnabled),Xt=a.useCallback(c=>{const M=qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,M)},[i]),en=U(c=>Va(c,"common")),z=U(c=>Ie(c)),{monthEndCloseChecksView:Y,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:se,currentSelectedViewBackgroundRefreshFetchState:tn,currentSelectedViewFetchState:W,jeSchedules:Oe,reconciliation:nn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||Q(void 0)},[x,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==se&&(ve.current=se,x==="transaction_categorization"&&Q(void 0)):ve.current=se},[x,se,Q]);const an=U(c=>V==null?void 0:Oa(c.transactionState,V)),ce=an?.qboId,on=U(c=>ce==null?void 0:ja(c,ce));a.useEffect(()=>{ce!=null&&h(Ma(ce))},[h,ce]);const{selectedAccountId:he}=nn,et=Qe(Oe.accountSettingsView.saveState.fetchState),sn=U(c=>La(c.accountState,c.accountListState,"accountList")),cn=U(c=>za(c)),pe=Ke!=null?Qa(Ke):x,ln=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Qt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ge=Ue(tt.start),Ce=Ue(tt.end);if(ge==null||Ce==null)throw Error(`Invalid start - ${ge} and end - ${Ce} period from given ${D}`);const rn=a.useCallback(()=>{l(!1)},[]),dn=a.useCallback(()=>{p(!0)},[]),un=a.useCallback(c=>{P(c),p(!1)},[]),mn=a.useCallback(()=>{P([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{me===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(Mt({cacheOverride:!0}))},[me,x,ye,nt,h]);const at=Ve?.userId,hn=D.month,pn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&me!==!1&&ye==="idle"&&at!=null&&ot!=null&&h($a())},[x,me,ye,at,ot,hn,pn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{pe!=null&&x!==pe&&h(Ot(pe))},[pe]),a.useEffect(()=>{Je!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!R||(Yt(!0),h(It(!1,!1,Z)))},[Je,W,R,Z]),a.useEffect(()=>{!Ze&&R&&(h(It(!1,!1,Z)),h(de(D,he,!1,!1)))},[D.month,D.year,R,Z]);const st=a.useCallback((c=!1,M=!1)=>{const J={start:ge,end:Ce};switch(x){case"transaction_categorization":h(fe(se,J,c,!_e,void 0,void 0,M,void 0,Z)),He(!1);break;case"flux_analysis":h(we(D,c,M,null));break;case"month_end_insights":if(M===!1){const O=new Date(D.year,D.month,0),F=qa(O.toDateString()).format(qt.analytics.YYYYDashMMDashDDFormat);h(Ya(!0,n.companyId,n.tenantId,F)),h(Ja(n.companyId,n.tenantId))}break;case"je_schedules":h(Ga(J,M));break;case"missing_receipts":h(jt(J,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,M));break;default:h(de(D,he,c,M))}},[x,ge,Ce,n.companyId,n.tenantId,se,D,he,_e,He,Z]);a.useEffect(()=>{x===pe&&W.fetchState==="Not-Started"&&R&&st(!0)},[W,ge,Ce,n.companyId,n.tenantId,R]),a.useEffect(()=>{Ze||_e||Ne.current||tn.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Ne.current=!0,st(!0,!0))},[]),a.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[Y.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Na({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[Y.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&he==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(de(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,de,he,D]);const gn=vt();a.useEffect(()=>{const c=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(M=>M.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&Y.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,Y.monthEndCloseChecks]);const Cn=u===!0?g:A,Sn=u===!0||E===!0,In=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Oe.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Oe.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:M,currentSelectedView:J})=>{const O=re();let F,Se,X;const be=vt(),G=c.transactionView;let K=()=>{};const{transactions:yn,selectedTransactionId:ie,selectedTransactionLineId:Ae,transactionLocalData:bn}=G;if(J==="transaction_categorization"){const je=bn.find(ee=>ee.transactionId===ie),q=yn.find(ee=>ee.id===ie),it=Ae!=null?je?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;Se=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Tn=Po(ie,q?.typeOfTransaction);q!=null&&Tn&&(X={id:ie,type:qe(q.typeOfTransaction)}),K=()=>{if(ie!=null&&Ae!=null&&q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===ie)?.transactionReviewLocalData;if(ee!=null&&q.lines!=null&&q.lines.length>0){const Te=ee.lineItemById[Ae];let Me=ee.selectedEntity;if(qn(q)||(Me=Te.selectedEntityLine),Me!=null){const Pn=Me,wn={transactionId:{id:q.id,type:q.type},transaction:q,lineIds:q.lines.map(xn=>xn.id)??[]};O(Ye(Pn,Te.amount.amount,wn,!1,!0,be))}}}}}const An=U(je=>dt(je,void 0,F,Se));return{transactionId:X,onSaveVendor:()=>{O(Gn(X,void 0,!1,!0))},onSaveSuccess:K,onCancel:()=>{X!=null&&O(zn({transactionId:X})),O(Qn()),O($n()),M()},vendorViewDetails:An}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Nt?.loggedInUserRoleMap==null?Y.fetchState==="Error"?C.jsx(vo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(xo,{isOpen:k,drawerLeftMargin:new yo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Fo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:un,resetCustomerRequest:mn})})}),ct!=null&&j&&C.jsx(Ao,{isOpen:j,transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}),C.jsx(Oo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:ln,entityAutoCompleteView:en},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:me,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:Z,isAccountingClassesEnabled:cn,isProjectsTransactionsEnabled:Wt,isCOTEnabled:gn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&V!=null?C.jsx(bo,{activityLogView:on,qboId:ce,onClose:()=>Q(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:sn,onClickCustomerRequest:dn,handleEditClick:rn,tenantEmailDomain:Jt,trackExpenseAutomationTabAnalytics:N,setActivityLogTransactionId:Q,closeSidePanel:In,openTransactionPanel:i,sidePanelIsOpen:Sn,sidePanelIsFullView:u!==!0&&f,panelContent:Cn,isAiCfoAccessEnabled:T,onAskAiCfoClick:ne,isExpenseAutomationCommentingEnabled:Zt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:u===!0?66:void 0})]})})),Mo=Fe(Dn)`
|
|
21
|
+
`;function Fo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>Ln(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(uo,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Bo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:_o,comma:At,space:Vo}},dateFormat:qt}=mo.getLocalizedStrings(),Tt=co,Oo=Un(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,b={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=Ie(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:b,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${po}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:b,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:N}=S.jeSchedules,te=Vt(I),j=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(I.month,I.year),t(_a(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const y=()=>t(St(e,n,{fetchState:"Error"}));go(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(P=>{P!=null?t(Ba(e,P)):y()}).catch(y)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Fa(e,n)),m!=null&&t(ke({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Ua(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?Vo+_o+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Da(e))},onUpdateMissingReceiptsUIState:e=>{t(Ra(e))},onFetchMissingReceiptsList:()=>{_!=null&&j!=null&&t(jt({start:j,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(so(e))},onBulkUploadProgress:e=>{t(oo(e))},onBulkUploadSuccess:e=>{t(ao({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(no(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(to(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(eo())},onSetBulkUploadResultsTab:e=>{t(Xa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Wa(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ha(e,n))},onFetchBulkUploadBatches:e=>{t(Mt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(xa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&j!=null&&t(fe(s,{start:j,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(wa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Pa(e))},onSaveReconciliationReview:e=>{t(Ta(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Ot(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(N.prepaidExpensesAccountList,s.selectedOptions),y=$e(N.fixedAssetsAccountList,l.selectedOptions),P=$e(N.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:y.map(w=>w.accountId),selectedAccruedExpensesAccountIds:P.map(w=>w.accountId)};t(Aa({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:y}=n,{allAccountList:P,allClassList:V,allDepreciationAccountList:w}=S.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===y?.selectedOption):void 0,ne={id:Q?.zeniId??y?.selectedOption??"",name:Q?.name??y?.defaultOptions.find($=>$.value===y?.selectedOption)?.label??"",logo:Q?.logo},ae=p?.selectedOption!=null?P.find($=>$.qboId===p.selectedOption):void 0,Ee=k?.selectedOption!=null?V.find($=>$.classId===k.selectedOption):void 0,oe=l?.selectedOption!=null?w.find($=>$.qboId===l.selectedOption):void 0;t(ba({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:ae?.accountId,updatedClassId:Ee?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ne.id,name:ne.name}}}))},ignoreRecommendedJeSchedule(e,n){t(va(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onCancelAutoComplete:()=>{t(Pe("common"))}},onPostJESchedule(e,n){t(Ea({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ka())},handleJeScheduleClick:(e,n,s)=>{t(fa({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Ia(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Sa())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ca(e))},onUpdateFileAttachment:e=>{t(ga({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ha(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,pa().format(qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,y,P,V,w,Q,ne,ae)=>{t(ma(e,n,s,l,b,k,p,y,P,V,w,Q,ne,ae))},onCancelAutoComplete:()=>{t(Pe("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&j!=null&&(t(fe(e,{start:j,end:_},!1,!1)),t(ua(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&j!=null&&t(fe(e,{start:j,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,y)=>{_!=null&&j!=null&&t(fe(e,{start:j,end:_},!0,s,n,l,k,p,y))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,y,P)=>{t(da(e,n,s,l,P??null,k,p,!1,y))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:b,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(ra(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(la({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,y)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&t(ca({transactionId:P,customerUpdates:p})),t(ia({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:b,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Ye(k,e,n,s,!0,E,y))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,y)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&(t(aa({transactionId:P,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(oa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:b,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Ye(k,e,n,s,!0,E,y))):t(sa({selectedTab:l,transactionId:P.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(na(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ta(e))},updateOperatingExpensesIdsForReview:e=>{t(ea({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=wo(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Xn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(de(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Wn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Kn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Jn(l)),t(Nn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,qe("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Yn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,b,r)=>{u.onUploadTransactionReceipt(v,S,m,b,r,g.authParams)}}}(t,i,E)})(ho),jo=To(function(t){const i=t.displayName??t.name??"Component",A=Pt.memo(t),f=E=>{const g=re(),u=function(){const T=re(),I=U(d=>Ie(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=U(T=>Ie(T).reconciliation),v=U(T=>Re(T)),S=a.useCallback((T,I)=>{g(Ft("expense_automation_reconcile",T,I))},[g]),m=a.useCallback((T,I)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),b=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Uo,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:b,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[b,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=Co(),m=So(),{isOpen:b}=Io(),r=wt(),B=Ge(),h=re(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:I}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=zt(),N=(()=>{const c=U(G=>Ie(G)),M=Ge(),{currentSelectedViewFetchState:J,currentSelectedView:O,selectedPeriod:F}=c,Se=Qe(O),X=Qe(J.fetchState),ye=a.useCallback(G=>{const K=M.state?.referrer;O==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,G,K??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,G,K??null)),O==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,G,c.missingReceipts.transactions.length,K??null),O==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,K??null),O==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,G,Bo(c.fluxAnalysis),K??null),O==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,G,"draft",c.auditSummary.auditScorePercentage,null,K??null)},[F,c]);return a.useEffect(()=>{X===J.fetchState&&O===Se||J.fetchState!=="Completed"||ye(!1)},[O,J.fetchState,Se]),ye})(),te=fo(),[j,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[y,P]=a.useState([]),[V,w]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),ne=a.useCallback(()=>{m(),w(void 0),d(),I()},[d,I,m]),ae=a.useRef(v);a.useEffect(()=>{v===!0&&ae.current===!1&&(m(),w(void 0),d()),ae.current=v},[d,v,m]);const Ee=a.useRef(b);a.useEffect(()=>{b===!0&&Ee.current===!1&&(v&&S(!1),w(void 0),E===!0&&f!==!0&&t?.()),Ee.current=b},[t,b,v,S,f,E]);const oe=E===!0&&f!==!0,$=a.useRef(oe);a.useEffect(()=>{oe&&!$.current&&(v&&S(!1),m(),w(void 0)),$.current=oe},[v,oe,m,S]);const[Je,Yt]=a.useState(!1),Ne=a.useRef(!1),{selectedTab:Ke}=rt(),{tenantEmailDomain:Jt}=rt(),[_e,He]=a.useState(B.state?.message==="comingFromTransactionDetail"),Ze=B.state?.message==="comingFromOverview",Nt=ko(),Ve=Be.getSignedInUser(),{useDynamicConfig:Kt,useFeatureGate:ue}=Lt(),{configValue:Ht}=Kt(Eo.enableUncategorizedExpenseCategory),Z=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=ue(le.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:me}=ue(le.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=ue(le.isTransactionActivityEnabled),{isFeatureEnabled:Zt}=ue(le.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Wt}=ue(le.isProjectsTransactionsEnabled),Xt=a.useCallback(c=>{const M=qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,M)},[i]),en=U(c=>Va(c,"common")),z=U(c=>Ie(c)),{monthEndCloseChecksView:Y,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:se,currentSelectedViewBackgroundRefreshFetchState:tn,currentSelectedViewFetchState:W,jeSchedules:Oe,reconciliation:nn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||Q(void 0)},[x,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==se&&(ve.current=se,x==="transaction_categorization"&&Q(void 0)):ve.current=se},[x,se,Q]);const an=U(c=>V==null?void 0:Oa(c.transactionState,V)),ce=an?.qboId,on=U(c=>ce==null?void 0:ja(c,ce));a.useEffect(()=>{ce!=null&&h(Ma(ce))},[h,ce]);const{selectedAccountId:he}=nn,et=Qe(Oe.accountSettingsView.saveState.fetchState),sn=U(c=>La(c.accountState,c.accountListState,"accountList")),cn=U(c=>za(c)),pe=Ke!=null?Qa(Ke):x,ln=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Qt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ge=Ue(tt.start),Ce=Ue(tt.end);if(ge==null||Ce==null)throw Error(`Invalid start - ${ge} and end - ${Ce} period from given ${D}`);const rn=a.useCallback(()=>{l(!1)},[]),dn=a.useCallback(()=>{p(!0)},[]),un=a.useCallback(c=>{P(c),p(!1)},[]),mn=a.useCallback(()=>{P([])},[]),be=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{me===!0&&x==="missing_receipts"&&be==="matching"&&nt!=null&&h(Mt({cacheOverride:!0}))},[me,x,be,nt,h]);const at=Ve?.userId,hn=D.month,pn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&me!==!1&&be==="idle"&&at!=null&&ot!=null&&h($a())},[x,me,be,at,ot,hn,pn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{pe!=null&&x!==pe&&h(Ot(pe))},[pe]),a.useEffect(()=>{Je!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!R||(Yt(!0),h(It(!1,!1,Z)))},[Je,W,R,Z]),a.useEffect(()=>{!Ze&&R&&(h(It(!1,!1,Z)),h(de(D,he,!1,!1)))},[D.month,D.year,R,Z]);const st=a.useCallback((c=!1,M=!1)=>{const J={start:ge,end:Ce};switch(x){case"transaction_categorization":h(fe(se,J,c,!_e,void 0,void 0,M,void 0,Z)),He(!1);break;case"flux_analysis":h(we(D,c,M,null));break;case"month_end_insights":if(M===!1){const O=new Date(D.year,D.month,0),F=qa(O.toDateString()).format(qt.analytics.YYYYDashMMDashDDFormat);h(Ya(!0,n.companyId,n.tenantId,F)),h(Ja(n.companyId,n.tenantId))}break;case"je_schedules":h(Ga(J,M));break;case"missing_receipts":h(jt(J,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,M));break;default:h(de(D,he,c,M))}},[x,ge,Ce,n.companyId,n.tenantId,se,D,he,_e,He,Z]);a.useEffect(()=>{x===pe&&W.fetchState==="Not-Started"&&R&&st(!0)},[W,ge,Ce,n.companyId,n.tenantId,R]),a.useEffect(()=>{Ze||_e||Ne.current||tn.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Ne.current=!0,st(!0,!0))},[]),a.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[Y.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Na({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&h(ke({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[Y.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&he==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(de(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,de,he,D]);const gn=vt();a.useEffect(()=>{const c=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(M=>M.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&Y.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,Y.monthEndCloseChecks]);const Cn=u===!0?g:A,Sn=u===!0||E===!0,In=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Oe.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Oe.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:M,currentSelectedView:J})=>{const O=re();let F,Se,X;const ye=vt(),G=c.transactionView;let K=()=>{};const{transactions:bn,selectedTransactionId:ie,selectedTransactionLineId:Ae,transactionLocalData:yn}=G;if(J==="transaction_categorization"){const je=yn.find(ee=>ee.transactionId===ie),q=bn.find(ee=>ee.id===ie),it=Ae!=null?je?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;Se=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Tn=Po(ie,q?.typeOfTransaction);q!=null&&Tn&&(X={id:ie,type:qe(q.typeOfTransaction)}),K=()=>{if(ie!=null&&Ae!=null&&q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===ie)?.transactionReviewLocalData;if(ee!=null&&q.lines!=null&&q.lines.length>0){const Te=ee.lineItemById[Ae];let Me=ee.selectedEntity;if(qn(q)||(Me=Te.selectedEntityLine),Me!=null){const Pn=Me,wn={transactionId:{id:q.id,type:q.type},transaction:q,lineIds:q.lines.map(xn=>xn.id)??[]};O(Ye(Pn,Te.amount.amount,wn,!1,!0,ye))}}}}}const An=U(je=>dt(je,void 0,F,Se));return{transactionId:X,onSaveVendor:()=>{O(Gn(X,void 0,!1,!0))},onSaveSuccess:K,onCancel:()=>{X!=null&&O(zn({transactionId:X})),O(Qn()),O($n()),M()},vendorViewDetails:An}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Nt?.loggedInUserRoleMap==null?Y.fetchState==="Error"?C.jsx(vo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(xo,{isOpen:k,drawerLeftMargin:new bo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Fo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:un,resetCustomerRequest:mn})})}),ct!=null&&j&&C.jsx(Ao,{isOpen:j,transactionId:ct,onSaveVendor:fn,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}),C.jsx(Oo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:ln,entityAutoCompleteView:en},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:me,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:y,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:Z,isAccountingClassesEnabled:cn,isProjectsTransactionsEnabled:Wt,isCOTEnabled:gn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&V!=null?C.jsx(yo,{activityLogView:on,qboId:ce,onClose:()=>Q(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:sn,onClickCustomerRequest:dn,handleEditClick:rn,tenantEmailDomain:Jt,trackExpenseAutomationTabAnalytics:N,setActivityLogTransactionId:Q,closeSidePanel:In,openTransactionPanel:i,sidePanelIsOpen:Sn,sidePanelIsFullView:u!==!0&&f,panelContent:Cn,isAiCfoAccessEnabled:T,onAskAiCfoClick:ne,isExpenseAutomationCommentingEnabled:Zt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:u===!0?66:void 0})]})})),Mo=Fe(Dn)`
|
|
22
22
|
display: flex;
|
|
23
23
|
min-height: 100%;
|
|
24
24
|
flex-direction: column;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-Do-nuGO9.js";import{a as r}from"./sentry-CpVyi-77.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-ssCDruz8.js";import"./mui-Ee2kkUYC.js";import c from"./NotFoundScreen-BbD7D-7R.js";import{h as u,g as b}from"./core-CAUatE6D.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},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-CpVyi-77.js";import{u as l,h as f,g as m}from"./core-CAUatE6D.js";import{gx as p,JH as g,JI as _}from"./zeni-epic-state-Cb-J9Nxh.js";import{u as b,L as h,z as y}from"./index-ssCDruz8.js";import"./liveblocks-Do-nuGO9.js";import"./recharts-DfwJcvGU.js";import"./mui-Ee2kkUYC.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="1c64556d-d610-4366-a7b5-7e46a63af10c",e._sentryDebugIdIdentifier="sentry-dbid-1c64556d-d610-4366-a7b5-7e46a63af10c")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-Do-nuGO9.js";import{i as S,n as x,h as C,g as y,u as ee,s as ae,j as E,N as te,o as ne,p}from"./core-CAUatE6D.js";import{JA as k,JB as v,JC as T,zA as B,zm as G,JD as D,JE as oe,JF as se,zq as ie,eW as $,zx as le,zu as re}from"./zeni-epic-state-Cb-J9Nxh.js";import{K as g,o as r,R as de,c as j,i as J,Q as ce,p as me,M as pe,m as M,w as ue,I as he,_ as xe,F as ge,h as be,n as fe,B as we,V as Se,T as ye,S as ke,q as ve,r as je,s as $e}from"./index-ssCDruz8.js";import{n as m}from"./mui-Ee2kkUYC.js";import b from"./NotFoundScreen-BbD7D-7R.js";import{a as I}from"./sentry-CpVyi-77.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="b8ec59a6-1adc-44b3-871a-e1893aabab26",e._sentryDebugIdIdentifier="sentry-dbid-b8ec59a6-1adc-44b3-871a-e1893aabab26")}catch{}})();const Ie=m.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
+
`,Ce=x(function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(de);function F(){const e=g(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(b,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const Be=m.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
height: 100vh;
|
|
13
|
+
width: 100%;
|
|
14
|
+
flex: 1 1 auto;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
18
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
19
|
+
`,De=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:D(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Ae();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=Pe(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function ze({isSubPage:e}){const t=C(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx(Be,{windowSize:o,children:a.jsx(De,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const Ae=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
flex: 1 1 auto;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
27
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
+
`,Ne=x(function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(T({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?a.jsx(b,{}):a.jsx(a.Fragment,{children:a.jsx(Le,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
flex: 1 1 auto;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
align-items: center;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
+
`,Te=x(function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(b,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Te,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},Me=m(ke)`
|
|
38
|
+
width: ${r.sp4};
|
|
39
|
+
height: ${r.sp4};
|
|
40
|
+
margin-bottom: ${r.sp3};
|
|
41
|
+
margin-top: ${r.sp3};
|
|
42
|
+
margin-left: ${r.sp8};
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
position: absolute;
|
|
45
|
+
color: ${e=>e.theme.colors.brandColorJade};
|
|
46
|
+
`,Ve=m.div`
|
|
47
|
+
display: flex;
|
|
48
|
+
height: 100vh;
|
|
49
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
50
|
+
width: 100vw;
|
|
51
|
+
overflow-y: scroll;
|
|
52
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
53
|
+
`,He=m.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
width: ${e=>`${Je.containerWidth.value(e.windowSize)}%`};
|
|
58
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
59
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
60
|
+
padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
|
|
61
|
+
`,Ke=m.div`
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
|
|
67
|
+
height: ${e=>e.windowSize==="small"?"490px":"auto"};
|
|
68
|
+
overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
|
|
69
|
+
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
|
+
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
|
+
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
+
`,We=x(function(e,t){return{file:t.file,type:t.type}})(ve);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=ae(),d=i.get("token"),V=n.pathname.includes("address"),f=g(),H=ge(),z=be(),w=fe(),K=()=>{H.toggle()},W=E(u=>k(u)),_=E(u=>v(u)),{authParams:U,fetchState:c,billAttachment:q,billFetchState:A,companyName:O,currencySymbol:Q,amount:R}=W,{tenantId:P,userId:L,sessionId:N}=U,{fetchState:X,internationalBankAccountCreateStatus:Y}=_;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{w&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&t(le(s,o,d))},[w,c,s,o,d,t]),I.useEffect(()=>{w&&c==="Completed"&&($(L,N,P),l!=null&&t(re(l)))},[c,w,L,N,P,l,t]),c==="Error"?a.jsx(b,{}):X==="Completed"||Y.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(we,{fetchState:c,style:{height:"100vh",backgroundColor:z.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${z.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&A==="Completed"&&a.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",O,l??"",_e(n.pathname),Q,R))(u)}),a.jsxs(Ve,{windowSize:f,children:[f!=="small"?a.jsx(Me,{onClick:K}):null,a.jsx(Ke,{windowSize:f,isAddressPage:V,children:A==="In-Progress"?a.jsx(ye,{size:"ExtraLarge",start:!0}):a.jsx(We,{file:q,type:"bill"})}),a.jsx(He,{windowSize:f,children:e})]})]})}const _e=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return a.jsx($e,{})}function da(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Ue,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(ze,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Ge,{})})}),a.jsx(p,{path:"*",element:a.jsx(b,{})})]})}export{da as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-Do-nuGO9.js";import{a as g}from"./sentry-CpVyi-77.js";import{u as U,g as w,h as _,s as J,j as l,N as T}from"./core-CAUatE6D.js";import{z as r,h as P,D as M,d as V,c as A,e as N,C as W,T as R,g as $}from"./index-ssCDruz8.js";import{eP as q,Jl as B,Jv as G,Jm as H,eW as K,fn as Q,Jr as X,fL as Y,cT as Z,Jw as ee,Jx as te}from"./zeni-epic-state-Cb-J9Nxh.js";import{n as ne}from"./mui-Ee2kkUYC.js";import{u as se}from"./useDeviceId-BXZMNB1t.js";import{f as ae}from"./analyticsHelper-DidHWGct.js";import{t as ie}from"./getLocaleForTenant-DjpfkvqM.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="d2ac19e7-7d20-4fd2-94d2-b61a28b6b06a",t._sentryDebugIdIdentifier="sentry-dbid-d2ac19e7-7d20-4fd2-94d2-b61a28b6b06a")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=U(),a=w(),f=_(),[k]=J(),n=k.get("token"),p=k.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:C,magicLinkEmail:c,verifyDeviceFetchState:D,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),M.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,y,s,o,b,v,a.state,t]);const j=g.useCallback(()=>{f("/signin/auth")},[f]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=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(W,{phoneNumber:C,verifyOtpFetchState:D.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||m==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
z-index: 9999;
|
|
11
|
+
background-color: ${t=>t.theme.colors.background};
|
|
12
|
+
`;export{xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as U}from"./liveblocks-
|
|
1
|
+
import{j as U}from"./liveblocks-Do-nuGO9.js";import{a as c}from"./sentry-CpVyi-77.js";import{u as pe,j as s,i as We,g as qe,h as Ke,l as M}from"./core-CAUatE6D.js";import{eP as he,e$ as Qe,f0 as Se,eT as Xe,bn as ea,eO as aa,f1 as ta,f2 as na,f4 as sa,f7 as oa,fg as ia,f8 as g,fa as ra,fb as ue,fe as da,fc as la,fd as ca,ff as ua,cJ as fa,fi as ma,cO as ba,bt as pa,eS as ha,fn as Sa,fo as ga,fm as Ea}from"./zeni-epic-state-Cb-J9Nxh.js";import{a7 as ka,a8 as Ca,F as ya,w as Ia,z as k,n as Ta,u as wa,I as r,a9 as Aa,aa as Fa,k as _a,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ga,ae as fe,af as me,L as Pa,ag as Ma,ah as be,c as R,Z as Ra,m as A,ai as N,aj as Na}from"./index-ssCDruz8.js";import{D as Ua}from"./mui-Ee2kkUYC.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]="589a4150-87e3-4490-b472-68d331be8e3e",f._sentryDebugIdIdentifier="sentry-dbid-589a4150-87e3-4490-b472-68d331be8e3e")}catch{}})();const Va=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=qe(),C=ya(),o=Ke(),V=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=k.getSignedInUser(),F=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,x=s(e=>aa(e)),j=x.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[_,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,Z),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),H=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabledV2),q=W||J&&F,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=F||!F&&$e,Ge=n.company!=null&&ia(n.company),w=ve&&Ge,Pe=s(e=>g(e).totalUnreadCount),Me=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ue={fetchStatus:Me,count:Pe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=_a(),oe=s(e=>la(e,S,h,W,J,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(xe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&H.fetchState==="Completed"&&ma(H.notificationSettings,h.userEmail,Z,n),re=Da(),Ye=re&&va(a),de=ba(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[Ze,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const He=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Je=Ba(He);return U.jsx(Ua,{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:U.jsx(Ga,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:Je,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:q&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${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=>{Ee(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:_e,newYearAnimationEnabled:De})})}),Za=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Za as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-Do-nuGO9.js";import{h as n,n as i}from"./core-CAUatE6D.js";import{$ as e}from"./index-ssCDruz8.js";import"./mui-Ee2kkUYC.js";import"./sentry-CpVyi-77.js";import"./zeni-epic-state-Cb-J9Nxh.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="f0a6f69d-2c9c-4f29-8b70-8d3b4a29316a",o._sentryDebugIdIdentifier="sentry-dbid-f0a6f69d-2c9c-4f29-8b70-8d3b4a29316a")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(e);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as ct,a as mt,m as
|
|
1
|
+
import{l as ct,a as mt,m as lt,j as E}from"./liveblocks-Do-nuGO9.js";import dt from"./NotFoundScreen-BbD7D-7R.js";import{a as k}from"./sentry-CpVyi-77.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 J}from"./core-CAUatE6D.js";import{cr as St,f1 as Y,eP as H,ff as bt,f8 as b,PS as O,fb as l,f0 as y,q_ as M,wl as It,PT as Ct,e$ as Tt,fi as yt,r3 as _t,PU as $,bq as F,gQ as x,r7 as K,PV as At,cC as Et,cw as Nt}from"./zeni-epic-state-Cb-J9Nxh.js";import{W as wt,z as Bt,w as xt,I as Pt,Y as Rt,cA as Ut,m as N,a7 as Dt,cB as vt,a8 as Gt,p as $t}from"./index-ssCDruz8.js";import"./mui-Ee2kkUYC.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="e7bb6427-900c-46b6-943c-a313736b9a8f",t._sentryDebugIdIdentifier="sentry-dbid-e7bb6427-900c-46b6-943c-a313736b9a8f")}catch{}})();const Mt=(t,d)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{d(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,d){const n=Y(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=d,i=b(t),s=H(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,d){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:w,fetchMoreCommentsNotifications:P}=d;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(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(l(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(l({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(w(r),t($([r],F())))})).then(()=>{t(l({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(l({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(l({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(l({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,w).then(()=>{t($(s,F())),t(l({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(l({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(vt)),Vt=()=>{const t=ft(),d=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[w,P]=k.useState(!1),a=S(e=>Y(e)),o=S(e=>H(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const X=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=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=Ut().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:L,isFetchingMore:Q,hasFetchedAll:z}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(d.state?.pathnameStackToGoBack,d.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(l({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(l({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const v=_||D===!0||C!==!0||_||D===!0||C!==!0;k.useEffect(()=>{v&&U!=="In-Progress"?s(l({fetchState:"In-Progress",error:void 0},"comments")):v||U!=="In-Progress"||s(l({fetchState:"Completed",error:void 0},"comments"))},[v,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&B!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(Q||z===!0||L==null||L(),null)}).filter(f=>f!=null);s(l({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,D,Q,C,z,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=lt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:X,signedInUser:h,externalNotificationsUnreadCount:tt,location:d,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(J,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(J,{path:"*",element:E.jsx(dt,{})})]})}export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-Do-nuGO9.js";import{a as r}from"./sentry-CpVyi-77.js";import{u as A,g as P,j as o,N as j}from"./core-CAUatE6D.js";import{JK as C,eP as J,f7 as M,JL as x,JM as z,JN as D,JO as L,mT as N,IG as R}from"./zeni-epic-state-Cb-J9Nxh.js";import{z as h,E as I}from"./index-ssCDruz8.js";import"./mui-Ee2kkUYC.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="a82454c9-1d7d-4be3-bcea-f2b56363cde0",n._sentryDebugIdIdentifier="sentry-dbid-a82454c9-1d7d-4be3-bcea-f2b56363cde0")}catch{}})();function ee(){const n=A(),s=P(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>J(e)),l=o(e=>M(e)),d=o(e=>e.tenantState.fetchState),b=o(x),y=o(z),c=o(D),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(N(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),u=v??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(R(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-Do-nuGO9.js";import{h as K,u as z,g as Z,i as H,j as d,n as J,o as Q,p as I}from"./core-CAUatE6D.js";import{eP as U,qO as O,qm as X,Kg as v,qh as T,bt as ee,bn as ae,bT as te,qi as se,Kh as oe,K2 as C,dE as re,ui as ne,Ki as ie,uF as ce,e_ as le,eY as de}from"./zeni-epic-state-Cb-J9Nxh.js";import{z as me,W as fe,Y as pe,k as ue,w as q,I as w,V as he,c as M,ao as be,m as ge}from"./index-ssCDruz8.js";import"./mui-Ee2kkUYC.js";import Fe from"./NotFoundScreen-BbD7D-7R.js";import{F as Ie}from"./FeaturePreviewScreen-CKIBiLol.js";import{a as b}from"./sentry-CpVyi-77.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import{u as Te}from"./useInitialThreadRequest-DnRRNYgw.js";import{t as Se}from"./routePaths-C0HYOQUJ.js";import{M as ye}from"./MobileAppDrawer-6SipHCGH.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="7b306fae-b157-4b43-a97c-ba48aa66f242",s._sentryDebugIdIdentifier="sentry-dbid-7b306fae-b157-4b43-a97c-ba48aa66f242")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=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:M}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=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 R(){const s=K(),e=z(),a=Z(),{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=>O(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:W,onAskAiCfoClick:_}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!i&&g)p(!0),l||e(X());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,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&g&&e(T(c.forecasts[t].id))}},[i,p,e,l,c,m,u,O,T,g]);const D=ue(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:N}=q(),{isFeatureEnabled:E}=N(w.isReportsCommentingEnabled),V=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[Y,G]=b.useState(!1),j=t=>{G(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:W,onAskAiCfoClick:_,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:V,onClickMenuIcon:()=>{j(!0)}})]})}function Ge(){const s=d(i=>U(i)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ge as PandLWithForecastRoutes,Ge as default};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-Do-nuGO9.js";import{Kb as te,eP as Q,jD as G,e_ as J,eY as ne,HD as q,JR as oe,to as Ee,Kc as N,tc as ke,tx as Ie,tr as ie,tg as re,tv as Pe,ts as je,Kd as le,v4 as ve,Ke as Le,fB as Te,Kf as $,tl as de,tj as ce,tA as Fe,c2 as Ae}from"./zeni-epic-state-Cb-J9Nxh.js";import{K as pe,w as X,I as E,z as H,a9 as ue,v as me,ak as ge,al as Re,r as he,o as R,x as fe,D as Ce,am as Oe,W as Ve,Y as Ue,V as Be,c as be,e as Ze,m as Ke,an as $e,k as _e}from"./index-ssCDruz8.js";import{D as ye,n as W,S as we}from"./mui-Ee2kkUYC.js";import ae from"./NotFoundScreen-BbD7D-7R.js";import{a as r}from"./sentry-CpVyi-77.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as We,o as se,p as K}from"./core-CAUatE6D.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import{M as Me}from"./MobileAppDrawer-6SipHCGH.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="58d0f36d-02b8-4eab-8d57-46f4e8dd166d",a._sentryDebugIdIdentifier="sentry-dbid-58d0f36d-02b8-4eab-8d57-46f4e8dd166d")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>G(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=J(k,u),L=ne(u),T=q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),v=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:T,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:v===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(T))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Je,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Je=W(we)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,Se=
|
|
5
|
+
`,Se=W(fe.H6Regular)`
|
|
6
6
|
margin-top: ${R.sp7};
|
|
7
7
|
padding-left: ${R.sp8};
|
|
8
8
|
padding-right: ${R.sp8};
|
|
9
9
|
color: ${a=>a.theme.colors.primary};
|
|
10
10
|
word-break: break-word;
|
|
11
|
-
`,De=
|
|
11
|
+
`,De=W(fe.LargeRegularSp)`
|
|
12
12
|
color: ${a=>a.theme.colors.hero};
|
|
13
13
|
padding-left: ${R.sp8};
|
|
14
14
|
padding-right: ${R.sp8};
|
|
15
15
|
margin-bottom: 30px;
|
|
16
16
|
margin-top: ${R.sp4};
|
|
17
17
|
white-space: pre-line;
|
|
18
|
-
`,qe={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:
|
|
18
|
+
`,qe={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>Q(i)),u=m(i=>G(i)),{useFeatureGate:D}=X(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=J(f,d),P=ne(d),L=q(d),T=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),v=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:v===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:z.discardTitle}),descriptionComponent:s.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=W(we)`
|
|
19
19
|
display: flex;
|
|
20
20
|
min-height: 100%;
|
|
21
21
|
flex-direction: column;
|
|
22
|
-
`,aa=
|
|
22
|
+
`,aa=We(function(a,t){const l=le(a),n=H.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a($({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a($({searchText:o}))}}}})($e);function M({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=Ge(),n=ee(),g=He(),{areTenantIdsInSync:o}=Ve(),y=H.getSignedInUser(),h=m(e=>Q(e)),{useFeatureGate:p}=X(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>G(e)),I=!J(O,h)&&V,w=q(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[T,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=Ye({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>ve(e.classState,e.classListState)),v=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>Te(e)),b=h?.companyId;r.useEffect(()=>{u&&T===c.uiState.mode||!o||(n($({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),L(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n($({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Be,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Xe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:v,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:v,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Me,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:v,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,Y)=>{n($({sortKey:e,sortOrder:Y}))},onRowClick:e=>{const Y=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=Ke(g.state?.pathnameStackToGoBack,g.pathname);l(Y,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function wa(){const a=_e();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx(K,{path:"/",element:s.jsx(M,{})}),s.jsx(K,{path:"new",element:s.jsx(M,{isInvitePeopleDrawerOpen:!0})}),s.jsx(K,{path:":userId/edit",element:s.jsx(M,{isEditPeopleDrawerOpen:!0})}),s.jsx(K,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx(K,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-Do-nuGO9.js";import E from"./NotFoundScreen-BbD7D-7R.js";import{a as r}from"./sentry-CpVyi-77.js";import{h as _,g as P,j as p,i as v,u as M,N as U,n as z,o as F,p as h}from"./core-CAUatE6D.js";import{eP as O,PW as b,bo as B,bn as N,hk as V,gQ as Q}from"./zeni-epic-state-Cb-J9Nxh.js";import{F as W,z as I,Y,cC as $}from"./index-ssCDruz8.js";import"./mui-Ee2kkUYC.js";import{u as q}from"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import{M as G}from"./MobileAppDrawer-6SipHCGH.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="d01ea2bf-f7cd-46d9-8ce4-ea681b3f0d34",e._sentryDebugIdIdentifier="sentry-dbid-d01ea2bf-f7cd-46d9-8ce4-ea681b3f0d34")}catch{}})();const H=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})($),J=()=>{const e=_(),t=P(),c=W(),o=p(a=>O(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=v(),u=M(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,C]=r.useState(!1),S=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=S||k||x,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=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=q({mobileExploreReferrer:"Performance"});return Y({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(G,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(H,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(J,{})}),s.jsx(h,{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-CpVyi-77.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};
|