@zeniai/web-app-ui 5.1.97-qa → 5.1.98-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-Up5IwqQs.js +1 -0
- package/dist/assets/{AddressScreen-4qRIlnK-.js → AddressScreen-UxWcRZmy.js} +2 -2
- package/dist/assets/{AiCfoScreen-C0xnk5cF.js → AiCfoScreen-BF05qSzR.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-oopRYco4.js → BillPayApprovalRoutes-D-GuovwH.js} +1 -1
- package/dist/assets/{BillPayRoutes-B0ySvfjH.js → BillPayRoutes-DrOfY-VV.js} +10 -10
- package/dist/assets/{BusinessVerificationPageScreen-BfTuFBnf.js → BusinessVerificationPageScreen-B2HhT9ni.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-B68NhQxR.js → CardsAiCfoScreen-BPXCnKpZ.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-BBe1i5WM.js → ChargeCardRoutes-CWdtg6YK.js} +6 -6
- package/dist/assets/CompanyPassportScreen-x21Ap6N1.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-hJWTTt8K.js → ConnectionAuthScreen-ge2sUVoY.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BIMtfZH9.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CMiSGPxL.js → CustomerOnboardingRoutes-DqDGjNdb.js} +4 -4
- package/dist/assets/{DashboardRoutes-C-AFXkgO.js → DashboardRoutes-Cgw_iCM3.js} +4 -4
- package/dist/assets/{DefaultTenantHome-S2gSmw3u.js → DefaultTenantHome-CR0_CXQW.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-C2GdXtSa.js +18 -0
- package/dist/assets/DrawerScreen-B3cQzzUP.js +1 -0
- package/dist/assets/{EntityDetailRoutes-CoUef8K_.js → EntityDetailRoutes-CpurlHtH.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DvnfBRy6.js → ExpenseAutomationRoutes-BGX8NlRB.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-CMZ336vr.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-H96Zh7Xb.js → HubSpotOAuthCallbackScreen-CZAmJj_d.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-BxVpzgVN.js → MagicLinkRoutes-BDaLfAq1.js} +9 -9
- package/dist/assets/MagicLinkSignInScreen-DEG2WA_h.js +12 -0
- package/dist/assets/{MobileAppDrawer-BLdyZXBV.js → MobileAppDrawer-BmpM5OEl.js} +1 -1
- package/dist/assets/NotFoundScreen-Dzg5zRVC.js +1 -0
- package/dist/assets/{NotificationRoutes-CMje6h_r.js → NotificationRoutes-BNb1ZPKE.js} +1 -1
- package/dist/assets/OAuthConsentScreen-D_0djnco.js +1 -0
- package/dist/assets/{PandLWithForecastRoutes-MVL6Lv1L.js → PandLWithForecastRoutes-cuWrGpLk.js} +1 -1
- package/dist/assets/PeopleRoutes-C4qepWZ_.js +22 -0
- package/dist/assets/PerformanceRoutes-BzhzpXd0.js +1 -0
- package/dist/assets/{Preview-Da-KYkaZ.js → Preview-BOuT-_53.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-D2pSbt3W.js → QBOConnectionScreen-lQslhLmS.js} +1 -1
- package/dist/assets/ReferralListScreen-BieHflTg.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-D_uAmibG.js → ReimbursementApprovalRoutes-BhxstoNC.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-oQrkg1Y7.js → ReimbursementApprovalRuleDetailScreen-CkEZJXQa.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BN-W5Zqw.js → ReimbursementRoutes-92SGBZZl.js} +4 -4
- package/dist/assets/{ReportsRoutes-BDn-mdcO.js → ReportsRoutes-a54YeLvu.js} +1 -1
- package/dist/assets/RewardsRoutes-0DC-adXs.js +1 -0
- package/dist/assets/{ScreenRoutes-DgLWjLgf.js → ScreenRoutes-BlNv4YIY.js} +2 -2
- package/dist/assets/{SettingsRoutes-B0KcbWsV.js → SettingsRoutes-C6UHiixM.js} +7 -7
- package/dist/assets/{SetupPagesScreen-Dux5L0dD.js → SetupPagesScreen-DdbFAdHb.js} +5 -5
- package/dist/assets/SignInScreen-HAlIOIjn.js +1 -0
- package/dist/assets/SignOutScreen-DW1gUCGz.js +9 -0
- package/dist/assets/{TaskListScreen-CLmDQlr2.js → TaskListScreen-B9eSStzs.js} +2 -2
- package/dist/assets/{TaskRoutes-Bvfb_uGY.js → TaskRoutes-BZqNTas-.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-CueWZ-Ua.js → TransactionDetailRoutes-BXo-56fO.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-Ch1gEoDW.js → TransactionDetailScreen-jnjIQhYw.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BtnPGpxm.js → TransactionListRoutes-BYb7ohjf.js} +1 -1
- package/dist/assets/{TreasuryRoutes-hhTgxfCu.js → TreasuryRoutes-D_Nc2Thq.js} +5 -5
- package/dist/assets/{VendorsRoutes-mwFtgJTR.js → VendorsRoutes-BW-uHhrx.js} +12 -12
- package/dist/assets/WiseConfirmationScreen-D1PZo18h.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DCD0MdZe.js → ZeniAccountRoutes-BiCibze4.js} +8 -8
- package/dist/assets/{ZeniAccountStatementScreen-DbDEELdQ.js → ZeniAccountStatementScreen-BrNKBtSn.js} +2 -2
- package/dist/assets/{accountMappingHelper-rs0CYQJW.js → accountMappingHelper-LYbX13CN.js} +1 -1
- package/dist/assets/{analytics-DL3j77s3.js → analytics-C32tZaP0.js} +1 -1
- package/dist/assets/{analyticsHelper-BLQhTmmj.js → analyticsHelper-DtQFmi0e.js} +1 -1
- package/dist/assets/{core-BUDfBDzW.js → core-BEqwGbSx.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CAV5JFIH.js → decodeURIComponentSafe-DTCbLY6J.js} +1 -1
- package/dist/assets/{dnd-C2uuKLS_.js → dnd-aedH_7an.js} +1 -1
- package/dist/assets/{empty-gH7VKio2.js → empty-CTT5XurM.js} +1 -1
- package/dist/assets/{empty-BZfUgT7s.js → empty-DaJrG0iL.js} +1 -1
- package/dist/assets/{emptyVideoElement-DgEZFuvR.js → emptyVideoElement-BbF1KvUh.js} +1 -1
- package/dist/assets/epic-DAvRZRKw.js +2 -0
- package/dist/assets/getLocaleForTenant-CPQG2FZU.js +1 -0
- package/dist/assets/{index-Pwg8iACI.js → index-54sgiomr.js} +2 -2
- package/dist/assets/{index-CwfGUvf7.js → index-BHmbllBx.js} +1 -1
- package/dist/assets/{index-B1-02ULB.js → index-BV2hYWmb.js} +1 -1
- package/dist/assets/{index-DN3QU4tq.js → index-CIHRBtr6.js} +1 -1
- package/dist/assets/{index-JzqLJcCq.js → index-Ctjlt8lG.js} +1 -1
- package/dist/assets/{index-9PmElJom.js → index-DD5A7mJH.js} +13722 -13708
- package/dist/assets/{index-YvePaYki.js → index-DgEagwC7.js} +1 -1
- package/dist/assets/{index-DoyRxeZ8.js → index-hKu4f1iJ.js} +1 -1
- package/dist/assets/{lexical-BJhq3Vel.js → lexical-Dk1uI_nN.js} +1 -1
- package/dist/assets/{liveblocks-DvqoH3dJ.js → liveblocks-CI520bHO.js} +1 -1
- package/dist/assets/{lottie-DU31Qsck.js → lottie-0YTaCosS.js} +1 -1
- package/dist/assets/{mui-BX-eccqP.js → mui-6WrS_ojW.js} +1 -1
- package/dist/assets/{pathToGoBack-CwLFXs-c.js → pathToGoBack-DZgL3eGt.js} +1 -1
- package/dist/assets/{pdf-SnLRVeGX.js → pdf-XPdZ15Zh.js} +3 -3
- package/dist/assets/{pdf-lib-C5S3Bgj_.js → pdf-lib-DImtf-Hd.js} +1 -1
- package/dist/assets/{plaid-C1X6Gp1j.js → plaid-BwgJPT1f.js} +1 -1
- package/dist/assets/{pusher-BeI8juZo.js → pusher-vO-vyZDC.js} +1 -1
- package/dist/assets/{react-qzNQ2jmd.js → react-CSZBa4ot.js} +1 -1
- package/dist/assets/{react-BLUmJ7p4.js → react-CoNtbOCQ.js} +1 -1
- package/dist/assets/{react-CajOW-KO.js → react-DgrHNyrR.js} +1 -1
- package/dist/assets/{react-C0kyiULF.js → react-MpBkihu9.js} +1 -1
- package/dist/assets/{react-4K1mijgw.js → react-S4diJ2jH.js} +1 -1
- package/dist/assets/{react-gWLA1NwC.js → react-bA_ZDfL5.js} +1 -1
- package/dist/assets/{recharts-C3oDuogX.js → recharts-HPhXmfTv.js} +1 -1
- package/dist/assets/{routePaths-BPZ60_ul.js → routePaths-BEczkE7A.js} +1 -1
- package/dist/assets/{sentry-oCFmppdA.js → sentry-B9QSZuyZ.js} +1 -1
- package/dist/assets/{url-BJ6QhvOT.js → url-45TnfvPl.js} +1 -1
- package/dist/assets/{url-MZGYWUXg.js → url-toWtB1hu.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CbeWjSYp.js → useAiCfoDashboardSuggestedQuestionsChips-DmLt0ng2.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BGHggyph.js +1 -0
- package/dist/assets/{useCashManagementBanner-DGFvypM8.js → useCashManagementBanner-CjSG1LM_.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-Cb-4seWD.js → useChargeCardPusherEvents-CXqYtiJS.js} +1 -1
- package/dist/assets/{useDeviceId-B2fVfrfI.js → useDeviceId-BeyVLeTd.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-CrM96Zb1.js → useEmailConnectResultRefresh-DvejkSG7.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DfW2emMG.js → useInitialThreadRequest-CqJaxo92.js} +1 -1
- package/dist/assets/{utils-BdmIffFy.js → utils-7NyLmgtg.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CYfRQO6D.js → withTransactionSidePanel-CgEEpbzu.js} +1 -1
- package/dist/assets/{zeni-epic-state-BRNxIopP.js → zeni-epic-state-DDiwMHXL.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-CkFcdLcd.js +0 -1
- package/dist/assets/CompanyPassportScreen-tdQzIeXB.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BR_iC0Wz.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-Bf63TFDj.js +0 -18
- package/dist/assets/DrawerScreen-CNxma0Qg.js +0 -1
- package/dist/assets/FeaturePreviewScreen-BvY_XvYQ.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-DU96qNSs.js +0 -12
- package/dist/assets/NotFoundScreen-Bjeg8OER.js +0 -1
- package/dist/assets/OAuthConsentScreen-jazB5K-T.js +0 -1
- package/dist/assets/PeopleRoutes-DSMPSkgq.js +0 -22
- package/dist/assets/PerformanceRoutes-C40c0t7S.js +0 -1
- package/dist/assets/ReferralListScreen-BRzq9B_u.js +0 -5
- package/dist/assets/RewardsRoutes-DFbFMPqn.js +0 -1
- package/dist/assets/SignInScreen-CPVG_KJo.js +0 -1
- package/dist/assets/SignOutScreen-DVvG8cxR.js +0 -9
- package/dist/assets/WiseConfirmationScreen-D9d_nucN.js +0 -12
- package/dist/assets/epic-Bh9aJ89a.js +0 -2
- package/dist/assets/getLocaleForTenant-D9pSDinJ.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-I9ttKeZb.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-CI520bHO.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as x,n as W,t as en}from"./core-BEqwGbSx.js";import{bJ as nn,cp as Ce,P_ as ye,eX as V,cB as tn,zB as Q,zl as an,Qa as sn,Qd as on,rC as te,rq as ae,l5 as ie,tJ as z,Qf as Ie,gh as $e,gg as Ge,gf as We,Qg as cn,zK as rn,Eu as Ae,El as ke,Ei as _e,E0 as J,Eo as Ee,Er as ve,Ex as Pe,ub as we,gw as un,cw as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qh as fn,D0 as le,DE as gn,Qi as Sn,bK as bn,FN as pe,EO as hn,Qj as Cn,Qk as In,FR as An,FV as kn,tC as _n,Kj as En,Gq as he,Hq as me,Ql as vn,Qm as Pn,Qn as wn,Qo as He,Qp as Tn,MM as Dn,Pn as Un,M$ as On,Qq as qe,E4 as Fn,N0 as Vn,E8 as Bn,Qr as Oe,GM as Ke,ld as xn,rt as Je,tL as jn,bE as Re,tX as Ne,cz as Rn,Qs as Xe,fW as Nn,G8 as zn,Gc as Ln,Qt as Mn,Gt as ze,Qu as Zn,Qv as Qn,Qw as $n,Qx as Gn,gp as Wn,AV as Hn,Qy as qn,A_ as Kn,AZ as Jn}from"./zeni-epic-state-DDiwMHXL.js";import{I as se,C as oe,G as K,y as Te,aS as X,bE as Ye,z as U,D as ce,d as O,B as De,f as $,bF as Xn,au as re,bG as B,bH as Yn,bI as et,ag as xe,bJ as nt,v as Le,av as Me,K as tt,F as at,bK as it,bL as st,bM as ot,a9 as ct}from"./index-DD5A7mJH.js";import{a as h}from"./sentry-B9QSZuyZ.js";import{n as Fe,D as rt,S as ut}from"./mui-6WrS_ojW.js";import{M as fe}from"./MobileAppDrawer-BmpM5OEl.js";import N from"./NotFoundScreen-Dzg5zRVC.js";import{a as Ze}from"./analyticsHelper-DtQFmi0e.js";import{d as Qe}from"./routePaths-BEczkE7A.js";import{B as Ue}from"./BusinessVerificationPageScreen-B2HhT9ni.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="0140ded3-7a0e-42a5-963c-6b95dcde1c3d",e._sentryDebugIdIdentifier="sentry-dbid-0140ded3-7a0e-42a5-963c-6b95dcde1c3d")}catch{}})();const dt=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-DvqoH3dJ.js";import{h as Y,g as ee,u as ne,i as
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,lt=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e($e(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Xn),pt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(K.isBillPayLocalCurrencyFeatureEnabled),g=we(),{configValue:C}=i(X.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),E=P(T=>T.billPaySetupViewState.fetchState),f=P(T=>V(T)),b=P(T=>T.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:D,isLoading:A}=Ye(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect(()=>{S.current||E!=="Not-Started"||m==null?S.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(Q(m,!1,!0))):(S.current=!0,t(Q(m,!0)))},[E,m,t]),h.useEffect(()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))},[y,b,A,D,t]);const F=T=>{d(T)};if(v===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(B,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const T=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>T(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,$t=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,Wt=e=>`/${e}/cards/onboard`,Ht=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},qt=(e,o)=>e.find(t=>t.id===o),Kt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(Te("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(ve(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),E=n.allBankAccounts.find(f=>f.accountId===d);O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find(f=>f.id===d),_=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,E=n.allFundingAccounts.findIndex(f=>f.id===d)+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:x(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}})(Yn),St=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=P(L=>V(L)),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(X.zeniAccountsConfig),{configValue:p}=s(X.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(K.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(K.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(K.isCardPolicyEnabled),S=P(L=>un(L,n.companyId)),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&v===!1,F=b===!1&&v,T=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=P(L=>L.chargeCardSetupViewState.fetchState),w=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=L=>{Se(L)},xe=P(L=>fn(L,w));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect(()=>{M||Z!=="Not-Started"||w==null?M||Z!=="Completed"||w==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(w,!1,!0)):(ue(!0),t(le(w,!0)))},[M,Z,w,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,q=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(v,b,E,_);return be||q?be||q?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded($.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:w,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:q,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:xe,isCreditCardProductVisible:v,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,accountsPromoConfig:T})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(B,{to:"../promo"})},bt=Fe.div`
|
|
9
|
+
`,lt=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e($e(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Xn),pt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(K.isBillPayLocalCurrencyFeatureEnabled),g=Te(),{configValue:C}=i(X.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),E=P(w=>w.billPaySetupViewState.fetchState),f=P(w=>V(w)),b=P(w=>w.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:D,isLoading:A}=Ye(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect(()=>{S.current||E!=="Not-Started"||m==null?S.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(Q(m,!1,!0))):(S.current=!0,t(Q(m,!0)))},[E,m,t]),h.useEffect(()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))},[y,b,A,D,t]);const F=w=>{d(w)};if(v===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const w=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>w(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,$t=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,Wt=e=>`/${e}/cards/onboard`,Ht=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},qt=(e,o)=>e.find(t=>t.id===o),Kt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(c.remainingAmountDue.amount)}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>B(n.accountBalance.available.amount)),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(we("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(ve(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),E=n.allBankAccounts.find(f=>f.accountId===d);O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find(f=>f.id===d),_=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,E=n.allFundingAccounts.findIndex(f=>f.id===d)+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:B(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}})(Yn),St=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=P(L=>V(L)),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(X.zeniAccountsConfig),{configValue:p}=s(X.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(K.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(K.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(K.isCardPolicyEnabled),S=P(L=>un(L,n.companyId)),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&v===!1,F=b===!1&&v,w=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=P(L=>L.chargeCardSetupViewState.fetchState),T=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=L=>{Se(L)},Be=P(L=>fn(L,T));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect(()=>{M||Z!=="Not-Started"||T==null?M||Z!=="Completed"||T==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(T,!1,!0)):(ue(!0),t(le(T,!0)))},[M,Z,T,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,q=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(v,b,E,_);return be||q?be||q?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded($.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:T,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:q,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Be,isCreditCardProductVisible:v,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,accountsPromoConfig:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},bt=Fe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-DvqoH3dJ.js";import{h as Y,g as ee,u as ne,i as
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,ht=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(et),Ct=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),{useDynamicConfig:n}=oe(),s=we(),{configValue:l}=n(X.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=P(m=>m.remiSetupViewState.fetchState),y=P(m=>V(m)),_=P(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:E,isLoading:f}=Ye(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect(()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))},[S,b,t]),h.useEffect(()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))},[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(B,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:T,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Ve}=i,de=g?.selectedOption,xe={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(q=>q.length===2?q:Me(q))??[],companySourceOfFunds:T?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Ve?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:E};e(Ne({companyDetails:xe,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map(p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:E,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:E,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach((I,k)=>{C[k]=I}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(Bn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(xn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}})(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=se(),{useDynamicConfig:I}=oe(),k=we(),{configValue:d}=I(X.zeniAccountsConfig),S=ye(d),y=P(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),_=P(m=>m.companyConfigState.fetchState),E=P(m=>m.userRoleConfigState.fetchState),f=P(m=>V(m)),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect(()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))},[_,E,n]),h.useEffect(()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(Q(b,!0))}},[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=P(m=>{let v;switch(e){case"zeni_accounts":v=wn(m,b);break;case"zeni_treasury":v=He(m,b);break;case"charge_cards":v=Tn(m,b);break;case"reimbursement":v=Pn(m,b);break;default:v=vn(m,b)}return v});return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded($.Event.billPayBusinessVerification,Be(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:Be(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=qe(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e($n(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(Te("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(ve(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}})(it),Et=()=>{const e=Y(),o=ee(),t=ne(),a=we(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(X.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[b,D]=h.useState(!1),A=P(w=>w.treasurySetupViewState.fetchState),m=P(w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=P(w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),j=P(w=>w.treasuryDetailState.transactionsState?.fetchState),F=P(w=>V(w)),T=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=P(w=>Xe(w,T)),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=w=>{k(w)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect(()=>{d||A!=="Not-Started"||T==null||(S(!0),t(he(T,!0,!1)))},[d,A,T,t]),h.useEffect(()=>{y||m!=="Not-Started"||T==null||(_(!0),t(Nn()))},[y,m,T,t]),h.useEffect(()=>{E||v!=="Not-Started"||T==null||(f(!0),t(zn()))},[E,v,T,t]),h.useEffect(()=>{b||j!=="Not-Started"||T==null||(D(!0),t(Ln(!0)))},[b,j,T,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect(()=>{i||A!=="Completed"||H||Z||!o.pathname.includes("setup")||r(!0)},[A,H,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(B,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:w=>w.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:T,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=Fe(ut)`
|
|
17
|
+
`,ht=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(et),Ct=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),{useDynamicConfig:n}=oe(),s=Te(),{configValue:l}=n(X.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=P(m=>m.remiSetupViewState.fetchState),y=P(m=>V(m)),_=P(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:E,isLoading:f}=Ye(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect(()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))},[S,b,t]),h.useEffect(()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))},[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:w,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve}=i,de=g?.selectedOption,Be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(q=>q.length===2?q:Me(q))??[],companySourceOfFunds:w?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:E};e(Ne({companyDetails:Be,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map(p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:E,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:E,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach((I,k)=>{C[k]=I}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(Bn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}})(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=se(),{useDynamicConfig:I}=oe(),k=Te(),{configValue:d}=I(X.zeniAccountsConfig),S=ye(d),y=P(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),_=P(m=>m.companyConfigState.fetchState),E=P(m=>m.userRoleConfigState.fetchState),f=P(m=>V(m)),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect(()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))},[_,E,n]),h.useEffect(()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(Q(b,!0))}},[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=P(m=>{let v;switch(e){case"zeni_accounts":v=Tn(m,b);break;case"zeni_treasury":v=He(m,b);break;case"charge_cards":v=wn(m,b);break;case"reimbursement":v=Pn(m,b);break;default:v=vn(m,b)}return v});return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=qe(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e($n(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(we("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(ve(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}})(it),Et=()=>{const e=Y(),o=ee(),t=ne(),a=Te(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(X.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[b,D]=h.useState(!1),A=P(T=>T.treasurySetupViewState.fetchState),m=P(T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=P(T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),j=P(T=>T.treasuryDetailState.transactionsState?.fetchState),F=P(T=>V(T)),w=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=P(T=>Xe(T,w)),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=T=>{k(T)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect(()=>{d||A!=="Not-Started"||w==null||(S(!0),t(he(w,!0,!1)))},[d,A,w,t]),h.useEffect(()=>{y||m!=="Not-Started"||w==null||(_(!0),t(Nn()))},[y,m,w,t]),h.useEffect(()=>{E||v!=="Not-Started"||w==null||(f(!0),t(zn()))},[E,v,w,t]),h.useEffect(()=>{b||j!=="Not-Started"||w==null||(D(!0),t(Ln(!0)))},[b,j,w,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect(()=>{i||A!=="Completed"||H||Z||!o.pathname.includes("setup")||r(!0)},[A,H,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:T=>T.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:w,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=Fe(ut)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,Pt=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Gn(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,s)=>{e(
|
|
21
|
+
`,Pt=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Gn(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,s)=>{e(we("account_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"zeni_accounts","account_setup",s))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"zeni_accounts","account_setup"):_e("account_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"account_setup",n,s))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))}}})(st),wt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=oe(),n=se(),s=Ce(n?.loggedInUserRoleMap),{configValue:l}=c(X.zeniAccountsConfig),i=ye(l),[r,p]=h.useState(!1),[g,C]=h.useState(!1),I=P(_=>_.zeniAccountSetupViewState.fetchState),k=P(_=>V(_)),d=U.getSignedInUserTenant(a)?.companyId??k.companyId,S=U.getSignedInUser(),y=_=>{p(_)};if(S==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect(()=>{g||I!=="Not-Started"||d==null?g||I!=="Completed"||d==null||k.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(d,!1,!0)):(C(!0),t(me(d,!0)))},[g,I,d,t]),k.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(x,{to:"../promo"});{const _=E=>E.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:E=>_(E)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:y}),u.jsx(Pt,{navigate:e,location:o,companyId:d,currentTenant:k,isUserZeniAccountsAdmin:s,accountsPromoConfig:i,onClickMenuIcon:()=>{y(!0)}})]})}},Tt=Fe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-DvqoH3dJ.js";import{h as Y,g as ee,u as ne,i as
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Dt=W(function(e,o){const t=V(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:qn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:n,analytics:O}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Jn(a))},onSubmitClick:()=>{e(Kn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ie({files:a}))},onDeleteFile:a=>{e(ae(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(te(a,c.split(".")[0]))}}})(ot),Ut=()=>{const e=Y(),o=ee(),t=ne(),[a,c]=h.useState(!1),[n,s]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=G(),p=se(),{useFeatureGate:g}=oe(),{isFeatureEnabled:C}=g(K.isBillPayLocalCurrencyFeatureEnabled),I=P(A=>A.internationalWireVerificationState.verificationFormFetchState.fetchState),k=P(A=>A.billPaySetupViewState.fetchState),d=P(A=>V(A)),S=
|
|
29
|
+
`,Dt=W(function(e,o){const t=V(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:qn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:n,analytics:O}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Jn(a))},onSubmitClick:()=>{e(Kn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ie({files:a}))},onDeleteFile:a=>{e(ae(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(te(a,c.split(".")[0]))}}})(ot),Ut=()=>{const e=Y(),o=ee(),t=ne(),[a,c]=h.useState(!1),[n,s]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=G(),p=se(),{useFeatureGate:g}=oe(),{isFeatureEnabled:C}=g(K.isBillPayLocalCurrencyFeatureEnabled),I=P(A=>A.internationalWireVerificationState.verificationFormFetchState.fetchState),k=P(A=>A.billPaySetupViewState.fetchState),d=P(A=>V(A)),S=Te(),y=d.companyId??U.getSignedInUserTenant(r)?.companyId,_=P(A=>Wn(A.companyState,d.companyId)),E=_?.company.companyBillPayInfo.internationalWireOnboardingStatus,f=E?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect(()=>{a||I!=="Not-Started"||y==null||(c(!0),t(Hn(y)))},[a,I,y,t]),h.useEffect(()=>{n||k!=="Not-Started"||y==null||(s(!0),t(Q(y,!0)))},[k,n,y,t]),U.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const b=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=A=>{i(A)};return b===!1?u.jsx(x,{to:"../promo"}):b===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Tt,{children:[u.jsx(ce,{analytics:O,onLoad:A=>(m=>m.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(A)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(Dt,{navigate:e,location:o,companyId:y,analytics:O,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:f,isLocalCurrencyEnabled:C})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:S.colors.grey5}})},Ot=W(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(he(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}})(ct(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:s,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return o?u.jsx(Ue,{productType:i}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Ut,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Ue,{productType:i}):u.jsx(N,{}):a?u.jsx(Ct,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(wt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?s?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(x,{to:"../"}):u.jsx(N,{}):s?u.jsx(St,{}):l?u.jsx(x,{to:"../"}):u.jsx(N,{})}}));function oa(e){const{tenantEmailDomain:o}=G(),t=P(c=>V(c)).companyId??U.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,s)=>{s.onEventReceived(c)}};if(U.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ot,{...e,companyId:t,...a})}export{na as A,ta as P,oa as S,Xt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Ht as g,$t as h,Jt as i,Yt as j,ia as k,Kt as l,qt as m,Gt as n,Wt as o,Qt as p,sa as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-CI520bHO.js";import{a as u,b as M,q as T}from"./sentry-B9QSZuyZ.js";import{u as A,h as z,j as c,g as D,N as j,n as O}from"./core-BEqwGbSx.js";import{u as P,z as s,y as F,d as E,a as B,e as _,f as N,r as V,g as Y,h as Z,j as v}from"./index-DD5A7mJH.js";import{eX as $,LY as q,LZ as J,fA as W,g0 as X,M2 as H,go as G,cZ as K,M3 as b,M4 as Q,M5 as R,bY as y}from"./zeni-epic-state-DDiwMHXL.js";import"./mui-6WrS_ojW.js";import{u as ee}from"./useDeviceId-BeyVLeTd.js";import{f as te}from"./analyticsHelper-DtQFmi0e.js";import{t as ne}from"./getLocaleForTenant-CPQG2FZU.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.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]="3470efc0-1c26-462c-83e8-76786baf8d6a",t._sentryDebugIdIdentifier="sentry-dbid-3470efc0-1c26-462c-83e8-76786baf8d6a")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(b())}}})(Z),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),k=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>$(e)),I=c(e=>q(e)),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(X(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=Y();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-CI520bHO.js";import{a as i}from"./sentry-B9QSZuyZ.js";import{u as c,g as d,N as u}from"./core-BEqwGbSx.js";import{z as n,d as a,f as m,B as p}from"./index-DD5A7mJH.js";import{gt as g,Mk as y}from"./zeni-epic-state-DDiwMHXL.js";import{n as b}from"./mui-6WrS_ojW.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.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]="732543fc-31a4-46b6-9465-e79f363e8662",e._sentryDebugIdIdentifier="sentry-dbid-732543fc-31a4-46b6-9465-e79f363e8662")}catch{}})();function M(){const e=c(),t=d(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect(()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}},[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.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
|
+
`;export{M as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as u}from"./liveblocks-CI520bHO.js";import{a as G}from"./sentry-B9QSZuyZ.js";import{h as v,u as z,g as K,j as b,i as J,n as O}from"./core-BEqwGbSx.js";import{z as R,C as _,G as p,a0 as M,D as Q,d as V,f as W,dc as X,v as g,p as Z}from"./index-DD5A7mJH.js";import{eX as q,TM as F,J5 as I,TN as x,TI as H,It as y,TO as Y,IB as E,HX as aa,J6 as S,TP as B,fz as ea,IY as ta,J1 as sa,IQ as oa,IO as w,J2 as na,IL as ia,TQ as la,TR as ra,TS as ka,TT as ca,TU as T,ej as da,TV as ua,TW as pa}from"./zeni-epic-state-DDiwMHXL.js";import{n as Ta}from"./mui-6WrS_ojW.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-BGHggyph.js";import{M as ga}from"./MobileAppDrawer-BmpM5OEl.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.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]="6b208284-69d6-4f5c-8935-6b89503529df",e._sentryDebugIdIdentifier="sentry-dbid-6b208284-69d6-4f5c-8935-6b89503529df")}catch{}})();const fa=Ta.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as d}from"./liveblocks-DvqoH3dJ.js";import{a as b}from"./sentry-oCFmppd
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ha=O(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,
|
|
9
|
+
`,ha=O(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=H(e),i=R.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(I(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(I(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Z(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const c=C(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(X);function $a(){const e=v(),t=z(),o=K(),k=R.getSignedInUser(),n=b(r=>q(r)),{taskGroupId:d}=J(),{useFeatureGate:i}=_(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,j]=G.useState(!1),h=b(r=>F(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:$}=ma({mobileExploreReferrer:"Task Checklist"});if(M({isDataReady:m==="Completed"}),G.useEffect(()=>{t(I(!1,l))},[n?.tenantId,t,l]),G.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(Q,{analytics:V,onLoad:r=>(U=>U.trackPageLoaded(W.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{j(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:N,onAskAiCfoClick:$})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{$a as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-CI520bHO.js";import se from"./NotFoundScreen-Dzg5zRVC.js";import{a as c}from"./sentry-B9QSZuyZ.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-BEqwGbSx.js";import{I8 as H,Ib as le,I5 as de,eX as M,TI as X,Ip as J,I2 as pe,IV as ue,IO as ke,TJ as K,TK as V,H_ as me,HX as fe,rC as ge,rq as he,l5 as Ie,Ij as Se,TL as Te,IA as be,Ix as Ce,Ie as Ee,Iu as Ge,It as De}from"./zeni-epic-state-DDiwMHXL.js";import{z as G,da as xe,x as je,C as ye,G as b,p as Q,v as w,D as ve,d as z,f as we,db as Re,j as A,au as Fe}from"./index-DD5A7mJH.js";import{n as Be}from"./mui-6WrS_ojW.js";import{u as Pe}from"./useInitialThreadRequest-CqJaxo92.js";import{M as Ue}from"./MobileAppDrawer-BmpM5OEl.js";import Le from"./TaskListScreen-B9eSStzs.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.js";import"./useAskAiCfoHostNavButtonProps-BGHggyph.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]="a13bc04e-d8fc-4565-bd20-c20f1839e5fb",e._sentryDebugIdIdentifier="sentry-dbid-a13bc04e-d8fc-4565-bd20-c20f1839e5fb")}catch{}})();function $e(){const e=O(),t=Z(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(H())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let q,_=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?V(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=X(e),{tenantEmailDomain:D}=d,C=r.recurringSourceTaskId,x=C!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(C)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==q&&(q=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>V(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ce(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Q(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(J(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(H())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=O(),t=Z(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:C}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,W]=c.useState(!1),[F,Y]=c.useState(!1),[B,ee]=c.useState(!1),[P,j]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>X(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(W(!0),t(J(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return j(!1),void(T.current=!1);if(E==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Q(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const $=g(i=>K(i,r)),y=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:C})]})]})}const Ve=Be.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as n}from"./liveblocks-DvqoH3dJ.js";import se from"./NotFoundScreen-Bje
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(
|
|
9
|
+
`,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(v,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(v,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(v,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
|
package/dist/assets/{TransactionDetailRoutes-CueWZ-Ua.js → TransactionDetailRoutes-BXo-56fO.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-CI520bHO.js";import i from"./NotFoundScreen-Dzg5zRVC.js";import{T as r}from"./TransactionDetailScreen-jnjIQhYw.js";import"./sentry-B9QSZuyZ.js";import{o as s,p as o}from"./core-BEqwGbSx.js";import"./zeni-epic-state-DDiwMHXL.js";import"./recharts-HPhXmfTv.js";import"./index-DD5A7mJH.js";import"./mui-6WrS_ojW.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.js";import"./useAskAiCfoHostNavButtonProps-BGHggyph.js";import"./decodeURIComponentSafe-DTCbLY6J.js";import"./routePaths-BEczkE7A.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]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|
package/dist/assets/{TransactionDetailScreen-Ch1gEoDW.js → TransactionDetailScreen-jnjIQhYw.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as U}from"./liveblocks-
|
|
1
|
+
import{j as U}from"./liveblocks-CI520bHO.js";import{a as i}from"./sentry-B9QSZuyZ.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as Ee,N as Xe,n as Qe}from"./core-BEqwGbSx.js";import{nO as he,eX as X,gp as Ze,Oi as et,m$ as tt,mJ as at,bn as nt,cV as be,bs as Ie,ra as q,Nh as H,Oj as ve,Ok as oe,NH as De,kI as Ce,Ol as ke,NM as se,NN as ce,lx as Ae,Kc as ie,Nb as M,kC as Oe,kA as xe,kM as ot,nB as st,Om as ct,On as it,vr as K,kH as Ue,Jx as we,ci as rt,c_ as lt,Oo as dt,Na as ut,Op as mt,vn as pt,Oq as ft,Or as ht,Os as yt,Ot as St,Ou as gt,kL as Tt,Ov as Et,Ow as bt,Nc as It,Ox as vt,Oy as Dt,Oz as Ct,Jr as kt,Jh as At,JG as Ot,kN as xt,Kd as ye,nG as Ut}from"./zeni-epic-state-DDiwMHXL.js";import{C as J,G as w,z as _e,aS as Pe,y as wt,K as _t,aT as Pt,F as Ft,p as ae,I as Vt,aU as Nt,v as ne,a0 as Bt,aV as zt,d as Fe,aW as Lt,au as Rt,a4 as te}from"./index-DD5A7mJH.js";import{n as Gt,S as jt,D as $t}from"./mui-6WrS_ojW.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-BGHggyph.js";import{d as Ve}from"./decodeURIComponentSafe-DTCbLY6J.js";import{h as Ne,c as Be,g as Wt,e as qt}from"./routePaths-BEczkE7A.js";import{u as Ht}from"./utils-7NyLmgtg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="21fee626-7a42-4904-9184-ecae5ca6a561",t._sentryDebugIdIdentifier="sentry-dbid-21fee626-7a42-4904-9184-ecae5ca6a561")}catch{}})();function Jt(t=!0){const e=W(),s=Ke(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Yt(t,e){const s=function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>X(h)),E=k.companyId,x=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:N,dismissedAccounts:R}=S(h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const B=i.useRef(N);B.current=N;const P=i.useRef(R);P.current=R;const z=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const b of z)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h},[z]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),Q=B.current??{},Y=P.current;for(const L of u)if($.has(L.accountId)&&Q[L.accountId]==null&&Y?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[v]),D=i.useCallback((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)},[r,E]),F=i.useCallback(()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))},[r,E,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:x,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function ze(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>X(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),E=i.useMemo(()=>f?.fetchState==="Completed"?ze(f?.transaction):void 0,[f?.fetchState,f?.transaction]),x=S(u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")}),_=S(u=>oe(u)),N=S(u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")}),R=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[B,P]=i.useState(!1),[z,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),b=N?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(B?z||x==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??x}))):(s(se()),s(ce()),P(!0),s(Ae(E))))},[s,l,f?.fetchState,f?.transaction,E,c,r,p,B,z,x,b]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:x,vendorViewDetails:_,uiState:N,firstMonthOfFY:R,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Xt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=W(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(xe()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return U.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:U.jsx(Qt,{onClick:y=>y.stopPropagation(),children:U.jsx(Pt,{...A})})})},Qt=Gt(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function Qt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=q(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Ne(g,A)&&(y={id:g,type:W(A)});const m=y!=null?S(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(Ue(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(xe()),o(it()),t(!0),O()}}},aa=Ze(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=X(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${Rt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(Ut({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Be(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?Ue(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xt({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(K({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Qt(t,a):void 0}})(Lt);function ya(){const t=Te(),e=q(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),c=S(d=>X(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),x=Ne(C,b),_=S(d=>d.transactionVendorViewState),N=re(),{isFeatureEnabled:R}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,z=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(x)return{id:C,type:W(b)}},[x,C,b]),l=I!=null?S(d=>H(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?ze(l?.transaction):void 0,F=S(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),E=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[Z,Y]=i.useState(!1),[L,le]=i.useState(!1),[Re,de]=i.useState(!1),Ge=i.useCallback(d=>Be(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{Y(!1),le(!1)},me=Nt();Jt();const Q=i.useRef(l?.transaction);Q.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Yt($e,()=>{const d=[];if(Q.current!=null)for(const ee of Q.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{Re||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(Z?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),Y(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=Mt({mobileExploreReferrer:"Transaction Details"});return Bt({isDataReady:l?.fetchState==="Completed"}),x?U.jsxs(U.Fragment,{children:[pe!=null&&v&&U.jsx(Xt,{isOpen:v,transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}),U.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:N,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:R,isProjectsTransactionsEnabled:B,companyId:P,companyName:z}),V.showPopup&&V.popupType!=null&&U.jsx(zt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):U.jsx(Xe,{to:Le(Me.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Xt as C,ya as T,Jt as a,Yt as b,ta as c,aa as d,ea as e,re as f,Qt as g,ha as u};
|
|
5
|
+
`;function Zt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=Ee(),g=e??p,A=s??Ve(r??"");let y;Ne(g,A)&&(y={id:g,type:q(A)});const m=y!=null?S(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(Ue(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(xe()),o(it()),t(!0),O()}}},aa=Qe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=X(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${Rt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(Ut({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Be(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?Ue(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xt({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(K({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(bt(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Et(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Zt(t,a):void 0}})(Lt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),c=S(d=>X(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&be(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=Ee(),[v,k]=i.useState(!1),E=Ve(f??""),x=Ne(C,E),_=S(d=>d.transactionVendorViewState),N=re(),{isFeatureEnabled:R}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,z=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(x)return{id:C,type:q(E)}},[x,C,E]),l=I!=null?S(d=>H(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?ze(l?.transaction):void 0,F=S(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),b=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[Q,Y]=i.useState(!1),[L,le]=i.useState(!1),[Re,de]=i.useState(!1),Ge=i.useCallback(d=>Be(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{Y(!1),le(!1)},me=Nt();Jt();const Z=i.useRef(l?.transaction);Z.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Yt($e,()=>{const d=[];if(Z.current!=null)for(const ee of Z.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{Re||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(Q?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:b?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),Y(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=Mt({mobileExploreReferrer:"Transaction Details"});return Bt({isDataReady:l?.fetchState==="Completed"}),x?U.jsxs(U.Fragment,{children:[pe!=null&&v&&U.jsx(Xt,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}),U.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:N,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:R,isProjectsTransactionsEnabled:B,companyId:P,companyName:z}),V.showPopup&&V.popupType!=null&&U.jsx(zt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):U.jsx(Xe,{to:Le(Me.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Xt as C,ya as T,Jt as a,Yt as b,ta as c,aa as d,ea as e,re as f,Zt as g,ha as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DvqoH3dJ.js";import{h as Q,g as U,u as W,i as Z,j as h,N as z,n as H,o as ve,p as j}from"./core-BUDfBDzW.js";import{eX as K,qR as X,jW as u,RI as ee,K3 as De,bo as le,RJ as be,kx as te,NJ as ae,RK as ue,RL as Pe,bE as Y,J$ as ye,RM as Ee,RN as me,RO as je,K2 as Ae,RP as xe,RQ as pe,RR as Me,RS as ge,RT as Le,RU as Ce,RV as fe,Lf as Be}from"./zeni-epic-state-BRNxIopP.js";import{a as de,C as ne,G as q,e as G,cq as ce,r as V,q as oe,Z as Re,d as Fe}from"./index-9PmElJom.js";import"./mui-BX-eccqP.js";import{a as g}from"./sentry-oCFmppdA.js";import{w as se}from"./withTransactionSidePanel-CYfRQO6D.js";import{p as ie,c as re}from"./routePaths-BPZ60_ul.js";import{v as Oe}from"./utils-BdmIffFy.js";import{d as b}from"./decodeURIComponentSafe-CAV5JFIH.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DbDEELdQ.js";import"./recharts-C3oDuogX.js";import"./analytics-DL3j77s3.js";import"./plaid-C1X6Gp1j.js";import"./dnd-C2uuKLS_.js";import"./stripe-DMRn4zHo.js";import"./lottie-DU31Qsck.js";import"./lexical-BJhq3Vel.js";import"./pdf-SnLRVeGX.js";import"./useAskAiCfoHostNavButtonProps-I9ttKeZb.js";import"./TransactionDetailScreen-Ch1gEoDW.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="43e00094-1d57-42d8-8925-b66b6a95b9e6",a._sentryDebugIdIdentifier="sentry-dbid-43e00094-1d57-42d8-8925-b66b6a95b9e6")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Oe(a),we=H(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),m=Je(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:N(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Z(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>K(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[R,F]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&R!=null&&(M={...f,period:R}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>F(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Je=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=H(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h(d=>K(d)),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const O=Ve(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ve=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=H(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h(d=>K(d)),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const O=We(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ze(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Z(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h(v=>K(v)),f=F.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=F.company?.companyInfo.firstMonthOfFY??1;let r;const w=Xe(p,A,S,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(q.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Re();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,S,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(He,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>R(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>K(n)).tenantId],t=Fe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-CI520bHO.js";import{h as Q,g as U,u as W,i as H,j as S,N as z,n as X,o as ve,p as j}from"./core-BEqwGbSx.js";import{eX as K,qR as Z,jW as u,RI as ee,K3 as De,bo as le,RJ as Pe,kx as te,NJ as ae,RK as ue,RL as be,bE as Y,J$ as ye,RM as Ee,RN as me,RO as je,K2 as Ae,RP as xe,RQ as pe,RR as Me,RS as ge,RT as Le,RU as Ce,RV as fe,Lf as Be}from"./zeni-epic-state-DDiwMHXL.js";import{a as de,C as ne,G as q,d as G,cq as ce,v as V,p as oe,_ as Re,S as Fe}from"./index-DD5A7mJH.js";import"./mui-6WrS_ojW.js";import{a as g}from"./sentry-B9QSZuyZ.js";import{w as se}from"./withTransactionSidePanel-CgEEpbzu.js";import{p as ie,c as re}from"./routePaths-BEczkE7A.js";import{v as Oe}from"./utils-7NyLmgtg.js";import{d as P}from"./decodeURIComponentSafe-DTCbLY6J.js";import{Z as Ge}from"./ZeniAccountStatementScreen-BrNKBtSn.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./useAskAiCfoHostNavButtonProps-BGHggyph.js";import"./TransactionDetailScreen-jnjIQhYw.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="c554037a-a5d8-4b53-942c-1e4342e690f0",a._sentryDebugIdIdentifier="sentry-dbid-c554037a-a5d8-4b53-942c-1e4342e690f0")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Oe(a),we=X(function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),m=Je(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:N(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=H(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S(r=>K(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=S(r=>Z(r))&&k,{dataAvailable:C,initialTimeframeTick:b}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[R,F]=g.useState(void 0),f=g.useMemo(()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}},[o,y,h,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&R!=null&&(M={...f,period:R}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>F(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Je=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=X(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S(d=>be(d.transactionListState,A,p,k)),[b,B]=g.useState(!1),[E,R]=g.useState(void 0),F=S(d=>K(d)),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>Z(d))&&r;let i;const O=Ve(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ve=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=S(d=>je(d.transactionListState,A,p,k)),[b,B]=g.useState(!1),[E,R]=g.useState(void 0),F=S(d=>K(d)),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>Z(d))&&r;let i;const O=We(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Xe=X(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=H(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S(v=>Me(v.transactionListState,A,p)),[b,B]=g.useState(!1),[E,R]=g.useState(void 0),F=S(v=>K(v)),f=F.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=F.company?.companyInfo.firstMonthOfFY??1;let r;const w=Ze(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(q.isProjectsTransactionsEnabled),d=S(v=>Z(v))&&$,{areTenantIdsInSync:_}=Re();g.useEffect(()=>{!b&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[b,r,c,_]);const ke=[l,m,h,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>R(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=S(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[S(n=>K(n)).tenantId],t=Fe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
|