@zeniai/web-app-ui 5.3.55-dev → 5.3.56-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/{AccountMappingScreen-DdQz2lM1.js → AccountMappingScreen-BJKuQUQK.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-CGBN-Q-7.js → ActualMatchingMatchDetailScreen-CkH9aaHO.js} +1 -1
- package/dist/assets/AddressRoutes-CHBmN4QX.js +1 -0
- package/dist/assets/AddressScreen-DVcm6rtP.js +9 -0
- package/dist/assets/AiCfoScreen-DLhxVK3m.js +22 -0
- package/dist/assets/{AppDrawer-CKP6jrbF.js → AppDrawer-DFw9ygHT.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-BpoA_nrV.js → BillPayApprovalRoutes-CrSvpjTF.js} +1 -1
- package/dist/assets/{BillPayRoutes-B9NE4VxB.js → BillPayRoutes-D25IkCRG.js} +7 -7
- package/dist/assets/BusinessVerificationPageScreen-C3i585S_.js +9 -0
- package/dist/assets/{CardsAiCfoScreen-oYxLbDwZ.js → CardsAiCfoScreen-CGVXrGo3.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-ljOxkkUf.js → ChargeCardRoutes-Be1yd7vs.js} +10 -10
- package/dist/assets/{CompanyPassportScreen-CamQRzbi.js → CompanyPassportScreen-BbxvKQ4h.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-DW_RpnUG.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-B9oqAEpw.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-UN9_koR-.js → CustomerOnboardingRoutes-DZPhXsuR.js} +2 -2
- package/dist/assets/{DashboardRoutes-B00G02__.js → DashboardRoutes-BNQ_G2Ja.js} +3 -3
- package/dist/assets/{DefaultTenantHome-BvquDIuf.js → DefaultTenantHome-CQb3BNY_.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-B1WqjoYC.js +18 -0
- package/dist/assets/{DrawerScreen-2p7xfq2O.js → DrawerScreen-BjVCvYOx.js} +1 -1
- package/dist/assets/EntityDetailRoutes-DPPxLcP3.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-Beqj_B98.js +38 -0
- package/dist/assets/FeaturePreviewScreen-DrZBk8z9.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-uMS-Wn41.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-CvLL3Xda.js → InboxNotificationsProvider-0KkUrcUF.js} +1 -1
- package/dist/assets/{InvoicingRoutes-BXUW-5w1.js → InvoicingRoutes-B7hVOPnd.js} +2 -2
- package/dist/assets/{MagicLinkRoutes-BxAzMNve.js → MagicLinkRoutes-0XNlBf8h.js} +6 -6
- package/dist/assets/MagicLinkSignInScreen-CmEuq8yZ.js +12 -0
- package/dist/assets/{MobileAppDrawer-fNaMEqpG.js → MobileAppDrawer-C4BbqfYY.js} +1 -1
- package/dist/assets/NotFoundScreen-BudPMncf.js +1 -0
- package/dist/assets/NotificationRoutes-ui3la9Pl.js +1 -0
- package/dist/assets/OAuthConsentScreen-BxSGmmYb.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CQxitPGl.js +1 -0
- package/dist/assets/{PaymentLinkScreen-0thjtbfK.js → PaymentLinkScreen-DZFH9-Dr.js} +3 -3
- package/dist/assets/PeopleRoutes-CTbqr9KR.js +22 -0
- package/dist/assets/PerformanceRoutes-DqqsTiLL.js +1 -0
- package/dist/assets/{Preview-CudBKEb3.js → Preview-CUqbKJrc.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-a_jxuJVg.js → QBOConnectionScreen-83wGiY1-.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DHL_6iez.js → ReimbursementApprovalRoutes-CefdRKJA.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-j72H8n28.js → ReimbursementApprovalRuleDetailScreen-DVIQ0iGz.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Cyrl2qi_.js → ReimbursementRoutes-CYSobdK2.js} +4 -4
- package/dist/assets/{ReportsRoutes-DSY4nYh6.js → ReportsRoutes-C0_U8cPe.js} +1 -1
- package/dist/assets/RewardsRoutes-Cuv6zmgH.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-C4z4GiyE.js → ScheduleDetailsPrepaidExpensesScreen-BQ_Jeykv.js} +5 -5
- package/dist/assets/ScreenRoutes-CWs8sPE7.js +2 -0
- package/dist/assets/{SettingsRoutes-DfnQIw3N.js → SettingsRoutes-tupY8NX6.js} +6 -6
- package/dist/assets/{SetupPagesScreen-Zigm3cB1.js → SetupPagesScreen-IP9GnMvD.js} +5 -5
- package/dist/assets/SignInScreen-C_QB0DLT.js +1 -0
- package/dist/assets/SignOutScreen-Dlg2jHAz.js +9 -0
- package/dist/assets/{TaskListScreen-WGfeq9_a.js → TaskListScreen-BLrDzaze.js} +2 -2
- package/dist/assets/TaskRoutes-D1AnOebo.js +9 -0
- package/dist/assets/TransactionDetailRoutes-aJqQLpSX.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BDWEHK1J.js → TransactionDetailScreen-DVTW16A1.js} +2 -2
- package/dist/assets/{TransactionListRoutes-COxnLE0l.js → TransactionListRoutes-7PO54jHW.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DmSouKJP.js → TreasuryRoutes-BLoMlu93.js} +5 -5
- package/dist/assets/{VendorsRoutes-OsvLnOdY.js → VendorsRoutes-u3UbdNbB.js} +12 -12
- package/dist/assets/WiseConfirmationScreen-BwqpmX8S.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-O9BxDbbv.js → ZeniAccountRoutes-CDbRnTrg.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-lhzrOeGm.js +9 -0
- package/dist/assets/{accountMappingHelper-DTr2dybD.js → accountMappingHelper-DAAt9xyM.js} +1 -1
- package/dist/assets/{analytics-BLHCH9ZW.js → analytics-B3pE_Rhv.js} +1 -1
- package/dist/assets/{analyticsHelper-DhzoozKy.js → analyticsHelper-DvdruwkE.js} +1 -1
- package/dist/assets/{core-_lmxLuL7.js → core-BtMsWhj9.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CNj7wDd5.js → decodeURIComponentSafe-roe2OgG2.js} +1 -1
- package/dist/assets/{dnd-4_dRT_p_.js → dnd-NbF88ub7.js} +1 -1
- package/dist/assets/{empty-Bz6Du369.js → empty-CaVGMRjr.js} +1 -1
- package/dist/assets/{empty-B3p_skJy.js → empty-Cx0IX9BK.js} +1 -1
- package/dist/assets/{emptyVideoElement-DVls5c-N.js → emptyVideoElement-BixupcUv.js} +1 -1
- package/dist/assets/epic-CvUAcLT0.js +2 -0
- package/dist/assets/expenseAutomationHelper-oTNGiYVa.js +1 -0
- package/dist/assets/{getLocaleForTenant-DiPOVD9Y.js → getLocaleForTenant-omtGYMrM.js} +1 -1
- package/dist/assets/{index-BqEaHxIT.js → index-BdE3bEFg.js} +11876 -11875
- package/dist/assets/{index-Cg11XXLq.js → index-CgkBXLPm.js} +1 -1
- package/dist/assets/{index-DMJTTbIe.js → index-CscHaeoB.js} +1 -1
- package/dist/assets/{index-sGFH656b.js → index-D4z6ymU4.js} +1 -1
- package/dist/assets/{index-DYybIBq-.js → index-DH8aYJll.js} +1 -1
- package/dist/assets/{index-DLV1sgpa.js → index-De8Bm1rc.js} +1 -1
- package/dist/assets/{index-BXkbHEmr.js → index-Dh_E8szn.js} +2 -2
- package/dist/assets/{index-hIpaHuHG.js → index-Dpw9AdmE.js} +1 -1
- package/dist/assets/{lexical-BibO8P7-.js → lexical-OFbGuPVJ.js} +1 -1
- package/dist/assets/{liveblocks-C_txwMxP.js → liveblocks-CVtnm86a.js} +1 -1
- package/dist/assets/{lottie-CyJj6i4R.js → lottie-DX_KUXtr.js} +1 -1
- package/dist/assets/{mui-DbFwPEO7.js → mui-DdZ2UeI1.js} +1 -1
- package/dist/assets/{pathToGoBack-W4B39XGQ.js → pathToGoBack-DUa0cp7d.js} +1 -1
- package/dist/assets/{pdf-BfgO0ZZE.js → pdf-Ck6JVYdq.js} +3 -3
- package/dist/assets/{pdf-lib-B5AjOY9Z.js → pdf-lib-BXXBaukU.js} +1 -1
- package/dist/assets/{plaid-DHbQ1Fnc.js → plaid-nsaMWH8B.js} +1 -1
- package/dist/assets/{pusher--5P9Uwc_.js → pusher-D5GzcojU.js} +1 -1
- package/dist/assets/{react-DrxoeICl.js → react-0n9ZpUxt.js} +1 -1
- package/dist/assets/{react-BmknZowZ.js → react-BgVq8Vpa.js} +1 -1
- package/dist/assets/{react-CUz7FHyX.js → react-C-0cdt-e.js} +1 -1
- package/dist/assets/{react-h8fTHwLe.js → react-CWdFYh5J.js} +1 -1
- package/dist/assets/{react-IBoMtt1b.js → react-DXmkD3ns.js} +1 -1
- package/dist/assets/{react-BKa7fZpZ.js → react-DhgbPzuh.js} +1 -1
- package/dist/assets/{recharts-B43pV0TY.js → recharts-DhwkC6iY.js} +1 -1
- package/dist/assets/{routePaths-C1I3AVBw.js → routePaths-znAFGC3M.js} +1 -1
- package/dist/assets/{sentry-D_60LtUS.js → sentry-BzkfMVrG.js} +1 -1
- package/dist/assets/{stripSplatSuffix-BWXYYZxG.js → stripSplatSuffix-BORWr7jN.js} +1 -1
- package/dist/assets/{url-BryZycM8.js → url-B1VibTls.js} +1 -1
- package/dist/assets/{url-CvufulZn.js → url-DLwy6QED.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-BOc11rCC.js → useActualMatchingMatchDetail-BATx-hw7.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DfcdcxeV.js → useAiCfoDashboardSuggestedQuestionsChips-RBwji9iv.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-Biynu986.js → useAskAiCfoHostNavButtonProps-yiVAQfVL.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-N9Kbq9gN.js → useChargeCardPusherEvents-D6w93u1p.js} +1 -1
- package/dist/assets/{useDeviceId-Dks2onQn.js → useDeviceId-Cvm1S2SE.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BtvKv8-C.js → useEmailConnectResultRefresh-BuXXdg7d.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-CyHRajCC.js → useInitialThreadRequest-CRJTlzEQ.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-Cs4MVKyS.js → useTaskManagerAccess-CtzHb9vx.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-BPWIyNie.js → useTaskManagerPusherEvents-BsdLgh09.js} +1 -1
- package/dist/assets/{utils-CPbtTTqo.js → utils-BrzWPNCR.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Dxu14DPo.js → withTransactionSidePanel-BrwXnQ2x.js} +4 -4
- package/dist/assets/{zeni-epic-state-CtlpRqoe.js → zeni-epic-state-xhG_euwn.js} +5 -5
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-CynmpoQu.js +0 -1
- package/dist/assets/AddressScreen-DqZYCoSs.js +0 -9
- package/dist/assets/AiCfoScreen-CtsJ7cDT.js +0 -22
- package/dist/assets/BusinessVerificationPageScreen-BldrMJdh.js +0 -9
- package/dist/assets/ConnectionAuthScreen-BoP4m4L6.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CDb5FCfJ.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BBhvylGY.js +0 -18
- package/dist/assets/EntityDetailRoutes-CLBqzGEu.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-CsO9a4nX.js +0 -38
- package/dist/assets/FeaturePreviewScreen-8gjXA436.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CdBNaEnB.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CBQx4xWX.js +0 -12
- package/dist/assets/NotFoundScreen-BeP62Nz9.js +0 -1
- package/dist/assets/NotificationRoutes-GCk-IahK.js +0 -1
- package/dist/assets/OAuthConsentScreen-DECI8j0I.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Ca12AKcd.js +0 -1
- package/dist/assets/PeopleRoutes-DYtmtMXx.js +0 -22
- package/dist/assets/PerformanceRoutes-DP4OW2qD.js +0 -1
- package/dist/assets/RewardsRoutes-DvJjiZGU.js +0 -1
- package/dist/assets/ScreenRoutes-C7oLHktw.js +0 -2
- package/dist/assets/SignInScreen-BRoXT-HL.js +0 -1
- package/dist/assets/SignOutScreen-DkRfW28z.js +0 -9
- package/dist/assets/TaskRoutes-C5PxGl6p.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BBdrsyNq.js +0 -1
- package/dist/assets/WiseConfirmationScreen-taiB3VxF.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-DzQsPHni.js +0 -9
- package/dist/assets/epic-Dg8E5zC1.js +0 -2
- package/dist/assets/expenseAutomationHelper-C8o4PBoS.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-CVtnm86a.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as G,t as Xe}from"./core-BtMsWhj9.js";import{bJ as en,fF as F,cG as nn,HR as $,YZ as tn,Z0 as an,uX as ne,uL as te,mz as ae,BL as R,Z2 as Ce,gG as He,gF as We,gE as Ge,Z3 as sn,H_ as on,Mv as he,Mm as Ie,Mj as Ae,M1 as Y,Mp as _e,Ms as ke,My as ve,Cd as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,Z4 as mn,L1 as de,LF as yn,Z5 as fn,bK as gn,NQ as le,NE as Sn,Z6 as bn,Z7 as Cn,NU as hn,NY as In,Z8 as je,BE as An,Sk as _n,Ou as be,Pj as pe,Z9 as kn,Za as vn,Zb as Pn,Zc as qe,Zd as En,Vo as Tn,Ye as Dn,VD as Un,Ze as Je,M5 as On,VE as wn,M9 as Fn,Zf as we,OE as Ke,mH as Vn,uO as Ye,BN as xn,bE as Ne,BZ as Re,cE as Bn,Zg as Qe,Ob as jn,Oc as Nn,Og as Rn,Zh as Ln,Ox as Le,Zi as Mn,Zj as zn,Zk as Zn,Zl as $n,gV as Hn,Ja as Wn,Zm as Gn,Jf as qn,Je as Jn}from"./zeni-epic-state-xhG_euwn.js";import{aj as Ee,Q as ie,c as me,v as K,E as Te,z as T,a9 as se,j as D,a8 as De,T as H,bR as Kn,af as oe,bS as V,bj as Ve,bT as Yn,bU as Qn,bV as Xn,n as Be,bW as et,p as Me,aH as ze,a2 as nt,ac as tt,bX as at,bY as it,bZ as st,w as ot}from"./index-BdE3bEFg.js";import{a as h}from"./sentry-BzkfMVrG.js";import{n as xe,D as ct,S as rt}from"./mui-DdZ2UeI1.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-C3i585S_.js";import{M as ye}from"./MobileAppDrawer-C4BbqfYY.js";import N from"./NotFoundScreen-BudPMncf.js";import{a as Ze}from"./analyticsHelper-DvdruwkE.js";import{d as $e}from"./routePaths-znAFGC3M.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]="c3cd8ba0-fd3d-4148-8f9d-743fe93bb641",e._sentryDebugIdIdentifier="sentry-dbid-c3cd8ba0-fd3d-4148-8f9d-743fe93bb641")}catch{}})();const dt=xe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-C_txwMxP.js";import{h as Q,g as X,u as ee,i as W
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,lt=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=F(e),n=tn(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=an(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(t,!0))},onEnableBillPayClick:()=>{e(J(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"bill_pay","bill_pay_setup"):Ae("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(t))},onAcceptUpdatedTOSSuccess:()=>{e($(t,!0))},onGetOtp:(n,i)=>{e(Ge(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(He(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(R(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(qn),pt=()=>{const e=Te(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=en(n?.loggedInUserRoleMap),{useFeatureGate:l}=me(),{isFeatureEnabled:s}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(q.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=v((m=>m.billPaySetupViewState.fetchState)),d=v((m=>F(m)));ut();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=nn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t($(y,!1,!0))):(_.current=!0,t($(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||P&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded(H.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(ye,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(lt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},$t=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Ht=e=>`/${e}/cards`,Wt=e=>`/${e}/cards/setup`,Gt=e=>`/${e}/cards/onboard`,Yt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Kt=(e,o)=>e.find((a=>a.id===o)),qt=(e,o,a)=>!e||!o||a.fetchState==="Completed",mt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Qt=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,Xt=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.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:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(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??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),gt=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=F(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(de(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(Pe("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ve(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(ke(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(_e(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(de(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(J(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(t,"charge_cards")):i===!0&&c===!1&&e(J(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const P=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?Ie(d,y,"charge_cards","charge_card_setup"):Ae("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),P=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(he(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(fn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ce({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(R(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(R(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(R(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(yn(t,d))}}}))(Jn),St=()=>{const e=Te(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=v((L=>F(L))),{useDynamicConfig:l,useFeatureGate:s}=me(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(q.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(q.isCardPolicyEnabled),y=v((L=>cn(L,i.companyId))),f=rn(y.controllers),P=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=un(S,i),C=yt({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),k=dn(i),T=ln(i),A=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=ft({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:A}),M=C&&U===!1,x=C===!1&&U,z=pn(n?.loggedInUserRoleMap),w=Fe(n?.loggedInUserRoleMap),[ce,Y]=h.useState(!1),[K,re]=h.useState(!1),Z=v((L=>L.chargeCardSetupViewState.fetchState)),B=E.getSignedInUserTenant(r)?.companyId??i.companyId,O=E.getSignedInUser(),Ue=L=>{Y(L)},fe=v((L=>mn(L,B)));if(O==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{K||Z!=="Not-Started"||B==null?K||Z!=="Completed"||B==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(de(B,!1,!0)):(re(!0),t(de(B,!0)))}),[K,Z,B,t]);const ge=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,Se=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=mt(U,C,b,P);return ge||Se?ge||Se?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded(H.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(ye,{isAppContentDrawerOpen:ce,handleDrawerToggle:Ue}),u.jsx(gt,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:B,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:ge,isDebitCardTOSAccepted:Se,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:M,isCreditCardOnlyEnabled:x,chargeCardSetUpView:fe,isCreditCardProductVisible:U,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:P,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},bt=xe.div`
|
|
9
|
+
`,lt=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=F(e),n=tn(e),i=T.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=an(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(t,!0))},onEnableBillPayClick:()=>{e(Y(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"bill_pay","bill_pay_setup"):Ae("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(t))},onAcceptUpdatedTOSSuccess:()=>{e($(t,!0))},onGetOtp:(n,i)=>{e(Ge(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(He(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(R(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Kn),pt=()=>{const e=Ee(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=en(n?.loggedInUserRoleMap),{useFeatureGate:l}=me(),{isFeatureEnabled:s}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(K.isBillPayLocalCurrencyFeatureEnabled),p=Te(),[g,S]=h.useState(!1),_=h.useRef(!1),I=v((m=>m.billPaySetupViewState.fetchState)),d=v((m=>F(m)));ut();const y=d.companyId??T.getSignedInUserTenant(r)?.companyId;if(T.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=nn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t($(y,!1,!0))):(_.current=!0,t($(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||P&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded(H.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(ye,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(lt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},$t=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Ht=e=>`/${e}/cards`,Wt=e=>`/${e}/cards/setup`,Gt=e=>`/${e}/cards/onboard`,qt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Jt=(e,o)=>e.find((a=>a.id===o)),Kt=(e,o,a)=>!e||!o||a.fetchState==="Completed",mt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),Yt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Qt=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,Xt=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.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:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(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??T.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),gt=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=F(e),l=T.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(de(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(Pe("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ve(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(ke(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(_e(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(de(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Y(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Y(t,"charge_cards")):i===!0&&c===!1&&e(Y(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const P=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?Ie(d,y,"charge_cards","charge_card_setup"):Ae("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),P=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(he(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(fn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ce({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(R(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(R(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(R(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(yn(t,d))}}}))(Yn),St=()=>{const e=Ee(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=v((L=>F(L))),{useDynamicConfig:l,useFeatureGate:s}=me(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(K.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(K.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(K.isCardPolicyEnabled),y=v((L=>cn(L,i.companyId))),f=rn(y.controllers),P=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=un(S,i),C=yt({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),k=dn(i),E=ln(i),A=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=ft({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:_,isBookKeepingTenant:E,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:A}),M=C&&U===!1,x=C===!1&&U,z=pn(n?.loggedInUserRoleMap),w=Fe(n?.loggedInUserRoleMap),[ce,q]=h.useState(!1),[J,re]=h.useState(!1),Z=v((L=>L.chargeCardSetupViewState.fetchState)),B=T.getSignedInUserTenant(r)?.companyId??i.companyId,O=T.getSignedInUser(),Ue=L=>{q(L)},fe=v((L=>mn(L,B)));if(O==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{J||Z!=="Not-Started"||B==null?J||Z!=="Completed"||B==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(de(B,!1,!0)):(re(!0),t(de(B,!0)))}),[J,Z,B,t]);const ge=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,Se=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=mt(U,C,b,P);return ge||Se?ge||Se?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded(H.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(ye,{isAppContentDrawerOpen:ce,handleDrawerToggle:Ue}),u.jsx(gt,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:B,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:ge,isDebitCardTOSAccepted:Se,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:M,isCreditCardOnlyEnabled:x,chargeCardSetUpView:fe,isCreditCardProductVisible:U,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:P,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},bt=xe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-C_txwMxP.js";import{h as Q,g as X,u as ee,i as W
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,Ct=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=F(e),n=bn(e),i=Cn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(hn(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(le(t,!0))},onEnableRemiClick:()=>{e(J(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"reimbursement","reimbursement_setup"):Ae("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"reimbursement_setup",n,i))}}}))(Xn),ht=()=>{const e=Te(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=gn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=v((k=>k.remiSetupViewState.fetchState)),d=v((k=>F(k))),y=v((k=>k.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:P}=Qn(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=k=>{p(k)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(le(b,!1,!0))):(g.current=!0,t(le(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||P||(_(!0),t(Sn(!0,!1,!1,f)))}),[S,y,P,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const k=T=>T.trackPageLoaded(H.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(se,{analytics:D,onLoad:T=>k(T)}),u.jsx(ye,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(Ct,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},It=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=En(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),g=t==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:P,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:k,typeOfIncorporation:T,stateOfIncorporation:A,sourceOfFunds:U,companySubIndustry:M,countriesOfOperations:x,companySourceOfFunds:z,companySourceOfFundsDescription:w,transactionVolume:ce,transactionVolumeDescription:Y,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue}=s,fe=g?.selectedOption,ge={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:fe==null||fe===""?void 0:fe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Bn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:k!=null?Ne(k?.toString()):k,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:U?.selectedOption??"",companySubIndustry:M?.selectedOption??"",countriesOfOperations:x?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:w,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:Y,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue?.selectedOptions??[]},Se={userId:P,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Re({companyDetails:ge,primaryContactDetails:Se}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:P,syncToken:b,selectDocument:m,role:C,ownership:k,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M}=p;let x;return m.selectDocumentType==="driverLicense"?x="driving_license":m.selectDocumentType==="passport"?x="passport":m.selectDocumentType==="stateId"?x="id_document":m.selectDocumentType==="ssnCard"&&(x="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:P,birthday:f!=null?Ne(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:k,documentTypeSelectedForVerification:x,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Re({officers:c}))},onSaveDetailsClick:s=>{e(R(a,s,t))},onSendForVerificationClick:s=>{e(R(a,s,t,!0))},onAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(xn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(He(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(Vn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(we())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=wn(s.documentType);c!=null&&e(Fn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(On({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))}}}))(et),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Q(),r=X(),n=ee(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=me(),I=Ee(),{configValue:d}=_(Ve.zeniAccountsConfig),y=je(d),f=v((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),P=v((A=>A.companyConfigState.fetchState)),b=v((A=>A.userRoleConfigState.fetchState)),m=v((A=>F(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{P==="Not-Started"&&n(An()),b==="Not-Started"&&n(_n(!0))}),[P,b,n]),h.useEffect((()=>{if(!c&&f==="Not-Started"&&C!=null)switch(p(!0),e){case"zeni_accounts":n(pe(C,!0));break;case"zeni_treasury":n(be(C,!0));break;case"reimbursement":n(le(C,!0));break;case"charge_cards":n(de(C,!0));break;default:n($(C,!0))}}),[c,f,C,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let k;switch(e){case"zeni_accounts":k=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":k=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":k=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":k=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:k=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}const T=v((A=>{let U;switch(e){case"zeni_accounts":U=Tn(A,C);break;case"zeni_treasury":U=Ye(A,C);break;case"charge_cards":U=Pn(A,C);break;case"reimbursement":U=vn(A,C);break;default:U=kn(A,C)}return U}));return k===!1?null:T.fetchState==="Completed"&&k===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded(H.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded(H.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded(H.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(It,{businessVerificationDetails:T,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},_t={overlayWidth:new tt(100,100,59)},kt=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=Ye(e,t),p=a&&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=Ln(e),S=g.transactions,_=Ke(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Zn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(be(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(Pe("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ve(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(ke(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(_e(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(be(t,!0))},onEnableTreasuryClick:()=>{e(J(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?Ie(s,c,"zeni_treasury","treasury_setup"):Ae("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(he(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(Ce({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(R(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Le(!1))}c===!0&&e(qe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(zn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Ze(s)),e(Mn(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(we())}}}))(at),vt=()=>{const e=Te(),o=Q(),a=X(),t=ee(),r=Ee(),n=nt(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=me(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[P,b]=h.useState(!1),[m,C]=h.useState(!1),[k,T]=h.useState(!1),A=v((O=>O.treasurySetupViewState.fetchState)),U=v((O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),M=v((O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),x=v((O=>O.treasuryDetailState.transactionsState?.fetchState)),z=v((O=>F(O))),w=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=v((O=>Qe(O,w))),Y=ce.isAtomicAccountExists,K=E.getSignedInUser(),re=O=>{d(O)};if(K==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||A!=="Not-Started"||w==null||(f(!0),t(be(w,!0,!1)))}),[y,A,w,t]),h.useEffect((()=>{P||U!=="Not-Started"||w==null||(b(!0),t(jn()))}),[P,U,w,t]),h.useEffect((()=>{m||M!=="Not-Started"||w==null||(C(!0),t(Nn()))}),[m,M,w,t]),h.useEffect((()=>{k||x!=="Not-Started"||w==null||(T(!0),t(Rn(!0)))}),[k,x,w,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||A!=="Completed"||Y||B||!a.pathname.includes("setup")||p(!0)}),[A,Y,B]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(ye,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(ct,{onClose:()=>{t(we()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:_t.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Pt,{onClick:O=>O.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(we()),o("../setup")}})})}),u.jsx(kt,{navigate:o,location:a,companyId:w,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:Y,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Pt=xe(rt)`
|
|
17
|
+
`,Ct=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=F(e),n=bn(e),i=Cn(e,t),l=T.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(hn(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(le(t,!0))},onEnableRemiClick:()=>{e(Y(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"reimbursement","reimbursement_setup"):Ae("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"reimbursement_setup",n,i))}}}))(Xn),ht=()=>{const e=Ee(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Te(),l=gn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=v((k=>k.remiSetupViewState.fetchState)),d=v((k=>F(k))),y=v((k=>k.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:P}=Qn(d?.tenantId),b=T.getSignedInUserTenant(r)?.companyId??d.companyId,m=T.getSignedInUser(),C=k=>{p(k)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(le(b,!1,!0))):(g.current=!0,t(le(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||P||(_(!0),t(Sn(!0,!1,!1,f)))}),[S,y,P,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const k=E=>E.trackPageLoaded(H.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(se,{analytics:D,onLoad:E=>k(E)}),u.jsx(ye,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(Ct,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},It=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=F(e),n=T.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Tn(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),g=t==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:P,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:k,typeOfIncorporation:E,stateOfIncorporation:A,sourceOfFunds:U,companySubIndustry:M,countriesOfOperations:x,companySourceOfFunds:z,companySourceOfFundsDescription:w,transactionVolume:ce,transactionVolumeDescription:q,purposeOfAccount:J,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue}=s,fe=g?.selectedOption,ge={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:fe==null||fe===""?void 0:fe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Bn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:k!=null?Ne(k?.toString()):k,typeOfIncorporation:E?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:U?.selectedOption??"",companySubIndustry:M?.selectedOption??"",countriesOfOperations:x?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:w,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:q,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue?.selectedOptions??[]},Se={userId:P,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Re({companyDetails:ge,primaryContactDetails:Se}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:P,syncToken:b,selectDocument:m,role:C,ownership:k,isSelectedForVerification:E,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M}=p;let x;return m.selectDocumentType==="driverLicense"?x="driving_license":m.selectDocumentType==="passport"?x="passport":m.selectDocumentType==="stateId"?x="id_document":m.selectDocumentType==="ssnCard"&&(x="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:P,birthday:f!=null?Ne(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:k,documentTypeSelectedForVerification:x,isSelectedForVerification:E,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Re({officers:c}))},onSaveDetailsClick:s=>{e(R(a,s,t))},onSendForVerificationClick:s=>{e(R(a,s,t,!0))},onAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(xn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Ye(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(He(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(Vn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(we())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=wn(s.documentType);c!=null&&e(Fn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(On({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))}}}))(et),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Q(),r=X(),n=ee(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=me(),I=Te(),{configValue:d}=_(Ve.zeniAccountsConfig),y=je(d),f=v((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),P=v((A=>A.companyConfigState.fetchState)),b=v((A=>A.userRoleConfigState.fetchState)),m=v((A=>F(A))),C=m.companyId??T.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{P==="Not-Started"&&n(An()),b==="Not-Started"&&n(_n(!0))}),[P,b,n]),h.useEffect((()=>{if(!c&&f==="Not-Started"&&C!=null)switch(p(!0),e){case"zeni_accounts":n(pe(C,!0));break;case"zeni_treasury":n(be(C,!0));break;case"reimbursement":n(le(C,!0));break;case"charge_cards":n(de(C,!0));break;default:n($(C,!0))}}),[c,f,C,n]),T.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let k;switch(e){case"zeni_accounts":k=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":k=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":k=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":k=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:k=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}const E=v((A=>{let U;switch(e){case"zeni_accounts":U=En(A,C);break;case"zeni_treasury":U=qe(A,C);break;case"charge_cards":U=Pn(A,C);break;case"reimbursement":U=vn(A,C);break;default:U=kn(A,C)}return U}));return k===!1?null:E.fetchState==="Completed"&&k===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded(H.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded(H.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded(H.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(It,{businessVerificationDetails:E,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},_t={overlayWidth:new tt(100,100,59)},kt=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=T.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=qe(e,t),p=a&&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=Ln(e),S=g.transactions,_=Je(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Zn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(be(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(Pe("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ve(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(ke(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(_e(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(be(t,!0))},onEnableTreasuryClick:()=>{e(Y(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?Ie(s,c,"zeni_treasury","treasury_setup"):Ae("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(he(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(Ce({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(R(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Le(!1))}c===!0&&e(Ke())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(zn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Ze(s)),e(Mn(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(we())}}}))(at),vt=()=>{const e=Ee(),o=Q(),a=X(),t=ee(),r=Te(),n=nt(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=me(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[P,b]=h.useState(!1),[m,C]=h.useState(!1),[k,E]=h.useState(!1),A=v((O=>O.treasurySetupViewState.fetchState)),U=v((O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),M=v((O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),x=v((O=>O.treasuryDetailState.transactionsState?.fetchState)),z=v((O=>F(O))),w=T.getSignedInUserTenant(i)?.companyId??z.companyId,ce=v((O=>Qe(O,w))),q=ce.isAtomicAccountExists,J=T.getSignedInUser(),re=O=>{d(O)};if(J==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||A!=="Not-Started"||w==null||(f(!0),t(be(w,!0,!1)))}),[y,A,w,t]),h.useEffect((()=>{P||U!=="Not-Started"||w==null||(b(!0),t(jn()))}),[P,U,w,t]),h.useEffect((()=>{m||M!=="Not-Started"||w==null||(C(!0),t(Nn()))}),[m,M,w,t]),h.useEffect((()=>{k||x!=="Not-Started"||w==null||(E(!0),t(Rn(!0)))}),[k,x,w,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||A!=="Completed"||q||B||!a.pathname.includes("setup")||p(!0)}),[A,q,B]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(ye,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(ct,{onClose:()=>{t(we()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:_t.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Pt,{onClick:O=>O.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(we()),o("../setup")}})})}),u.jsx(kt,{navigate:o,location:a,companyId:w,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:q,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Pt=xe(rt)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,
|
|
21
|
+
`,Et=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=T.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=$n(e,t),c=a&&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";return{zeniAccountSetUpView:s,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Pe("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(t,!0))},onEnableZeniAccountClick:()=>{e(Y(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"zeni_accounts","account_setup"):Ae("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(it),Tt=()=>{const e=Ee(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=me(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=v((b=>b.zeniAccountSetupViewState.fetchState)),d=v((b=>F(b))),y=T.getSignedInUserTenant(r)?.companyId??d.companyId,f=T.getSignedInUser(),P=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(pe(y,!1,!0)):(_(!0),t(pe(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const b=m=>m.trackPageLoaded(H.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(ye,{isAppContentDrawerOpen:p,handleDrawerToggle:P}),u.jsx(Et,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{P(!0)}})]})}},Dt=xe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-C_txwMxP.js";import{h as Q,g as X,u as ee,i as W
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Ut=G((function(e,o){const a=F(e),t=
|
|
29
|
+
`,Ut=G((function(e,o){const a=F(e),t=T.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Gn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Jn(t))},onSubmitClick:()=>{e(qn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Ye(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(st),Ot=()=>{const e=Q(),o=X(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=me(),{isFeatureEnabled:S}=g(K.isBillPayLocalCurrencyFeatureEnabled),_=v((E=>E.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=v((E=>E.billPaySetupViewState.fetchState)),d=v((E=>F(E))),y=Te(),f=d.companyId??T.getSignedInUserTenant(c)?.companyId,P=v((E=>Hn(E.companyState,d.companyId))),b=P?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||_!=="Not-Started"||f==null||(r(!0),a(Wn(f)))}),[t,_,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a($(f,!0)))}),[I,n,f,a]),T.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,k=E=>{s(E)};return C===!1?u.jsx(j,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Dt,{children:[u.jsx(se,{analytics:D,onLoad:E=>(A=>A.trackPageLoaded(H.Event.billPayBusinessVerification,void 0))(E)}),Be(o)?u.jsx(ye,{isAppContentDrawerOpen:l,handleDrawerToggle:k}):null,u.jsx(Ut,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},wt=G((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(le(a,!0,!0));break;case"zeni_accounts":e(pe(a,!0,!0));break;case"charge_cards":e(de(a,!0,!0));break;case"zeni_treasury":e(be(a,!0,!0));break;default:e($(a,!0,!0))}}}}}))(ot((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Oe,{productType:s}):a?u.jsx(j,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Ot,{}):a?u.jsx(j,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):a?u.jsx(j,{to:"../"}):u.jsx(N,{})}case"reimbursement":return c==="verification"?t?u.jsx(Oe,{productType:s}):u.jsx(N,{}):t?u.jsx(ht,{}):u.jsx(N,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Oe,{productType:"zeni_accounts"}):u.jsx(N,{}):r?u.jsx(Tt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(vt,{}):u.jsx(N,{});case"charge_cards":return c==="verification"?i?u.jsx(Oe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(N,{}):i?u.jsx(St,{}):l?u.jsx(j,{to:"../"}):u.jsx(N,{})}})));function oa(e){const{tenantEmailDomain:o}=W(),a=v((r=>F(r))).companyId??T.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(T.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:a,...t})}export{na as A,ta as P,oa as S,Qt as a,ea as b,yt as c,ft as d,mt as e,aa as f,qt as g,Ht as h,Yt as i,Xt as j,ia as k,Kt as l,Jt as m,Wt as n,Gt as o,$t as p,sa as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-CVtnm86a.js";import{a as f,R as T,q as A}from"./sentry-BzkfMVrG.js";import{u as j,h as z,j as l,g as D,N as F,l as M}from"./core-BtMsWhj9.js";import{u as P,z as s,E as O,j as w,G as N,S as _,T as B,V,W as $,X as W,Z as v}from"./index-BdE3bEFg.js";import{fF as X,TX as q,Uf as J,gi as R,gk as Z,Uk as G,gU as H,dj as K,Ul as y,Um as Q,Un as Y,b$ as U}from"./zeni-epic-state-xhG_euwn.js";import"./mui-DdZ2UeI1.js";import{u as ee}from"./useDeviceId-Cvm1S2SE.js";import{f as te}from"./analyticsHelper-DvdruwkE.js";import{t as ne}from"./getLocaleForTenant-omtGYMrM.js";import"./recharts-DhwkC6iY.js";import"./analytics-B3pE_Rhv.js";import"./plaid-nsaMWH8B.js";import"./dnd-NbF88ub7.js";import"./stripe-cKAAJElX.js";import"./lottie-DX_KUXtr.js";import"./lexical-OFbGuPVJ.js";import"./pdf-Ck6JVYdq.js";import"./utils-BrzWPNCR.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]="2d9809fd-9083-4097-902b-bd055d7e7ec7",t._sentryDebugIdIdentifier="sentry-dbid-2d9809fd-9083-4097-902b-bd055d7e7ec7")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(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(y())}}}))(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=j(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:L}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>X(e))),I=l((e=>q(e))),m=D(),E=O().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),H().then((()=>{const e=$();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,h,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(F,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&L!=null?u.jsx(V,{onClose:()=>i(y()),unlockDate:L}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-CVtnm86a.js";import{a}from"./sentry-BzkfMVrG.js";import{u as l,g as d,N as u}from"./core-BtMsWhj9.js";import{z as i,j as n,T as m,a8 as p}from"./index-BdE3bEFg.js";import{gX as g,UB as y}from"./zeni-epic-state-xhG_euwn.js";import{n as b}from"./mui-DdZ2UeI1.js";import"./recharts-DhwkC6iY.js";import"./analytics-B3pE_Rhv.js";import"./plaid-nsaMWH8B.js";import"./dnd-NbF88ub7.js";import"./stripe-cKAAJElX.js";import"./lottie-DX_KUXtr.js";import"./lexical-OFbGuPVJ.js";import"./pdf-Ck6JVYdq.js";import"./utils-BrzWPNCR.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]="faf99514-59a7-4cee-ac4b-674a2b1a976c",e._sentryDebugIdIdentifier="sentry-dbid-faf99514-59a7-4cee-ac4b-674a2b1a976c")}catch{}})();function L(){const e=l(),t=d(),r=a.useRef(!1),c=i.isSignedIn(),o=t.state?.message==="logout"||c;return a.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),i.clearAll()}catch(f){console.error("Error during sign out:",f)}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{L as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-CVtnm86a.js";import{a as A}from"./sentry-BzkfMVrG.js";import{h as pa,u as Ta,g as fa,k as ga,j as v,i as _a,l as ma}from"./core-BtMsWhj9.js";import{z as w,c as Da,v as _,at as Sa,a9 as ya,j as Ea,T as ba,e6 as ha,p as C,a5 as Aa}from"./index-BdE3bEFg.js";import{fF as Ca,a24 as V,R6 as D,a25 as W,a20 as Ga,Qu as N,a26 as Ia,QC as O,Qc as Ba,PQ as Ka,R7 as Q,a27 as Z,gh as La,QZ as va,R2 as Ra,QR as wa,QP as z,R3 as Ua,QM as Pa,a28 as Fa,a29 as ja,a2a as xa,a2b as $a,a2c as m,dx as Na,dw as Oa,a2d as Qa,Q9 as Za}from"./zeni-epic-state-xhG_euwn.js";import{n as za}from"./mui-DdZ2UeI1.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-yiVAQfVL.js";import{M as Va}from"./MobileAppDrawer-C4BbqfYY.js";import{u as Wa}from"./useTaskManagerPusherEvents-BsdLgh09.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="ff64b5cd-f3ec-482c-9435-9fcd685b9af9",e._sentryDebugIdIdentifier="sentry-dbid-ff64b5cd-f3ec-482c-9435-9fcd685b9af9")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},qa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ja=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Xa=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ya=za.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as g}from"./liveblocks-C_txwMxP.js";import{a as A}from"./sentry-D_60LtU
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ae=ma((function(e,a){const n=V(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ga(e),l=
|
|
9
|
+
`,ae=ma((function(e,a){const n=V(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ga(e),l=w.isZeniUser(),S=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:r,tagListView:T,localData:r.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:S}}),(function(e,a){const{navigate:n,currentTenant:i,location:r,isTaskTemplatesEnabled:T}=a,{tenantEmailDomain:l}=i,{groupByKey:S}=a.uiState;return{onTaskManagementRowClick:t=>{const s=M(l,t),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(D(!0,T))},onTabChange:t=>{e($a(t))},onParentTaskClick:t=>{const s=M(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(z(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=R(l,a.localData.defaultTaskGroupId),s=C(r.state?.pathnameStackToGoBack,r.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(Z({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(xa({filters:t}))},onSearchTextChanged:t=>{e(ja({searchText:t}))},onReloadCards:()=>{e(D(!0,T))},onBackClick:()=>{if(r.state?.message==="triggerBackClick"){const t=Aa(r.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(Fa({localData:t}))},resetLocalData:()=>{e(W({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(Pa(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(z(a.localData.selectedTaskIds,t,Ua(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(wa(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=te(S,t);e(N({taskDetailLocalData:s}));const k=R(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),I=C(r.state?.pathnameStackToGoBack,r.pathname);n(k,{state:{pathnameStackToGoBack:I,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ra(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(va(t,s))},onTimeSpentUpdate:(t,s)=>{e(Q({task:t,updates:s}))},onShowToast:t=>{e(La(t))},onGroupByFilterChange:t=>{e(Z({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(Q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(Ka(t,s))},onSubtaskCreation:(t,s)=>{e(Ba({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(O(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(O(t,[s]))},handleNewTaskInitialization:t=>{if(e(N({taskDetailLocalData:{...Ia,name:t}})),a.localData.defaultTaskGroupId!=null){const s=R(l,a.localData.defaultTaskGroupId),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(ha);function ee(){const e=pa(),a=Ta(),n=fa(),i=w.getSignedInUser(),r=w.isZeniUser(),T=ga(),l=v((u=>Ca(u))),{taskGroupId:S}=_a(),{useFeatureGate:t}=Da(),{isFeatureEnabled:s}=t(_.isTaskTemplatesEnabled),{isFeatureEnabled:k}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:I}=t(_.isTaskCategorizationEnabled),{isFeatureEnabled:q}=t(_.isTaskBulkResolutionEnabled),{isFeatureEnabled:H}=t(_.isTaskGroupAssigneesEnabled),{isFeatureEnabled:J}=t(_.isTaskRecurringParentEnabled),[X,Y]=A.useState(!1),B=v((u=>V(u,s))),K=v((u=>u.taskGroupState)),y=B.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Ma({mobileExploreReferrer:"Task Checklist"});Sa({isDataReady:y==="Completed"}),A.useEffect((()=>{a(D(!1,s))}),[l?.tenantId,a,s]);const ta=A.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],f=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...qa(l?.companyId,u),...Ha(i?.userId,f)]}),[l?.companyId,i?.userId]);if(Wa({events:ta,onEvent:(u,f)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Ja(f);if(o!=null){const h=T.getState(),U=o.task_id,p=U!=null?h.taskState.taskByID?.[U]:void 0,L=p!=null;if(!r)if(o.is_private===!0){if(!L)return}else{const E=i?.userId,b=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&b.add(o.created_by),!(E!=null&&b.has(E))&&!L)return}if(u===c.TASK_UPDATED&&L&&p!=null&&Array.isArray(o.task_group_ids)){const E=new Set(Object.values(h.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),b=(p.taskGroupIds??[]).filter((d=>E.has(d))),P=(o.task_group_ids??[]).filter((d=>E.has(d))),sa=b.length===P.length&&b.every((d=>P.includes(d))),F=p.taskGroupIds??[],j=o.task_group_ids??[],na=F.length!==j.length||!F.every((d=>j.includes(d))),oa=(d,da)=>{const x=d??[],$=da??[];if(x.length!==$.length)return!1;const ca=new Set($);return x.every((ka=>ca.has(ka)))},ia=o.name==null||o.name===p.name,ra=o.is_private==null||o.is_private===p.isPrivate,la=o.assignees==null||oa(o.assignees,p.assignees),ua=o.direct_assignees==null;if(sa&&na&&ia&&ra&&la&&ua)return}}return void a(D(!0,s))}case c.TASKS_BULK_DELETED:{const o=Xa(f);return o==null?void 0:void o.task_ids.forEach((h=>a(Za(h))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(D(!0,s))}},onSubscribed:()=>{a(D(!0,s))}}),A.useEffect((()=>{y==="Completed"&&a(W({taskGroupById:K.taskGroupById}))}),[y,K.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return g.jsxs(g.Fragment,{children:[y==="Completed"?g.jsx(ya,{analytics:Ea,onLoad:u=>(f=>f.trackPageLoaded(ba.Event.taskListPage))(u)}):null,g.jsxs(Ya,{children:[g.jsx(Va,{isAppContentDrawerOpen:X,handleDrawerToggle:u=>{Y(u)}}),g.jsx(ae,{location:n,navigate:e,currentTenant:l,taskGroupId:S,taskGroupState:K,localData:B.localData,uiState:B.uiState,isTaskTemplatesEnabled:s,taskListFetchState:y,isTaskCategorizationEnabled:I,isTaskCannedResponsesEnabled:k,isTaskBulkResolutionEnabled:q,isTaskGroupAssigneesEnabled:H,isTaskRecurringParentEnabled:J,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const M=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,R=(e,a)=>`/${e}/tasks/new/${a}`,te=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...m.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Na(a);return{...m.taskDetailLocalData,priority:n}}if(e==="status"){const n=Oa(a);return{...m.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...m.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qa(a);return{...m.taskDetailLocalData,dueDate:n}}return{...m.taskDetailLocalData}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));export{c as T,Ha as a,qa as b,Xa as c,Ja as d,ee as e,pe as f,ke as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-CVtnm86a.js";import ue from"./NotFoundScreen-BudPMncf.js";import{a as k}from"./sentry-BzkfMVrG.js";import{h as Y,u as ee,j as b,g as de,i as ke,N as pe,l as me,n as Se,o as E}from"./core-BtMsWhj9.js";import{Q1 as ae,Q4 as fe,P_ as Te,a1$ as ge,fF as te,a20 as se,Qq as g,Qi as T,PX as he,QW as Ee,QP as be,a21 as ne,gh as oe,a22 as Z,PT as Ie,PQ as De,uX as Ce,uL as Ge,mz as _e,Qg as ye,a23 as Re,R7 as Ue,Qc as Be,QB as ve,Qy as xe,Q7 as we,Qv as Pe,Qu as je}from"./zeni-epic-state-xhG_euwn.js";import{z as y,e4 as Ae,U as Fe,c as Le,v as G,a5 as ie,p as _,a9 as Ke,j as q,T as Qe,e5 as $e,Z as M,af as Ne}from"./index-BdE3bEFg.js";import{n as ze}from"./mui-DdZ2UeI1.js";import{u as Oe}from"./useInitialThreadRequest-CRJTlzEQ.js";import{M as Ve}from"./MobileAppDrawer-C4BbqfYY.js";import{b as Ze,a as qe,T as f,t as Me,c as W,d as X,e as We}from"./TaskListScreen-BLrDzaze.js";import{u as Xe}from"./useTaskManagerPusherEvents-BsdLgh09.js";import"./recharts-DhwkC6iY.js";import"./analytics-B3pE_Rhv.js";import"./plaid-nsaMWH8B.js";import"./dnd-NbF88ub7.js";import"./stripe-cKAAJElX.js";import"./lottie-DX_KUXtr.js";import"./lexical-OFbGuPVJ.js";import"./pdf-Ck6JVYdq.js";import"./utils-BrzWPNCR.js";import"./InboxNotificationsProvider-0KkUrcUF.js";import"./useTaskManagerAccess-CtzHb9vx.js";import"./useAskAiCfoHostNavButtonProps-yiVAQfVL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="44f38c5d-f41e-47e5-a486-7d51aca934f9",e._sentryDebugIdIdentifier="sentry-dbid-44f38c5d-f41e-47e5-a486-7d51aca934f9")}catch{}})();function He(){const e=Y(),a=ee(),n=y.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Ae,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,A=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Je=ge([A,(e,a)=>{const n=A(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=A(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let H,J=[];const Ye=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=Je(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=y.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},v=se(e),{tenantEmailDomain:x}=u,R=s.recurringSourceTaskId,w=R!=null?`${M.appUrl}/${x}/tasks/${encodeURIComponent(R)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:y.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==H&&(H=h,J=Object.values(h)),J),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:v,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(je({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(Pe(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(we(a.taskId))},onSnoozeTask:(t,o)=>{e(xe(t,o))},onUnsnoozeTask:t=>{e(ve(t))},onCreateSubtask:(t,o)=>{e(Be({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Ue({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=B(m),o=_(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(Re({taskId:n}))},onDeleteTaskClick:()=>{e(ye(n))},updateFilesEntity:t=>{e(_e({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))($e);function F(){const e=Y(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((i=>te(i))),m=Oe(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=t(G.isTaskGroupAssigneesEnabled),[R,w]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[Q,P]=k.useState(!1),C=k.useRef(!1),U=b((i=>i.taskListState.updateTasksFetchState.fetchState)),$=b((i=>se(i))),N=b((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const z=y.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Ze(d?.companyId,i),...qe(z,l)]}),[d?.companyId,z]);Xe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{X(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=X(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=W(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=W(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(B(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Me(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||$.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,$.fetchState]),k.useEffect((()=>{K||N==="Completed"||(re(!0),a(Ee()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),P(!0))}),[a,s]);k.useEffect((()=>{if(Q)if(U!=="In-Progress"){if(C.current){if(U==="Error")return P(!1),void(C.current=!1);if(U==="Completed"){P(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=B(i);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[Q,U,d,n,e]);const O=b((i=>ne(i,s))),j=O.fetchState,V=y.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&O.error?.code===400){const{tenantEmailDomain:i}=d,l=B(i),p=_(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(Ke,{analytics:q,onLoad:i=>(l=>l.trackPageLoaded(Qe.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(Ve,{isAppContentDrawerOpen:R,handleDrawerToggle:i=>{w(i)}}),r.jsx(Ye,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:j,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:x})]})]})}const ea=ze.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,B=e=>`/${e}/tasks`;function Ca(){return r.jsxs(Se,{children:[r.jsx(E,{path:"/new",element:r.jsx(F,{})}),r.jsx(E,{path:"/new/:taskGroupId",element:r.jsx(F,{})}),r.jsx(E,{path:"/group/:taskGroupId",element:r.jsx(We,{})}),r.jsx(E,{path:"/quick-responses",element:r.jsx(He,{})}),r.jsx(E,{path:"/:taskId",element:r.jsx(F,{})}),r.jsx(E,{path:"*",element:r.jsx(ue,{})})]})}export{Ca as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-CVtnm86a.js";import i from"./NotFoundScreen-BudPMncf.js";import{T as r}from"./TransactionDetailScreen-DVTW16A1.js";import"./sentry-BzkfMVrG.js";import{n as a,o as e}from"./core-BtMsWhj9.js";import"./zeni-epic-state-xhG_euwn.js";import"./recharts-DhwkC6iY.js";import"./index-BdE3bEFg.js";import"./mui-DdZ2UeI1.js";import"./analytics-B3pE_Rhv.js";import"./plaid-nsaMWH8B.js";import"./dnd-NbF88ub7.js";import"./stripe-cKAAJElX.js";import"./lottie-DX_KUXtr.js";import"./lexical-OFbGuPVJ.js";import"./pdf-Ck6JVYdq.js";import"./utils-BrzWPNCR.js";import"./useAskAiCfoHostNavButtonProps-yiVAQfVL.js";import"./decodeURIComponentSafe-roe2OgG2.js";import"./useInitialThreadRequest-CRJTlzEQ.js";import"./routePaths-znAFGC3M.js";import"./expenseAutomationHelper-oTNGiYVa.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
|
package/dist/assets/{TransactionDetailScreen-BDWEHK1J.js → TransactionDetailScreen-DVTW16A1.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-CVtnm86a.js";import{a as i}from"./sentry-BzkfMVrG.js";import{u as z,k as sn,j as g,s as ge,g as ke,h as Ce,i as Ae,N as cn,l as rn}from"./core-BtMsWhj9.js";import{pv as Ie,fF as ee,gV as ln,UI as dn,oB as un,ob as mn,DF as se,bn as pn,df as Re,bq as _e,sS as H,VO as Y,WW as we,WX as le,Wc as Pe,ma as Fe,WY as Ue,Wh as de,Wi as ue,m$ as xe,Sd as me,WS as G,m4 as Le,m2 as Be,me as fn,pi as hn,WZ as Sn,W_ as yn,Dw as J,m9 as Ve,Ry as Oe,cm as Tn,dl as bn,W$ as gn,WR as In,X0 as vn,X1 as En,X2 as Dn,X3 as kn,Ds as Cn,X4 as An,X5 as Rn,X6 as _n,X7 as wn,X8 as Pn,md as Fn,X9 as Un,Xa as xn,WT as Ln,Xb as Bn,Xc as Vn,Xd as On,Rs as Nn,Ri as zn,RH as Wn,mf as jn,Se as ve,pn as Mn}from"./zeni-epic-state-xhG_euwn.js";import{c as Q,v as A,j as $,b3 as Gn,z as Ne,E as $n,a2 as Xn,b4 as qn,ac as Hn,a5 as ce,Q as Yn,b5 as Qn,p as ie,at as Zn,b6 as Jn,b7 as Kn,b8 as et,af as nt,aw as oe}from"./index-BdE3bEFg.js";import{n as tt,S as at,D as ot}from"./mui-DdZ2UeI1.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-yiVAQfVL.js";import{d as ze}from"./decodeURIComponentSafe-roe2OgG2.js";import{u as ct}from"./useInitialThreadRequest-CRJTlzEQ.js";import{h as We,c as je,g as it,e as rt}from"./routePaths-znAFGC3M.js";import{u as lt}from"./expenseAutomationHelper-oTNGiYVa.js";import{A as dt}from"./utils-BrzWPNCR.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="b043a496-34fb-4a8c-9b69-1abdffe7c065",n._sentryDebugIdIdentifier="sentry-dbid-b043a496-34fb-4a8c-9b69-1abdffe7c065")}catch{}})();function ut(n=!0){const e=z(),o=sn(),{useFeatureGate:t}=Q(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=z(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=Q(),{configValue:k,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&k?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,X=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:w}=g((l=>{const E=l.tenantState.currentTenantId,D=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:D?.capitalizableAccounts??null,capitalizableAccountOverrides:D?.capitalizableAccountOverrides??null,dismissedAccounts:D?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const P=i.useRef(_);P.current=_;const L=i.useRef(w);L.current=w;const B=g((l=>dn(l.accountState)),ge),q=i.useMemo((()=>{const l={};for(const E of B)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[B]),W=r!=null?q[r]??null:null,V=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const D=E.accounts??[],M=new Set(l),Z=P.current??{},ne=L.current;for(const O of D)if(M.has(O.accountId)&&Z[O.accountId]==null&&ne?.[O.accountId]==null)return d(O.classificationType),S(O.accountId),void y(!0)}),[b]),j=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:W,currencySymbol:X,checkAndShowPopup:V,handleSubmit:j,handleDismiss:p}})(),t=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,K=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),Me=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Lt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),Me(n,t.feedback,t.transactionId))}))},Bt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=z(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,k,T)=>{const b=Ee(I,k,T),v=N.get(b);return v!=null&&(N.delete(b),Me(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(K(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...K(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(K(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=Q(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Vt(n,e){const o=z(),{useFeatureGate:t}=Q(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:H(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,k=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return we(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return Pe(p.trendWithTransactionsState,T,"TransactionDetail")})),X=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,w]=i.useState(!1),[x,P]=i.useState(!1),[L,B]=i.useState(!1);i.useEffect((()=>{w(!1),P(!1),B(!1)}),[n,e]);const q=i.useCallback((()=>{w(!1),P(!1)}),[]),[W,V]=i.useState(!1),j=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{L||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),B(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(P(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:j??b}))):(o(de()),o(ue()),w(!0),o(xe(T))))}),[o,L,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,j]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?V(!0):V(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:X,uncategorizedAccounts:U,resetTrendIsFetchedStates:q,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:V}}const ft={overlayWidth:new Hn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=Xn(),u=z(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Be()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Le({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(qn,{...f})})})},St=tt(at)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function yt(n,e){n(hn({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:H(e.transactionType),sourceTransactionType:H(e.sourceTransactionType)}))}function Tt({currentTransactionId:n,enabled:e=!0,buildPath:o,beforeNavigate:t,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||n==null||u.current===c)return;const{previousTransactionId:h,newTransactionId:y}=c;n.id===h.id&&n.type===h.type&&(u.current=c,t?.(),a(o(y),{replace:!0,state:s}))}),[e,c,n,o,t,a,s])}const bt=({closeDrawerHandler:n,overrideTransactionId:e,overrideTransactionType:o})=>{const t=ke(),a=Ce(),s=W(),c=pe(),{transactionTypeEncoded:u,transactionId:h}=Ae(),y=e??h,f=o??We(u??"");let d;ze(y,f)&&(d={id:y,type:H(f)});const r=d!=null?g((I=>Y(I,d))):void 0,S=()=>{const I=ce(t.state?.pathnameStackToGoBack),k=I.poppedPathname??((T=2)=>{let b="../";for(let v=0;v<T;v++)b=`${b}../`;return b})(1);a(k,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Le(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,k={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(Z({entity:k,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}S()},onCancel:()=>{d!=null&&s(Sn({transactionId:d})),s(Be()),s(yn()),n(!0),S()}}},gt=rn((function(n,e){const o=Y(n,e.selectedTransaction);let t;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=n.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(t=gn(n,e.entity,"TransactionDetail"));const u=n.entityAutoCompleteState.autoCompleteText.common,h=In(n,"common"),y=ee(n);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${nt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(n,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(n(G("common")),e.onBackClick!=null)return void e.onBackClick();const t=ce(e.location.state?.pathnameStackToGoBack),a=t.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,a)=>{e.transaction!=null&&n(Mn({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:a}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),n(de()),n(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&n(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};n(me(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),n(ve(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:a}))}},onSaveUpdates:(t,a,s,c)=>{n(c===!0&&s!=null?Le(t,s,!0,e.isExpenseAutomationEnabled):jn({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),n(G("common"))},onUploadAttachmentAttachment:t=>{n(zn(t))},onDeleteAttachment:t=>{e.transaction!=null&&n(Wn(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,a)=>{n(Nn({transactionId:t,transactionLocalData:a}))},onUpdateAllChecked:(t,a,s,c)=>{e.transaction!=null&&n(On(e.selectedTransaction,e.transaction,t,a,s,c))},onResetLineItemsCategoryClassInLocalData:(t,a,s,c,u,h)=>{n(Ln(t,a,s,c,u,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,a)=>{e.transaction!=null&&n(Bn({id:e.transaction.id,type:e.transaction.type},e.transaction,t,a))},onSaveSuccess:()=>{const t=ce(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const a=dt(t.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${it(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{n(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,a)=>{t.trim().length>=2?n(Vn({searchString:t,entityType:a,searchOrigin:"common"})):t.trim().length===0&&n(G("common"))},onCancelAutoComplete:()=>{n(G("common"))}},onFetchRecommendationsForEntity:(t,a,s,c)=>{n(Z({entity:t,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:t=>{const{transactionId:a,transaction:s,lineId:c}=t;n(xn(a,s,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};n(Un(t))},onSaveVendorInLocalData:(t,a,s,c,u)=>{if(n(Fn({transactionId:t,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(Z({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),n(Ve({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(t,a,s,c,u)=>{n(wn({transactionId:t,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(Z({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{n(Pn({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,a,s)=>{n(_n(t,a,s))},onResetVendorToAllLineItems:(t,a,s)=>{n(Rn(t,a,s))},saveLatestSelectedEntity:(t,a,s)=>{n(An({transactionId:t,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(t,a)=>{n(Cn(t,a))},setIsVendorUpdateAllChecked:(t,a,s)=>{n(kn(t,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>yt(n,t):void 0,onLineAdd:()=>{if(e.transaction==null)return;const t={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};n(Dn(t,u))},onLineDelete:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(En(a,t))},onToggleSplitEditMode:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(vn(a,t))}}}))(et);function Ot(){const n=Ce(),e=W(),o=ke(),{useFeatureGate:t}=K(),a=Yn(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),h=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:S}=Ae(),[I,k]=i.useState(!1),T=We(r??""),b=ze(S,T),v=g((m=>m.transactionVendorViewState)),R=pe(),{isFeatureEnabled:X}=t(A.isRecommendationFeedbackEnabled),U=Kn(),{onRecommendationSelection:_,popup:P}=pt({isEnabled:X,fallbackTransactionId:S}),x=i.useMemo((()=>({...U,onRecommendationSelection:_})),[U,_]),{isFeatureEnabled:w}=t(A.isTransactionCommentingEnabled),{isFeatureEnabled:V}=t(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=t(A.isProjectsTransactionsEnabled),{isFeatureEnabled:q}=t(A.isTransactionSplitEnabled),z=a?.currentTenant?.companyId,L=a?.currentTenant?.companyName,j=ct(z),p=i.useMemo((()=>{if(b)return{id:S,type:H(T)}}),[b,S,T]),l=p!=null?g((m=>Y(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?v.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,M=g((m=>D!=null?Pe(m.customerIncomeState,m.vendorExpenseState,m.trendState,D,"month"):void 0)),Q=g((m=>le(m))),ne=g((m=>D!=null?we(m.trendWithTransactionsState,D,"TransactionDetail"):void 0)),O=s.company?.companyInfo.firstMonthOfFY??1,Xe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[qe,fe]=i.useState(!1),[He,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Ke=i.useCallback((m=>je(m,d??"")+o.search),[d,o.search]),Qe=i.useCallback((()=>{Se(!1)}),[]);Tt({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Ke,beforeNavigate:Qe,navigate:n,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=lt();ut();const te=i.useRef(l?.transaction);te.current=l?.transaction;const Ze=l?.transactionDetailUpdateStatus?.fetchState,F=mt(Ze,(()=>{const m=[];if(te.current!=null)for(const ae of te.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Oe(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);n("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,n,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ue({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;D==null&&l?.fetchState==="Completed"&&De(l?.transaction,m),D!=null&&(!c||u&&h===!1)&&(qe?He||M==null||(he(!0),e(me(D,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??M}))):(e(de()),e(ue()),De(l?.transaction,m),fe(!0),e(xe(D))))}),[l?.fetchState,l?.transaction,M,c]),i.useEffect((()=>{Q.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)}),[Q.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Je=[r,S].filter((m=>m!=null)),{transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}=bt({closeDrawerHandler:m=>{k(!1),n(m?"../":"../..")}}),{isAiCfoAccessEnabled:an,onAskAiCfoClick:on}=st({mobileExploreReferrer:"Transaction Details"});return Qn({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(ht,{isOpen:I,transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}),C.jsx(Zn,{toolkit:x,children:C.jsx(gt,{hideDeleteAttachment:!0,firstMonthOfFY:O,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:n,selectedTransaction:p,entity:D,isCOTEnabled:R,defaultTrendTransactionTimePeriod:M,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:Xe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:V,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:an,onAskAiCfoClick:on,isTransactionCommentingEnabled:w,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:q,companyId:z,companyName:L,initialOpenThreadRequest:j})}),P,F.showPopup&&F.popupType!=null&&C.jsx(Jn,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(cn,{to:$e(Je.length)})}const $e=(n=2)=>{let e="../";for(let o=0;o<n;o++)e=`${e}../`;return e},De=(n,e)=>{if(n!=null){const{transactionCategory:o,transactionClass:t}=It(n),a=vt(n);$.trackTransactionDetails(n.account?.accountId,n.account?.accountName,n.id,a,o.length>0?o:void 0,t.length>0?t:void 0,n.type,n.amount,n.memo,n.lines?.length??0,n.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},It=n=>{const e=[],o=[];return n.lines?.forEach((t=>{switch(t.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 a=t;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},vt=n=>Tn(n)===!0?n.customer?.name??"":bn(n)===!0?n.vendor?.name??"":n.memo!=null?n.memo:n.type;export{ht as C,Ot as T,pt as a,ut as b,mt as c,bt as d,gt as e,Tt as f,pe as g,yt as h,Bt as i,De as l,Vt as r,Lt as u};
|
|
5
|
+
`;function yt(n,e){n(hn({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:H(e.transactionType),sourceTransactionType:H(e.sourceTransactionType)}))}function Tt({currentTransactionId:n,enabled:e=!0,buildPath:o,beforeNavigate:t,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||n==null||u.current===c)return;const{previousTransactionId:h,newTransactionId:y}=c;n.id===h.id&&n.type===h.type&&(u.current=c,t?.(),a(o(y),{replace:!0,state:s}))}),[e,c,n,o,t,a,s])}const bt=({closeDrawerHandler:n,overrideTransactionId:e,overrideTransactionType:o})=>{const t=ke(),a=Ce(),s=z(),c=pe(),{transactionTypeEncoded:u,transactionId:h}=Ae(),y=e??h,f=o??ze(u??"");let d;We(y,f)&&(d={id:y,type:H(f)});const r=d!=null?g((I=>Y(I,d))):void 0,S=()=>{const I=ce(t.state?.pathnameStackToGoBack),k=I.poppedPathname??((T=2)=>{let b="../";for(let v=0;v<T;v++)b=`${b}../`;return b})(1);a(k,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Ve(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,k={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(J({entity:k,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}S()},onCancel:()=>{d!=null&&s(Sn({transactionId:d})),s(Be()),s(yn()),n(!0),S()}}},gt=rn((function(n,e){const o=Y(n,e.selectedTransaction);let t;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=n.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(t=gn(n,e.entity,"TransactionDetail"));const u=n.entityAutoCompleteState.autoCompleteText.common,h=In(n,"common"),y=ee(n);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${nt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(n,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(n(G("common")),e.onBackClick!=null)return void e.onBackClick();const t=ce(e.location.state?.pathnameStackToGoBack),a=t.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,a)=>{e.transaction!=null&&n(Mn({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:a}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),n(de()),n(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&n(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};n(me(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),n(ve(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:a}))}},onSaveUpdates:(t,a,s,c)=>{n(c===!0&&s!=null?Ve(t,s,!0,e.isExpenseAutomationEnabled):jn({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),n(G("common"))},onUploadAttachmentAttachment:t=>{n(Wn(t))},onDeleteAttachment:t=>{e.transaction!=null&&n(zn(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,a)=>{n(Nn({transactionId:t,transactionLocalData:a}))},onUpdateAllChecked:(t,a,s,c)=>{e.transaction!=null&&n(On(e.selectedTransaction,e.transaction,t,a,s,c))},onResetLineItemsCategoryClassInLocalData:(t,a,s,c,u,h)=>{n(Vn(t,a,s,c,u,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,a)=>{e.transaction!=null&&n(Bn({id:e.transaction.id,type:e.transaction.type},e.transaction,t,a))},onSaveSuccess:()=>{const t=ce(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const a=dt(t.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${it(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{n(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,a)=>{t.trim().length>=2?n(Ln({searchString:t,entityType:a,searchOrigin:"common"})):t.trim().length===0&&n(G("common"))},onCancelAutoComplete:()=>{n(G("common"))}},onFetchRecommendationsForEntity:(t,a,s,c)=>{n(J({entity:t,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:t=>{const{transactionId:a,transaction:s,lineId:c}=t;n(xn(a,s,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};n(Un(t))},onSaveVendorInLocalData:(t,a,s,c,u)=>{if(n(Fn({transactionId:t,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),n(Le({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(t,a,s,c,u)=>{n(Pn({transactionId:t,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{n(wn({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,a,s)=>{n(_n(t,a,s))},onResetVendorToAllLineItems:(t,a,s)=>{n(Rn(t,a,s))},saveLatestSelectedEntity:(t,a,s)=>{n(An({transactionId:t,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(t,a)=>{n(Cn(t,a))},setIsVendorUpdateAllChecked:(t,a,s)=>{n(kn(t,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>yt(n,t):void 0,onLineAdd:()=>{if(e.transaction==null)return;const t={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};n(Dn(t,u))},onLineDelete:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(En(a,t))},onToggleSplitEditMode:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(vn(a,t))}}}))(et);function Ot(){const n=Ce(),e=z(),o=ke(),{useFeatureGate:t}=Q(),a=Yn(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),h=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:S}=Ae(),[I,k]=i.useState(!1),T=ze(r??""),b=We(S,T),v=g((m=>m.transactionVendorViewState)),R=pe(),{isFeatureEnabled:X}=t(A.isRecommendationFeedbackEnabled),U=Qn(),{onRecommendationSelection:_,popup:w}=pt({isEnabled:X,fallbackTransactionId:S}),x=i.useMemo((()=>({...U,onRecommendationSelection:_})),[U,_]),{isFeatureEnabled:P}=t(A.isTransactionCommentingEnabled),{isFeatureEnabled:L}=t(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=t(A.isProjectsTransactionsEnabled),{isFeatureEnabled:q}=t(A.isTransactionSplitEnabled),W=a?.currentTenant?.companyId,V=a?.currentTenant?.companyName,j=ct(W),p=i.useMemo((()=>{if(b)return{id:S,type:H(T)}}),[b,S,T]),l=p!=null?g((m=>Y(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?v.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,M=g((m=>D!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,D,"month"):void 0)),Z=g((m=>le(m))),ne=g((m=>D!=null?Pe(m.trendWithTransactionsState,D,"TransactionDetail"):void 0)),O=s.company?.companyInfo.firstMonthOfFY??1,Xe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[qe,fe]=i.useState(!1),[He,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Qe=i.useCallback((m=>je(m,d??"")+o.search),[d,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);Tt({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Qe,beforeNavigate:Ze,navigate:n,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=lt();ut();const te=i.useRef(l?.transaction);te.current=l?.transaction;const Je=l?.transactionDetailUpdateStatus?.fetchState,F=mt(Je,(()=>{const m=[];if(te.current!=null)for(const ae of te.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Oe(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);n("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,n,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ue({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;D==null&&l?.fetchState==="Completed"&&De(l?.transaction,m),D!=null&&(!c||u&&h===!1)&&(qe?He||M==null||(he(!0),e(me(D,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??M}))):(e(de()),e(ue()),De(l?.transaction,m),fe(!0),e(xe(D))))}),[l?.fetchState,l?.transaction,M,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Ke=[r,S].filter((m=>m!=null)),{transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}=bt({closeDrawerHandler:m=>{k(!1),n(m?"../":"../..")}}),{isAiCfoAccessEnabled:an,onAskAiCfoClick:on}=st({mobileExploreReferrer:"Transaction Details"});return Zn({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(ht,{isOpen:I,transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}),C.jsx(Jn,{toolkit:x,children:C.jsx(gt,{hideDeleteAttachment:!0,firstMonthOfFY:O,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:n,selectedTransaction:p,entity:D,isCOTEnabled:R,defaultTrendTransactionTimePeriod:M,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:Xe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:L,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:an,onAskAiCfoClick:on,isTransactionCommentingEnabled:P,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:q,companyId:W,companyName:V,initialOpenThreadRequest:j})}),w,F.showPopup&&F.popupType!=null&&C.jsx(Kn,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(cn,{to:$e(Ke.length)})}const $e=(n=2)=>{let e="../";for(let o=0;o<n;o++)e=`${e}../`;return e},De=(n,e)=>{if(n!=null){const{transactionCategory:o,transactionClass:t}=It(n),a=vt(n);$.trackTransactionDetails(n.account?.accountId,n.account?.accountName,n.id,a,o.length>0?o:void 0,t.length>0?t:void 0,n.type,n.amount,n.memo,n.lines?.length??0,n.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},It=n=>{const e=[],o=[];return n.lines?.forEach((t=>{switch(t.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 a=t;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},vt=n=>Tn(n)===!0?n.customer?.name??"":bn(n)===!0?n.vendor?.name??"":n.memo!=null?n.memo:n.type;export{ht as C,Ot as T,pt as a,ut as b,mt as c,bt as d,gt as e,Tt as f,pe as g,yt as h,Bt as i,De as l,Lt as r,Vt as u};
|