@zeniai/web-app-ui 5.2.16-dev → 5.2.17-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-B2KIG7En.js +1 -0
- package/dist/assets/AddressScreen-BRHUGjlq.js +9 -0
- package/dist/assets/{AiCfoScreen-CjlYW9BA.js → AiCfoScreen-HMy5Y7Mq.js} +4 -4
- package/dist/assets/{BillPayApprovalRoutes-D6R35wEu.js → BillPayApprovalRoutes-ClKax7IT.js} +1 -1
- package/dist/assets/BillPayRoutes-BChpGQL2.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-BwMN9nGs.js +9 -0
- package/dist/assets/{CardsAiCfoScreen-BqGSzxio.js → CardsAiCfoScreen-DO_y52lp.js} +3 -3
- package/dist/assets/{ChargeCardRoutes-DwSiYhNV.js → ChargeCardRoutes-Dv5pDzqZ.js} +8 -8
- package/dist/assets/CompanyPassportScreen-DpirfeBa.js +1 -0
- package/dist/assets/ConnectionAuthScreen-rOB6ynUK.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-C98l4ZVS.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-D9rEFGOH.js → CustomerOnboardingRoutes-D_6fNZiA.js} +6 -6
- package/dist/assets/{DashboardRoutes-uvzfWzIm.js → DashboardRoutes-Cp_J4k4_.js} +1 -1
- package/dist/assets/DefaultTenantHome-D0bfOiik.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-CEzBRH9X.js +18 -0
- package/dist/assets/DrawerScreen-CTCbWuBb.js +1 -0
- package/dist/assets/EntityDetailRoutes-8jxY5Riu.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CjC0R383.js → ExpenseAutomationRoutes-BLGJhe2d.js} +3 -3
- package/dist/assets/{FeaturePreviewScreen-DAIgYjjb.js → FeaturePreviewScreen-BYw0siNX.js} +1 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-D5JpfjXx.js +1 -0
- package/dist/assets/MagicLinkRoutes-DJ8XQppN.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-Pc9aSzuu.js +12 -0
- package/dist/assets/MobileAppDrawer-C850zeFL.js +1 -0
- package/dist/assets/NotFoundScreen-D8y3QSjF.js +1 -0
- package/dist/assets/NotificationRoutes-CgDlCmJS.js +1 -0
- package/dist/assets/OAuthConsentScreen-BHm1bSWe.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CxkAljmn.js +1 -0
- package/dist/assets/PeopleRoutes-Cwuko2wK.js +22 -0
- package/dist/assets/PerformanceRoutes-Cpl-d1r4.js +1 -0
- package/dist/assets/{Preview-CcprGnkI.js → Preview-BD6Y1F_q.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CBR0AZz1.js → QBOConnectionScreen-BlMcHgbG.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-nJxxaKUX.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-m4OK96Pp.js → ReimbursementApprovalRuleDetailScreen-DXovejDg.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CC1LJLL_.js → ReimbursementRoutes-41mQ1voL.js} +10 -10
- package/dist/assets/{ReportsRoutes-BSnn6sLO.js → ReportsRoutes-CPxhUqlo.js} +1 -1
- package/dist/assets/RewardsRoutes-BXExREiG.js +1 -0
- package/dist/assets/ScreenRoutes-DBgtMxcS.js +2 -0
- package/dist/assets/{SettingsRoutes-BW92o1e1.js → SettingsRoutes-C3VXjgEl.js} +8 -8
- package/dist/assets/{SetupPagesScreen-CmqcI8Pt.js → SetupPagesScreen-BX3zI3tV.js} +5 -5
- package/dist/assets/SignInScreen-DYVSrH1Q.js +1 -0
- package/dist/assets/SignOutScreen-D8IS2BPQ.js +9 -0
- package/dist/assets/TaskListScreen-DbBL-EqC.js +9 -0
- package/dist/assets/TaskRoutes-CP206xuh.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-BiZAv8du.js → TransactionDetailRoutes-8oHAjr2u.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-DrsbGFZL.js → TransactionDetailScreen-Bfy3N_JT.js} +2 -2
- package/dist/assets/{TransactionListRoutes-CWvS2zXP.js → TransactionListRoutes-C46bH8Mo.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BWDCDIwg.js → TreasuryRoutes-CzmHsChK.js} +5 -5
- package/dist/assets/{VendorsRoutes-D5S2XjMm.js → VendorsRoutes-CUyxWOUM.js} +14 -14
- package/dist/assets/WiseConfirmationScreen-lyjRGpZ9.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-D0ZCvv0b.js → ZeniAccountRoutes-8seJMANR.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-D_5y24R6.js +9 -0
- package/dist/assets/{accountMappingHelper-DvHt_faU.js → accountMappingHelper-Cg1rcuy8.js} +1 -1
- package/dist/assets/{analytics-fzE8ssbj.js → analytics-CP-wGaZJ.js} +1 -1
- package/dist/assets/analyticsHelper-BZTNTJma.js +1 -0
- package/dist/assets/{core-Bnb5S7eF.js → core-4nWRIid2.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-IB5WoVjO.js → decodeURIComponentSafe-B-9vw5Be.js} +1 -1
- package/dist/assets/{dnd-BclBZkmc.js → dnd-DPx0nGIt.js} +1 -1
- package/dist/assets/{empty-CGGO74v5.js → empty-BWSUSl2t.js} +1 -1
- package/dist/assets/{empty-BXrJtoVu.js → empty-dwCpPdyI.js} +1 -1
- package/dist/assets/{emptyVideoElement-DBjMlLZt.js → emptyVideoElement-Cgz9sC1U.js} +1 -1
- package/dist/assets/epic-BIxKmwU7.js +2 -0
- package/dist/assets/getLocaleForTenant-Bpp7IHaZ.js +1 -0
- package/dist/assets/{index-D7gFR706.js → index-B89XzExo.js} +1 -1
- package/dist/assets/{index-BfeFOTnu.js → index-BEdY_Av6.js} +1 -1
- package/dist/assets/{index-BSl9hMca.js → index-C53rjstg.js} +2 -2
- package/dist/assets/{index-BzrRJ8WV.js → index-CbGX11uA.js} +33478 -32829
- package/dist/assets/index-Cx4f0JbF.css +1 -0
- package/dist/assets/{index-oAxAWZsp.js → index-D7c6Pfp9.js} +1 -1
- package/dist/assets/{index-B9FzYJpE.js → index-DmHtkhiK.js} +1 -1
- package/dist/assets/{index-DRI9BXaF.js → index-P8XH9v_Z.js} +1 -1
- package/dist/assets/{index-gZ-YqOdE.js → index-ot86Rern.js} +1 -1
- package/dist/assets/{lexical-DbVLnI8g.js → lexical-Dce73siJ.js} +1 -1
- package/dist/assets/liveblocks-BqtYq8PY.js +54 -0
- package/dist/assets/{lottie-CosVBOrn.js → lottie-C6mBeCcV.js} +1 -1
- package/dist/assets/{mui-BAFflVdx.js → mui-ChRNPf14.js} +1 -1
- package/dist/assets/{pathToGoBack-BX0vhbVE.js → pathToGoBack-DjzKcd4A.js} +1 -1
- package/dist/assets/{pdf-Ba7sOjY6.js → pdf-CHegScPw.js} +3 -3
- package/dist/assets/{pdf-lib-Sz3Y8uGi.js → pdf-lib-xuF5byC3.js} +1 -1
- package/dist/assets/{plaid-Il6Pn-tK.js → plaid-j-SLH4pe.js} +1 -1
- package/dist/assets/{pusher-DSTN6BAp.js → pusher-BK7gFb-W.js} +1 -1
- package/dist/assets/{react-DjsKx-MP.js → react-Bo9yX59J.js} +1 -1
- package/dist/assets/{react-DF-XRbvU.js → react-CWkBMv_4.js} +1 -1
- package/dist/assets/{react-Ahj_9ocn.js → react-D_MXXpOM.js} +1 -1
- package/dist/assets/{react-BQr1_2Lm.js → react-Dy3J-4XE.js} +1 -1
- package/dist/assets/{react-DV1w5wyt.js → react-YqzjdluA.js} +1 -1
- package/dist/assets/{react-wreqxVEC.js → react-wzy7xDal.js} +1 -1
- package/dist/assets/{recharts-B3FaT6ex.js → recharts-UIIeT-6j.js} +1 -1
- package/dist/assets/routePaths-BYuMJjxP.js +1 -0
- package/dist/assets/{sentry-Bj_fC7Ll.js → sentry-BtWdTNDK.js} +1 -1
- package/dist/assets/{url-CRSVA0N_.js → url-CUWwwyN4.js} +1 -1
- package/dist/assets/{url-Cv9qurGb.js → url-CkFCyaeM.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BjjheFLZ.js → useAiCfoDashboardSuggestedQuestionsChips-7YoEarS7.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DuEP5Klm.js +1 -0
- package/dist/assets/useCashManagementBanner-_9igQwqA.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-Dl4aF9Gu.js → useChargeCardPusherEvents-DCjAMeeL.js} +1 -1
- package/dist/assets/{useDeviceId-CnUmsNEA.js → useDeviceId-BVGc_c85.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BTnBt-Sy.js +1 -0
- package/dist/assets/{useInitialThreadRequest-BaClMW9n.js → useInitialThreadRequest-BMuxer3t.js} +1 -1
- package/dist/assets/{utils-BKBg63lI.js → utils-BGj88Dzy.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Dkd_LZWk.js → withTransactionSidePanel-MO-qZsKE.js} +2 -2
- package/dist/assets/{zeni-epic-state-GXytJkko.js → zeni-epic-state-Brhydpej.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +8 -5
- package/dist/assets/AddressRoutes-f609Ttdc.js +0 -1
- package/dist/assets/AddressScreen-DnnIRcHN.js +0 -9
- package/dist/assets/BillPayRoutes-CAVdOoQ5.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-2yzgn_dq.js +0 -9
- package/dist/assets/CompanyPassportScreen-6gSkpDjZ.js +0 -1
- package/dist/assets/ConnectionAuthScreen-Ck4Gxy8V.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-IhYlyAOK.js +0 -1
- package/dist/assets/DefaultTenantHome-BeV69g9G.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-C-5bE-Xl.js +0 -18
- package/dist/assets/DrawerScreen-BL40QyXA.js +0 -1
- package/dist/assets/EntityDetailRoutes-CnjAhdib.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Bwh56-e_.js +0 -1
- package/dist/assets/MagicLinkRoutes-wKih3lqk.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-7uBJWOza.js +0 -12
- package/dist/assets/MobileAppDrawer-QMY9Y_6M.js +0 -1
- package/dist/assets/NotFoundScreen-Bjgm3Cgg.js +0 -1
- package/dist/assets/NotificationRoutes-DQXiQJ75.js +0 -1
- package/dist/assets/OAuthConsentScreen-BgywNNMG.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CRmbuHlA.js +0 -1
- package/dist/assets/PeopleRoutes-Br3c54zD.js +0 -22
- package/dist/assets/PerformanceRoutes-D8GxMw7x.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-COdNraf8.js +0 -1
- package/dist/assets/RewardsRoutes-CzaqvCYC.js +0 -1
- package/dist/assets/ScreenRoutes-BT39k7R-.js +0 -2
- package/dist/assets/SignInScreen-Db_yZc64.js +0 -1
- package/dist/assets/SignOutScreen-CNV5EZSB.js +0 -9
- package/dist/assets/TaskListScreen-YoPRLTQT.js +0 -9
- package/dist/assets/TaskRoutes-Dl6VRn1s.js +0 -9
- package/dist/assets/WiseConfirmationScreen-Q0J40ioP.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BQINO3hW.js +0 -9
- package/dist/assets/analyticsHelper-DjBKxGVt.js +0 -1
- package/dist/assets/epic-Bq9rvz3h.js +0 -2
- package/dist/assets/getLocaleForTenant-DBW7UyHp.js +0 -1
- package/dist/assets/index-Czu7h9lW.css +0 -1
- package/dist/assets/liveblocks-bqFl_SVp.js +0 -54
- package/dist/assets/routePaths-iBgwsr_r.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DGvHpWY7.js +0 -1
- package/dist/assets/useCashManagementBanner-DUUI_7bK.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-C_fGcTHu.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-BqtYq8PY.js";import{a}from"./sentry-BtWdTNDK.js";import{u as w,g as D,j as c,N as v}from"./core-4nWRIid2.js";import{Mp as A,e$ as O,g5 as _,ok as j,gy as h,g4 as U,fE as L,Mw as $}from"./zeni-epic-state-Brhydpej.js";import{u as k,z as m,L as C,a as F,o as H}from"./index-CbGX11uA.js";import{n as z}from"./mui-ChRNPf14.js";import{t as R}from"./getLocaleForTenant-Bpp7IHaZ.js";import{g as M,Q as P}from"./QBOConnectionScreen-BlMcHgbG.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./empty-dwCpPdyI.js";import"./pdf-lib-xuF5byC3.js";import"./index-DmHtkhiK.js";import"./url-CUWwwyN4.js";import"./index-ot86Rern.js";import"./decodeURIComponentSafe-B-9vw5Be.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]="dc5b6b59-9594-490c-827a-898b8c7d94ef",t._sentryDebugIdIdentifier="sentry-dbid-dc5b6b59-9594-490c-827a-898b8c7d94ef")}catch{}})();const G=z.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: 1 1 auto;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
background-color: ${t=>t.theme.colors.background};
|
|
10
|
+
box-shadow: ${t=>`0px 2px ${H.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
+
`;function pe(){const t=w(),i=D(),{setLoading:d,clearAllLoading:b}=k(),p=a.useRef(!1),f=a.useRef(!1),{code:x,realmId:y,state:T}=M(i.search),N=x!==""&&y!==""&&T!=="",I=c((l=>A(l))),e=c((l=>O(l))),n=c((l=>l.tenantState.fetchState)),r=c((l=>l.tenantState.activeTenantFetchState.fetchState)),o=m.getSignedInUser(),u=m.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect((()=>{d(C.CONNECTION_AUTH)}),[d]),a.useEffect((()=>{p.current||o==null||u==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(C.TENANT_FETCHING),t(_(o.userId,u))))}),[p,n,d]),a.useEffect((()=>{e.tenantId==null&&!f.current&&o!=null&&(f.current=!0,!(u==null||u!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(j(o.userId)))}),[f,n,r]),a.useEffect((()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(C.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))}),[E]),a.useEffect((()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(U(e.tenantId)),m.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),F.updateAppLocaleID(R($(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))}),[n,r,s]),a.useEffect((()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&m.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)}),[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect((()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()}),[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S!==!0?g.jsx(G,{children:g.jsx(P,{})}):g.jsx(v,{to:"/",replace:!0})}export{pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BqtYq8PY.js";import{z as n}from"./index-CbGX11uA.js";import{g as d}from"./QBOConnectionScreen-BlMcHgbG.js";import"./sentry-BtWdTNDK.js";import{g as p,N as s}from"./core-4nWRIid2.js";import"./zeni-epic-state-Brhydpej.js";import"./recharts-UIIeT-6j.js";import"./mui-ChRNPf14.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./empty-dwCpPdyI.js";import"./pdf-lib-xuF5byC3.js";import"./index-DmHtkhiK.js";import"./url-CUWwwyN4.js";import"./index-ot86Rern.js";import"./decodeURIComponentSafe-B-9vw5Be.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-D9rEFGOH.js → CustomerOnboardingRoutes-D_6fNZiA.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BqtYq8PY.js";import{t as ht,A as Ve}from"./AddressScreen-BRHUGjlq.js";import St from"./NotFoundScreen-D8y3QSjF.js";import{a as d}from"./sentry-BtWdTNDK.js";import{h as Ce,g as Ie,u as ae,i as ke,j as k,N as B,l as bt,n as tt,o as Ct,p as H}from"./core-4nWRIid2.js";import{e$ as Y,fI as _e,fG as Oe,bs as It,fW as kt,bS as _t,oi as Ot,tJ as vt,tM as Tt,No as wt,Np as xt,kk as he,kn as nt,MV as Et,bZ as At,c7 as ue,ub as ve,tY as Pt,Nq as de,uc as at,KO as Dt,lo as ot,Nr as jt,Ns as Ft,rH as Bt,hw as Nt,MN as me,ht as Vt,MO as Ut,yo as Rt,rL as Lt,hl as $t,ho as Ue,Nt as st,Nu as Gt,Er as Mt,Nv as Qt,Ev as zt,tP as Kt,Nw as qt,Nx as Ht,ki as Zt,kl as Jt,uo as Wt,t_ as it,ua as Yt,bE as Re,cB as Xt,un as Le,r_ as en,rO as tn,lg as nn,gn as an,gm as on,gl as sn,Ny as rn,tS as cn,up as dn,us as un,uv as ln,uB as pn,c_ as mn}from"./zeni-epic-state-Brhydpej.js";import{z as L,w as Te,i as Z,R as gn,x as z,Z as oe,e as N,aq as fn,J as yn,A as rt,D as ct,ar as $e,m as Se,h as be,as as hn,o as Ge,at as Me,au as Sn,av as Qe,aw as bn,ax as Cn}from"./index-CbGX11uA.js";import{n as we}from"./mui-ChRNPf14.js";import{g as In,h as kn,q as se}from"./QBOConnectionScreen-BlMcHgbG.js";import{u as _n,a as On}from"./useEmailConnectResultRefresh-BTnBt-Sy.js";import{u as vn}from"./useChargeCardPusherEvents-DCjAMeeL.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./empty-dwCpPdyI.js";import"./pdf-lib-xuF5byC3.js";import"./index-DmHtkhiK.js";import"./url-CUWwwyN4.js";import"./index-ot86Rern.js";import"./decodeURIComponentSafe-B-9vw5Be.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new e.Error().stack;u&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[u]="55040366-dc8b-484d-b0c3-0cd4d9b533f8",e._sentryDebugIdIdentifier="sentry-dbid-55040366-dc8b-484d-b0c3-0cd4d9b533f8")}catch{}})();const ze=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Tn=()=>{const e=Ce(),u=Ie(),i=ae(),[o,l]=d.useState(!1),[c,y]=d.useState(!1),{tenantEmailDomain:S}=ke(),t=L.getSignedInUser(),{useFeatureGate:n}=Te(),{isFeatureEnabled:s}=n(Z.isApAgingFeatureEnabled),{isFeatureEnabled:b}=n(Z.isArAgingFeatureEnabled),{isFeatureEnabled:_}=n(Z.isReferralFeatureEnabled),{isFeatureEnabled:I}=n(Z.isExpenseAutomationEnabledV2),{isFeatureEnabled:w}=n(Z.isDebitCardFeatureEnabled),r=gn(),g=k((h=>Y(h))),p=k((h=>h.onboardingCustomerViewState.fetchState)),O=g.excludedResources,T=g.companyId??L.getSignedInUserTenant(S)?.companyId;if(t==null)throw Error("Can't access onboarding flow without signing in...");const x=_e(w,g),D=Oe(g),m=[],$=O?.resources?.find((h=>h.resource==="/reports/top_expenses"))==null,j=O?.resources?.find((h=>h.resource==="/reports/task_card"))==null,G=g?.userRole!=null&&It(g?.userRole),M=O?.resources?.find((h=>h.resource==="/bills"))==null&&!G,A=O?.resources?.find((h=>h.resource==="/reimbursements"))==null;$===!1&&m.push("top_expenses"),j===!1&&m.push("task_card"),M===!1&&m.push("bill_pay_card","bill_pay_promo_card"),A===!1&&m.push("reimbursement_card","reimbursement_promo_card"),m.push("zeni_accounts_promo_card","treasury_promo_card"),_===!1&&m.push("rewards_card");const F=k((h=>{const v=[];s===!1&&v.push("accounts_payable_aging"),b===!1&&v.push("accounts_receivable_aging"),v.push("zeni_accounts_promo_card","treasury_promo_card"),_===!1&&v.push("rewards_card"),r===!1&&v.push("expense_automation_card");const J=kt(h,v,t,I,r);return _t(J.reportsInOrder.map((P=>({fetchState:P.fetchState,error:P.error})))).fetchState}));d.useEffect((()=>{p!=="Completed"||o||x||D||(l(!0),i(Ot(t.userId,T,g.tenantId,!0,!1,m)))}),[o,p,x,D,t,g.tenantId,i]);const K=d.useRef(!1),Q=d.useCallback((()=>{const h={pathnameStackToGoBack:z(u.state?.pathnameStackToGoBack,u.pathname),message:"activation"};e(x?"../../checking":D?"../../cards":"../../dashboard",{state:h})}),[e,u,x,D]),V=d.useCallback((()=>{K.current||(K.current=!0,Q())}),[Q]);if(d.useEffect((()=>{const h=setTimeout((()=>y(!0)),3e3);return()=>clearTimeout(h)}),[]),d.useEffect((()=>{const h=setTimeout(V,6e3);return()=>clearTimeout(h)}),[V]),d.useEffect((()=>{x||D||!c||F!=="Completed"&&F!=="Error"||V()}),[c,F,x,D,V]),p!=="Completed")return a.jsx(B,{to:"../"});const U=g.company?.companyOnboardingInfo?.onboardingInfo,q={timeSinceQuoteSign:U?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:U?.onboardingToQuoteSignMinutes??0,isKybDone:ze(U?.businessVerified?.status),isKycDone:ze(U?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:U?.accountingConnectionCreationMode??""};return a.jsxs(a.Fragment,{children:[a.jsx(oe,{analytics:N,onLoad:h=>h.trackOnboardingDashboardActivation(q)}),a.jsx(fn,{show:!0,onComplete:V})]})},ge=["reading_books","finance_graph","reconciliation","cfo_foundation"],fe=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],Ke=(e,u)=>{const i=new Map(e.map((o=>[o.key,o])));return u.map((o=>{return l=i.get(o)?.status,l==="starting"||l==="building"?l:"idle";var l}))},qe=(e,u)=>{if(e.length===0)return!1;const i=new Map(e.map((o=>[o.key,o])));return u.every((o=>i.get(o)?.status==="ready"))},He=we.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${e=>e.theme.colors.grey4};
|
|
5
|
-
`,Ze=
|
|
5
|
+
`,Ze=we.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
align-items: center;
|
|
@@ -11,7 +11,7 @@ import{j as a}from"./liveblocks-bqFl_SVp.js";import{t as ht,A as Ue}from"./Addre
|
|
|
11
11
|
|
|
12
12
|
${e=>e.skipLegacyDrawerOffset?`
|
|
13
13
|
width: 100%;
|
|
14
|
-
padding-left: ${
|
|
14
|
+
padding-left: ${Ge.sp0};
|
|
15
15
|
`:`
|
|
16
16
|
min-width: calc(100% - ${Me}px);
|
|
17
17
|
padding-left: ${Me}px;
|
|
@@ -19,12 +19,12 @@ import{j as a}from"./liveblocks-bqFl_SVp.js";import{t as ht,A as Ue}from"./Addre
|
|
|
19
19
|
|
|
20
20
|
${e=>e.theme.breakpoints.down("md")} {
|
|
21
21
|
width: 100%;
|
|
22
|
-
padding-left: ${
|
|
22
|
+
padding-left: ${Ge.sp0};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
26
|
-
`,Je=tt((function(e,u){const{companyId:i,isAdmin:o,currentTenant:l,isOnAddressPage:c}=u,y=L.getSignedInUser(),S=l.tenantId,t={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},n=Y(e),s=ve(e,i),b=st(e),_=ue(l?.userRole??[])&&s.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=$t(e.userRoleConfigState);return{onboardingCustomerView:s,analytics:B,isRefreshingViewInBackground:!1,isDisabled:_,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Sn.fileMicroServiceBaseUrl,authParams:t},signedInUser:L.getSignedInUser(),currentTenant:n,isAdmin:o,isOnAddressPage:c,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:b,isCardPaymentPopupOpen:!1,stripeKey:Se.stripeKey}}),(function(e,u){const{companyId:i,currentTenant:o,themeState:l,navigate:c,location:y}=u,{tenantEmailDomain:S}=o;return{onFetchLinkTokenClick:(t,n)=>{e(pn(t,n))},onEstablishConnectionClick:(t,n)=>{e(ln(t,n))},onUpdatePaymentAccountStatus:(t,n,s)=>{e(un(t,n,s))},onUpdatePaymentAccountLoginStatus:(t,n)=>{e(dn(!1,t,n))},onEstablishConnectionSuccess:()=>{e(cn(i,!0,!1))},handleOnConnectClick:()=>{B.trackOnboardingConnectQBO(),se.handleClick()},updateQBOPopupState:t=>{e(de({isQBOPopupOpen:t}))},onCompanyOfficerUpdated:t=>{const n=t.map((s=>{const{officerType:b,userId:_,name:I,email:x,ssn:r,nationalityCountryCode:g,dob:p,phone:O,syncToken:T,selectDocument:w,role:D,ownership:m,isSelectedForVerification:G,userVerificationStatus:j,fileIds:$,isPhoneVerified:M}=s;let A;return w.selectDocumentType==="driverLicense"?A="driving_license":w.selectDocumentType==="passport"?A="passport":w.selectDocumentType==="stateId"?A="id_document":w.selectDocumentType==="ssnCard"&&(A="social_security_card"),{officerType:b,userId:_,firstName:I.firstName,lastName:I.lastName,email:x,ssn:r,nationalityCountryCode:g?.selectedOption!=null?Qe(g.selectedOption):void 0,phone:O,birthday:p!=null?Re(p?.toString()):p,syncToken:T,titleAtCompany:D.selectedOption,ownershipInCompany:m,documentTypeSelectedForVerification:A,isSelectedForVerification:G,userVerificationStatus:j,fileIds:$,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:M}}));e(Le({officers:n}))},onGetOtp:(t,n)=>{e(sn(t,"CustomerOnboarding")),n!=null&&e(rn({officerType:n,phone:t}))},onResendOtp:t=>{e(on(t,"CustomerOnboarding"))},onVerifyOtp:(t,n)=>{e(an(t,n,"CustomerOnboarding"))},updateFilesEntity:t=>{e(nn({files:t}))},onDeleteFile:t=>{e(tn(t))},onEditFileName:(t,n)=>{e(en(t,n.split(".")[0]))},onCompanyDetailsChanged:t=>{const{companyDescription:n,companyIndustry:s,companyIndustryType:b,companyLegalName:_,companyTaxId:I,companyWebsite:x,companyPhone:r,primaryContactEmail:g,primaryContactName:p,primaryContactUserId:O,primaryContactSyncToken:T,syncToken:w,fileIds:D,typeOfIncorporation:m,stateOfIncorporation:G,incDate:j,companySourceOfFunds:$,companySourceOfFundsDescription:M,companySubIndustry:A,countriesOfOperations:F,purposeOfAccount:K,purposeOfAccountDescription:Q,regulatedStatus:U,regulatedStatusDescription:V,transactionVolume:q,transactionVolumeDescription:h,usNexus:v,usNexusTypes:J}=t,P={companyId:i,companyDescription:n,companyIndustry:s.selectedOption,companyIndustryType:b?.selectedOption??"",companyLegalName:_,taxIdOrEIN:I,website:x!=""&&x!=null?Xt(x):void 0,phone:r,syncToken:w,fileIds:D,incDate:j!=null?Re(j?.toString()):j,typeOfIncorporation:m?.selectedOption??"",stateOfIncorporation:G?.selectedOption??"",companySourceOfFunds:$?.selectedOption??"",companySourceOfFundsDescription:M,companySubIndustry:A?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((X=>X.length===2?X:Qe(X)))??[],purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:U??"",regulatedStatusDescription:V,transactionVolume:q?.selectedOption??"",transactionVolumeDescription:h,usNexus:v,usNexusTypes:J?.selectedOptions??[]},le={userId:O,firstName:p.firstName,lastName:p.lastName,email:g,syncToken:T};e(Le({companyDetails:P,primaryContactDetails:le}))},onAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onRegisteredAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onUpdateCustomerView:(t,n,s)=>{e(Yt(i,!1,n,s,t))},onAddressEditHandler:t=>{if(t!=null){const n=ht(t);e(ot({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);e(it(i,!1,!1)),c("./activation",{state:{pathnameStackToGoBack:t}})},onUpdateStep:t=>{e(at({step:t}))},onUpdateSubStep:t=>{e(Wt({subStep:t}))},onZeniLogoClick:()=>{l.toggle()},handleLogOutClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c("/signout",{replace:!0,state:{pathnameStackToGoBack:t,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{c(`/${S}/rewards`)},handleCreateCardSetupIntent:t=>{e(nt(t))},handleConfirmCardSetupIntent:t=>{e(Jt(t))},updateCardPaymentModalState:t=>{e(de({isCardPaymentPopupOpen:t}))},handleAddCardPaymentSource:(t,n,s)=>{e(Zt(t,n,s))},handleFetchPaymentSources:()=>{e(he())},resetCardPaymentViewState:()=>{e(Ht())},handleResetCardPaymentErrorStatuses:()=>{e(qt())},redirectToProductSuitePage:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:t,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(B.trackOnboardingAiFinanceTeamAcknowledged(),e(Kt(i)))},onIdentityDocumentUploadedForAutofill:t=>{if(i==null)return;const n=Qt(t.documentType);n!=null&&e(zt({target:"onboarding",companyId:i,officerType:t.officerType,fileId:t.fileId,documentType:n}))},onCompanyDocumentUploadedForAutofill:t=>{i!=null&&e(Mt({target:"onboarding",companyId:i,fileId:t.fileId,documentType:t.documentType}))}}}))(hn),ce=({taxCFOCustomer:e=!1,isOnAddressPage:u=!1,appContent:i})=>{const o=Ce(),l=Ie(),c=ae(),y=yn(),S=rt(),[t,n]=d.useState(!1),[s,b]=d.useState(!1),[_,I]=d.useState(!1),{tenantEmailDomain:x}=ke(),r=ct(),{useFeatureGate:g}=Te(),{isFeatureEnabled:p}=g(Z.isDebitCardFeatureEnabled),O=bt("/:tenantEmailDomain/onboarding")!==null&&l.search?.includes("code"),T=k((f=>f.onboardingCustomerViewState.fetchState)),w=k((f=>f.onboardingCustomerViewState.currentStep)),D=k((f=>f.onboardingCustomerViewState.uiState)),m=k((f=>Y(f))),G=k((f=>f.userRoleConfigState.fetchState)),j=k((f=>f.cardPaymentViewState)),$=Ge(j.addCardPaymentSourceStatus.fetchState),M=j.addCardPaymentSourceStatus.fetchState,{code:A,realmId:F,state:K}=In(l.search),Q=m.externalConnections?.accounting[0],U=Q?.connectionType,V=Q?.connectionName,q=Q?.connectionId??"",h=L.getSignedInUser()?.userId??"";d.useEffect((()=>{s||(b(!0),c(he()))}),[s,c]),d.useEffect((()=>{_||(nt(["card"]),I(!0))}),[_]),d.useEffect((()=>{$==="In-Progress"&&M==="Completed"&&c(he())}),[$,M]),d.useEffect((()=>{kn(A,F,K,q,h)===!0&&m.externalConnections?.saveConnectionState!=="In-Progress"&&T==="Completed"&&(c(Et(m.tenantId,{connection_type:U??"accounting",connection_name:V??"quickbooks_online",authorization_code:A,realm_id:F,connection_id:q,user_id:h},At(window.location.origin+"/onboarding/auth"))),B.trackOnboardingSaveQBOConnection(F,q),o(l.pathname))}),[A,F,K,l.pathname,T]),d.useEffect((()=>{se.isInitiated===!1&&T==="Completed"&&se.init("/onboarding/auth",m.tenantEmailDomain)}),[T]);const v=m.companyId??L.getSignedInUserTenant(x)?.companyId,J=ue(m?.userRole??[]),P=k((f=>ve(f,v)));d.useEffect((()=>{t||T!=="Not-Started"||v==null||(n(!0),c(Pt(v,!0,!O)))}),[t,T,v]),d.useEffect((()=>{m.externalConnections?.saveConnectionState!=="Completed"&&m.externalConnections?.saveConnectionState!=="Error"||!D.isQBOPopupOpen||w!=="connect_ledger"||c(de({isQBOPopupOpen:!1}))}),[m.externalConnections?.saveConnectionState]),d.useEffect((()=>{T==="Completed"&&O&&(c(at({step:"connect_ledger"})),c(de({isQBOPopupOpen:!0})))}),[O,T]),d.useEffect((()=>{G==="Not-Started"&&c(Dt(!0))}),[G,c]);const le=Ge(P.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&P.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&le==null&&c(ot({addressType:"company_registered_address",addressToCreate:P.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[P.companyDetailsLocalData?.addressStatus?.addressToCreate,P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const X=P.isInterimEmailSent,we=L.getSignedInUser();if(we==null)throw Error("Can't access onboarding flow without signing in...");const dt=_e(p,m),ut=Oe(m),Ee=m.company?.companyOnboardingInfo.isOnboardingCompleted,Ae=f=>f.trackPageLoaded(be.Event.onboardingPage),Pe=m.productSettings.isOtherProductsEnabled,lt=m.productSettings.isTreasuryEnabled,De=xn({tenantEmailDomain:x??"",signedInUserEmail:we.userEmail??"",companyId:v}),je=(({companyId:f})=>{const R=ae(),ie=k((E=>E.onboardingCustomerViewState?.aiAgentsActivation)),ee=k((E=>Y(E).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),pe=d.useCallback((()=>{R(vt())}),[R]);d.useEffect((()=>{pe()}),[pe]);const Fe=d.useCallback((()=>{f==null||f===""||ee||R(Tt(f))}),[f,ee,R]),pt=d.useMemo((()=>{if(f==null||f==="")return[];const E=`private-encrypted-${f}`;return[`${E}.ledger-ingestion.counts-updated`,`${E}.ai-agents-activation.phase-changed`]}),[f]),mt=d.useCallback(((E,te)=>{if(te==null||typeof te!="object")return;const C=te;if(E!=="ledger-ingestion.counts-updated"){if(E==="ai-agents-activation.phase-changed"){const re=typeof C.phase_key=="string"?C.phase_key:typeof C.key=="string"?C.key:"",W=typeof C.status=="string"?C.status:"idle";if(re==="")return;R(wt({key:re,status:W==="starting"||W==="building"||W==="ready"?W:"idle",startedAt:typeof C.started_at=="string"?C.started_at:void 0,completedAt:typeof C.completed_at=="string"?C.completed_at:void 0}))}}else R(xt({customerCount:typeof C.customer_count=="number"?C.customer_count:void 0,glAccountCount:typeof C.gl_account_count=="number"?C.gl_account_count:void 0,targetTransactionCount:typeof C.target_transaction_count=="number"?C.target_transaction_count:void 0,transactionCount:typeof C.transaction_count=="number"?C.transaction_count:void 0,vendorCount:typeof C.vendor_count=="number"?C.vendor_count:void 0}))}),[R]);return vn({events:pt,onEvent:mt,onSubscribed:pe}),d.useMemo((()=>{const E=ie?.phases??[],te=Ke(E,ge),C=Ke(E,fe),re=qe(E,ge),W=qe(E,fe),Ne=E.some((yt=>yt.status!=="idle")),ne=!ee&&!Ne,Be=ee&&!Ne,gt=Be?ge.map((()=>"building")):te,ft=Be?fe.map((()=>"building")):C;return{ledgerRowStatuses:ne?void 0:gt,backgroundRowStatuses:ne?void 0:ft,showLedgerReadyInLabel:ne?void 0:re,showBackgroundReadyInLabel:ne?void 0:W,forceContinueEnabled:!ne||void 0,counts:ie?.counts,onContinueClicked:Fe}}),[ie?.phases,ie?.counts,ee,Fe])})({companyId:v});if(Ee===!0){if(!Pe)return lt?a.jsx(N,{to:"../../treasury"}):dt?a.jsx(N,{to:"../../checking"}):ut?a.jsx(N,{to:"../../cards"}):a.jsx(N,{to:"../../dashboard"});const f=P.updateStatus.fetchState==="In-Progress";if(Pe&&!f)return e?a.jsxs(He,{children:[a.jsx(oe,{analytics:B,onLoad:R=>Ae(R)}),a.jsx(Je,{navigate:o,location:l,companyId:v,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):a.jsx(N,{to:"../../onboarding/thankyou"})}else if(Ee===!1&&r?.loggedInUserRoleMap!=null)return X===!0?a.jsx(N,{to:"../../onboarding/thankyou"}):a.jsxs(He,{children:[a.jsx(oe,{analytics:B,onLoad:f=>Ae(f)}),a.jsx(Je,{navigate:o,location:l,companyId:v,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ye="external_integrations",xn=({tenantEmailDomain:e,signedInUserEmail:u,companyId:i})=>{const o=ae(),{pendingAutoFocusTabId:l}=_n(),{plaidAccounts:c,onAddPlaidAccount:y}=On({companyId:i}),S=k((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=k((r=>Y(r))),n=k((r=>r.tenantState.fetchState)),s=k((r=>jt(r,i))),b=k((r=>Ft(r,ye))),_=d.useMemo((()=>new Set(b.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[b]),I=t.tenantId,x=ue(t.userRole??[]);return d.useEffect((()=>{o(Nt(ye))}),[o]),d.useMemo((()=>({isAdmin:x,integrationsView:s,isLoading:n==="In-Progress",notifyMeRegisteredSlugs:_,autoFocusTabId:l??void 0,saveChargeBeeState:s.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:s.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:s.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:s.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:s.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(s.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,g])=>[r,g?.message]))),deleteConnectionState:s.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:s.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{o(Ve(I,"gmail",We()))},onConnectOutlook:()=>{o(Ve(I,"outlook",We()))},onConnectHubSpot:(r,g)=>{const p=s.externalConnections?.revenue?.find((T=>T.connectionName==="hubspot"))?.connectionId;if(p==null)return;const O=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:g,connection_id:p,redirect_uri:O,tenant_id:I})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(O)}`},onDisconnect:(r,g)=>{o(Gt(I,r,me(g)))},onNotifyMe:r=>{B.trackIntegrationsNotifyMeClicked("Onboarding",r),o(Lt(ye,r,u))},onReconnectQBO:()=>{se.init("/onboarding/auth",e),se.handleClick()},onRefreshClick:()=>{s.integrations.refreshQBO.fetchState!=="In-Progress"&&o(Rt())},onSaveChargeBeeCredentials:(r,g)=>{const p=s.externalConnections?.revenue?.find((O=>O.connectionName==="chargebee"))?.connectionId;p!=null&&o(Ut(I,p,me("revenue"),Vt("chargebee"),{api_key:r,site:g}))},onSaveConnectorCredentials:r=>{o(Bt(I,me("payments"),r))},plaidAccounts:c,onAddPlaidAccount:y,plaidConnectionDetails:S})),[x,s,n,_,l,I,u,e,o,c,y,S])};function We(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function Ye(e,u,i){let o=`/${e}/onboarding/address`;return o=i!=null?o.concat(`/edit/${u}/${encodeURIComponent(i)}`):o.concat(`/new/${u}`),o}const Xe=xe.div`
|
|
26
|
+
`,Je=tt((function(e,u){const{companyId:i,isAdmin:o,currentTenant:l,isOnAddressPage:c}=u,y=L.getSignedInUser(),S=l.tenantId,t={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},n=Y(e),s=ve(e,i),b=st(e),_=ue(l?.userRole??[])&&s.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=Gt(e.userRoleConfigState);return{onboardingCustomerView:s,analytics:N,isRefreshingViewInBackground:!1,isDisabled:_,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Sn.fileMicroServiceBaseUrl,authParams:t},signedInUser:L.getSignedInUser(),currentTenant:n,isAdmin:o,isOnAddressPage:c,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:b,isCardPaymentPopupOpen:!1,stripeKey:Se.stripeKey}}),(function(e,u){const{companyId:i,currentTenant:o,themeState:l,navigate:c,location:y}=u,{tenantEmailDomain:S}=o;return{onFetchLinkTokenClick:(t,n)=>{e(pn(t,n))},onEstablishConnectionClick:(t,n)=>{e(ln(t,n))},onUpdatePaymentAccountStatus:(t,n,s)=>{e(un(t,n,s))},onUpdatePaymentAccountLoginStatus:(t,n)=>{e(dn(!1,t,n))},onEstablishConnectionSuccess:()=>{e(cn(i,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),se.handleClick()},updateQBOPopupState:t=>{e(de({isQBOPopupOpen:t}))},onCompanyOfficerUpdated:t=>{const n=t.map((s=>{const{officerType:b,userId:_,name:I,email:w,ssn:r,nationalityCountryCode:g,dob:p,phone:O,syncToken:T,selectDocument:x,role:D,ownership:m,isSelectedForVerification:$,userVerificationStatus:j,fileIds:G,isPhoneVerified:M}=s;let A;return x.selectDocumentType==="driverLicense"?A="driving_license":x.selectDocumentType==="passport"?A="passport":x.selectDocumentType==="stateId"?A="id_document":x.selectDocumentType==="ssnCard"&&(A="social_security_card"),{officerType:b,userId:_,firstName:I.firstName,lastName:I.lastName,email:w,ssn:r,nationalityCountryCode:g?.selectedOption!=null?Qe(g.selectedOption):void 0,phone:O,birthday:p!=null?Re(p?.toString()):p,syncToken:T,titleAtCompany:D.selectedOption,ownershipInCompany:m,documentTypeSelectedForVerification:A,isSelectedForVerification:$,userVerificationStatus:j,fileIds:G,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:M}}));e(Le({officers:n}))},onGetOtp:(t,n)=>{e(sn(t,"CustomerOnboarding")),n!=null&&e(rn({officerType:n,phone:t}))},onResendOtp:t=>{e(on(t,"CustomerOnboarding"))},onVerifyOtp:(t,n)=>{e(an(t,n,"CustomerOnboarding"))},updateFilesEntity:t=>{e(nn({files:t}))},onDeleteFile:t=>{e(tn(t))},onEditFileName:(t,n)=>{e(en(t,n.split(".")[0]))},onCompanyDetailsChanged:t=>{const{companyDescription:n,companyIndustry:s,companyIndustryType:b,companyLegalName:_,companyTaxId:I,companyWebsite:w,companyPhone:r,primaryContactEmail:g,primaryContactName:p,primaryContactUserId:O,primaryContactSyncToken:T,syncToken:x,fileIds:D,typeOfIncorporation:m,stateOfIncorporation:$,incDate:j,companySourceOfFunds:G,companySourceOfFundsDescription:M,companySubIndustry:A,countriesOfOperations:F,purposeOfAccount:K,purposeOfAccountDescription:Q,regulatedStatus:V,regulatedStatusDescription:U,transactionVolume:q,transactionVolumeDescription:h,usNexus:v,usNexusTypes:J}=t,P={companyId:i,companyDescription:n,companyIndustry:s.selectedOption,companyIndustryType:b?.selectedOption??"",companyLegalName:_,taxIdOrEIN:I,website:w!=""&&w!=null?Xt(w):void 0,phone:r,syncToken:x,fileIds:D,incDate:j!=null?Re(j?.toString()):j,typeOfIncorporation:m?.selectedOption??"",stateOfIncorporation:$?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:M,companySubIndustry:A?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((X=>X.length===2?X:Qe(X)))??[],purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:V??"",regulatedStatusDescription:U,transactionVolume:q?.selectedOption??"",transactionVolumeDescription:h,usNexus:v,usNexusTypes:J?.selectedOptions??[]},le={userId:O,firstName:p.firstName,lastName:p.lastName,email:g,syncToken:T};e(Le({companyDetails:P,primaryContactDetails:le}))},onAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onRegisteredAddressClick:(t,n)=>{const s=Ye(S,t,n),b=z(y.state?.pathnameStackToGoBack,y.pathname);c(s,{state:{pathnameStackToGoBack:b}})},onUpdateCustomerView:(t,n,s)=>{e(Yt(i,!1,n,s,t))},onAddressEditHandler:t=>{if(t!=null){const n=ht(t);e(ot({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);e(it(i,!1,!1)),c("./activation",{state:{pathnameStackToGoBack:t}})},onUpdateStep:t=>{e(at({step:t}))},onUpdateSubStep:t=>{e(Wt({subStep:t}))},onZeniLogoClick:()=>{l.toggle()},handleLogOutClick:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c("/signout",{replace:!0,state:{pathnameStackToGoBack:t,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{c(`/${S}/rewards`)},handleCreateCardSetupIntent:t=>{e(nt(t))},handleConfirmCardSetupIntent:t=>{e(Jt(t))},updateCardPaymentModalState:t=>{e(de({isCardPaymentPopupOpen:t}))},handleAddCardPaymentSource:(t,n,s)=>{e(Zt(t,n,s))},handleFetchPaymentSources:()=>{e(he())},resetCardPaymentViewState:()=>{e(Ht())},handleResetCardPaymentErrorStatuses:()=>{e(qt())},redirectToProductSuitePage:()=>{const t=z(y.state?.pathnameStackToGoBack,y.pathname);c(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:t,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(N.trackOnboardingAiFinanceTeamAcknowledged(),e(Kt(i)))},onIdentityDocumentUploadedForAutofill:t=>{if(i==null)return;const n=Qt(t.documentType);n!=null&&e(zt({target:"onboarding",companyId:i,officerType:t.officerType,fileId:t.fileId,documentType:n}))},onCompanyDocumentUploadedForAutofill:t=>{i!=null&&e(Mt({target:"onboarding",companyId:i,fileId:t.fileId,documentType:t.documentType}))}}}))(hn),ce=({taxCFOCustomer:e=!1,isOnAddressPage:u=!1,appContent:i})=>{const o=Ce(),l=Ie(),c=ae(),y=yn(),S=rt(),[t,n]=d.useState(!1),[s,b]=d.useState(!1),[_,I]=d.useState(!1),{tenantEmailDomain:w}=ke(),r=ct(),{useFeatureGate:g}=Te(),{isFeatureEnabled:p}=g(Z.isDebitCardFeatureEnabled),O=bt("/:tenantEmailDomain/onboarding")!==null&&l.search?.includes("code"),T=k((f=>f.onboardingCustomerViewState.fetchState)),x=k((f=>f.onboardingCustomerViewState.currentStep)),D=k((f=>f.onboardingCustomerViewState.uiState)),m=k((f=>Y(f))),$=k((f=>f.userRoleConfigState.fetchState)),j=k((f=>f.cardPaymentViewState)),G=$e(j.addCardPaymentSourceStatus.fetchState),M=j.addCardPaymentSourceStatus.fetchState,{code:A,realmId:F,state:K}=In(l.search),Q=m.externalConnections?.accounting[0],V=Q?.connectionType,U=Q?.connectionName,q=Q?.connectionId??"",h=L.getSignedInUser()?.userId??"";d.useEffect((()=>{s||(b(!0),c(he()))}),[s,c]),d.useEffect((()=>{_||(nt(["card"]),I(!0))}),[_]),d.useEffect((()=>{G==="In-Progress"&&M==="Completed"&&c(he())}),[G,M]),d.useEffect((()=>{kn(A,F,K,q,h)===!0&&m.externalConnections?.saveConnectionState!=="In-Progress"&&T==="Completed"&&(c(Et(m.tenantId,{connection_type:V??"accounting",connection_name:U??"quickbooks_online",authorization_code:A,realm_id:F,connection_id:q,user_id:h},At(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(F,q),o(l.pathname))}),[A,F,K,l.pathname,T]),d.useEffect((()=>{se.isInitiated===!1&&T==="Completed"&&se.init("/onboarding/auth",m.tenantEmailDomain)}),[T]);const v=m.companyId??L.getSignedInUserTenant(w)?.companyId,J=ue(m?.userRole??[]),P=k((f=>ve(f,v)));d.useEffect((()=>{t||T!=="Not-Started"||v==null||(n(!0),c(Pt(v,!0,!O)))}),[t,T,v]),d.useEffect((()=>{m.externalConnections?.saveConnectionState!=="Completed"&&m.externalConnections?.saveConnectionState!=="Error"||!D.isQBOPopupOpen||x!=="connect_ledger"||c(de({isQBOPopupOpen:!1}))}),[m.externalConnections?.saveConnectionState]),d.useEffect((()=>{T==="Completed"&&O&&(c(at({step:"connect_ledger"})),c(de({isQBOPopupOpen:!0})))}),[O,T]),d.useEffect((()=>{$==="Not-Started"&&c(Dt(!0))}),[$,c]);const le=$e(P.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&P.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&le==null&&c(ot({addressType:"company_registered_address",addressToCreate:P.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[P.companyDetailsLocalData?.addressStatus?.addressToCreate,P.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const X=P.isInterimEmailSent,xe=L.getSignedInUser();if(xe==null)throw Error("Can't access onboarding flow without signing in...");const dt=_e(p,m),ut=Oe(m),Ee=m.company?.companyOnboardingInfo.isOnboardingCompleted,Ae=f=>f.trackPageLoaded(be.Event.onboardingPage),Pe=m.productSettings.isOtherProductsEnabled,lt=m.productSettings.isTreasuryEnabled,De=wn({tenantEmailDomain:w??"",signedInUserEmail:xe.userEmail??"",companyId:v}),je=(({companyId:f})=>{const R=ae(),ie=k((E=>E.onboardingCustomerViewState?.aiAgentsActivation)),ee=k((E=>Y(E).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),pe=d.useCallback((()=>{R(vt())}),[R]);d.useEffect((()=>{pe()}),[pe]);const Fe=d.useCallback((()=>{f==null||f===""||ee||R(Tt(f))}),[f,ee,R]),pt=d.useMemo((()=>{if(f==null||f==="")return[];const E=`private-encrypted-${f}`;return[`${E}.ledger-ingestion.counts-updated`,`${E}.ai-agents-activation.phase-changed`]}),[f]),mt=d.useCallback(((E,te)=>{if(te==null||typeof te!="object")return;const C=te;if(E!=="ledger-ingestion.counts-updated"){if(E==="ai-agents-activation.phase-changed"){const re=typeof C.phase_key=="string"?C.phase_key:typeof C.key=="string"?C.key:"",W=typeof C.status=="string"?C.status:"idle";if(re==="")return;R(xt({key:re,status:W==="starting"||W==="building"||W==="ready"?W:"idle",startedAt:typeof C.started_at=="string"?C.started_at:void 0,completedAt:typeof C.completed_at=="string"?C.completed_at:void 0}))}}else R(wt({customerCount:typeof C.customer_count=="number"?C.customer_count:void 0,glAccountCount:typeof C.gl_account_count=="number"?C.gl_account_count:void 0,targetTransactionCount:typeof C.target_transaction_count=="number"?C.target_transaction_count:void 0,transactionCount:typeof C.transaction_count=="number"?C.transaction_count:void 0,vendorCount:typeof C.vendor_count=="number"?C.vendor_count:void 0}))}),[R]);return vn({events:pt,onEvent:mt,onSubscribed:pe}),d.useMemo((()=>{const E=ie?.phases??[],te=Ke(E,ge),C=Ke(E,fe),re=qe(E,ge),W=qe(E,fe),Be=E.some((yt=>yt.status!=="idle")),ne=!ee&&!Be,Ne=ee&&!Be,gt=Ne?ge.map((()=>"building")):te,ft=Ne?fe.map((()=>"building")):C;return{ledgerRowStatuses:ne?void 0:gt,backgroundRowStatuses:ne?void 0:ft,showLedgerReadyInLabel:ne?void 0:re,showBackgroundReadyInLabel:ne?void 0:W,forceContinueEnabled:!ne||void 0,counts:ie?.counts,onContinueClicked:Fe}}),[ie?.phases,ie?.counts,ee,Fe])})({companyId:v});if(Ee===!0){if(!Pe)return lt?a.jsx(B,{to:"../../treasury"}):dt?a.jsx(B,{to:"../../checking"}):ut?a.jsx(B,{to:"../../cards"}):a.jsx(B,{to:"../../dashboard"});const f=P.updateStatus.fetchState==="In-Progress";if(Pe&&!f)return e?a.jsxs(He,{children:[a.jsx(oe,{analytics:N,onLoad:R=>Ae(R)}),a.jsx(Je,{navigate:o,location:l,companyId:v,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):a.jsx(B,{to:"../../onboarding/thankyou"})}else if(Ee===!1&&r?.loggedInUserRoleMap!=null)return X===!0?a.jsx(B,{to:"../../onboarding/thankyou"}):a.jsxs(He,{children:[a.jsx(oe,{analytics:N,onLoad:f=>Ae(f)}),a.jsx(Je,{navigate:o,location:l,companyId:v,currentTenant:m,isAdmin:J,isOnAddressPage:u,themeState:S,googleAPIKey:Se.googleMapsAPIKey,integrationsSectionProps:De,aiAgentsActivationProps:je}),i!=null?a.jsx(Ze,{windowSize:y,skipLegacyDrawerOffset:u&&m.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ye="external_integrations",wn=({tenantEmailDomain:e,signedInUserEmail:u,companyId:i})=>{const o=ae(),{pendingAutoFocusTabId:l}=_n(),{plaidAccounts:c,onAddPlaidAccount:y}=On({companyId:i}),S=k((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=k((r=>Y(r))),n=k((r=>r.tenantState.fetchState)),s=k((r=>jt(r,i))),b=k((r=>Ft(r,ye))),_=d.useMemo((()=>new Set(b.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[b]),I=t.tenantId,w=ue(t.userRole??[]);return d.useEffect((()=>{o(Bt(ye))}),[o]),d.useMemo((()=>({isAdmin:w,integrationsView:s,isLoading:n==="In-Progress",notifyMeRegisteredSlugs:_,autoFocusTabId:l??void 0,saveChargeBeeState:s.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:s.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:s.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:s.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:s.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(s.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,g])=>[r,g?.message]))),deleteConnectionState:s.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:s.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{o(Ue(I,"gmail",We()))},onConnectOutlook:()=>{o(Ue(I,"outlook",We()))},onConnectHubSpot:(r,g)=>{const p=s.externalConnections?.revenue?.find((T=>T.connectionName==="hubspot"))?.connectionId;if(p==null)return;const O=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:g,connection_id:p,redirect_uri:O,tenant_id:I})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(O)}`},onDisconnect:(r,g)=>{o($t(I,r,me(g)))},onNotifyMe:r=>{N.trackIntegrationsNotifyMeClicked("Onboarding",r),o(Lt(ye,r,u))},onReconnectQBO:()=>{se.init("/onboarding/auth",e),se.handleClick()},onRefreshClick:()=>{s.integrations.refreshQBO.fetchState!=="In-Progress"&&o(Rt())},onSaveChargeBeeCredentials:(r,g)=>{const p=s.externalConnections?.revenue?.find((O=>O.connectionName==="chargebee"))?.connectionId;p!=null&&o(Vt(I,p,me("revenue"),Ut("chargebee"),{api_key:r,site:g}))},onSaveConnectorCredentials:r=>{o(Nt(I,me("payments"),r))},plaidAccounts:c,onAddPlaidAccount:y,plaidConnectionDetails:S})),[w,s,n,_,l,I,u,e,o,c,y,S])};function We(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function Ye(e,u,i){let o=`/${e}/onboarding/address`;return o=i!=null?o.concat(`/edit/${u}/${encodeURIComponent(i)}`):o.concat(`/new/${u}`),o}const Xe=we.div`
|
|
27
27
|
display: flex;
|
|
28
28
|
height: 100vh;
|
|
29
29
|
background-color: ${e=>e.theme.colors.grey4};
|
|
30
|
-
`,et=tt((function(e,u){const{companyId:i,currentTenant:o}=u,l=ve(e,i),c=st(e);return{hasVerifiedBankAccount:(l.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(c.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ue(o?.userRole??[])&&l.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:L.getSignedInUser(),currentTenant:o,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}}),(function(e,u){const{currentTenant:i,themeState:o,navigate:l,location:c}=u,{tenantEmailDomain:y}=i;return{onZeniLogoClick:()=>{o.toggle()},handleLogOutClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{l(`/${y}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l(`/${y}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}}))(Cn),
|
|
30
|
+
`,et=tt((function(e,u){const{companyId:i,currentTenant:o}=u,l=ve(e,i),c=st(e);return{hasVerifiedBankAccount:(l.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(c.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ue(o?.userRole??[])&&l.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:L.getSignedInUser(),currentTenant:o,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}}),(function(e,u){const{currentTenant:i,themeState:o,navigate:l,location:c}=u,{tenantEmailDomain:y}=i;return{onZeniLogoClick:()=>{o.toggle()},handleLogOutClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{l(`/${y}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const S=z(c.state?.pathnameStackToGoBack,c.pathname);l(`/${y}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}}))(Cn),xn=()=>{const e=Ce(),u=ae(),i=Ie(),o=rt(),{useFeatureGate:l}=Te(),{isFeatureEnabled:c}=l(Z.isDebitCardFeatureEnabled),{tenantEmailDomain:y}=ke(),S=ct(),[t,n]=d.useState(!1);d.useEffect((()=>{t===!1&&i.state?.message==="OnboardingThankyou"&&n(!0)}),[i.state]);const s=k((p=>Y(p))),b=s.productSettings.isOtherProductsEnabled;d.useEffect((()=>{u(it(_,!1,!b))}),[]);const _=s.companyId??L.getSignedInUserTenant(y)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=_e(c,s),w=Oe(s),r=k((p=>p.onboardingCustomerViewState.updateStatus.fetchState)),g=s.company?.companyOnboardingInfo.isOnboardingCompleted;if(g!==!0||b)return r==="Completed"&&g===!0&&b&&S?.loggedInUserRoleMap!=null?a.jsxs(Xe,{children:[a.jsx(oe,{analytics:N,onLoad:p=>{p.trackPageLoaded(be.Event.onboardingLandingPage,"Onboarding",mn(s.productSettings))}}),a.jsx(et,{navigate:e,showUpdatePaymentDetailButton:b,location:i,companyId:_,currentTenant:s,themeState:o,isVisitingFirstTime:t})]}):r==="Completed"&&g===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Xe,{children:[a.jsx(oe,{analytics:N,onLoad:p=>{p.trackPageLoaded(be.Event.onboardingInterimPage)}}),a.jsx(et,{navigate:e,showUpdatePaymentDetailButton:b,location:i,companyId:_,currentTenant:s,themeState:o,isVisitingFirstTime:t})]}):a.jsx(bn,{});{const p={pathnameStackToGoBack:i.state?.pathnameStackToGoBack,message:"activation"};return I?a.jsx(B,{to:"../../checking",state:p,replace:!0}):w?a.jsx(B,{to:"../../cards",state:p,replace:!0}):a.jsx(B,{to:"../../dashboard",state:p,replace:!0})}};function ta(){return a.jsxs(Ct,{children:[a.jsx(H,{path:"/",element:a.jsx(ce,{})}),a.jsx(H,{path:"/billing/edit",element:a.jsx(ce,{taxCFOCustomer:!0})}),a.jsx(H,{path:"/thankyou",element:a.jsx(xn,{})}),a.jsx(H,{path:"/activation",element:a.jsx(Tn,{})}),a.jsx(H,{path:"/address/edit/:addressType/:addressId",element:a.jsx(ce,{isOnAddressPage:!0,appContent:a.jsx(Ve,{})})}),a.jsx(H,{path:"/address/new/:addressType",element:a.jsx(ce,{isOnAddressPage:!0,appContent:a.jsx(Ve,{})})}),a.jsx(H,{path:"*",element:a.jsx(St,{})})]})}export{ta as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-bqFl_SVp.js";import{i as K,j as _,g as H,u as $,h as W,n as ee,k as ra,o as bt,p as F,N as Dn}from"./core-Bnb5S7eF.js";import{eZ as U,NH as We,bE as ia,bo as Pe,OY as Fn,j8 as On,OZ as Kt,O_ as Rn,jb as Ct,O$ as Ze,P0 as Bn,jg as jn,P1 as qt,P2 as Mn,jk as kt,P3 as Qe,P4 as Ln,cq as yt,P5 as Un,P6 as Gn,N$ as Vn,kc as Nn,P7 as Yn,bn as Xe,P8 as ca,Nv as ce,bc as la,kq as da,oq as ua,k9 as ma,Nx as le,Nw as J,eY as pa,fu as $n,g5 as _t,P9 as zn,Pa as Kn,Pb as ha,Pc as Fe,wc as Me,wd as Le,wA as we,wu as de,wh as Ue,Pd as qn,Pe as Zn,Pf as Qn,Pg as fa,Ph as Oe,Pi as Hn,dI as Je,sw as ga,Pj as Wn,Pk as Xn,Pl as Jn,Pm as vt,MN as At,kG as xe,wI as It,sE as eo,Pn as to,we as Zt,sz as Ee,sv as ba,Po as ge,Pp as ao,Pq as Et,MM as Tt,uD as Ca,Pr as no,Ps as oo,Pt as so,Pu as Pt,uT as ro,Pv as io,wg as Qt,uC as ka,Pw as be,Px as co,bs as _a,wM as Sa,Py as lo,Pz as uo,PA as mo,PB as wt,wH as po,PC as ho,wf as Ht,wL as ya,PD as Ce,PE as fo,PF as go,PG as va,kv as Aa,on as Ia,kA as Ea,ol as Ta,ok as Pa,oj as wa,t$ as bo,PH as Co,cU as ko,cV as _o,og as So,fU as yo,ox as vo,GZ as dt,GR as Ao,GV as Io,PI as Eo,PJ as To,PK as Po,b5 as et,fM as wo,hN as xo,gn as Do,or as Fo,k2 as Oo,oo as Ro,om as Bo,fG as jo,fE as Mo}from"./zeni-epic-state-GXytJkko.js";import{z as M,a4 as te,w,g as T,O as q,a_ as Lo,a0 as Ge,D as Ve,a$ as xa,j as N,b0 as Uo,f as _e,b1 as Da,y as Se,d as B,E as Go,b2 as Vo,b3 as No,Z as Fa,p as Oa,a as Ra,$ as Yo,b4 as $o,X as zo,aS as Ba,a1 as se,b5 as ja,b6 as Ma,a3 as La,b7 as Ko,b8 as qo,c as Zo,ar as Qo,v as Ho,_ as Wo,b9 as Xo,ba as Jo,bb as es,bc as ts,bd as ke}from"./index-BzrRJ8WV.js";import{n as xt}from"./mui-BAFflVdx.js";import{a as b}from"./sentry-Bj_fC7Ll.js";import{w as Ua}from"./withTransactionSidePanel-Dkd_LZWk.js";import{c as Ga,t as De,f as ue,a as Dt,v as as}from"./routePaths-iBgwsr_r.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-DGvHpWY7.js";import je from"./NotFoundScreen-Bjgm3Cgg.js";import{u as Ft}from"./useInitialThreadRequest-BaClMW9n.js";import{t as Va}from"./analyticsHelper-DjBKxGVt.js";import{C as ns}from"./CompanyPassportScreen-6gSkpDjZ.js";import{u as os}from"./useAiCfoDashboardSuggestedQuestionsChips-BjjheFLZ.js";import{F as ss}from"./FeaturePreviewScreen-DAIgYjjb.js";import"./recharts-B3FaT6ex.js";import"./analytics-fzE8ssbj.js";import"./plaid-Il6Pn-tK.js";import"./dnd-BclBZkmc.js";import"./stripe-cKAAJElX.js";import"./lottie-CosVBOrn.js";import"./lexical-DbVLnI8g.js";import"./pdf-Ba7sOjY6.js";import"./utils-BKBg63lI.js";import"./TransactionDetailScreen-DrsbGFZL.js";import"./decodeURIComponentSafe-IB5WoVjO.js";import"./MobileAppDrawer-QMY9Y_6M.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]="2b062378-aa99-4c31-af7f-07a106cf0243",e._sentryDebugIdIdentifier="sentry-dbid-2b062378-aa99-4c31-af7f-07a106cf0243")}catch{}})();const rs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((I=>I.tenantState.currentTenantId)),c=_((I=>U(I))),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo((()=>({authParams:u,companyName:C,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()})),[]),h=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),p=$(),f=W(),S=_((I=>Fn(I,h,o))),E=b.useCallback((()=>{o!=null&&S.fetchState!=="In-Progress"&&S.fetchState!=="Completed"&&p(On(o,h))}),[h]),v=b.useCallback((()=>{f("../../",{relative:"path"})}),[]),k=b.useCallback(((I,L)=>{p(Kt({sortKey:I,sortOrder:L}))}),[]),P=b.useCallback((I=>{p(Kt({downloadState:I}))}),[]),x=b.useCallback((I=>{if(e)e(I.transactionId,I.transactionType);else if(m!=null){const L=Ga({id:I.transactionId,type:I.transactionType},m);f(L);const ne=w(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}}),[m,e]),y=b.useCallback((()=>{S.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),S.vendor.id,S.vendor.name)}),[S.vendor,h]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{S.fetchState==="Completed"&&y()}),[y,S.fetchState]),d.jsx(Lo,{apAgingDetail:S,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:x,onReload:E,onBackClick:v,onColumnSortConfigChanged:k,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),is=()=>{const e=$(),a=W(),t=_((k=>Rn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((k=>k.tenantState.currentTenantId)),i=_((k=>U(k))),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo((()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),C=t.apAgingUIState.selectedDate??Pe(),u=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(C))}),[]);b.useEffect((()=>{u()}),[]);const l=b.useCallback((()=>{a("../",{relative:"path"})}),[]),h=b.useCallback((k=>{e(Ze({searchString:k}))}),[]),p=b.useCallback(((k,P)=>{e(Ze({sortKey:P,sortOrder:k}))}),[]),f=b.useCallback((k=>{a(`./${k}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[C]),S=b.useCallback((k=>{e(Ze({downloadState:k}))}),[]),E=b.useCallback(((k,P)=>{}),[]),v=b.useCallback(((k,P)=>{e(Ze({selectedDate:k,agingDateSelectionType:P})),e(Ct(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:S,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((y=>U(y))),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo((()=>({authParams:C,companyName:g,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()})),[]),l=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),h=$(),p=W(),f=_((y=>Bn(y,l,o))),S=b.useCallback((()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))}),[l]),E=b.useCallback((()=>{p("../../",{relative:"path"})}),[]),v=b.useCallback(((y,I)=>{h(qt({sortKey:y,sortOrder:I}))}),[]),k=b.useCallback((y=>{h(qt({downloadState:y}))}),[]),P=b.useCallback((y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const I=Ga({id:y.transactionId,type:y.transactionType},c);p(I);const L=w(m.state?.pathnameStackToGoBack,m.pathname);p(I,{state:{pathnameStackToGoBack:L}})}}),[c,e]),x=b.useCallback((()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)}),[f.customer,l]);return b.useEffect((()=>{S()}),[]),b.useEffect((()=>{f.fetchState==="Completed"&&x()}),[f.fetchState,x]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:P,onReload:S,onBackClick:E,onColumnSortConfigChanged:v,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=$(),a=W(),t=_((v=>Mn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((v=>U(v))),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),g=t.arAgingUIState.selectedDate??Pe(),C=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(g))}),[]);b.useEffect((()=>{C()}),[]);const u=b.useCallback((()=>{a("../",{relative:"path"})}),[]),l=b.useCallback((v=>{e(Qe({searchString:v}))}),[]),h=b.useCallback(((v,k)=>{e(Qe({sortKey:k,sortOrder:v}))}),[]),p=b.useCallback((v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[g]),f=b.useCallback((v=>{e(Qe({downloadState:v}))}),[]),S=b.useCallback(((v,k)=>{e(Qe({selectedDate:v,agingDateSelectionType:k})),e(kt(v))}),[]),E=b.useCallback(((v,k)=>{e(Ln({nodeId:v,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Na=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee((function(e){const a=Un(e).accountsInOrder.map(((n,o)=>Na(n,o))),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ya)(Da),us=ee((function(e){const a=Yn(e).accountsInOrder.map(((o,r)=>Na(o,r))),t=M.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ya)(Da);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1)),r=yt(n?.loggedInUserRoleMap);return _((s=>s.cashBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=yt(n?.loggedInUserRoleMap),r=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1));return _((s=>s.cardBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=xt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-BqtYq8PY.js";import{i as K,j as _,g as H,u as $,h as W,n as ee,k as ra,o as bt,p as F,N as Dn}from"./core-4nWRIid2.js";import{e$ as U,NR as We,bE as ia,bo as Pe,P6 as Fn,ja as On,P7 as Kt,P8 as Rn,jd as Ct,P9 as Ze,Pa as Bn,ji as jn,Pb as qt,Pc as Mn,jm as kt,Pd as Qe,Pe as Ln,cr as yt,Pf as Un,Pg as Gn,O9 as Vn,ke as Nn,Ph as Yn,bn as Xe,Pi as ca,NF as ce,bc as la,ks as da,os as ua,kb as ma,NH as le,NG as J,e_ as pa,fw as $n,g7 as _t,Pj as zn,Pk as Kn,Pl as ha,Pm as Fe,we as Me,wf as Le,wC as we,ww as de,wj as Ue,Pn as qn,Po as Zn,Pp as Qn,Pq as fa,Pr as Oe,Ps as Hn,dL as Je,sy as ga,Pt as Wn,Pu as Xn,Pv as Jn,Pw as vt,MX as At,kI as xe,wK as It,sG as eo,Px as to,wg as Zt,sB as Ee,sx as ba,Py as ge,Pz as ao,PA as Et,MW as Tt,uF as Ca,PB as no,PC as oo,PD as so,PE as Pt,uV as ro,PF as io,wi as Qt,uE as ka,PG as be,PH as co,bs as _a,wO as Sa,PI as lo,PJ as uo,PK as mo,PL as wt,wJ as po,PM as ho,wh as Ht,wN as ya,PN as Ce,PO as fo,PP as go,PQ as va,kx as Aa,op as Ia,kC as Ea,on as Ta,om as Pa,ol as wa,u1 as bo,PR as Co,cV as ko,cW as _o,oi as So,fW as yo,oz as vo,G$ as dt,GT as Ao,GX as Io,PS as Eo,PT as To,PU as Po,b5 as et,fO as wo,hP as xo,gp as Do,ot as Fo,k4 as Oo,oq as Ro,oo as Bo,fI as jo,fG as Mo}from"./zeni-epic-state-Brhydpej.js";import{z as M,a4 as te,x as w,e as T,a as q,a_ as Lo,a0 as Ge,Z as Ve,a$ as xa,h as N,b0 as Uo,D as _e,b1 as Da,w as Se,i as B,E as Go,b2 as Vo,b3 as No,Y as Fa,J as Oa,c as Ra,$ as Yo,b4 as $o,W as zo,aS as Ba,a1 as se,b5 as ja,b6 as Ma,a3 as La,b7 as Ko,b8 as qo,R as Zo,ar as Qo,v as Ho,_ as Wo,b9 as Xo,ba as Jo,bb as es,bc as ts,bd as ke}from"./index-CbGX11uA.js";import{n as xt}from"./mui-ChRNPf14.js";import{a as b}from"./sentry-BtWdTNDK.js";import{w as Ua}from"./withTransactionSidePanel-MO-qZsKE.js";import{c as Ga,t as De,f as ue,a as Dt,v as as}from"./routePaths-BYuMJjxP.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import je from"./NotFoundScreen-D8y3QSjF.js";import{u as Ft}from"./useInitialThreadRequest-BMuxer3t.js";import{t as Va}from"./analyticsHelper-BZTNTJma.js";import{C as ns}from"./CompanyPassportScreen-DpirfeBa.js";import{u as os}from"./useAiCfoDashboardSuggestedQuestionsChips-7YoEarS7.js";import{F as ss}from"./FeaturePreviewScreen-BYw0siNX.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./TransactionDetailScreen-Bfy3N_JT.js";import"./decodeURIComponentSafe-B-9vw5Be.js";import"./MobileAppDrawer-C850zeFL.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]="c2521d45-5e20-414e-ab2b-10b510695b4e",e._sentryDebugIdIdentifier="sentry-dbid-c2521d45-5e20-414e-ab2b-10b510695b4e")}catch{}})();const rs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((I=>I.tenantState.currentTenantId)),c=_((I=>U(I))),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo((()=>({authParams:u,companyName:C,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()})),[]),h=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),p=$(),f=W(),S=_((I=>Fn(I,h,o))),E=b.useCallback((()=>{o!=null&&S.fetchState!=="In-Progress"&&S.fetchState!=="Completed"&&p(On(o,h))}),[h]),v=b.useCallback((()=>{f("../../",{relative:"path"})}),[]),k=b.useCallback(((I,L)=>{p(Kt({sortKey:I,sortOrder:L}))}),[]),P=b.useCallback((I=>{p(Kt({downloadState:I}))}),[]),x=b.useCallback((I=>{if(e)e(I.transactionId,I.transactionType);else if(m!=null){const L=Ga({id:I.transactionId,type:I.transactionType},m);f(L);const ne=w(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}}),[m,e]),y=b.useCallback((()=>{S.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),S.vendor.id,S.vendor.name)}),[S.vendor,h]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{S.fetchState==="Completed"&&y()}),[y,S.fetchState]),d.jsx(Lo,{apAgingDetail:S,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:x,onReload:E,onBackClick:v,onColumnSortConfigChanged:k,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),is=()=>{const e=$(),a=W(),t=_((k=>Rn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((k=>k.tenantState.currentTenantId)),i=_((k=>U(k))),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo((()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),C=t.apAgingUIState.selectedDate??Pe(),u=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(C))}),[]);b.useEffect((()=>{u()}),[]);const l=b.useCallback((()=>{a("../",{relative:"path"})}),[]),h=b.useCallback((k=>{e(Ze({searchString:k}))}),[]),p=b.useCallback(((k,P)=>{e(Ze({sortKey:P,sortOrder:k}))}),[]),f=b.useCallback((k=>{a(`./${k}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[C]),S=b.useCallback((k=>{e(Ze({downloadState:k}))}),[]),E=b.useCallback(((k,P)=>{}),[]),v=b.useCallback(((k,P)=>{e(Ze({selectedDate:k,agingDateSelectionType:P})),e(Ct(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:S,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_((y=>U(y))),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo((()=>({authParams:C,companyName:g,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()})),[]),l=b.useMemo((()=>r!=null?ia(r):Pe()),[r]),h=$(),p=W(),f=_((y=>Bn(y,l,o))),S=b.useCallback((()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))}),[l]),E=b.useCallback((()=>{p("../../",{relative:"path"})}),[]),v=b.useCallback(((y,I)=>{h(qt({sortKey:y,sortOrder:I}))}),[]),k=b.useCallback((y=>{h(qt({downloadState:y}))}),[]),P=b.useCallback((y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const I=Ga({id:y.transactionId,type:y.transactionType},c);p(I);const L=w(m.state?.pathnameStackToGoBack,m.pathname);p(I,{state:{pathnameStackToGoBack:L}})}}),[c,e]),x=b.useCallback((()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)}),[f.customer,l]);return b.useEffect((()=>{S()}),[]),b.useEffect((()=>{f.fetchState==="Completed"&&x()}),[f.fetchState,x]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:P,onReload:S,onBackClick:E,onColumnSortConfigChanged:v,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=$(),a=W(),t=_((v=>Mn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_((v=>U(v))),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()})),[]),g=t.arAgingUIState.selectedDate??Pe(),C=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(g))}),[]);b.useEffect((()=>{C()}),[]);const u=b.useCallback((()=>{a("../",{relative:"path"})}),[]),l=b.useCallback((v=>{e(Qe({searchString:v}))}),[]),h=b.useCallback(((v,k)=>{e(Qe({sortKey:k,sortOrder:v}))}),[]),p=b.useCallback((v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[g]),f=b.useCallback((v=>{e(Qe({downloadState:v}))}),[]),S=b.useCallback(((v,k)=>{e(Qe({selectedDate:v,agingDateSelectionType:k})),e(kt(v))}),[]),E=b.useCallback(((v,k)=>{e(Ln({nodeId:v,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Na=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=w(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee((function(e){const a=Un(e).accountsInOrder.map(((n,o)=>Na(n,o))),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ya)(Da),us=ee((function(e){const a=Yn(e).accountsInOrder.map(((o,r)=>Na(o,r))),t=M.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ya)(Da);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1)),r=yt(n?.loggedInUserRoleMap);return _((s=>s.cashBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=yt(n?.loggedInUserRoleMap),r=_((s=>U(s).company?.companyInfo.firstMonthOfFY??1));return _((s=>s.cardBalanceState.fetchState))==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=xt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as v}from"./liveblocks-BqtYq8PY.js";import{a as u}from"./sentry-BtWdTNDK.js";import{u as y,j as b,n as w,g as A,N as k}from"./core-4nWRIid2.js";import{Mp as N,e$ as _,g5 as U,Mq as L,ok as R,Mr as z}from"./zeni-epic-state-Brhydpej.js";import{u as $,z as f,L as T,t as I,a as j,b as O}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{t as P}from"./getLocaleForTenant-Bpp7IHaZ.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="f4117c89-affc-4976-9d6c-f382572d2ce1",t._sentryDebugIdIdentifier="sentry-dbid-f4117c89-affc-4976-9d6c-f382572d2ce1")}catch{}})();const q=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=O(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=$(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>N(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(q,{})}const M=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],Q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of M)if(t.toLocaleLowerCase().includes(s))return Q[s]}export{oe as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-BqtYq8PY.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-4nWRIid2.js";import{Qz as k,QG as _,gn as J,gm as W,gl as Y,jF as q,NG as K,rR as L,e$ as D,Q5 as V,jD as j,QA as v,QJ as F,jB as G,jY as T}from"./zeni-epic-state-Brhydpej.js";import{bz as M,J as R,w as N,z as U,E as z,v as p,i as S,C as Q,bA as X,o as O,bB as ee,x as te}from"./index-CbGX11uA.js";import{n as Z}from"./mui-ChRNPf14.js";import"./sentry-BtWdTNDK.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]="dbd96fa0-b496-4bf5-a774-7c048aace9e7",e._sentryDebugIdIdentifier="sentry-dbid-dbd96fa0-b496-4bf5-a774-7c048aace9e7")}catch{}})();const ne=A(null,(function(e,t){return{onSaveVendor:n=>{e(q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Y(n,"BillPayVendor"))},onResendOtp:n=>{e(W(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(M);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((c=>k(c,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,oe=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),c=s.poppedPathname??$();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(F({data:c}))},onBackClick:()=>{if(e(j({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??$(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}}))(X);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=P(),d=e??s,{useFeatureGate:r}=N(),i=U.getSignedInUser(),b=h((u=>D(u))),g=z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Q,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=Z.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,ce=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(T(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??B();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(j({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??B(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}}))(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=P(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=N(),b=z(),g=h((u=>D(u))),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Q,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const B=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BqtYq8PY.js";import{J as l,G as c,E as f}from"./index-CbGX11uA.js";import{D as p}from"./mui-ChRNPf14.js";import"./sentry-BtWdTNDK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="a9db073a-25eb-4a7d-9307-cd57c4a62335",e._sentryDebugIdIdentifier="sentry-dbid-a9db073a-25eb-4a7d-9307-cd57c4a62335")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=l(),s=o?.valuePx(a)??b.drawerLeftMargin.valuePx(a),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{h as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BqtYq8PY.js";import{a as d}from"./sentry-BtWdTNDK.js";import{h as A,u as B,g as G,i as N,j as l,N as q,n as F,o as _,p as $}from"./core-4nWRIid2.js";import{OO as H,e$ as K,Oa as M,lI as R,KH as k,OT as W,NF as Y,kI as z,KI as S,Of as V,Og as X,NH as J,NG as L}from"./zeni-epic-state-Brhydpej.js";import{aX as Q,e as U,v as Z,x as tt}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{d as I}from"./decodeURIComponentSafe-B-9vw5Be.js";import{w as et}from"./withTransactionSidePanel-MO-qZsKE.js";import{f as at,c as nt}from"./routePaths-BYuMJjxP.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import"./TransactionDetailScreen-Bfy3N_JT.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]="afb5a497-5d68-44bc-8488-710640d37763",a._sentryDebugIdIdentifier="sentry-dbid-afb5a497-5d68-44bc-8488-710640d37763")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:z(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(Q),it=et((function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:O,entityNameEncoded:x}=N(),r=I(O??""),p=I(x??""),u=rt(r,p),j=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l((n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),v=l((n=>K(n).company?.companyInfo.firstMonthOfFY??1)),f=l((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&u===!0&&(T(!0),o(R(i)))}),[m,u,i]);const E=l((n=>n.trendState.fetchState)),P=f?.selectedPeriod?.timePeriod??D,w=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(f?.selectedPeriod?.timePeriod,D);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:b(j.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function Ot({entityType:a}){return s.jsx(_,{children:s.jsx($,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Ot as EntityDetailRoutes,Ot as default};
|
package/dist/assets/{ExpenseAutomationRoutes-CjC0R383.js → ExpenseAutomationRoutes-BLGJhe2d.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-
|
|
1
|
+
import{j as S}from"./liveblocks-BqtYq8PY.js";import ua from"./NotFoundScreen-D8y3QSjF.js";import{a,b as nn}from"./sentry-BtWdTNDK.js";import{n as Ge,S as ma}from"./mui-ChRNPf14.js";import{u as ke,h as an,g as st,j as D,n as pa,i as Vt,o as ha,p as et}from"./core-4nWRIid2.js";import{e$ as Me,Tx as ga,ou as we,g0 as Ca,ss as Sa,Ty as tt,fD as Le,Tz as Ot,el as fa,fm as Ia,TA as zt,TB as Oe,pc as ka,TC as Ea,pp as ba,oM as on,oK as re,TD as sn,TE as ya,p5 as cn,ps as Ta,TF as ln,oF as va,r_ as Pa,fN as Ae,TG as je,uy as rn,EU as dn,TH as un,TI as Aa,ry as ct,OP as Mt,OR as wa,kL as Ra,OS as xa,kS as Da,c$ as Ua,vO as it,oS as mn,px as $e,p8 as Fa,TJ as _a,NH as Lt,NG as Ve,TK as jt,l7 as Ba,TL as Va,TM as Oa,TN as za,TO as Ma,oZ as La,pA as ze,TP as ja,TQ as $a,TR as qa,pH as Ga,kW as Na,kN as Ja,TS as Ya,kV as $t,P0 as Ka,TT as Za,TU as Ha,ru as Qa,r6 as Wa,py as Ie,r5 as nt,TV as Xa,TW as eo,TX as to,mq as no,bo as ao,ml as qt,m7 as oo,TY as so,gD as co,mi as io,xH as lo,TZ as ro,q6 as uo,q1 as mo,q5 as po,pS as ho,T_ as go,fQ as pn,pg as Co,oV as So,g1 as Gt,pC as fo,T$ as Io,U0 as ko,pz as hn,U1 as Eo,U2 as bo,U3 as yo,U4 as To,U5 as Nt,rG as vo,qZ as Po,NF as Ao,U6 as wo,U7 as Ro,kU as xo,U8 as Do,JI as Uo,kT as Fo,kI as _o,fP as Bo,qv as gn,qR as Vo,pw as Jt,pB as Oo,bE as zo,mf as Mo,mc as Lo,U9 as jo,pR as Yt,qN as Kt,qL as $o,Ua as qo,qA as Go,qg as No,qO as Jo,Ub as Yo,Uc as Ko,qk as Zo,Ud as Ho,qb as Qo,qj as Wo,qh as Xo,qU as es}from"./zeni-epic-state-Brhydpej.js";import{w as qe,i as Y,e as G,x as le,_ as Cn,a0 as Sn,cZ as ts,z as Ne,c_ as Zt,c$ as ns,d0 as as,d1 as os,au as Re,d2 as ss,aZ as Ht,C as fn,d3 as cs,ar as at,a as is,a9 as ls,d4 as rs,a4 as ds,d5 as us,Y as ms,d6 as ps,d7 as hs,A as gs,D as Cs,aS as Ss,d8 as fs,d9 as Is,be as ks,G as Es,aV as bs}from"./index-CbGX11uA.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import{f as Qt,a as ys,b as Ts,g as vs,C as Ps}from"./TransactionDetailScreen-Bfy3N_JT.js";import{w as As}from"./withTransactionSidePanel-MO-qZsKE.js";import{h as ws,v as Rs}from"./routePaths-BYuMJjxP.js";import{g as ot}from"./accountMappingHelper-Cg1rcuy8.js";import{D as xs}from"./DrawerScreen-CTCbWuBb.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./decodeURIComponentSafe-B-9vw5Be.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d315bbf5-853d-450e-a282-0b5956682d10",t._sentryDebugIdIdentifier="sentry-dbid-d315bbf5-853d-450e-a282-0b5956682d10")}catch{}})();const Ds=()=>{const t=ke(),s=an(),R=st(),y=D((m=>Me(m))),{useFeatureGate:A}=qe(),{isFeatureEnabled:i}=A(Y.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:p}=A(Y.aiAuditScorePercentage),I=D((m=>m.expenseAutomationViewState.selectedPeriodByTenantId)),l=D((m=>ga(m,y.tenantId))),{isAiCfoAccessEnabled:C,onAskAiCfoClick:g}=In({mobileExploreReferrer:"Month-End Close Overview"}),x=a.useCallback(((m,O,te=!1)=>{t(we({tenantId:O,period:{month:m.month,year:m.year},refreshViewInBackground:te}))}),[]),T=a.useCallback((m=>{const O=R.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&G.trackMonthCloseAuditPage(m.month,m.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,O??null),t(Ca(y.tenantId,m))}),[y.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),r=I[y.tenantId],h=a.useCallback((()=>{const m=R.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&G.trackMonthCloseAuditPage(r.month,r.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,m??null),x(r,y.tenantId,!0)}),[x,r,y.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),F=le(R.state?.pathnameStackToGoBack,R.pathname),J=a.useCallback((()=>{if(l.monthEndCloseChecks!=null&&r!=null){const m=l.monthEndCloseChecks.monthEndCloseCheckList.find((O=>O.progress<100));if(m!=null)return void s(`./${m.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}});s(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,r]),{areTenantIdsInSync:u}=Cn();return Sn({isDataReady:l.fetchState==="Completed"}),a.useEffect((()=>{r!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&u&&x(r,y.tenantId)}),[x,r,l.fetchState,y.tenantId,u]),a.useEffect((()=>{r!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&u&&t(Sa(r))}),[r,l.monthClosePerformanceTrendFetchStatus.fetchState,u]),a.useEffect((()=>{const m=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&h()}),3e5);return()=>clearInterval(m)}),[l.fetchState]),a.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const m=R.state?.referrer;G.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,m??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Us,{children:S.jsx(ts,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:m=>{s(`./${m}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:T,handleReviewButtonClick:J,onBackClick:()=>{s("../../dashboard")},onReload:h,isAiCfoAccessEnabled:C,onAskAiCfoClick:g,aiAuditScorePercentageEnabled:p})})},Us=Ge.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
|
-
`,
|
|
8
|
+
`,Fs=nn.memo((({reconciliation:t,selectedDrawerAccountId:s,onClose:R,onFetchLinkTokenClick:y,onEstablishConnectionClick:A})=>{const i=ke(),{useFeatureGate:p}=qe(),{isFeatureEnabled:I}=p(Y.isReconV3Enabled),l=Ne.getSignedInUser(),C=D((f=>Me(f))),g=t.excludedAccountIDs,x=a.useMemo((()=>({userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:C?.tenantId??""})),[l?.userId,l?.zeniSessionId,C?.tenantId]),{accountReconciliationsByAccountID:T,monthYearPeriod:r,statementUploadChosen:h}=t,F=T[s],J=a.useRef(!1),u=a.useRef({}),m=a.useCallback((f=>{J.current=f}),[]),O=a.useCallback((f=>{i(tt({accountId:s,selectedPeriod:r,dismissedToBackground:!0,backgroundCompletedSteps:f.completedSteps,startedAtMs:f.startedAtMs,totalDurationSeconds:f.totalDurationSeconds})),F!=null&&requestAnimationFrame((()=>{J.current||i(Le({messageSection:"statement_parsing_in_progress",messageText:"success",type:"info",showStatusIcon:!0,variables:[{variableName:"_account_name_",variableValue:Zt(F)}]}))}))}),[i,r,F,s]),te=a.useCallback((()=>{i(tt({accountId:s,selectedPeriod:r,dismissedToBackground:!1}))}),[i,s,r]),de=a.useCallback((f=>{i(Ot({accountId:s,selectedPeriod:r,backgroundCompletedSteps:f}))}),[i,r,s]),z=a.useCallback((()=>{i(Ot({accountId:s,selectedPeriod:r,backgroundCompletedSteps:0})),i(tt({accountId:s,selectedPeriod:r,dismissedToBackground:!1}))}),[i,r,s]);a.useEffect((()=>{Object.entries(T).forEach((([f,X])=>{const ue=X.statementParseStatus.fetchState,xe=u.current[f]??"Not-Started",Je=f===s&&J.current;X.statementProcessingDismissedToBackground!==!0||Je||xe!=="In-Progress"||ue!=="Completed"||i(Le({messageSection:"statement_parsing_complete",messageText:"success",type:"info",showStatusIcon:!0,variables:[{variableName:"_account_name_",variableValue:Zt(X)},{variableName:"_transaction_count_",variableValue:String(ns(X))}]})),u.current[f]=ue}))}),[T,i,s]);const B=F?.parsedStatementData?.statementUpload?.statementMeta?.statementUploadId??F?.accountReconEntity.statementMetaData?.statementUploadId,e=F?.statementDateConflict?.previousReconciliationInfo?.reconciledByUserId,n=D((f=>e!=null&&e!==""?fa(Ia(f.userState,e)):"")),c=a.useCallback((()=>{i(zt({accountId:s,selectedPeriod:r}))}),[i,s,r]),d=a.useCallback((()=>{i(zt({accountId:s,selectedPeriod:r})),i(Oe({statementUploadChosen:!0}))}),[i,s,r]),E=(f,X)=>{i(Pa(f,X.split(".")[0]))},k=f=>{B!=null&&i(va({accountId:s,selectedPeriod:r,fileId:f,statementUploadId:B}))},v=()=>{i(Oe({statementUploadChosen:!1}))},b=f=>{i(Ta({accountId:s,selectedPeriod:r,payload:f}))},M=a.useCallback(((f,X,ue)=>{i(ka({accountId:f,selectedPeriod:X,statementUploadId:ue}))}),[i]),P=a.useCallback((f=>{i(Ea({accountId:s,selectedPeriod:r,statementUpdateLocalData:f}))}),[i,s,r]),Q=a.useCallback((()=>{B!=null&&i(ba({accountId:s,selectedPeriod:r,statementUploadId:B}))}),[i,s,r,B]),W=a.useCallback((()=>{i(Oe({statementUploadChosen:!0}))}),[i]),oe=f=>{i(ln({accountId:s,selectedPeriod:r,localData:{accountSource:f}}))},he=a.useCallback((()=>{i(on({accountId:s}))}),[i,s]),ge=a.useCallback((f=>{i(re(r,f)),R()}),[i,r,R]),q=a.useCallback((()=>{i(sn({accountId:s,selectedPeriod:r,statementProcessingFailed:!1})),i(ya({accountId:s,selectedPeriod:r}))}),[i,s,r]),Ce=a.useCallback((()=>{i(cn({accountId:s}))}),[i,s]),Ee=g.includes(s)?t.excludedAccountReconciliationByAccountID[s]:void 0;if(Ee!=null)return S.jsx(Wt,{children:S.jsx(Xt,{$isV3:I===!0,children:S.jsx(as,{excludedAccountReconciliation:Ee,includeAccountFetch:t.includeAccountFetchState,isReconV3Enabled:I,onDismissClick:R,onIncludeIntoReconciliation:Ce})})});if(F!=null){const f=I===!0?S.jsx(os,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:F,monthYearPeriod:r,onDismissClick:R,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:y,onEstablishConnectionClick:A,onEditFileName:E,onDeleteFile:k,onSelectSourceType:oe,filesEndPoint:Re.fileMicroServiceBaseUrl,authParams:x,openFilePicker:h,onStatementUploadSuccess:b,onUploadWindowOpenedOnce:v,onExcludeFromReconciliation:he,onRetryParsing:M,onReviewClicked:ge,statementProcessingFailed:F.statementProcessingFailed,statementProcessingDismissedToBackground:F.statementProcessingDismissedToBackground,onDismissStatementProcessingFailed:q,onContinueInBackground:O,onClearStatementProcessingDismissedToBackground:te,onResetStatementProcessingProgress:z,onStatementProcessingProgressChange:de,onStatementFlowVisibilityChange:m,onReuploadStatement:W,onStatementFormDataChange:P,onStatementConfirmSave:Q,reconciledByName:n,onDismissDateConflict:c,onReuploadAfterDateConflict:d,isReconV3Enabled:I}):S.jsx(ss,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:F,monthYearPeriod:r,onDismissClick:R,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:y,onEstablishConnectionClick:A,onEditFileName:E,onDeleteFile:k,onSelectSourceType:oe,filesEndPoint:Re.fileMicroServiceBaseUrl,authParams:x,openFilePicker:h,onStatementUploadSuccess:b,onUploadWindowOpenedOnce:v,onExcludeFromReconciliation:he});return S.jsx(Wt,{children:S.jsx(Xt,{$isV3:I===!0,children:f})})}return null})),Wt=Ge.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
@@ -18,7 +18,7 @@ import{j as S}from"./liveblocks-bqFl_SVp.js";import ua from"./NotFoundScreen-Bjg
|
|
|
18
18
|
min-width: 0;
|
|
19
19
|
overflow-x: hidden;
|
|
20
20
|
overflow-y: ${t=>t.$isV3===!0?"hidden":"auto"};
|
|
21
|
-
`;function Us({companyId:t,closeCustomerRequestDrawer:s,addCustomerRequest:R,resetCustomerRequest:b}){const A=Ne.getSignedInUser();if(A==null)throw Error("Can't access Customer Request page without signing in...");const i=D((p=>Aa(p,t,A)));return a.useEffect((()=>{b()}),[]),S.jsx(S.Fragment,{children:i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?S.jsx(fn,{fetchState:"In-Progress"}):S.jsx(cs,{onCloseClick:s,addCustomerRequest:R,snippets:i.companyMonthEndReportTemplatesData,bulletPoints:i.zeniRequestsData??[]})})}const Bs=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,kn="reconciliation-status-updated",En="statement-status-updated",{common:{strings:{hyphen:Vs,comma:en,space:Os}},dateFormat:Tn}=is.getLocalizedStrings(),tn=es,zs=pa((function(t,s){const{uncategorizedAccounts:R,vendorSearchAutoCompleteData:b,monthEndInsightsCustomerRequestData:A,monthEndInsightsPreviewMode:i,companyId:p,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:l}=s,C=Ne.getSignedInUser(),g=t.tenantState.currentTenantId,x={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:g??""},y=Ae(t),{selectedTransactionCategorizationTab:r}=y;return{expenseAutomationViewSelector:y,bulkUploadSelector:I===!0?y.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:b,authParams:x,receiptUploadEndpoint:`${Re.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ds}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Re.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:r,monthEndInsightsCustomerRequestData:A,monthEndInsightsPreviewMode:i,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:C,uncategorizedAccounts:R,companyId:p,isTransactionActivityEnabled:l}}),(function(t,s){const{themeState:R,isAccountingClassesEnabled:b,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:i,isMissingReceiptsBulkUploadEnabled:p,location:I,vendorSearchAutoCompleteData:l,expenseAutomationViewSelector:C,currentTenant:g,uncategorizedAccounts:x,navigate:y,onClickCustomerRequest:r,handleEditClick:h,setActivityLogTransactionId:_,isReconV3Enabled:J}=s,{selectedPeriod:u,currentSelectedView:m,reconciliation:{selectedAccountId:O}}=C,{accountSettingsView:te}=C.jeSchedules,de=mn(u),z=$e(de.start),B=$e(de.end);return{onZeniLogoClick:()=>{R.toggle()},onUploadReceiptAttachment:e=>{G.trackMissingReceiptAttached(u.month,u.year),t(Po(e))},onUploadTransactionReceipt:(e,n,c,d,E,k)=>{t(Nt(e,n,{fetchState:"In-Progress"}));const v=()=>t(Nt(e,n,{fetchState:"Error"}));us(`${Re.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,k,n,c,d,E).then((T=>{T!=null?t(vo(e,T)):v()})).catch(v)},onMissingReceiptsRowClick:(e,n)=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,n);const c=le(I.state?.pathnameStackToGoBack,I.pathname);y(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(yo(e,n)),g!=null&&t(we({tenantId:g.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,d)=>{t(bo(e,{fetchState:n,error:c})),c!=null&&t(Le({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:d!=null?Os+Vs+d+en:en}]}))},onUpdateJESchedulesUIState:e=>{t(To(e))},onUpdateMissingReceiptsUIState:e=>{t(Eo(e))},onFetchMissingReceiptsList:()=>{B!=null&&z!=null&&t(hn({start:z,end:B},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...p===!0?{onBulkUploadFiles:e=>{t(Xo(e))},onBulkUploadProgress:e=>{t(Wo(e))},onBulkUploadSuccess:e=>{t(Ho({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Zo(e))},onConfirmBulkUploadMatch:(e,n,c,d,E)=>{t(Qo(e,n,c,d,E))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Ko())},onSetBulkUploadResultsTab:e=>{t(Yo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Jo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(No())},onSearchTransactionsForManualMatch:(e,n)=>{t(tn(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=C.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(tn(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Go(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(qo())},onFetchBulkUploadBatches:e=>{t(gn(e))},onFetchMoreBatchDetails:()=>{t($o())},onResetBulkUploadSort:()=>{t(Kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(ko())},onSearchTextChanged:e=>{const n=C.currentSelectedView,c=C.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(nt({selectedTab:c,uiState:{searchString:e}})),B!=null&&z!=null&&t(Ie(c,{start:z,end:B},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=C.selectedTransactionCategorizationTab;t(Io({filters:e,selectedTab:n}))},onRefresh:()=>{s.trackExpenseAutomationTabAnalytics(!0),t(fo(i))},onClose:()=>{m==="reconciliation"&&O!=null&&t(Gt({selectedAccountId:void 0})),y("../")},onBack:()=>{m==="reconciliation"&&O!=null&&t(Gt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(So(e))},onSaveReconciliationReview:e=>{t(Co(e))},onUpdateStep:e=>{const{selectedPeriod:n}=C,c=le(I.state?.pathnameStackToGoBack,I.pathname);y(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:C.currentSelectedView}}),t(pn(e))},handleLogOutClick:()=>{const e=le(I.state?.pathnameStackToGoBack,I.pathname);y("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:d,accruedExpensesAccount:E}=n,k=ot(te.prepaidExpensesAccountList,c.selectedOptions),v=ot(te.fixedAssetsAccountList,d.selectedOptions),T=ot(te.accruedExpensesAccountList,E.selectedOptions),M={selectedPrepaidExpensesAccountIds:k.map((P=>P.accountId)),selectedFixedAssetsAccountIds:v.map((P=>P.accountId)),selectedAccruedExpensesAccountIds:T.map((P=>P.accountId))};t(go({data:M}))},onSaveJeAccountSettingsClick:()=>{t(ho())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:d,scheduleClass:E,scheduleExpenseCategory:k,vendor:v}=n,{allAccountList:T,allClassList:M,allDepreciationAccountList:P}=C.jeSchedules,H=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((q=>q.id===v?.selectedOption)):void 0,W={id:H?.zeniId??v?.selectedOption??"",name:H?.name??v?.defaultOptions.find((q=>q.value===v?.selectedOption))?.label??"",logo:H?.logo},oe=k?.selectedOption!=null?T.find((q=>q.qboId===k.selectedOption)):void 0,he=E?.selectedOption!=null?M.find((q=>q.classId===E.selectedOption)):void 0,ge=d?.selectedOption!=null?P.find((q=>q.qboId===d.selectedOption)):void 0;t(po({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:oe?.accountId,updatedClassId:he?.classId,updatedAccumulatedDepreciationCategoryID:ge?.accountId,updatedVendor:{id:W.id,name:W.name}}}))},ignoreRecommendedJeSchedule(e,n){t(mo(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Lt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Ve("common"))},onCancelAutoComplete:()=>{t(Ve("common"))}},onPostJESchedule(e,n){t(uo({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ro())},handleJeScheduleClick:(e,n,c)=>{t(lo({selectedJEScheduleKey:n}));const d=le(I.state?.pathnameStackToGoBack,I.pathname);y(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{g!=null&&t(io(e,g.companyId,g.tenantId))},onClickCustomerRequest:r,setActivityLogTransactionId:_,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(co())},onOpenFileAttachmentSnackBar:()=>{t(Le({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(so(e))},onUpdateFileAttachment:e=>{t(oo({files:e}))},previewMonthEndReport:(e,n,c,d)=>{g!=null&&t(qt(e,g.companyId,n,!0,c,d,g.tenantId))},saveMonthEndReport:(e,n,c,d)=>{g!=null&&t(qt(e,g.companyId,n,!1,c,d,g.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:d}=C;g!=null&&d?.auditScorePercentage!=null&&(t(no(g.companyId,e,g.tenantId)),G.trackInsightsEmailPage(c.month,c.year,!1,"draft",d.auditScorePercentage,ao().format(Tn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,n);const c=le(I.state?.pathnameStackToGoBack,I.pathname);y(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,d,E,k,v,T,M,P,H,W,oe)=>{t(to(e,n,c,d,x,E,k,v,T,M,P,H,W,oe))},onCancelAutoComplete:()=>{t(Ve("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(jt({scrollPosition:e}))},onUpdateTab:e=>{s.closeSidePanel?.(),B!=null&&z!=null&&(t(Ie(e,{start:z,end:B},!1,!1)),t(eo(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{s.closeSidePanel?.(),B!=null&&z!=null&&(t(Xa(e)),t(Ie("autoCategorized",{start:z,end:B},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(nt({selectedTab:e,uiState:n})),B!=null&&z!=null&&t(Ie(e,{start:z,end:B},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(nt({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,d,E,k,v)=>{B!=null&&z!=null&&t(Ie(e,{start:z,end:B},!0,c,n,d,E,k,v))},resetTransactionCategorizationLocalData:(e,n,c,d,E,k,v,T)=>{t(Wa(e,n,c,d,T??null,E,k,!1,v))},updateSelectedVendorForTransaction:(e,n,c,d,E)=>{t($t({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:d,uncategorizedAccounts:x,updatedVendor:E,isAccountingClassesEnabled:b}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const d=I.state?.referrer;e==="autoCategorized"?G.trackTransactionsAutoCategorisedPage(u.month,u.year,C.transactionView.totalCountByTab.autoCategorized,n.length,!1,d??null):G.trackTransactionsReviewPage(u.month,u.year,C.transactionView.totalCountByTab.review,n.length,!1,d??null),t(Ha(e,n,c,i))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Za({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,d,E,k,v)=>{const{transactionId:T,transaction:M,lineIds:P}=n;k!=null&&t(Ka({transactionId:T,customerUpdates:k})),t(Qa({selectedTab:d,transactionId:T.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:x,updatedCustomer:k,selectedEntity:E,isAccountingClassesEnabled:b,isUncategorizedExpenseCategoryEnabled:v})),E!=null&&t(it({entity:E,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:d,isFetchCOT:A,isUncategorizedExpenseCategoryEnabled:v}))},onFetchRecommendationsForEntityCategorization:(e,n,c,d,E,k,v)=>{const{transactionId:T,transaction:M,lineIds:P}=n;k!=null&&(t(Na({transactionId:T,vendorUpdates:{name:k.name,id:k.id?k.id:void 0}})),t(Ja({vendorId:k.id?k.id:void 0,localData:{vendorName:k.name,vendorId:k.id?k.id:void 0}}))),k?.id?(t($t({selectedTab:d,transactionId:T.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:x,updatedVendor:k,selectedEntity:E,isAccountingClassesEnabled:b,isUncategorizedExpenseCategoryEnabled:v})),E!=null&&t(it({entity:E,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:d,isFetchCOT:A,isUncategorizedExpenseCategoryEnabled:v}))):t(Ya({selectedTab:d,transactionId:T.id,lineId:P[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(ze(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(ze(u,!0,!1,null,!1,!1))},markAsReview:(e,n,c,d)=>{G.trackFluxAnalysisReviewed(c.month,c.year,d??!1,e),t(Ga(n,e,c,d??!1))},onUpdateFluxAnalysisUIState:e=>{t(qa(e))},updateOperatingExpensesIdsForReview:e=>{t($a({operatingExpenseIds:e,selectedPeriod:u}))},redirectToVendorDetailPage:e=>{if(s.tenantEmailDomain!=null){const n=Rs(e.id,e.qboId,s.tenantEmailDomain),c=le(s.location.state?.pathnameStackToGoBack,s.location.pathname);s.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(ja({sectionId:e,selectedPeriod:u}))},onFetchReimbursementView:(e,n,c)=>{t(ze(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(re(u,e))},setOpenDrawerClicked:e=>{t(je({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(rn("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=g?.companyId;c!=null&&(t(dn(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(un({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(je({selectedDrawerAccountId:e})),t(ln({accountId:e,selectedPeriod:u,localData:{accountSource:"bank_statement"}})),t(Oe({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(re(u,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(La({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Ma({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(za({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{s.closeSidePanel?.(),t(Oa({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const d=e.vendor?.id;c&&d!=null&&t(Ba(d)),t(Va({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,ct("bill"));const n=le(I.state?.pathnameStackToGoBack,I.pathname);y(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{y(-1)},onReconListPageScroll:e=>{t(jt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Lt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ve("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ua({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(on({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(cn({accountId:e}))},onReconciliationPusherEventReceived:(e,n)=>{const c=n??{};if((e===kn||e===En)&&m==="reconciliation"&&(t(re(u,O,!0,!0)),J===!0)){const d=c.account_id;d!=null&&c.new_statement_data_status?.code==="processed"&&c.statement_upload_id!=null&&t(_a({accountId:d,selectedPeriod:u,statementUploadId:c.statement_upload_id})),d==null||c.new_statement_data_status?.code!=="validation_failed"&&c.new_statement_data_status?.code!=="parsing_failed"&&c.new_statement_data_status?.code!=="processing_failed"||t(sn({accountId:d,selectedPeriod:u,statementProcessingFailed:!0}))}}}}),((t,s,R)=>{const{isMissingReceiptsBulkUploadEnabled:b,...A}=R;return(function(i,p,I){return{...i,...p,...I,onUploadTransactionReceipt:(l,C,g,x,y)=>{p.onUploadTransactionReceipt(l,C,g,x,y,i.authParams)}}})(t,s,A)}))(ls(rs)),Ms=As((function(t){const s=t.displayName??t.name??"Component",R=nn.memo(t),b=A=>{const i=ke(),p=(function(){const u=ke(),m=D((O=>Ae(O).reconciliation.selectedDrawerAccountId));return{isOpen:m!=null,selectedAccountId:m,openPanel:a.useCallback((O=>{u(je({selectedDrawerAccountId:O}))}),[u]),closePanel:a.useCallback((()=>{u(je({selectedDrawerAccountId:void 0}))}),[u])}})(),I=D((u=>Ae(u).reconciliation)),l=D((u=>Me(u))),C=a.useCallback(((u,m)=>{i(rn("expense_automation_reconcile",u,m))}),[i]),g=a.useCallback(((u,m)=>{const O=l?.companyId;O!=null&&(i(dn(u,O,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",m)),i(un({accountId:m,connectionInProgress:!0})))}),[i,l?.companyId]),x=a.useMemo((()=>{if(p.isOpen&&p.selectedAccountId!=null)return S.jsx(_s,{reconciliation:I,selectedDrawerAccountId:p.selectedAccountId,onClose:p.closePanel,onFetchLinkTokenClick:C,onEstablishConnectionClick:g})}),[p.isOpen,p.selectedAccountId,p.closePanel,I,C,g]),y=a.useMemo((()=>({reconPanelContent:x,reconSidePanelIsOpen:p.isOpen,closeReconSidePanel:p.closePanel})),[x,p.isOpen,p.closePanel]),{useFeatureGate:r}=qe(),{isFeatureEnabled:h}=r(Y.isReconV3Enabled),_=a.useContext(Zt),J=a.useMemo((()=>p.isOpen?h===!0?{selectedItemId:p.selectedAccountId}:{closePanel:p.closePanel,selectedItemId:p.selectedAccountId}:_),[p.isOpen,p.closePanel,p.selectedAccountId,_,h]);return S.jsx(Zt.Provider,{value:J,children:S.jsx(R,{...A,...y})})};return b.displayName=`withReconSidePanel(${s})`,b})((({closeSidePanel:t,openTransactionPanel:s,panelContent:R,sidePanelIsFullView:b,sidePanelIsOpen:A,reconPanelContent:i,reconSidePanelIsOpen:p,closeReconSidePanel:I})=>{const{isAiCfoOpen:l,setIsAiCfoOpen:C}=ms(),g=ps(),{isOpen:x}=hs(),y=an(),r=st(),h=ke(),{isAiCfoAccessEnabled:_,onAskAiCfoClick:J}=In({mobileExploreReferrer:"Transaction categorization"}),u=a.useCallback((()=>{A===!0&&b!==!0&&t?.()}),[t,A,b]),{areTenantIdsInSync:m}=Cn(),O=(()=>{const o=D((N=>Ae(N))),w=st(),{currentSelectedViewFetchState:j,currentSelectedView:$,selectedPeriod:F}=o,ne=at($),Q=at(j.fetchState),ee=a.useCallback((N=>{const ae=w.state?.referrer;$==="transaction_categorization"&&(o.selectedTransactionCategorizationTab==="review"?G.trackTransactionsReviewPage(F.month,F.year,o.transactionView.totalCountByTab.review,0,N,ae??null):G.trackTransactionsAutoCategorisedPage(F.month,F.year,o.transactionView.totalCountByTab.autoCategorized,0,N,ae??null)),$==="missing_receipts"&&G.trackMissingReceiptsPage(F.month,F.year,N,o.missingReceipts.transactions.length,ae??null),$==="je_schedules"&&G.trackMonthCloseScheduleListPage(F.month,F.year,N,o.jeSchedules.draftSchedules.length,o.jeSchedules.resolveSchedules.length,ae??null),$==="flux_analysis"&&G.trackFluxAnalysisPage(F.month,F.year,N,Bs(o.fluxAnalysis),ae??null),$==="month_end_insights"&&o.auditSummary?.auditScorePercentage!=null&&G.trackInsightsEmailPage(F.month,F.year,N,"draft",o.auditSummary.auditScorePercentage,null,ae??null)}),[F,o]);return a.useEffect((()=>{Q===j.fetchState&&$===ne||j.fetchState!=="Completed"||ee(!1)}),[$,j.fetchState,ne]),ee})(),te=gs(),[de,z]=a.useState(!1),B=D((o=>Mt(o))),e=D((o=>Me(o))),[n,c]=a.useState(!1),[d,E]=a.useState(!1),[k,v]=a.useState([]),[T,M]=a.useState(null),P=a.useCallback((()=>{M(null)}),[]),H=T?.contentType==="activity"?T.detail.transactionId:void 0,W=a.useCallback((o=>{o!=null?(l&&C(!1),g(),u(),M({contentType:"activity",detail:{transactionId:o}})):M((w=>w?.contentType==="activity"?null:w))}),[u,l,g,C]),oe=a.useCallback((o=>{l&&C(!1),g(),u(),M({contentType:"transfer",detail:o})}),[u,l,g,C]),he=a.useCallback((()=>{g(),P(),u(),J()}),[u,P,J,g]),ge=a.useRef(l);a.useEffect((()=>{l===!0&&ge.current===!1&&(g(),P(),u()),ge.current=l}),[u,P,l,g]);const q=a.useRef(x);a.useEffect((()=>{x===!0&&q.current===!1&&(l&&C(!1),P(),A===!0&&b!==!0&&t?.()),q.current=x}),[P,t,x,l,C,b,A]);const Ce=A===!0&&b!==!0,Ee=a.useRef(Ce);a.useEffect((()=>{Ce&&!Ee.current&&(l&&C(!1),g(),P()),Ee.current=Ce}),[P,l,Ce,g,C]);const[f,X]=a.useState(!1),ue=a.useRef(!1),{selectedTab:xe}=Vt(),{tenantEmailDomain:Je}=Vt(),[Ye,lt]=a.useState(r.state?.message==="comingFromTransactionDetail"),rt=r.state?.message==="comingFromOverview",bn=Cs(),Ke=Ne.getSignedInUser(),{useDynamicConfig:yn,useFeatureGate:se}=qe(),{configValue:vn}=yn(Ss.enableUncategorizedExpenseCategory),ce=vn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:dt}=se(Y.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:Te}=se(Y.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Qe}=se(Y.isTransactionActivityEnabled),{isFeatureEnabled:ut}=se(Y.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:Pn}=se(Y.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:An}=se(Y.isProjectsTransactionsEnabled),{isFeatureEnabled:wn}=se(Y.isReconV3Enabled),{isFeatureEnabled:Rn}=se(Y.isJEScheduleCOTEnabled),xn=a.useCallback((o=>{const w=ct(o.view==="reconciliation"?"bill":"expense");s?.(o.entityId,w)}),[s]),Dn=D((o=>Ao(o,"common"))),L=D((o=>Ae(o))),{categoryOptions:Fn,paymentAccountNames:_n}=D((o=>wo(o.accountState))),Un=D((o=>Ro(o.classState))),{monthEndCloseChecksView:K,currentSelectedView:U,selectedPeriod:V,selectedTransactionCategorizationTab:Ze,currentSelectedViewBackgroundRefreshFetchState:Bn,currentSelectedViewFetchState:Se,jeSchedules:He,reconciliation:mt}=L;bs(U==="transaction_categorization");const Vn=L.transactionView.saveStatus.fetchState,pt=L.transactionView.transactions,ht=a.useRef(pt);ht.current=pt;const gt=D((o=>o.expenseAutomationTransactionsViewState?.transactionCategorizationView)),Ct=D((o=>o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),St=a.useRef(gt);St.current=gt;const ft=a.useRef(Ct);ft.current=Ct;const ie=ys(Vn,(()=>{const o=[],w=ft.current,j=St.current,$=j!=null&&w!=null?j[w]:void 0;if($?.transactionReviewLocalDataById!=null)for(const ne of Object.values($.transactionReviewLocalDataById)){const Q=ne?.transactionReviewLocalData?.lineItemById;if(Q!=null)for(const ee of Object.values(Q)){const N=ee?.account;N?.accountId!=null&&o.push(N.accountId)}}const F=ht.current;for(const ne of F)for(const Q of ne.lines??[])"account"in Q&&Q.account?.accountId!=null&&o.push(Q.account.accountId);return o}));a.useEffect((()=>{U==="transaction_categorization"&&A!==!0||W(void 0)}),[U,W,A]),a.useEffect((()=>{p===!0&&I?.()}),[U,mt.selectedAccountId]);const On=L.transactionView.selectedTransactionCategorizationCompletedSubTab,De=`${Ze}|${On}`,Fe=a.useRef(null),It=a.useRef(null);a.useEffect((()=>{Fe.current!==null?Fe.current!==De&&(Fe.current=De,U==="transaction_categorization"&&P()):Fe.current=De}),[P,U,De]);const zn=D((o=>H==null?void 0:xo(o.transactionState,H))),me=zn?.qboId,kt=D((o=>me==null?void 0:Do(o,me)));a.useEffect((()=>{me!=null&&h(Fo(me))}),[h,me]);const{createTransferEntryStatus:Et,creditCardTransferAccountsList:Tt,transferAccounts:bt}=L.transactionView,yt=a.useCallback((o=>vs(h,o)),[h]),vt=a.useMemo((()=>U!=="transaction_categorization"||T==null?null:T.contentType==="activity"?Qe===!0?S.jsx(fs,{activityLogView:kt,qboId:me,onClose:()=>M(null),selectedTransactionId:T.detail.transactionId,isQuickViewCardStyle:!0},String(T.detail.transactionId)):null:T.contentType==="transfer"?S.jsx(Is,{createTransferEntryStatus:Et,transaction:T.detail,transferAccounts:T.detail.transactionType==="credit_card_payment"?Tt:bt,onClose:()=>M(null),onCreateTransfer:yt,isQuickViewCardStyle:!0},String(T.detail.transactionId)):null),[U,T,Qe,kt,me,Et,Tt,bt,yt]),Mn=vt!=null,{selectedAccountId:be}=mt,Pt=at(He.accountSettingsView.saveState.fetchState),Ln=D((o=>_o(o.accountState,o.accountListState,"accountList"))),jn=D((o=>Uo(o))),ye=xe!=null?Bo(xe):U,$n=D((o=>o.entityAutoCompleteState.autoCompleteText.common));if(Sn({isDataReady:Se.fetchState==="Completed"}),Ke==null)throw Error("Can't access expense automation screen without signing in...");const At=mn(V),ve=$e(At.start),Pe=$e(At.end);if(ve==null||Pe==null)throw Error(`Invalid start - ${ve} and end - ${Pe} period from given ${V}`);const qn=a.useCallback((()=>{c(!1)}),[]),Gn=a.useCallback((()=>{E(!0)}),[]),Nn=a.useCallback((o=>{v(o),E(!1)}),[]),Jn=a.useCallback((()=>{v([])}),[]),_e=L.missingReceipts.bulkUpload.phase,wt=L.missingReceipts.bulkUpload.currentBatchId;a.useEffect((()=>{Te===!0&&U==="missing_receipts"&&_e==="matching"&&wt!=null&&h(gn({cacheOverride:!0}))}),[Te,U,_e,wt,h]);const Rt=Ke?.userId,Yn=V.month,Kn=V.year,xt=e?.tenantId;a.useEffect((()=>{U==="missing_receipts"&&Te!==!1&&_e==="idle"&&Rt!=null&&xt!=null&&h(Vo())}),[U,Te,_e,Rt,xt,Yn,Kn,h]),a.useEffect((()=>{B.newVendorState?.vendorDetailLocalData?.vendorName!=null?z(!0):z(!1)}),[B.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect((()=>{ye!=null&&U!==ye&&h(pn(ye))}),[ye]),a.useEffect((()=>{f===!1&&Se.fetchState==="Completed"&&m&&(X(!0),h(Jt(!1,!1,ce)))}),[f,Se,m,ce]),a.useEffect((()=>{const o={month:V.month,year:V.year},w=It.current;It.current=o,w===null||w.month===o.month&&w.year===o.year||!rt&&m&&(h(Jt(!1,!1,ce)),h(re(V,be,!1,!1)))}),[V.month,V.year,m,ce]);const Dt=a.useCallback(((o=!1,w=!1)=>{const j={start:ve,end:Pe};switch(U){case"transaction_categorization":h(Ie(Ze,j,o,!Ye,void 0,void 0,w,void 0,ce)),lt(!1);break;case"flux_analysis":h(ze(V,o,w,null));break;case"month_end_insights":if(w===!1){const $=new Date(V.year,V.month,0),F=zo($.toDateString()).format(Tn.analytics.YYYYDashMMDashDDFormat);h(Mo(!0,e.companyId,e.tenantId,F)),h(Lo(e.companyId,e.tenantId))}break;case"je_schedules":h(Oo(j,w));break;case"missing_receipts":h(hn(j,{amount:75,currencyCode:"USD",currencySymbol:"$"},o,w));break;default:h(re(V,be,o,w))}}),[U,ve,Pe,e.companyId,e.tenantId,Ze,V,be,Ye,lt,ce]);a.useEffect((()=>{U===ye&&Se.fetchState==="Not-Started"&&m&&Dt(!0)}),[Se,ve,Pe,e.companyId,e.tenantId,m]),a.useEffect((()=>{rt||Ye||ue.current||Bn.fetchState==="In-Progress"||Se.fetchState!=="Completed"||(ue.current=!0,Dt(!0,!0))}),[]),a.useEffect((()=>{K.fetchState!=="In-Progress"&&K.fetchState!=="Completed"&&K.fetchState!=="Error"&&e?.tenantId!=null&&h(we({tenantId:e.tenantId,period:V,refreshViewInBackground:!1}))}),[K.fetchState,e?.tenantId]),a.useEffect((()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?c(!0):c(!1)}),[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect((()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&m&&(h(we({tenantId:e.tenantId,period:V,refreshViewInBackground:!0})),h(jo({companyId:e.companyId})),y("../"))}),[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,e.tenantId,V,e.companyId,m]),a.useEffect((()=>{const o=setInterval((()=>{K.fetchState!=="In-Progress"&&K.fetchState==="Completed"&&h(we({tenantId:e.tenantId,period:V,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(o)}),[K.fetchState,e.tenantId,V,h]),a.useEffect((()=>{const o=setInterval((()=>{U==="reconciliation"&&be==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(re(V,void 0,!0,!0))}),3e5);return()=>clearInterval(o)}),[U,h,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,re,be,V]);const Qn=Ht();a.useEffect((()=>{const o=(K.monthEndCloseChecks?.monthEndCloseCheckList.find((w=>w.id==="month_end_insights"))?.isDisabled??!1)&&!dt;U!=="month_end_insights"||!o&&K.monthEndCloseChecks?.reportEmailSentDate==null||y("../")}),[U,K.monthEndCloseChecks]);const Zn=p===!0?i:R,Hn=p===!0||A===!0,Wn=p===!0?I:t;a.useEffect((()=>{Pt==="In-Progress"&&He.accountSettingsView.saveState.fetchState==="Completed"&&h(Yt())}),[Pt,He.accountSettingsView.saveState.fetchState,Yt]);const{transactionId:Ft,onSaveVendor:Xn,onSaveSuccess:ea,onCancel:ta,vendorViewDetails:na}=(({expenseAutomationViewSelector:o,closeDrawerHandler:w,currentSelectedView:j,isUncategorizedExpenseCategoryEnabled:$})=>{const F=ke();let ne,Q,ee;const N=Ht(),ae=o.transactionView;let _t=()=>{};const{transactions:oa,selectedTransactionId:fe,selectedTransactionLineId:Ue,transactionLocalData:sa}=ae;if(j==="transaction_categorization"){const We=sa.find((pe=>pe.transactionId===fe)),Z=oa.find((pe=>pe.id===fe)),Ut=Ue!=null?We?.transactionReviewLocalData?.lineItemById[Ue]:void 0,Bt=Ut?.account;Q=Ut?.class?.classId,ne=["Uncategorized Income","Uncategorized Expense"].includes(Bt?.accountName??"")?void 0:Bt?.accountId;const ia=ws(fe,Z?.typeOfTransaction);Z!=null&&ia&&(ee={id:fe,type:ct(Z.typeOfTransaction)}),_t=()=>{if(fe!=null&&Ue!=null&&Z!=null){const pe=ae.transactionLocalData.find((Be=>Be.transactionId===fe))?.transactionReviewLocalData;if(pe!=null&&Z.lines!=null&&Z.lines.length>0){const Be=pe.lineItemById[Ue];let Xe=pe.selectedEntity;if(Fa(Z)||(Xe=Be.selectedEntityLine),Xe!=null){const la=Xe,ra={transactionId:{id:Z.id,type:Z.type},transaction:Z,lineIds:Z.lines.map((da=>da.id))??[]};F(it({entity:la,amount:Be.amount.amount,transactionDetails:ra,flowType:"categorization",selectedTab:o.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const ca=D((We=>Mt(We,void 0,ne,Q)));return{transactionId:ee,onSaveVendor:()=>{F(Da(ee,void 0,!1,!0))},onSaveSuccess:_t,onCancel:()=>{ee!=null&&F(wa({transactionId:ee})),F(Ra()),F(xa()),w()},vendorViewDetails:ca}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{z(!1)},currentSelectedView:U,isUncategorizedExpenseCategoryEnabled:ce}),aa={events:e.companyId!=null?[`private-encrypted-${e.companyId}.${kn}`,`private-encrypted-${e.companyId}.${En}`]:[],eventCallback:(o,w,j)=>{j.onReconciliationPusherEventReceived(o,w)}};return bn?.loggedInUserRoleMap==null?K.fetchState==="Error"?S.jsx(ks,{onGoHome:()=>y("../",{replace:!0}),onReload:()=>window.location.reload()}):S.jsx(fn,{fetchState:"In-Progress"}):S.jsxs(S.Fragment,{children:[S.jsx(xs,{isOpen:d,drawerLeftMargin:new Es(0,0,300,650),onClose:()=>{E(!1)},children:S.jsx(Ls,{onClick:o=>o.stopPropagation(),children:S.jsx(Us,{companyId:e.companyId,closeCustomerRequestDrawer:()=>E(!1),addCustomerRequest:Nn,resetCustomerRequest:Jn})})}),Ft!=null&&de&&S.jsx(Ps,{isOpen:de,transactionId:Ft,onSaveVendor:Xn,onSaveSuccess:ea,onCancel:ta,vendorViewDetails:na}),S.jsx(zs,{...aa,navigate:y,location:r,themeState:te,categoryOptions:Fn,classesForFilters:Un,accountsForFilters:_n,vendorSearchAutoCompleteData:{autoCompleteText:$n,entityAutoCompleteView:Dn},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:Te,monthEndInsightsPreviewMode:n,monthEndInsightsCustomerRequestData:k,isRealtimeInsightsFeatureEnabled:dt,isCreateTransferEntryFromExpenseEnabled:ut,isUncategorizedExpenseCategoryEnabled:ce,isAccountingClassesEnabled:jn,isProjectsTransactionsEnabled:An,isCOTEnabled:Qn,isJEScheduleCOTEnabled:Rn,currentTenant:e,companyId:e.companyId,signedInUser:Ke,isTransactionActivityEnabled:Qe,isRightPanelOpen:Mn,rightSidePanel:vt,onOpenTransferRightPanel:ut===!0?oe:void 0,uncategorizedAccounts:Ln,onClickCustomerRequest:Gn,handleEditClick:qn,tenantEmailDomain:Je,trackExpenseAutomationTabAnalytics:O,setActivityLogTransactionId:W,closeSidePanel:Wn,openTransactionPanel:s,sidePanelIsOpen:Hn,sidePanelIsFullView:p!==!0&&b,panelContent:Zn,isAiCfoAccessEnabled:_,onAskAiCfoClick:he,isExpenseAutomationCommentingEnabled:Pn,isReconV3Enabled:wn,onExpenseAutomationCommentingThreadClick:xn,sidePanelListPercent:p===!0?66:void 0}),ie.showPopup&&ie.popupType!=null&&S.jsx(Ts,{popupType:ie.popupType,currencySymbol:ie.currencySymbol,accountId:ie.popupAccountId??"",accountName:ie.popupAccountName??"",onSubmit:ie.handleSubmit,onDismiss:ie.handleDismiss})]})}))),Ls=Ge(ma)`
|
|
21
|
+
`;function _s({companyId:t,closeCustomerRequestDrawer:s,addCustomerRequest:R,resetCustomerRequest:y}){const A=Ne.getSignedInUser();if(A==null)throw Error("Can't access Customer Request page without signing in...");const i=D((p=>Aa(p,t,A)));return a.useEffect((()=>{y()}),[]),S.jsx(S.Fragment,{children:i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?S.jsx(fn,{fetchState:"In-Progress"}):S.jsx(cs,{onCloseClick:s,addCustomerRequest:R,snippets:i.companyMonthEndReportTemplatesData,bulletPoints:i.zeniRequestsData??[]})})}const Bs=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,kn="reconciliation-status-updated",En="statement-status-updated",{common:{strings:{hyphen:Vs,comma:en,space:Os}},dateFormat:bn}=is.getLocalizedStrings(),tn=es,zs=pa((function(t,s){const{uncategorizedAccounts:R,vendorSearchAutoCompleteData:y,monthEndInsightsCustomerRequestData:A,monthEndInsightsPreviewMode:i,companyId:p,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:l}=s,C=Ne.getSignedInUser(),g=t.tenantState.currentTenantId,x={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:g??""},T=Ae(t),{selectedTransactionCategorizationTab:r}=T;return{expenseAutomationViewSelector:T,bulkUploadSelector:I===!0?T.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:y,authParams:x,receiptUploadEndpoint:`${Re.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ds}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Re.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:r,monthEndInsightsCustomerRequestData:A,monthEndInsightsPreviewMode:i,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:C,uncategorizedAccounts:R,companyId:p,isTransactionActivityEnabled:l}}),(function(t,s){const{themeState:R,isAccountingClassesEnabled:y,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:i,isMissingReceiptsBulkUploadEnabled:p,location:I,vendorSearchAutoCompleteData:l,expenseAutomationViewSelector:C,currentTenant:g,uncategorizedAccounts:x,navigate:T,onClickCustomerRequest:r,handleEditClick:h,setActivityLogTransactionId:F,isReconV3Enabled:J}=s,{selectedPeriod:u,currentSelectedView:m,reconciliation:{selectedAccountId:O}}=C,{accountSettingsView:te}=C.jeSchedules,de=mn(u),z=$e(de.start),B=$e(de.end);return{onZeniLogoClick:()=>{R.toggle()},onUploadReceiptAttachment:e=>{G.trackMissingReceiptAttached(u.month,u.year),t(Po(e))},onUploadTransactionReceipt:(e,n,c,d,E,k)=>{t(Nt(e,n,{fetchState:"In-Progress"}));const v=()=>t(Nt(e,n,{fetchState:"Error"}));us(`${Re.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,k,n,c,d,E).then((b=>{b!=null?t(vo(e,b)):v()})).catch(v)},onMissingReceiptsRowClick:(e,n)=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,n);const c=le(I.state?.pathnameStackToGoBack,I.pathname);T(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(To(e,n)),g!=null&&t(we({tenantId:g.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,d)=>{t(yo(e,{fetchState:n,error:c})),c!=null&&t(Le({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:d!=null?Os+Vs+d+en:en}]}))},onUpdateJESchedulesUIState:e=>{t(bo(e))},onUpdateMissingReceiptsUIState:e=>{t(Eo(e))},onFetchMissingReceiptsList:()=>{B!=null&&z!=null&&t(hn({start:z,end:B},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...p===!0?{onBulkUploadFiles:e=>{t(Xo(e))},onBulkUploadProgress:e=>{t(Wo(e))},onBulkUploadSuccess:e=>{t(Qo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Ho(e))},onConfirmBulkUploadMatch:(e,n,c,d,E)=>{t(Zo(e,n,c,d,E))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Ko())},onSetBulkUploadResultsTab:e=>{t(Yo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Jo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(No())},onSearchTransactionsForManualMatch:(e,n)=>{t(tn(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=C.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(tn(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Go(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(qo())},onFetchBulkUploadBatches:e=>{t(gn(e))},onFetchMoreBatchDetails:()=>{t($o())},onResetBulkUploadSort:()=>{t(Kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(ko())},onSearchTextChanged:e=>{const n=C.currentSelectedView,c=C.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(nt({selectedTab:c,uiState:{searchString:e}})),B!=null&&z!=null&&t(Ie(c,{start:z,end:B},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=C.selectedTransactionCategorizationTab;t(Io({filters:e,selectedTab:n}))},onRefresh:()=>{s.trackExpenseAutomationTabAnalytics(!0),t(fo(i))},onClose:()=>{m==="reconciliation"&&O!=null&&t(Gt({selectedAccountId:void 0})),T("../")},onBack:()=>{m==="reconciliation"&&O!=null&&t(Gt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(So(e))},onSaveReconciliationReview:e=>{t(Co(e))},onUpdateStep:e=>{const{selectedPeriod:n}=C,c=le(I.state?.pathnameStackToGoBack,I.pathname);T(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:C.currentSelectedView}}),t(pn(e))},handleLogOutClick:()=>{const e=le(I.state?.pathnameStackToGoBack,I.pathname);T("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:d,accruedExpensesAccount:E}=n,k=ot(te.prepaidExpensesAccountList,c.selectedOptions),v=ot(te.fixedAssetsAccountList,d.selectedOptions),b=ot(te.accruedExpensesAccountList,E.selectedOptions),M={selectedPrepaidExpensesAccountIds:k.map((P=>P.accountId)),selectedFixedAssetsAccountIds:v.map((P=>P.accountId)),selectedAccruedExpensesAccountIds:b.map((P=>P.accountId))};t(go({data:M}))},onSaveJeAccountSettingsClick:()=>{t(ho())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:d,scheduleClass:E,scheduleExpenseCategory:k,vendor:v}=n,{allAccountList:b,allClassList:M,allDepreciationAccountList:P}=C.jeSchedules,Q=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((q=>q.id===v?.selectedOption)):void 0,W={id:Q?.zeniId??v?.selectedOption??"",name:Q?.name??v?.defaultOptions.find((q=>q.value===v?.selectedOption))?.label??"",logo:Q?.logo},oe=k?.selectedOption!=null?b.find((q=>q.qboId===k.selectedOption)):void 0,he=E?.selectedOption!=null?M.find((q=>q.classId===E.selectedOption)):void 0,ge=d?.selectedOption!=null?P.find((q=>q.qboId===d.selectedOption)):void 0;t(po({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:oe?.accountId,updatedClassId:he?.classId,updatedAccumulatedDepreciationCategoryID:ge?.accountId,updatedVendor:{id:W.id,name:W.name}}}))},ignoreRecommendedJeSchedule(e,n){t(mo(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Lt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Ve("common"))},onCancelAutoComplete:()=>{t(Ve("common"))}},onPostJESchedule(e,n){t(uo({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ro())},handleJeScheduleClick:(e,n,c)=>{t(lo({selectedJEScheduleKey:n}));const d=le(I.state?.pathnameStackToGoBack,I.pathname);T(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{g!=null&&t(io(e,g.companyId,g.tenantId))},onClickCustomerRequest:r,setActivityLogTransactionId:F,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(co())},onOpenFileAttachmentSnackBar:()=>{t(Le({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(so(e))},onUpdateFileAttachment:e=>{t(oo({files:e}))},previewMonthEndReport:(e,n,c,d)=>{g!=null&&t(qt(e,g.companyId,n,!0,c,d,g.tenantId))},saveMonthEndReport:(e,n,c,d)=>{g!=null&&t(qt(e,g.companyId,n,!1,c,d,g.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:d}=C;g!=null&&d?.auditScorePercentage!=null&&(t(no(g.companyId,e,g.tenantId)),G.trackInsightsEmailPage(c.month,c.year,!1,"draft",d.auditScorePercentage,ao().format(bn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,n);const c=le(I.state?.pathnameStackToGoBack,I.pathname);T(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,d,E,k,v,b,M,P,Q,W,oe)=>{t(to(e,n,c,d,x,E,k,v,b,M,P,Q,W,oe))},onCancelAutoComplete:()=>{t(Ve("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(jt({scrollPosition:e}))},onUpdateTab:e=>{s.closeSidePanel?.(),B!=null&&z!=null&&(t(Ie(e,{start:z,end:B},!1,!1)),t(eo(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{s.closeSidePanel?.(),B!=null&&z!=null&&(t(Xa(e)),t(Ie("autoCategorized",{start:z,end:B},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(nt({selectedTab:e,uiState:n})),B!=null&&z!=null&&t(Ie(e,{start:z,end:B},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(nt({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,d,E,k,v)=>{B!=null&&z!=null&&t(Ie(e,{start:z,end:B},!0,c,n,d,E,k,v))},resetTransactionCategorizationLocalData:(e,n,c,d,E,k,v,b)=>{t(Wa(e,n,c,d,b??null,E,k,!1,v))},updateSelectedVendorForTransaction:(e,n,c,d,E)=>{t($t({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:d,uncategorizedAccounts:x,updatedVendor:E,isAccountingClassesEnabled:y}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const d=I.state?.referrer;e==="autoCategorized"?G.trackTransactionsAutoCategorisedPage(u.month,u.year,C.transactionView.totalCountByTab.autoCategorized,n.length,!1,d??null):G.trackTransactionsReviewPage(u.month,u.year,C.transactionView.totalCountByTab.review,n.length,!1,d??null),t(Qa(e,n,c,i))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Ha({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,d,E,k,v)=>{const{transactionId:b,transaction:M,lineIds:P}=n;k!=null&&t(Ka({transactionId:b,customerUpdates:k})),t(Za({selectedTab:d,transactionId:b.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:x,updatedCustomer:k,selectedEntity:E,isAccountingClassesEnabled:y,isUncategorizedExpenseCategoryEnabled:v})),E!=null&&t(it({entity:E,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:d,isFetchCOT:A,isUncategorizedExpenseCategoryEnabled:v}))},onFetchRecommendationsForEntityCategorization:(e,n,c,d,E,k,v)=>{const{transactionId:b,transaction:M,lineIds:P}=n;k!=null&&(t(Na({transactionId:b,vendorUpdates:{name:k.name,id:k.id?k.id:void 0}})),t(Ja({vendorId:k.id?k.id:void 0,localData:{vendorName:k.name,vendorId:k.id?k.id:void 0}}))),k?.id?(t($t({selectedTab:d,transactionId:b.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:x,updatedVendor:k,selectedEntity:E,isAccountingClassesEnabled:y,isUncategorizedExpenseCategoryEnabled:v})),E!=null&&t(it({entity:E,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:d,isFetchCOT:A,isUncategorizedExpenseCategoryEnabled:v}))):t(Ya({selectedTab:d,transactionId:b.id,lineId:P[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(ze(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(ze(u,!0,!1,null,!1,!1))},markAsReview:(e,n,c,d)=>{G.trackFluxAnalysisReviewed(c.month,c.year,d??!1,e),t(Ga(n,e,c,d??!1))},onUpdateFluxAnalysisUIState:e=>{t(qa(e))},updateOperatingExpensesIdsForReview:e=>{t($a({operatingExpenseIds:e,selectedPeriod:u}))},redirectToVendorDetailPage:e=>{if(s.tenantEmailDomain!=null){const n=Rs(e.id,e.qboId,s.tenantEmailDomain),c=le(s.location.state?.pathnameStackToGoBack,s.location.pathname);s.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(ja({sectionId:e,selectedPeriod:u}))},onFetchReimbursementView:(e,n,c)=>{t(ze(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(re(u,e))},setOpenDrawerClicked:e=>{t(je({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(rn("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=g?.companyId;c!=null&&(t(dn(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(un({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(je({selectedDrawerAccountId:e})),t(ln({accountId:e,selectedPeriod:u,localData:{accountSource:"bank_statement"}})),t(Oe({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(re(u,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(La({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Ma({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(za({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{s.closeSidePanel?.(),t(Oa({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const d=e.vendor?.id;c&&d!=null&&t(Ba(d)),t(Va({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(s.openTransactionPanel)return void s.openTransactionPanel(e,ct("bill"));const n=le(I.state?.pathnameStackToGoBack,I.pathname);T(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{T(-1)},onReconListPageScroll:e=>{t(jt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Lt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ve("common"))},onReconNodeCollapseToggled:(e,n)=>{t(_a({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(on({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(cn({accountId:e}))},onReconciliationPusherEventReceived:(e,n)=>{const c=n??{};if((e===kn||e===En)&&m==="reconciliation"&&(t(re(u,O,!0,!0)),J===!0)){const d=c.account_id;d!=null&&c.new_statement_data_status?.code==="processed"&&c.statement_upload_id!=null&&t(Fa({accountId:d,selectedPeriod:u,statementUploadId:c.statement_upload_id})),d==null||c.new_statement_data_status?.code!=="validation_failed"&&c.new_statement_data_status?.code!=="parsing_failed"&&c.new_statement_data_status?.code!=="processing_failed"||t(sn({accountId:d,selectedPeriod:u,statementProcessingFailed:!0}))}}}}),((t,s,R)=>{const{isMissingReceiptsBulkUploadEnabled:y,...A}=R;return(function(i,p,I){return{...i,...p,...I,onUploadTransactionReceipt:(l,C,g,x,T)=>{p.onUploadTransactionReceipt(l,C,g,x,T,i.authParams)}}})(t,s,A)}))(ls(rs)),Ms=As((function(t){const s=t.displayName??t.name??"Component",R=nn.memo(t),y=A=>{const i=ke(),p=(function(){const u=ke(),m=D((O=>Ae(O).reconciliation.selectedDrawerAccountId));return{isOpen:m!=null,selectedAccountId:m,openPanel:a.useCallback((O=>{u(je({selectedDrawerAccountId:O}))}),[u]),closePanel:a.useCallback((()=>{u(je({selectedDrawerAccountId:void 0}))}),[u])}})(),I=D((u=>Ae(u).reconciliation)),l=D((u=>Me(u))),C=a.useCallback(((u,m)=>{i(rn("expense_automation_reconcile",u,m))}),[i]),g=a.useCallback(((u,m)=>{const O=l?.companyId;O!=null&&(i(dn(u,O,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",m)),i(un({accountId:m,connectionInProgress:!0})))}),[i,l?.companyId]),x=a.useMemo((()=>{if(p.isOpen&&p.selectedAccountId!=null)return S.jsx(Fs,{reconciliation:I,selectedDrawerAccountId:p.selectedAccountId,onClose:p.closePanel,onFetchLinkTokenClick:C,onEstablishConnectionClick:g})}),[p.isOpen,p.selectedAccountId,p.closePanel,I,C,g]),T=a.useMemo((()=>({reconPanelContent:x,reconSidePanelIsOpen:p.isOpen,closeReconSidePanel:p.closePanel})),[x,p.isOpen,p.closePanel]),{useFeatureGate:r}=qe(),{isFeatureEnabled:h}=r(Y.isReconV3Enabled),F=a.useContext(Ht),J=a.useMemo((()=>p.isOpen?h===!0?{selectedItemId:p.selectedAccountId}:{closePanel:p.closePanel,selectedItemId:p.selectedAccountId}:F),[p.isOpen,p.closePanel,p.selectedAccountId,F,h]);return S.jsx(Ht.Provider,{value:J,children:S.jsx(R,{...A,...T})})};return y.displayName=`withReconSidePanel(${s})`,y})((({closeSidePanel:t,openTransactionPanel:s,panelContent:R,sidePanelIsFullView:y,sidePanelIsOpen:A,reconPanelContent:i,reconSidePanelIsOpen:p,closeReconSidePanel:I})=>{const{isAiCfoOpen:l,setIsAiCfoOpen:C}=ms(),g=ps(),{isOpen:x}=hs(),T=an(),r=st(),h=ke(),{isAiCfoAccessEnabled:F,onAskAiCfoClick:J}=In({mobileExploreReferrer:"Transaction categorization"}),u=a.useCallback((()=>{A===!0&&y!==!0&&t?.()}),[t,A,y]),{areTenantIdsInSync:m}=Cn(),O=(()=>{const o=D((N=>Ae(N))),w=st(),{currentSelectedViewFetchState:j,currentSelectedView:$,selectedPeriod:U}=o,ne=at($),Z=at(j.fetchState),ee=a.useCallback((N=>{const ae=w.state?.referrer;$==="transaction_categorization"&&(o.selectedTransactionCategorizationTab==="review"?G.trackTransactionsReviewPage(U.month,U.year,o.transactionView.totalCountByTab.review,0,N,ae??null):G.trackTransactionsAutoCategorisedPage(U.month,U.year,o.transactionView.totalCountByTab.autoCategorized,0,N,ae??null)),$==="missing_receipts"&&G.trackMissingReceiptsPage(U.month,U.year,N,o.missingReceipts.transactions.length,ae??null),$==="je_schedules"&&G.trackMonthCloseScheduleListPage(U.month,U.year,N,o.jeSchedules.draftSchedules.length,o.jeSchedules.resolveSchedules.length,ae??null),$==="flux_analysis"&&G.trackFluxAnalysisPage(U.month,U.year,N,Bs(o.fluxAnalysis),ae??null),$==="month_end_insights"&&o.auditSummary?.auditScorePercentage!=null&&G.trackInsightsEmailPage(U.month,U.year,N,"draft",o.auditSummary.auditScorePercentage,null,ae??null)}),[U,o]);return a.useEffect((()=>{Z===j.fetchState&&$===ne||j.fetchState!=="Completed"||ee(!1)}),[$,j.fetchState,ne]),ee})(),te=gs(),[de,z]=a.useState(!1),B=D((o=>Mt(o))),e=D((o=>Me(o))),[n,c]=a.useState(!1),[d,E]=a.useState(!1),[k,v]=a.useState([]),[b,M]=a.useState(null),P=a.useCallback((()=>{M(null)}),[]),Q=b?.contentType==="activity"?b.detail.transactionId:void 0,W=a.useCallback((o=>{o!=null?(l&&C(!1),g(),u(),M({contentType:"activity",detail:{transactionId:o}})):M((w=>w?.contentType==="activity"?null:w))}),[u,l,g,C]),oe=a.useCallback((o=>{l&&C(!1),g(),u(),M({contentType:"transfer",detail:o})}),[u,l,g,C]),he=a.useCallback((()=>{g(),P(),u(),J()}),[u,P,J,g]),ge=a.useRef(l);a.useEffect((()=>{l===!0&&ge.current===!1&&(g(),P(),u()),ge.current=l}),[u,P,l,g]);const q=a.useRef(x);a.useEffect((()=>{x===!0&&q.current===!1&&(l&&C(!1),P(),A===!0&&y!==!0&&t?.()),q.current=x}),[P,t,x,l,C,y,A]);const Ce=A===!0&&y!==!0,Ee=a.useRef(Ce);a.useEffect((()=>{Ce&&!Ee.current&&(l&&C(!1),g(),P()),Ee.current=Ce}),[P,l,Ce,g,C]);const[f,X]=a.useState(!1),ue=a.useRef(!1),{selectedTab:xe}=Vt(),{tenantEmailDomain:Je}=Vt(),[Ye,lt]=a.useState(r.state?.message==="comingFromTransactionDetail"),rt=r.state?.message==="comingFromOverview",yn=Cs(),Ke=Ne.getSignedInUser(),{useDynamicConfig:Tn,useFeatureGate:se}=qe(),{configValue:vn}=Tn(Ss.enableUncategorizedExpenseCategory),ce=vn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:dt}=se(Y.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:be}=se(Y.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Ze}=se(Y.isTransactionActivityEnabled),{isFeatureEnabled:ut}=se(Y.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:Pn}=se(Y.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:An}=se(Y.isProjectsTransactionsEnabled),{isFeatureEnabled:wn}=se(Y.isReconV3Enabled),{isFeatureEnabled:Rn}=se(Y.isJEScheduleCOTEnabled),xn=a.useCallback((o=>{const w=ct(o.view==="reconciliation"?"bill":"expense");s?.(o.entityId,w)}),[s]),Dn=D((o=>Ao(o,"common"))),L=D((o=>Ae(o))),{categoryOptions:Un,paymentAccountNames:Fn}=D((o=>wo(o.accountState))),_n=D((o=>Ro(o.classState))),{monthEndCloseChecksView:K,currentSelectedView:_,selectedPeriod:V,selectedTransactionCategorizationTab:He,currentSelectedViewBackgroundRefreshFetchState:Bn,currentSelectedViewFetchState:Se,jeSchedules:Qe,reconciliation:mt}=L;ys(_==="transaction_categorization");const Vn=L.transactionView.saveStatus.fetchState,pt=L.transactionView.transactions,ht=a.useRef(pt);ht.current=pt;const gt=D((o=>o.expenseAutomationTransactionsViewState?.transactionCategorizationView)),Ct=D((o=>o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),St=a.useRef(gt);St.current=gt;const ft=a.useRef(Ct);ft.current=Ct;const ie=Ts(Vn,(()=>{const o=[],w=ft.current,j=St.current,$=j!=null&&w!=null?j[w]:void 0;if($?.transactionReviewLocalDataById!=null)for(const ne of Object.values($.transactionReviewLocalDataById)){const Z=ne?.transactionReviewLocalData?.lineItemById;if(Z!=null)for(const ee of Object.values(Z)){const N=ee?.account;N?.accountId!=null&&o.push(N.accountId)}}const U=ht.current;for(const ne of U)for(const Z of ne.lines??[])"account"in Z&&Z.account?.accountId!=null&&o.push(Z.account.accountId);return o}));a.useEffect((()=>{_==="transaction_categorization"&&A!==!0||W(void 0)}),[_,W,A]),a.useEffect((()=>{p===!0&&I?.()}),[_,mt.selectedAccountId]);const On=L.transactionView.selectedTransactionCategorizationCompletedSubTab,De=`${He}|${On}`,Ue=a.useRef(null),It=a.useRef(null);a.useEffect((()=>{Ue.current!==null?Ue.current!==De&&(Ue.current=De,_==="transaction_categorization"&&P()):Ue.current=De}),[P,_,De]);const zn=D((o=>Q==null?void 0:xo(o.transactionState,Q))),me=zn?.qboId,kt=D((o=>me==null?void 0:Do(o,me)));a.useEffect((()=>{me!=null&&h(Uo(me))}),[h,me]);const{createTransferEntryStatus:Et,creditCardTransferAccountsList:bt,transferAccounts:yt}=L.transactionView,Tt=a.useCallback((o=>vs(h,o)),[h]),vt=a.useMemo((()=>_!=="transaction_categorization"||b==null?null:b.contentType==="activity"?Ze===!0?S.jsx(fs,{activityLogView:kt,qboId:me,onClose:()=>M(null),selectedTransactionId:b.detail.transactionId,isQuickViewCardStyle:!0},String(b.detail.transactionId)):null:b.contentType==="transfer"?S.jsx(Is,{createTransferEntryStatus:Et,transaction:b.detail,transferAccounts:b.detail.transactionType==="credit_card_payment"?bt:yt,onClose:()=>M(null),onCreateTransfer:Tt,isQuickViewCardStyle:!0},String(b.detail.transactionId)):null),[_,b,Ze,kt,me,Et,bt,yt,Tt]),Mn=vt!=null,{selectedAccountId:ye}=mt,Pt=at(Qe.accountSettingsView.saveState.fetchState),Ln=D((o=>Fo(o.accountState,o.accountListState,"accountList"))),jn=D((o=>_o(o))),Te=xe!=null?Bo(xe):_,$n=D((o=>o.entityAutoCompleteState.autoCompleteText.common));if(Sn({isDataReady:Se.fetchState==="Completed"}),Ke==null)throw Error("Can't access expense automation screen without signing in...");const At=mn(V),ve=$e(At.start),Pe=$e(At.end);if(ve==null||Pe==null)throw Error(`Invalid start - ${ve} and end - ${Pe} period from given ${V}`);const qn=a.useCallback((()=>{c(!1)}),[]),Gn=a.useCallback((()=>{E(!0)}),[]),Nn=a.useCallback((o=>{v(o),E(!1)}),[]),Jn=a.useCallback((()=>{v([])}),[]),Fe=L.missingReceipts.bulkUpload.phase,wt=L.missingReceipts.bulkUpload.currentBatchId;a.useEffect((()=>{be===!0&&_==="missing_receipts"&&Fe==="matching"&&wt!=null&&h(gn({cacheOverride:!0}))}),[be,_,Fe,wt,h]);const Rt=Ke?.userId,Yn=V.month,Kn=V.year,xt=e?.tenantId;a.useEffect((()=>{_==="missing_receipts"&&be!==!1&&Fe==="idle"&&Rt!=null&&xt!=null&&h(Vo())}),[_,be,Fe,Rt,xt,Yn,Kn,h]),a.useEffect((()=>{B.newVendorState?.vendorDetailLocalData?.vendorName!=null?z(!0):z(!1)}),[B.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect((()=>{Te!=null&&_!==Te&&h(pn(Te))}),[Te]),a.useEffect((()=>{f===!1&&Se.fetchState==="Completed"&&m&&(X(!0),h(Jt(!1,!1,ce)))}),[f,Se,m,ce]),a.useEffect((()=>{const o={month:V.month,year:V.year},w=It.current;It.current=o,w===null||w.month===o.month&&w.year===o.year||!rt&&m&&(h(Jt(!1,!1,ce)),h(re(V,ye,!1,!1)))}),[V.month,V.year,m,ce]);const Dt=a.useCallback(((o=!1,w=!1)=>{const j={start:ve,end:Pe};switch(_){case"transaction_categorization":h(Ie(He,j,o,!Ye,void 0,void 0,w,void 0,ce)),lt(!1);break;case"flux_analysis":h(ze(V,o,w,null));break;case"month_end_insights":if(w===!1){const $=new Date(V.year,V.month,0),U=zo($.toDateString()).format(bn.analytics.YYYYDashMMDashDDFormat);h(Mo(!0,e.companyId,e.tenantId,U)),h(Lo(e.companyId,e.tenantId))}break;case"je_schedules":h(Oo(j,w));break;case"missing_receipts":h(hn(j,{amount:75,currencyCode:"USD",currencySymbol:"$"},o,w));break;default:h(re(V,ye,o,w))}}),[_,ve,Pe,e.companyId,e.tenantId,He,V,ye,Ye,lt,ce]);a.useEffect((()=>{_===Te&&Se.fetchState==="Not-Started"&&m&&Dt(!0)}),[Se,ve,Pe,e.companyId,e.tenantId,m]),a.useEffect((()=>{rt||Ye||ue.current||Bn.fetchState==="In-Progress"||Se.fetchState!=="Completed"||(ue.current=!0,Dt(!0,!0))}),[]),a.useEffect((()=>{K.fetchState!=="In-Progress"&&K.fetchState!=="Completed"&&K.fetchState!=="Error"&&e?.tenantId!=null&&h(we({tenantId:e.tenantId,period:V,refreshViewInBackground:!1}))}),[K.fetchState,e?.tenantId]),a.useEffect((()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?c(!0):c(!1)}),[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect((()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&m&&(h(we({tenantId:e.tenantId,period:V,refreshViewInBackground:!0})),h(jo({companyId:e.companyId})),T("../"))}),[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,e.tenantId,V,e.companyId,m]),a.useEffect((()=>{const o=setInterval((()=>{K.fetchState!=="In-Progress"&&K.fetchState==="Completed"&&h(we({tenantId:e.tenantId,period:V,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(o)}),[K.fetchState,e.tenantId,V,h]),a.useEffect((()=>{const o=setInterval((()=>{_==="reconciliation"&&ye==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(re(V,void 0,!0,!0))}),3e5);return()=>clearInterval(o)}),[_,h,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,re,ye,V]);const Zn=Qt();a.useEffect((()=>{const o=(K.monthEndCloseChecks?.monthEndCloseCheckList.find((w=>w.id==="month_end_insights"))?.isDisabled??!1)&&!dt;_!=="month_end_insights"||!o&&K.monthEndCloseChecks?.reportEmailSentDate==null||T("../")}),[_,K.monthEndCloseChecks]);const Hn=p===!0?i:R,Qn=p===!0||A===!0,Wn=p===!0?I:t;a.useEffect((()=>{Pt==="In-Progress"&&Qe.accountSettingsView.saveState.fetchState==="Completed"&&h(Yt())}),[Pt,Qe.accountSettingsView.saveState.fetchState,Yt]);const{transactionId:Ut,onSaveVendor:Xn,onSaveSuccess:ea,onCancel:ta,vendorViewDetails:na}=(({expenseAutomationViewSelector:o,closeDrawerHandler:w,currentSelectedView:j,isUncategorizedExpenseCategoryEnabled:$})=>{const U=ke();let ne,Z,ee;const N=Qt(),ae=o.transactionView;let Ft=()=>{};const{transactions:oa,selectedTransactionId:fe,selectedTransactionLineId:_e,transactionLocalData:sa}=ae;if(j==="transaction_categorization"){const We=sa.find((pe=>pe.transactionId===fe)),H=oa.find((pe=>pe.id===fe)),_t=_e!=null?We?.transactionReviewLocalData?.lineItemById[_e]:void 0,Bt=_t?.account;Z=_t?.class?.classId,ne=["Uncategorized Income","Uncategorized Expense"].includes(Bt?.accountName??"")?void 0:Bt?.accountId;const ia=ws(fe,H?.typeOfTransaction);H!=null&&ia&&(ee={id:fe,type:ct(H.typeOfTransaction)}),Ft=()=>{if(fe!=null&&_e!=null&&H!=null){const pe=ae.transactionLocalData.find((Be=>Be.transactionId===fe))?.transactionReviewLocalData;if(pe!=null&&H.lines!=null&&H.lines.length>0){const Be=pe.lineItemById[_e];let Xe=pe.selectedEntity;if(Ua(H)||(Xe=Be.selectedEntityLine),Xe!=null){const la=Xe,ra={transactionId:{id:H.id,type:H.type},transaction:H,lineIds:H.lines.map((da=>da.id))??[]};U(it({entity:la,amount:Be.amount.amount,transactionDetails:ra,flowType:"categorization",selectedTab:o.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const ca=D((We=>Mt(We,void 0,ne,Z)));return{transactionId:ee,onSaveVendor:()=>{U(Da(ee,void 0,!1,!0))},onSaveSuccess:Ft,onCancel:()=>{ee!=null&&U(wa({transactionId:ee})),U(Ra()),U(xa()),w()},vendorViewDetails:ca}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{z(!1)},currentSelectedView:_,isUncategorizedExpenseCategoryEnabled:ce}),aa={events:e.companyId!=null?[`private-encrypted-${e.companyId}.${kn}`,`private-encrypted-${e.companyId}.${En}`]:[],eventCallback:(o,w,j)=>{j.onReconciliationPusherEventReceived(o,w)}};return yn?.loggedInUserRoleMap==null?K.fetchState==="Error"?S.jsx(ks,{onGoHome:()=>T("../",{replace:!0}),onReload:()=>window.location.reload()}):S.jsx(fn,{fetchState:"In-Progress"}):S.jsxs(S.Fragment,{children:[S.jsx(xs,{isOpen:d,drawerLeftMargin:new Es(0,0,300,650),onClose:()=>{E(!1)},children:S.jsx(Ls,{onClick:o=>o.stopPropagation(),children:S.jsx(_s,{companyId:e.companyId,closeCustomerRequestDrawer:()=>E(!1),addCustomerRequest:Nn,resetCustomerRequest:Jn})})}),Ut!=null&&de&&S.jsx(Ps,{isOpen:de,transactionId:Ut,onSaveVendor:Xn,onSaveSuccess:ea,onCancel:ta,vendorViewDetails:na}),S.jsx(zs,{...aa,navigate:T,location:r,themeState:te,categoryOptions:Un,classesForFilters:_n,accountsForFilters:Fn,vendorSearchAutoCompleteData:{autoCompleteText:$n,entityAutoCompleteView:Dn},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:be,monthEndInsightsPreviewMode:n,monthEndInsightsCustomerRequestData:k,isRealtimeInsightsFeatureEnabled:dt,isCreateTransferEntryFromExpenseEnabled:ut,isUncategorizedExpenseCategoryEnabled:ce,isAccountingClassesEnabled:jn,isProjectsTransactionsEnabled:An,isCOTEnabled:Zn,isJEScheduleCOTEnabled:Rn,currentTenant:e,companyId:e.companyId,signedInUser:Ke,isTransactionActivityEnabled:Ze,isRightPanelOpen:Mn,rightSidePanel:vt,onOpenTransferRightPanel:ut===!0?oe:void 0,uncategorizedAccounts:Ln,onClickCustomerRequest:Gn,handleEditClick:qn,tenantEmailDomain:Je,trackExpenseAutomationTabAnalytics:O,setActivityLogTransactionId:W,closeSidePanel:Wn,openTransactionPanel:s,sidePanelIsOpen:Qn,sidePanelIsFullView:p!==!0&&y,panelContent:Hn,isAiCfoAccessEnabled:F,onAskAiCfoClick:he,isExpenseAutomationCommentingEnabled:Pn,isReconV3Enabled:wn,onExpenseAutomationCommentingThreadClick:xn,sidePanelListPercent:p===!0?66:void 0}),ie.showPopup&&ie.popupType!=null&&S.jsx(bs,{popupType:ie.popupType,currencySymbol:ie.currencySymbol,accountId:ie.popupAccountId??"",accountName:ie.popupAccountName??"",onSubmit:ie.handleSubmit,onDismiss:ie.handleDismiss})]})}))),Ls=Ge(ma)`
|
|
22
22
|
display: flex;
|
|
23
23
|
min-height: 100%;
|
|
24
24
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BqtYq8PY.js";import{a as r}from"./sentry-BtWdTNDK.js";import{a5 as i,a6 as l,a7 as p,v as f}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import m from"./NotFoundScreen-D8y3QSjF.js";import{h as b,g as u}from"./core-4nWRIid2.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]="c70580bc-4af3-4de4-ac46-b35ae2a6be4d",e._sentryDebugIdIdentifier="sentry-dbid-c70580bc-4af3-4de4-ac46-b35ae2a6be4d")}catch{}})();const _=()=>{const e=b(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=f(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./sentry-BtWdTNDK.js";import{u,h as l,g as m}from"./core-4nWRIid2.js";import{hz as p,MN as g,MO as _}from"./zeni-epic-state-Brhydpej.js";import{u as b,L as h,z as y}from"./index-CbGX11uA.js";import"./liveblocks-BqtYq8PY.js";import"./recharts-UIIeT-6j.js";import"./mui-ChRNPf14.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="cedaf845-2fef-4ad4-9061-fcf1b9651295",e._sentryDebugIdIdentifier="sentry-dbid-cedaf845-2fef-4ad4-9061-fcf1b9651295")}catch{}})();function R(){const e=u(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=b(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),f=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&f!=null){const t=JSON.parse(f);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{R as default};
|